Commit 97974309 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: ca0106: More constifications

Apply const prefix to each possible place: the static tables for
registers and verbs, and the string arrays.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-31-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ba09f5d8
...@@ -1360,7 +1360,7 @@ static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device) ...@@ -1360,7 +1360,7 @@ static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device)
} }
#define SPI_REG(reg, value) (((reg) << SPI_REG_SHIFT) | (value)) #define SPI_REG(reg, value) (((reg) << SPI_REG_SHIFT) | (value))
static unsigned int spi_dac_init[] = { static const unsigned int spi_dac_init[] = {
SPI_REG(SPI_LDA1_REG, SPI_DA_BIT_0dB), /* 0dB dig. attenuation */ SPI_REG(SPI_LDA1_REG, SPI_DA_BIT_0dB), /* 0dB dig. attenuation */
SPI_REG(SPI_RDA1_REG, SPI_DA_BIT_0dB), SPI_REG(SPI_RDA1_REG, SPI_DA_BIT_0dB),
SPI_REG(SPI_PL_REG, SPI_PL_BIT_L_L | SPI_PL_BIT_R_R | SPI_IZD_BIT), SPI_REG(SPI_PL_REG, SPI_PL_BIT_L_L | SPI_PL_BIT_R_R | SPI_IZD_BIT),
...@@ -1378,7 +1378,7 @@ static unsigned int spi_dac_init[] = { ...@@ -1378,7 +1378,7 @@ static unsigned int spi_dac_init[] = {
SPI_REG(SPI_DACD4_REG, SPI_DACD4_BIT), SPI_REG(SPI_DACD4_REG, SPI_DACD4_BIT),
}; };
static unsigned int i2c_adc_init[][2] = { static const unsigned int i2c_adc_init[][2] = {
{ 0x17, 0x00 }, /* Reset */ { 0x17, 0x00 }, /* Reset */
{ 0x07, 0x00 }, /* Timeout */ { 0x07, 0x00 }, /* Timeout */
{ 0x0b, 0x22 }, /* Interface control */ { 0x0b, 0x22 }, /* Interface control */
......
...@@ -739,7 +739,7 @@ static int rename_ctl(struct snd_card *card, const char *src, const char *dst) ...@@ -739,7 +739,7 @@ static int rename_ctl(struct snd_card *card, const char *src, const char *dst)
static static
DECLARE_TLV_DB_SCALE(snd_ca0106_master_db_scale, -6375, 25, 1); DECLARE_TLV_DB_SCALE(snd_ca0106_master_db_scale, -6375, 25, 1);
static char *slave_vols[] = { static const char * const slave_vols[] = {
"Analog Front Playback Volume", "Analog Front Playback Volume",
"Analog Rear Playback Volume", "Analog Rear Playback Volume",
"Analog Center/LFE Playback Volume", "Analog Center/LFE Playback Volume",
...@@ -752,7 +752,7 @@ static char *slave_vols[] = { ...@@ -752,7 +752,7 @@ static char *slave_vols[] = {
NULL NULL
}; };
static char *slave_sws[] = { static const char * const slave_sws[] = {
"Analog Front Playback Switch", "Analog Front Playback Switch",
"Analog Rear Playback Switch", "Analog Rear Playback Switch",
"Analog Center/LFE Playback Switch", "Analog Center/LFE Playback Switch",
...@@ -762,7 +762,7 @@ static char *slave_sws[] = { ...@@ -762,7 +762,7 @@ static char *slave_sws[] = {
}; };
static void add_slaves(struct snd_card *card, static void add_slaves(struct snd_card *card,
struct snd_kcontrol *master, char **list) struct snd_kcontrol *master, const char * const *list)
{ {
for (; *list; list++) { for (; *list; list++) {
struct snd_kcontrol *slave = ctl_find(card, *list); struct snd_kcontrol *slave = ctl_find(card, *list);
...@@ -775,9 +775,9 @@ int snd_ca0106_mixer(struct snd_ca0106 *emu) ...@@ -775,9 +775,9 @@ int snd_ca0106_mixer(struct snd_ca0106 *emu)
{ {
int err; int err;
struct snd_card *card = emu->card; struct snd_card *card = emu->card;
char **c; const char * const *c;
struct snd_kcontrol *vmaster; struct snd_kcontrol *vmaster;
static char *ca0106_remove_ctls[] = { static const char * const ca0106_remove_ctls[] = {
"Master Mono Playback Switch", "Master Mono Playback Switch",
"Master Mono Playback Volume", "Master Mono Playback Volume",
"3D Control - Switch", "3D Control - Switch",
...@@ -801,7 +801,7 @@ int snd_ca0106_mixer(struct snd_ca0106 *emu) ...@@ -801,7 +801,7 @@ int snd_ca0106_mixer(struct snd_ca0106 *emu)
"Surround Phase Inversion Playback Switch", "Surround Phase Inversion Playback Switch",
NULL NULL
}; };
static char *ca0106_rename_ctls[] = { static const char * const ca0106_rename_ctls[] = {
"Master Playback Switch", "Capture Switch", "Master Playback Switch", "Capture Switch",
"Master Playback Volume", "Capture Volume", "Master Playback Volume", "Capture Volume",
"Line Playback Switch", "AC97 Line Capture Switch", "Line Playback Switch", "AC97 Line Capture Switch",
...@@ -875,7 +875,7 @@ struct ca0106_vol_tbl { ...@@ -875,7 +875,7 @@ struct ca0106_vol_tbl {
unsigned int reg; unsigned int reg;
}; };
static struct ca0106_vol_tbl saved_volumes[NUM_SAVED_VOLUMES] = { static const struct ca0106_vol_tbl saved_volumes[NUM_SAVED_VOLUMES] = {
{ CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2 }, { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2 },
{ CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2 }, { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2 },
{ CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2 }, { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2 },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment