aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5640.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/rt5640.c')
-rw-r--r--sound/soc/codecs/rt5640.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index c3f2decd643c..178e55d4d481 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[] = {
458static int set_dmic_clk(struct snd_soc_dapm_widget *w, 458static 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,
475static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, 475static 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)
963static int rt5640_hp_event(struct snd_soc_dapm_widget *w, 964static 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,
987static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w, 988static 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,
1003static int rt5640_hp_post_event(struct snd_soc_dapm_widget *w, 1004static 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) {
@@ -2124,6 +2125,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match);
2124static struct acpi_device_id rt5640_acpi_match[] = { 2125static struct acpi_device_id rt5640_acpi_match[] = {
2125 { "INT33CA", 0 }, 2126 { "INT33CA", 0 },
2126 { "10EC5640", 0 }, 2127 { "10EC5640", 0 },
2128 { "10EC5642", 0 },
2127 { }, 2129 { },
2128}; 2130};
2129MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match); 2131MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);