sound: Use uint8_t instead of legacy u_char

No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Christos Margiolis committed 2026-09-22 18:11:58 +02:00
1 parent 20c09e6fec
commit 2793e5498d
7 files changed
+90 -90

No files matched your search

+13 -13
View File
@@ -137,19 +137,19 @@ MIXER_DECLARE(onyx_mixer);
#define PCM3052_REG_INFO_4 80
struct onyx_reg {
u_char LEFT_ATTN;
u_char RIGHT_ATTN;
u_char CONTROL;
u_char DAC_CONTROL;
u_char DAC_DEEMPH;
u_char DAC_FILTER;
u_char OUT_PHASE;
u_char ADC_CONTROL;
u_char ADC_HPF_BP;
u_char INFO_1;
u_char INFO_2;
u_char INFO_3;
u_char INFO_4;
uint8_t LEFT_ATTN;
uint8_t RIGHT_ATTN;
uint8_t CONTROL;
uint8_t DAC_CONTROL;
uint8_t DAC_DEEMPH;
uint8_t DAC_FILTER;
uint8_t OUT_PHASE;
uint8_t ADC_CONTROL;
uint8_t ADC_HPF_BP;
uint8_t INFO_1;
uint8_t INFO_2;
uint8_t INFO_3;
uint8_t INFO_4;
};
static const struct onyx_reg onyx_initdata = {
+30 -30
View File
@@ -94,7 +94,7 @@ struct snapper_softc
uint32_t sc_addr;
struct mtx sc_volume_mtx;
struct task sc_volume_task;
u_char sc_volume_reg[6];
uint8_t sc_volume_reg[6];
};
static int snapper_probe(device_t);
@@ -191,33 +191,33 @@ MIXER_DECLARE(snapper_mixer);
#define SNAPPER_ACR_APD 0x01 /* Analog power down */
struct snapper_reg {
u_char MCR1[1];
u_char DRC[6];
u_char VOLUME[6];
u_char TREBLE[1];
u_char BASS[1];
u_char MIXER_L[9];
u_char MIXER_R[9];
u_char LB0[15];
u_char LB1[15];
u_char LB2[15];
u_char LB3[15];
u_char LB4[15];
u_char LB5[15];
u_char LB6[15];
u_char RB0[15];
u_char RB1[15];
u_char RB2[15];
u_char RB3[15];
u_char RB4[15];
u_char RB5[15];
u_char RB6[15];
u_char LLB[15];
u_char RLB[15];
u_char LLB_GAIN[3];
u_char RLB_GAIN[3];
u_char ACR[1];
u_char MCR2[1];
uint8_t MCR1[1];
uint8_t DRC[6];
uint8_t VOLUME[6];
uint8_t TREBLE[1];
uint8_t BASS[1];
uint8_t MIXER_L[9];
uint8_t MIXER_R[9];
uint8_t LB0[15];
uint8_t LB1[15];
uint8_t LB2[15];
uint8_t LB3[15];
uint8_t LB4[15];
uint8_t LB5[15];
uint8_t LB6[15];
uint8_t RB0[15];
uint8_t RB1[15];
uint8_t RB2[15];
uint8_t RB3[15];
uint8_t RB4[15];
uint8_t RB5[15];
uint8_t RB6[15];
uint8_t LLB[15];
uint8_t RLB[15];
uint8_t LLB_GAIN[3];
uint8_t RLB_GAIN[3];
uint8_t ACR[1];
uint8_t MCR2[1];
};
static const struct snapper_reg snapper_initdata = {
@@ -351,7 +351,7 @@ static void
snapper_volume_task(void *arg, int pending __unused)
{
struct snapper_softc *sc = arg;
u_char reg[6];
uint8_t reg[6];
mtx_lock(&sc->sc_volume_mtx);
memcpy(reg, sc->sc_volume_reg, sizeof(reg));
@@ -468,7 +468,7 @@ snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
{
struct snapper_softc *sc;
unsigned int l, r;
u_char reg[6];
uint8_t reg[6];
sc = device_get_softc(mix_getdevinfo(m));
+22 -22
View File
@@ -94,7 +94,7 @@ struct tumbler_softc
uint32_t sc_addr;
struct mtx sc_volume_mtx;
struct task sc_volume_task;
u_char sc_volume_reg[6];
uint8_t sc_volume_reg[6];
};
static int tumbler_probe(device_t);
@@ -181,25 +181,25 @@ MIXER_DECLARE(tumbler_mixer);
*/
struct tumbler_reg {
u_char MCR[1];
u_char DRC[2];
u_char VOLUME[6];
u_char TREBLE[1];
u_char BASS[1];
u_char MIXER1[3];
u_char MIXER2[3];
u_char LB0[15];
u_char LB1[15];
u_char LB2[15];
u_char LB3[15];
u_char LB4[15];
u_char LB5[15];
u_char RB0[15];
u_char RB1[15];
u_char RB2[15];
u_char RB3[15];
u_char RB4[15];
u_char RB5[15];
uint8_t MCR[1];
uint8_t DRC[2];
uint8_t VOLUME[6];
uint8_t TREBLE[1];
uint8_t BASS[1];
uint8_t MIXER1[3];
uint8_t MIXER2[3];
uint8_t LB0[15];
uint8_t LB1[15];
uint8_t LB2[15];
uint8_t LB3[15];
uint8_t LB4[15];
uint8_t LB5[15];
uint8_t RB0[15];
uint8_t RB1[15];
uint8_t RB2[15];
uint8_t RB3[15];
uint8_t RB4[15];
uint8_t RB5[15];
};
const struct tumbler_reg tumbler_initdata = {
@@ -312,7 +312,7 @@ static void
tumbler_volume_task(void *arg, int pending __unused)
{
struct tumbler_softc *sc = arg;
u_char reg[6];
uint8_t reg[6];
mtx_lock(&sc->sc_volume_mtx);
memcpy(reg, sc->sc_volume_reg, sizeof(reg));
@@ -415,7 +415,7 @@ tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
{
struct tumbler_softc *sc;
unsigned int l, r;
u_char reg[6];
uint8_t reg[6];
sc = device_get_softc(mix_getdevinfo(m));
+10 -10
View File
@@ -105,7 +105,7 @@ struct hdaa_widget {
uint32_t ossmask;
int unsol;
nid_t conns[HDA_MAX_CONNS];
u_char connsenable[HDA_MAX_CONNS];
uint8_t connsenable[HDA_MAX_CONNS];
char name[HDA_MAX_NAMELEN];
uint8_t *eld;
int eld_len;
@@ -148,12 +148,12 @@ struct hdaa_audio_ctl {
/* Association is a group of pins bound for some special function. */
struct hdaa_audio_as {
u_char enable;
u_char index;
u_char dir;
u_char pincnt;
u_char fakeredir;
u_char digital;
uint8_t enable;
uint8_t index;
uint8_t dir;
uint8_t pincnt;
uint8_t fakeredir;
uint8_t digital;
uint16_t pinset;
nid_t hpredir;
nid_t pins[16];
@@ -172,13 +172,13 @@ struct hdaa_pcm_devinfo {
int index;
int registered;
int playas, recas;
u_char left[SOUND_MIXER_NRDEVICES];
u_char right[SOUND_MIXER_NRDEVICES];
uint8_t left[SOUND_MIXER_NRDEVICES];
uint8_t right[SOUND_MIXER_NRDEVICES];
int minamp[SOUND_MIXER_NRDEVICES]; /* Minimal amps in 1/4dB. */
int maxamp[SOUND_MIXER_NRDEVICES]; /* Maximal amps in 1/4dB. */
int chan_size;
int chan_blkcnt;
u_char digital;
uint8_t digital;
uint32_t ossmask; /* Mask of supported OSS devices. */
uint32_t recsrc; /* Mask of supported OSS sources. */
int autorecsrc;
+1 -1
View File
@@ -30,7 +30,7 @@
#define NM_TOTAL_COEFF_COUNT 0x3158
static u_char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
static uint8_t coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21,
0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01,
0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD,
+13 -13
View File
@@ -107,15 +107,15 @@ struct ess_info {
static int ess_rd(struct ess_info *sc, int reg);
static void ess_wr(struct ess_info *sc, int reg, uint8_t val);
static int ess_dspready(struct ess_info *sc);
static int ess_cmd(struct ess_info *sc, u_char val);
static int ess_cmd1(struct ess_info *sc, u_char cmd, int val);
static int ess_cmd(struct ess_info *sc, uint8_t val);
static int ess_cmd1(struct ess_info *sc, uint8_t cmd, int val);
static int ess_get_byte(struct ess_info *sc);
static void ess_setmixer(struct ess_info *sc, unsigned int port, unsigned int value);
static int ess_getmixer(struct ess_info *sc, unsigned int port);
static int ess_reset_dsp(struct ess_info *sc);
static int ess_write(struct ess_info *sc, u_char reg, int val);
static int ess_read(struct ess_info *sc, u_char reg);
static int ess_write(struct ess_info *sc, uint8_t reg, int val);
static int ess_read(struct ess_info *sc, uint8_t reg);
static void ess_intr(void *arg);
static int ess_setupch(struct ess_info *sc, int ch, int dir, int spd, uint32_t fmt, int len);
@@ -194,7 +194,7 @@ ess_dspready(struct ess_info *sc)
}
static int
ess_dspwr(struct ess_info *sc, u_char val)
ess_dspwr(struct ess_info *sc, uint8_t val)
{
int i;
@@ -210,14 +210,14 @@ ess_dspwr(struct ess_info *sc, u_char val)
}
static int
ess_cmd(struct ess_info *sc, u_char val)
ess_cmd(struct ess_info *sc, uint8_t val)
{
DEB(printf("ess_cmd: %x\n", val));
return ess_dspwr(sc, val);
}
static int
ess_cmd1(struct ess_info *sc, u_char cmd, int val)
ess_cmd1(struct ess_info *sc, uint8_t cmd, int val)
{
DEB(printf("ess_cmd1: %x, %x\n", cmd, val));
if (ess_dspwr(sc, cmd)) {
@@ -229,9 +229,9 @@ static void
ess_setmixer(struct ess_info *sc, unsigned int port, unsigned int value)
{
DEB(printf("ess_setmixer: reg=%x, val=%x\n", port, value);)
ess_wr(sc, SB_MIX_ADDR, (u_char) (port & 0xff)); /* Select register */
ess_wr(sc, SB_MIX_ADDR, (uint8_t) (port & 0xff)); /* Select register */
DELAY(10);
ess_wr(sc, SB_MIX_DATA, (u_char) (value & 0xff));
ess_wr(sc, SB_MIX_DATA, (uint8_t) (value & 0xff));
DELAY(10);
}
@@ -240,7 +240,7 @@ ess_getmixer(struct ess_info *sc, unsigned int port)
{
int val;
ess_wr(sc, SB_MIX_ADDR, (u_char) (port & 0xff)); /* Select register */
ess_wr(sc, SB_MIX_ADDR, (uint8_t) (port & 0xff)); /* Select register */
DELAY(10);
val = ess_rd(sc, SB_MIX_DATA);
DELAY(10);
@@ -263,13 +263,13 @@ ess_get_byte(struct ess_info *sc)
}
static int
ess_write(struct ess_info *sc, u_char reg, int val)
ess_write(struct ess_info *sc, uint8_t reg, int val)
{
return ess_cmd1(sc, reg, val);
}
static int
ess_read(struct ess_info *sc, u_char reg)
ess_read(struct ess_info *sc, uint8_t reg)
{
return (ess_cmd(sc, 0xc0) && ess_cmd(sc, reg))? ess_get_byte(sc) : -1;
}
@@ -716,7 +716,7 @@ static uint32_t
essmix_setrecsrc(struct snd_mixer *m, uint32_t src)
{
struct ess_info *sc = mix_getdevinfo(m);
u_char recdev;
uint8_t recdev;
switch (src) {
case SOUND_MASK_CD:
+1 -1
View File
@@ -297,7 +297,7 @@ void
sndbuf_clear(struct snd_dbuf *b, unsigned int length)
{
int i;
u_char data, *p;
uint8_t data, *p;
if (length == 0)
return;