diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-15 06:52:14 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-15 06:57:06 -0500 |
commit | 30c173ed3e03a21be78257852d1815d7c4e55ae9 (patch) | |
tree | 5293f972deed5b1e084527273da5e9ab980822a2 | |
parent | c5f596cb4b4969a5539a7c71b960045a1399093d (diff) |
ASoC: rt5651: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
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>
-rw-r--r-- | sound/soc/codecs/rt5651.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c index bb0a3ab5416c..9f4c7be6d798 100644 --- a/sound/soc/codecs/rt5651.c +++ b/sound/soc/codecs/rt5651.c | |||
@@ -376,7 +376,7 @@ static const struct snd_kcontrol_new rt5651_snd_controls[] = { | |||
376 | static int set_dmic_clk(struct snd_soc_dapm_widget *w, | 376 | static int set_dmic_clk(struct snd_soc_dapm_widget *w, |
377 | struct snd_kcontrol *kcontrol, int event) | 377 | struct snd_kcontrol *kcontrol, int event) |
378 | { | 378 | { |
379 | struct snd_soc_codec *codec = w->codec; | 379 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
380 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); | 380 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); |
381 | int idx = -EINVAL; | 381 | int idx = -EINVAL; |
382 | 382 | ||
@@ -394,9 +394,10 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w, | |||
394 | static int is_sysclk_from_pll(struct snd_soc_dapm_widget *source, | 394 | static int is_sysclk_from_pll(struct snd_soc_dapm_widget *source, |
395 | struct snd_soc_dapm_widget *sink) | 395 | struct snd_soc_dapm_widget *sink) |
396 | { | 396 | { |
397 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); | ||
397 | unsigned int val; | 398 | unsigned int val; |
398 | 399 | ||
399 | val = snd_soc_read(source->codec, RT5651_GLB_CLK); | 400 | val = snd_soc_read(codec, RT5651_GLB_CLK); |
400 | val &= RT5651_SCLK_SRC_MASK; | 401 | val &= RT5651_SCLK_SRC_MASK; |
401 | if (val == RT5651_SCLK_SRC_PLL1) | 402 | if (val == RT5651_SCLK_SRC_PLL1) |
402 | return 1; | 403 | return 1; |
@@ -731,7 +732,7 @@ static const struct snd_kcontrol_new rt5651_pdm_r_mux = | |||
731 | static int rt5651_amp_power_event(struct snd_soc_dapm_widget *w, | 732 | static int rt5651_amp_power_event(struct snd_soc_dapm_widget *w, |
732 | struct snd_kcontrol *kcontrol, int event) | 733 | struct snd_kcontrol *kcontrol, int event) |
733 | { | 734 | { |
734 | struct snd_soc_codec *codec = w->codec; | 735 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
735 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); | 736 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); |
736 | 737 | ||
737 | switch (event) { | 738 | switch (event) { |
@@ -769,7 +770,7 @@ static int rt5651_amp_power_event(struct snd_soc_dapm_widget *w, | |||
769 | static int rt5651_hp_event(struct snd_soc_dapm_widget *w, | 770 | static int rt5651_hp_event(struct snd_soc_dapm_widget *w, |
770 | struct snd_kcontrol *kcontrol, int event) | 771 | struct snd_kcontrol *kcontrol, int event) |
771 | { | 772 | { |
772 | struct snd_soc_codec *codec = w->codec; | 773 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
773 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); | 774 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); |
774 | 775 | ||
775 | switch (event) { | 776 | switch (event) { |
@@ -813,7 +814,8 @@ static int rt5651_hp_event(struct snd_soc_dapm_widget *w, | |||
813 | static int rt5651_hp_post_event(struct snd_soc_dapm_widget *w, | 814 | static int rt5651_hp_post_event(struct snd_soc_dapm_widget *w, |
814 | struct snd_kcontrol *kcontrol, int event) | 815 | struct snd_kcontrol *kcontrol, int event) |
815 | { | 816 | { |
816 | struct snd_soc_codec *codec = w->codec; | 817 | |
818 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | ||
817 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); | 819 | struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); |
818 | 820 | ||
819 | switch (event) { | 821 | switch (event) { |
@@ -833,7 +835,7 @@ static int rt5651_hp_post_event(struct snd_soc_dapm_widget *w, | |||
833 | static int rt5651_bst1_event(struct snd_soc_dapm_widget *w, | 835 | static int rt5651_bst1_event(struct snd_soc_dapm_widget *w, |
834 | struct snd_kcontrol *kcontrol, int event) | 836 | struct snd_kcontrol *kcontrol, int event) |
835 | { | 837 | { |
836 | struct snd_soc_codec *codec = w->codec; | 838 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
837 | 839 | ||
838 | switch (event) { | 840 | switch (event) { |
839 | case SND_SOC_DAPM_POST_PMU: | 841 | case SND_SOC_DAPM_POST_PMU: |
@@ -856,7 +858,7 @@ static int rt5651_bst1_event(struct snd_soc_dapm_widget *w, | |||
856 | static int rt5651_bst2_event(struct snd_soc_dapm_widget *w, | 858 | static int rt5651_bst2_event(struct snd_soc_dapm_widget *w, |
857 | struct snd_kcontrol *kcontrol, int event) | 859 | struct snd_kcontrol *kcontrol, int event) |
858 | { | 860 | { |
859 | struct snd_soc_codec *codec = w->codec; | 861 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
860 | 862 | ||
861 | switch (event) { | 863 | switch (event) { |
862 | case SND_SOC_DAPM_POST_PMU: | 864 | case SND_SOC_DAPM_POST_PMU: |
@@ -879,7 +881,7 @@ static int rt5651_bst2_event(struct snd_soc_dapm_widget *w, | |||
879 | static int rt5651_bst3_event(struct snd_soc_dapm_widget *w, | 881 | static int rt5651_bst3_event(struct snd_soc_dapm_widget *w, |
880 | struct snd_kcontrol *kcontrol, int event) | 882 | struct snd_kcontrol *kcontrol, int event) |
881 | { | 883 | { |
882 | struct snd_soc_codec *codec = w->codec; | 884 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
883 | 885 | ||
884 | switch (event) { | 886 | switch (event) { |
885 | case SND_SOC_DAPM_POST_PMU: | 887 | case SND_SOC_DAPM_POST_PMU: |