ASoC: rt5631: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 15 Jan 2015 11:52:11 +0000 (12:52 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 15 Jan 2015 11:57:06 +0000 (11:57 +0000)
The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5631.c

index 6d7b7ca7d530f034d2e972ba8070c03280e22bd0..c61852742ee30889c3fa482135acd1960324602f 100644 (file)
@@ -287,70 +287,78 @@ static const struct snd_kcontrol_new rt5631_snd_controls[] = {
 static int check_sysclk1_source(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_GLOBAL_CLK_CTRL);
+       reg = snd_soc_read(codec, RT5631_GLOBAL_CLK_CTRL);
        return reg & RT5631_SYSCLK_SOUR_SEL_PLL;
 }
 
 static int check_dmic_used(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(source->codec);
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
+       struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
        return rt5631->dmic_used_flag;
 }
 
 static int check_dacl_to_outmixl(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_OUTMIXER_L_CTRL);
+       reg = snd_soc_read(codec, RT5631_OUTMIXER_L_CTRL);
        return !(reg & RT5631_M_DAC_L_TO_OUTMIXER_L);
 }
 
 static int check_dacr_to_outmixr(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_OUTMIXER_R_CTRL);
+       reg = snd_soc_read(codec, RT5631_OUTMIXER_R_CTRL);
        return !(reg & RT5631_M_DAC_R_TO_OUTMIXER_R);
 }
 
 static int check_dacl_to_spkmixl(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_SPK_MIXER_CTRL);
+       reg = snd_soc_read(codec, RT5631_SPK_MIXER_CTRL);
        return !(reg & RT5631_M_DAC_L_TO_SPKMIXER_L);
 }
 
 static int check_dacr_to_spkmixr(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_SPK_MIXER_CTRL);
+       reg = snd_soc_read(codec, RT5631_SPK_MIXER_CTRL);
        return !(reg & RT5631_M_DAC_R_TO_SPKMIXER_R);
 }
 
 static int check_adcl_select(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_ADC_REC_MIXER);
+       reg = snd_soc_read(codec, RT5631_ADC_REC_MIXER);
        return !(reg & RT5631_M_MIC1_TO_RECMIXER_L);
 }
 
 static int check_adcr_select(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
        unsigned int reg;
 
-       reg = snd_soc_read(source->codec, RT5631_ADC_REC_MIXER);
+       reg = snd_soc_read(codec, RT5631_ADC_REC_MIXER);
        return !(reg & RT5631_M_MIC2_TO_RECMIXER_R);
 }
 
@@ -556,7 +564,7 @@ static void depop_seq_mute_stage(struct snd_soc_codec *codec, int enable)
 static int hp_event(struct snd_soc_dapm_widget *w,
        struct snd_kcontrol *kcontrol, int event)
 {
-       struct snd_soc_codec *codec = w->codec;
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
        struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
 
        switch (event) {
@@ -590,7 +598,7 @@ static int hp_event(struct snd_soc_dapm_widget *w,
 static int set_dmic_params(struct snd_soc_dapm_widget *w,
        struct snd_kcontrol *kcontrol, int event)
 {
-       struct snd_soc_codec *codec = w->codec;
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
        struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
 
        switch (rt5631->rx_rate) {