diff options
| -rw-r--r-- | sound/soc/codecs/rt5640.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index c3f2decd643c..b386958de042 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
| @@ -458,7 +458,7 @@ static const struct snd_kcontrol_new rt5640_specific_snd_controls[] = { | |||
| 458 | static int set_dmic_clk(struct snd_soc_dapm_widget *w, | 458 | static int set_dmic_clk(struct snd_soc_dapm_widget *w, |
| 459 | struct snd_kcontrol *kcontrol, int event) | 459 | struct snd_kcontrol *kcontrol, int event) |
| 460 | { | 460 | { |
| 461 | struct snd_soc_codec *codec = w->codec; | 461 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 462 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); | 462 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); |
| 463 | int idx = -EINVAL; | 463 | int idx = -EINVAL; |
| 464 | 464 | ||
| @@ -475,9 +475,10 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w, | |||
| 475 | static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, | 475 | static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, |
| 476 | struct snd_soc_dapm_widget *sink) | 476 | struct snd_soc_dapm_widget *sink) |
| 477 | { | 477 | { |
| 478 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); | ||
| 478 | unsigned int val; | 479 | unsigned int val; |
| 479 | 480 | ||
| 480 | val = snd_soc_read(source->codec, RT5640_GLB_CLK); | 481 | val = snd_soc_read(codec, RT5640_GLB_CLK); |
| 481 | val &= RT5640_SCLK_SRC_MASK; | 482 | val &= RT5640_SCLK_SRC_MASK; |
| 482 | if (val == RT5640_SCLK_SRC_PLL1) | 483 | if (val == RT5640_SCLK_SRC_PLL1) |
| 483 | return 1; | 484 | return 1; |
| @@ -963,7 +964,7 @@ static void rt5640_pmu_depop(struct snd_soc_codec *codec) | |||
| 963 | static int rt5640_hp_event(struct snd_soc_dapm_widget *w, | 964 | static int rt5640_hp_event(struct snd_soc_dapm_widget *w, |
| 964 | struct snd_kcontrol *kcontrol, int event) | 965 | struct snd_kcontrol *kcontrol, int event) |
| 965 | { | 966 | { |
| 966 | struct snd_soc_codec *codec = w->codec; | 967 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 967 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); | 968 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); |
| 968 | 969 | ||
| 969 | switch (event) { | 970 | switch (event) { |
| @@ -987,7 +988,7 @@ static int rt5640_hp_event(struct snd_soc_dapm_widget *w, | |||
| 987 | static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w, | 988 | static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w, |
| 988 | struct snd_kcontrol *kcontrol, int event) | 989 | struct snd_kcontrol *kcontrol, int event) |
| 989 | { | 990 | { |
| 990 | struct snd_soc_codec *codec = w->codec; | 991 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 991 | 992 | ||
| 992 | switch (event) { | 993 | switch (event) { |
| 993 | case SND_SOC_DAPM_POST_PMU: | 994 | case SND_SOC_DAPM_POST_PMU: |
| @@ -1003,7 +1004,7 @@ static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w, | |||
| 1003 | static int rt5640_hp_post_event(struct snd_soc_dapm_widget *w, | 1004 | static int rt5640_hp_post_event(struct snd_soc_dapm_widget *w, |
| 1004 | struct snd_kcontrol *kcontrol, int event) | 1005 | struct snd_kcontrol *kcontrol, int event) |
| 1005 | { | 1006 | { |
| 1006 | struct snd_soc_codec *codec = w->codec; | 1007 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 1007 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); | 1008 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); |
| 1008 | 1009 | ||
| 1009 | switch (event) { | 1010 | switch (event) { |
