Commit 64793047 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Constify snd_soc_dai_ops variables

The snd_soc_dai_ops variables are not modified after initialization in
these drivers, so make them const.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d770e558
...@@ -919,7 +919,7 @@ static int cs42l52_set_bias_level(struct snd_soc_codec *codec, ...@@ -919,7 +919,7 @@ static int cs42l52_set_bias_level(struct snd_soc_codec *codec,
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_U20_3LE | \ SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_U20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE)
static struct snd_soc_dai_ops cs42l52_ops = { static const struct snd_soc_dai_ops cs42l52_ops = {
.hw_params = cs42l52_pcm_hw_params, .hw_params = cs42l52_pcm_hw_params,
.digital_mute = cs42l52_digital_mute, .digital_mute = cs42l52_digital_mute,
.set_fmt = cs42l52_set_fmt, .set_fmt = cs42l52_set_fmt,
......
...@@ -989,7 +989,7 @@ static int cs42l56_set_bias_level(struct snd_soc_codec *codec, ...@@ -989,7 +989,7 @@ static int cs42l56_set_bias_level(struct snd_soc_codec *codec,
SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_ops cs42l56_ops = { static const struct snd_soc_dai_ops cs42l56_ops = {
.hw_params = cs42l56_pcm_hw_params, .hw_params = cs42l56_pcm_hw_params,
.digital_mute = cs42l56_digital_mute, .digital_mute = cs42l56_digital_mute,
.set_fmt = cs42l56_set_dai_fmt, .set_fmt = cs42l56_set_dai_fmt,
......
...@@ -1016,25 +1016,25 @@ static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -1016,25 +1016,25 @@ static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
#define ISABELLE_FORMATS (SNDRV_PCM_FMTBIT_S20_3LE |\ #define ISABELLE_FORMATS (SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_ops isabelle_hs_dai_ops = { static const struct snd_soc_dai_ops isabelle_hs_dai_ops = {
.hw_params = isabelle_hw_params, .hw_params = isabelle_hw_params,
.set_fmt = isabelle_set_dai_fmt, .set_fmt = isabelle_set_dai_fmt,
.digital_mute = isabelle_hs_mute, .digital_mute = isabelle_hs_mute,
}; };
static struct snd_soc_dai_ops isabelle_hf_dai_ops = { static const struct snd_soc_dai_ops isabelle_hf_dai_ops = {
.hw_params = isabelle_hw_params, .hw_params = isabelle_hw_params,
.set_fmt = isabelle_set_dai_fmt, .set_fmt = isabelle_set_dai_fmt,
.digital_mute = isabelle_hf_mute, .digital_mute = isabelle_hf_mute,
}; };
static struct snd_soc_dai_ops isabelle_line_dai_ops = { static const struct snd_soc_dai_ops isabelle_line_dai_ops = {
.hw_params = isabelle_hw_params, .hw_params = isabelle_hw_params,
.set_fmt = isabelle_set_dai_fmt, .set_fmt = isabelle_set_dai_fmt,
.digital_mute = isabelle_line_mute, .digital_mute = isabelle_line_mute,
}; };
static struct snd_soc_dai_ops isabelle_ul_dai_ops = { static const struct snd_soc_dai_ops isabelle_ul_dai_ops = {
.hw_params = isabelle_hw_params, .hw_params = isabelle_hw_params,
.set_fmt = isabelle_set_dai_fmt, .set_fmt = isabelle_set_dai_fmt,
}; };
......
...@@ -1291,35 +1291,35 @@ static int lm49453_set_bias_level(struct snd_soc_codec *codec, ...@@ -1291,35 +1291,35 @@ static int lm49453_set_bias_level(struct snd_soc_codec *codec,
#define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ #define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_ops lm49453_headset_dai_ops = { static const struct snd_soc_dai_ops lm49453_headset_dai_ops = {
.hw_params = lm49453_hw_params, .hw_params = lm49453_hw_params,
.set_sysclk = lm49453_set_dai_sysclk, .set_sysclk = lm49453_set_dai_sysclk,
.set_fmt = lm49453_set_dai_fmt, .set_fmt = lm49453_set_dai_fmt,
.digital_mute = lm49453_hp_mute, .digital_mute = lm49453_hp_mute,
}; };
static struct snd_soc_dai_ops lm49453_speaker_dai_ops = { static const struct snd_soc_dai_ops lm49453_speaker_dai_ops = {
.hw_params = lm49453_hw_params, .hw_params = lm49453_hw_params,
.set_sysclk = lm49453_set_dai_sysclk, .set_sysclk = lm49453_set_dai_sysclk,
.set_fmt = lm49453_set_dai_fmt, .set_fmt = lm49453_set_dai_fmt,
.digital_mute = lm49453_ls_mute, .digital_mute = lm49453_ls_mute,
}; };
static struct snd_soc_dai_ops lm49453_haptic_dai_ops = { static const struct snd_soc_dai_ops lm49453_haptic_dai_ops = {
.hw_params = lm49453_hw_params, .hw_params = lm49453_hw_params,
.set_sysclk = lm49453_set_dai_sysclk, .set_sysclk = lm49453_set_dai_sysclk,
.set_fmt = lm49453_set_dai_fmt, .set_fmt = lm49453_set_dai_fmt,
.digital_mute = lm49453_ha_mute, .digital_mute = lm49453_ha_mute,
}; };
static struct snd_soc_dai_ops lm49453_ep_dai_ops = { static const struct snd_soc_dai_ops lm49453_ep_dai_ops = {
.hw_params = lm49453_hw_params, .hw_params = lm49453_hw_params,
.set_sysclk = lm49453_set_dai_sysclk, .set_sysclk = lm49453_set_dai_sysclk,
.set_fmt = lm49453_set_dai_fmt, .set_fmt = lm49453_set_dai_fmt,
.digital_mute = lm49453_ep_mute, .digital_mute = lm49453_ep_mute,
}; };
static struct snd_soc_dai_ops lm49453_lineout_dai_ops = { static const struct snd_soc_dai_ops lm49453_lineout_dai_ops = {
.hw_params = lm49453_hw_params, .hw_params = lm49453_hw_params,
.set_sysclk = lm49453_set_dai_sysclk, .set_sysclk = lm49453_set_dai_sysclk,
.set_fmt = lm49453_set_dai_fmt, .set_fmt = lm49453_set_dai_fmt,
......
...@@ -2383,7 +2383,7 @@ EXPORT_SYMBOL_GPL(max98090_mic_detect); ...@@ -2383,7 +2383,7 @@ EXPORT_SYMBOL_GPL(max98090_mic_detect);
#define MAX98090_RATES SNDRV_PCM_RATE_8000_96000 #define MAX98090_RATES SNDRV_PCM_RATE_8000_96000
#define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
static struct snd_soc_dai_ops max98090_dai_ops = { static const struct snd_soc_dai_ops max98090_dai_ops = {
.set_sysclk = max98090_dai_set_sysclk, .set_sysclk = max98090_dai_set_sysclk,
.set_fmt = max98090_dai_set_fmt, .set_fmt = max98090_dai_set_fmt,
.set_tdm_slot = max98090_set_tdm_slot, .set_tdm_slot = max98090_set_tdm_slot,
......
...@@ -79,7 +79,7 @@ static struct snd_soc_codec_driver max98357a_codec_driver = { ...@@ -79,7 +79,7 @@ static struct snd_soc_codec_driver max98357a_codec_driver = {
.num_dapm_routes = ARRAY_SIZE(max98357a_dapm_routes), .num_dapm_routes = ARRAY_SIZE(max98357a_dapm_routes),
}; };
static struct snd_soc_dai_ops max98357a_dai_ops = { static const struct snd_soc_dai_ops max98357a_dai_ops = {
.trigger = max98357a_daiops_trigger, .trigger = max98357a_daiops_trigger,
}; };
......
...@@ -650,14 +650,14 @@ static int mc13783_remove(struct snd_soc_codec *codec) ...@@ -650,14 +650,14 @@ static int mc13783_remove(struct snd_soc_codec *codec)
#define MC13783_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ #define MC13783_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE) SNDRV_PCM_FMTBIT_S24_LE)
static struct snd_soc_dai_ops mc13783_ops_dac = { static const struct snd_soc_dai_ops mc13783_ops_dac = {
.hw_params = mc13783_pcm_hw_params_dac, .hw_params = mc13783_pcm_hw_params_dac,
.set_fmt = mc13783_set_fmt_async, .set_fmt = mc13783_set_fmt_async,
.set_sysclk = mc13783_set_sysclk_dac, .set_sysclk = mc13783_set_sysclk_dac,
.set_tdm_slot = mc13783_set_tdm_slot_dac, .set_tdm_slot = mc13783_set_tdm_slot_dac,
}; };
static struct snd_soc_dai_ops mc13783_ops_codec = { static const struct snd_soc_dai_ops mc13783_ops_codec = {
.hw_params = mc13783_pcm_hw_params_codec, .hw_params = mc13783_pcm_hw_params_codec,
.set_fmt = mc13783_set_fmt_async, .set_fmt = mc13783_set_fmt_async,
.set_sysclk = mc13783_set_sysclk_codec, .set_sysclk = mc13783_set_sysclk_codec,
...@@ -698,7 +698,7 @@ static struct snd_soc_dai_driver mc13783_dai_async[] = { ...@@ -698,7 +698,7 @@ static struct snd_soc_dai_driver mc13783_dai_async[] = {
}, },
}; };
static struct snd_soc_dai_ops mc13783_ops_sync = { static const struct snd_soc_dai_ops mc13783_ops_sync = {
.hw_params = mc13783_pcm_hw_params_sync, .hw_params = mc13783_pcm_hw_params_sync,
.set_fmt = mc13783_set_fmt_sync, .set_fmt = mc13783_set_fmt_sync,
.set_sysclk = mc13783_set_sysclk_sync, .set_sysclk = mc13783_set_sysclk_sync,
......
...@@ -3110,7 +3110,7 @@ static int rt5645_resume(struct snd_soc_codec *codec) ...@@ -3110,7 +3110,7 @@ static int rt5645_resume(struct snd_soc_codec *codec)
#define RT5645_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ #define RT5645_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
static struct snd_soc_dai_ops rt5645_aif_dai_ops = { static const struct snd_soc_dai_ops rt5645_aif_dai_ops = {
.hw_params = rt5645_hw_params, .hw_params = rt5645_hw_params,
.set_fmt = rt5645_set_dai_fmt, .set_fmt = rt5645_set_dai_fmt,
.set_sysclk = rt5645_set_dai_sysclk, .set_sysclk = rt5645_set_dai_sysclk,
......
...@@ -2720,7 +2720,7 @@ static int rt5670_resume(struct snd_soc_codec *codec) ...@@ -2720,7 +2720,7 @@ static int rt5670_resume(struct snd_soc_codec *codec)
#define RT5670_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ #define RT5670_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
static struct snd_soc_dai_ops rt5670_aif_dai_ops = { static const struct snd_soc_dai_ops rt5670_aif_dai_ops = {
.hw_params = rt5670_hw_params, .hw_params = rt5670_hw_params,
.set_fmt = rt5670_set_dai_fmt, .set_fmt = rt5670_set_dai_fmt,
.set_sysclk = rt5670_set_dai_sysclk, .set_sysclk = rt5670_set_dai_sysclk,
......
...@@ -4863,7 +4863,7 @@ static int rt5677_write(void *context, unsigned int reg, unsigned int val) ...@@ -4863,7 +4863,7 @@ static int rt5677_write(void *context, unsigned int reg, unsigned int val)
#define RT5677_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ #define RT5677_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
static struct snd_soc_dai_ops rt5677_aif_dai_ops = { static const struct snd_soc_dai_ops rt5677_aif_dai_ops = {
.hw_params = rt5677_hw_params, .hw_params = rt5677_hw_params,
.set_fmt = rt5677_set_dai_fmt, .set_fmt = rt5677_set_dai_fmt,
.set_sysclk = rt5677_set_dai_sysclk, .set_sysclk = rt5677_set_dai_sysclk,
......
...@@ -208,7 +208,7 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream, ...@@ -208,7 +208,7 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream,
return err; return err;
} }
static struct snd_soc_dai_ops si476x_dai_ops = { static const struct snd_soc_dai_ops si476x_dai_ops = {
.hw_params = si476x_codec_hw_params, .hw_params = si476x_codec_hw_params,
.set_fmt = si476x_codec_set_dai_fmt, .set_fmt = si476x_codec_set_dai_fmt,
}; };
......
...@@ -520,7 +520,7 @@ static const struct dev_pm_ops tas2552_pm = { ...@@ -520,7 +520,7 @@ static const struct dev_pm_ops tas2552_pm = {
NULL) NULL)
}; };
static struct snd_soc_dai_ops tas2552_speaker_dai_ops = { static const struct snd_soc_dai_ops tas2552_speaker_dai_ops = {
.hw_params = tas2552_hw_params, .hw_params = tas2552_hw_params,
.prepare = tas2552_prepare, .prepare = tas2552_prepare,
.set_sysclk = tas2552_set_dai_sysclk, .set_sysclk = tas2552_set_dai_sysclk,
......
...@@ -1121,7 +1121,7 @@ static struct snd_soc_codec_driver soc_codec_driver_aic31xx = { ...@@ -1121,7 +1121,7 @@ static struct snd_soc_codec_driver soc_codec_driver_aic31xx = {
.num_dapm_routes = ARRAY_SIZE(aic31xx_audio_map), .num_dapm_routes = ARRAY_SIZE(aic31xx_audio_map),
}; };
static struct snd_soc_dai_ops aic31xx_dai_ops = { static const struct snd_soc_dai_ops aic31xx_dai_ops = {
.hw_params = aic31xx_hw_params, .hw_params = aic31xx_hw_params,
.set_sysclk = aic31xx_set_dai_sysclk, .set_sysclk = aic31xx_set_dai_sysclk,
.set_fmt = aic31xx_set_dai_fmt, .set_fmt = aic31xx_set_dai_fmt,
......
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