Commit f16a4e96 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: ice1712: More constifications

Apply const prefix to each possible place: the EEPROM tables, the
static string arrays, the init verb tables, etc.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-17-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bf6f3d74
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2133,7 +2133,7 @@ static int aureon_init(struct snd_ice1712 *ice)
 * hence the driver needs to sets up it properly.
 */

static unsigned char aureon51_eeprom[] = {
static const unsigned char aureon51_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x0a,	/* clock 512, spdif-in/ADC, 3DACs */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
	[ICE_EEP2_I2S]         = 0xfc,	/* vol, 96k, 24bit, 192k */
@@ -2149,7 +2149,7 @@ static unsigned char aureon51_eeprom[] = {
	[ICE_EEP2_GPIO_STATE2] = 0x00,
};

static unsigned char aureon71_eeprom[] = {
static const unsigned char aureon71_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x0b,	/* clock 512, spdif-in/ADC, 4DACs */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
	[ICE_EEP2_I2S]         = 0xfc,	/* vol, 96k, 24bit, 192k */
@@ -2166,7 +2166,7 @@ static unsigned char aureon71_eeprom[] = {
};
#define prodigy71_eeprom aureon71_eeprom

static unsigned char aureon71_universe_eeprom[] = {
static const unsigned char aureon71_universe_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x2b,	/* clock 512, mpu401, spdif-in/ADC,
					 * 4DACs
					 */
@@ -2184,7 +2184,7 @@ static unsigned char aureon71_universe_eeprom[] = {
	[ICE_EEP2_GPIO_STATE2] = 0x00,
};

static unsigned char prodigy71lt_eeprom[] = {
static const unsigned char prodigy71lt_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x4b,	/* clock 384, spdif-in/ADC, 4DACs */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
	[ICE_EEP2_I2S]         = 0xfc,	/* vol, 96k, 24bit, 192k */
+3 −3
Original line number Diff line number Diff line
@@ -397,7 +397,7 @@ static const struct snd_kcontrol_new juli_mute_controls[] = {
	},
};

static char *slave_vols[] = {
static const char * const slave_vols[] = {
	PCM_VOLUME,
	MONITOR_AN_IN_VOLUME,
	MONITOR_DIG_IN_VOLUME,
@@ -420,7 +420,7 @@ static struct snd_kcontrol *ctl_find(struct snd_card *card,

static void add_slaves(struct snd_card *card,
		       struct snd_kcontrol *master,
		       char * const *list)
		       const char * const *list)
{
	for (; *list; list++) {
		struct snd_kcontrol *slave = ctl_find(card, *list);
@@ -651,7 +651,7 @@ static int juli_init(struct snd_ice1712 *ice)
 * hence the driver needs to sets up it properly.
 */

static unsigned char juli_eeprom[] = {
static const unsigned char juli_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x2b,	/* clock 512, mpu401, 1xADC, 1xDACs,
					   SPDIF in */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
+5 −5
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ struct maya_vol_info {
	unsigned char mux_bits[2];	/* extra bits for ADC mute */
};

static struct maya_vol_info vol_info[WM_NUM_VOLS] = {
static const struct maya_vol_info vol_info[WM_NUM_VOLS] = {
	[WM_VOL_HP] = {
		.maxval = 80,
		.regs = { WM8776_REG_HEADPHONE_L, WM8776_REG_HEADPHONE_R },
@@ -158,7 +158,7 @@ static int maya_vol_info(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_info *uinfo)
{
	unsigned int idx = kcontrol->private_value;
	struct maya_vol_info *vol = &vol_info[idx];
	const struct maya_vol_info *vol = &vol_info[idx];

	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 2;
@@ -189,7 +189,7 @@ static int maya_vol_put(struct snd_kcontrol *kcontrol,
	struct snd_wm8776 *wm =
		&chip->wm[snd_ctl_get_ioff(kcontrol, &ucontrol->id)];
	unsigned int idx = kcontrol->private_value;
	struct maya_vol_info *vol = &vol_info[idx];
	const struct maya_vol_info *vol = &vol_info[idx];
	unsigned int val, data;
	int ch, changed = 0;

@@ -662,7 +662,7 @@ static const struct snd_pcm_hw_constraint_list dac_rates = {
/*
 * chip addresses on I2C bus
 */
static unsigned char wm8776_addr[2] = {
static const unsigned char wm8776_addr[2] = {
	0x34, 0x36, /* codec 0 & 1 */
};

@@ -712,7 +712,7 @@ static int maya44_init(struct snd_ice1712 *ice)
 * hence the driver needs to sets up it properly.
 */

static unsigned char maya44_eeprom[] = {
static const unsigned char maya44_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x45,
		/* clock xin1=49.152MHz, mpu401, 2 stereo ADCs+DACs */
	[ICE_EEP2_ACLINK]      = 0x80,
+2 −2
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ static int phase22_add_controls(struct snd_ice1712 *ice)
	return 0;
}

static unsigned char phase22_eeprom[] = {
static const unsigned char phase22_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x28,  /* clock 512, mpu 401,
					spdif-in/1xADC, 1xDACs */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
@@ -174,7 +174,7 @@ static unsigned char phase22_eeprom[] = {
	[ICE_EEP2_GPIO_STATE2] = 0x00,
};

static unsigned char phase28_eeprom[] = {
static const unsigned char phase28_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x2b,  /* clock 512, mpu401,
					spdif-in/1xADC, 4xDACs */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
+1 −1
Original line number Diff line number Diff line
@@ -778,7 +778,7 @@ static int pontis_init(struct snd_ice1712 *ice)
 * hence the driver needs to sets up it properly.
 */

static unsigned char pontis_eeprom[] = {
static const unsigned char pontis_eeprom[] = {
	[ICE_EEP2_SYSCONF]     = 0x08,	/* clock 256, mpu401, spdif-in/ADC, 1DAC */
	[ICE_EEP2_ACLINK]      = 0x80,	/* I2S */
	[ICE_EEP2_I2S]         = 0xf8,	/* vol, 96k, 24bit, 192k */
Loading