diff options
| author | Takashi Iwai <tiwai@suse.de> | 2011-03-03 06:56:34 -0500 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2011-03-03 06:56:34 -0500 |
| commit | d207df2df064c19a2cf4eac8f887351fe5ce526e (patch) | |
| tree | f2005e1b2017c5e35a297318dcf6fe8a635f7c87 /sound/soc/codecs | |
| parent | 1aa924e21eec9dbb2c5fae90a71451a700db4414 (diff) | |
| parent | c8900a0fad5ae9f4823451de17ba5dec6653ac74 (diff) | |
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/soc/codecs')
| -rw-r--r-- | sound/soc/codecs/cx20442.c | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8903.c | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8903.h | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8994.c | 202 | ||||
| -rw-r--r-- | sound/soc/codecs/wm_hubs.c | 3 |
5 files changed, 191 insertions, 20 deletions
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index bb4bf65b9e7e..0bb424af956f 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
| @@ -367,7 +367,7 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) | |||
| 367 | return 0; | 367 | return 0; |
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC; | 370 | static const u8 cx20442_reg; |
| 371 | 371 | ||
| 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { | 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { |
| 373 | .probe = cx20442_codec_probe, | 373 | .probe = cx20442_codec_probe, |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 987476a5895f..017d99ceb42e 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
| @@ -1482,7 +1482,7 @@ int wm8903_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
| 1482 | WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, | 1482 | WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, |
| 1483 | irq_mask); | 1483 | irq_mask); |
| 1484 | 1484 | ||
| 1485 | if (det && shrt) { | 1485 | if (det || shrt) { |
| 1486 | /* Enable mic detection, this may not have been set through | 1486 | /* Enable mic detection, this may not have been set through |
| 1487 | * platform data (eg, if the defaults are OK). */ | 1487 | * platform data (eg, if the defaults are OK). */ |
| 1488 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, | 1488 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, |
diff --git a/sound/soc/codecs/wm8903.h b/sound/soc/codecs/wm8903.h index e8490f3edd03..e3ec2433b215 100644 --- a/sound/soc/codecs/wm8903.h +++ b/sound/soc/codecs/wm8903.h | |||
| @@ -165,7 +165,7 @@ extern int wm8903_mic_detect(struct snd_soc_codec *codec, | |||
| 165 | 165 | ||
| 166 | #define WM8903_VMID_RES_50K 2 | 166 | #define WM8903_VMID_RES_50K 2 |
| 167 | #define WM8903_VMID_RES_250K 3 | 167 | #define WM8903_VMID_RES_250K 3 |
| 168 | #define WM8903_VMID_RES_5K 4 | 168 | #define WM8903_VMID_RES_5K 6 |
| 169 | 169 | ||
| 170 | /* | 170 | /* |
| 171 | * R8 (0x08) - Analogue DAC 0 | 171 | * R8 (0x08) - Analogue DAC 0 |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 37b8aa8a680f..ebaee5ca7434 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
| @@ -107,6 +107,9 @@ struct wm8994_priv { | |||
| 107 | 107 | ||
| 108 | int revision; | 108 | int revision; |
| 109 | struct wm8994_pdata *pdata; | 109 | struct wm8994_pdata *pdata; |
| 110 | |||
| 111 | unsigned int aif1clk_enable:1; | ||
| 112 | unsigned int aif2clk_enable:1; | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | static int wm8994_readable(unsigned int reg) | 115 | static int wm8994_readable(unsigned int reg) |
| @@ -1004,6 +1007,93 @@ static void wm8994_update_class_w(struct snd_soc_codec *codec) | |||
| 1004 | } | 1007 | } |
| 1005 | } | 1008 | } |
| 1006 | 1009 | ||
| 1010 | static int late_enable_ev(struct snd_soc_dapm_widget *w, | ||
| 1011 | struct snd_kcontrol *kcontrol, int event) | ||
| 1012 | { | ||
| 1013 | struct snd_soc_codec *codec = w->codec; | ||
| 1014 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1015 | |||
| 1016 | switch (event) { | ||
| 1017 | case SND_SOC_DAPM_PRE_PMU: | ||
| 1018 | if (wm8994->aif1clk_enable) | ||
| 1019 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, | ||
| 1020 | WM8994_AIF1CLK_ENA_MASK, | ||
| 1021 | WM8994_AIF1CLK_ENA); | ||
| 1022 | if (wm8994->aif2clk_enable) | ||
| 1023 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, | ||
| 1024 | WM8994_AIF2CLK_ENA_MASK, | ||
| 1025 | WM8994_AIF2CLK_ENA); | ||
| 1026 | break; | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | return 0; | ||
| 1030 | } | ||
| 1031 | |||
| 1032 | static int late_disable_ev(struct snd_soc_dapm_widget *w, | ||
| 1033 | struct snd_kcontrol *kcontrol, int event) | ||
| 1034 | { | ||
| 1035 | struct snd_soc_codec *codec = w->codec; | ||
| 1036 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1037 | |||
| 1038 | switch (event) { | ||
| 1039 | case SND_SOC_DAPM_POST_PMD: | ||
| 1040 | if (wm8994->aif1clk_enable) { | ||
| 1041 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, | ||
| 1042 | WM8994_AIF1CLK_ENA_MASK, 0); | ||
| 1043 | wm8994->aif1clk_enable = 0; | ||
| 1044 | } | ||
| 1045 | if (wm8994->aif2clk_enable) { | ||
| 1046 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, | ||
| 1047 | WM8994_AIF2CLK_ENA_MASK, 0); | ||
| 1048 | wm8994->aif2clk_enable = 0; | ||
| 1049 | } | ||
| 1050 | break; | ||
| 1051 | } | ||
| 1052 | |||
| 1053 | return 0; | ||
| 1054 | } | ||
| 1055 | |||
| 1056 | static int aif1clk_ev(struct snd_soc_dapm_widget *w, | ||
| 1057 | struct snd_kcontrol *kcontrol, int event) | ||
| 1058 | { | ||
| 1059 | struct snd_soc_codec *codec = w->codec; | ||
| 1060 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1061 | |||
| 1062 | switch (event) { | ||
| 1063 | case SND_SOC_DAPM_PRE_PMU: | ||
| 1064 | wm8994->aif1clk_enable = 1; | ||
| 1065 | break; | ||
| 1066 | } | ||
| 1067 | |||
| 1068 | return 0; | ||
| 1069 | } | ||
| 1070 | |||
| 1071 | static int aif2clk_ev(struct snd_soc_dapm_widget *w, | ||
| 1072 | struct snd_kcontrol *kcontrol, int event) | ||
| 1073 | { | ||
| 1074 | struct snd_soc_codec *codec = w->codec; | ||
| 1075 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1076 | |||
| 1077 | switch (event) { | ||
| 1078 | case SND_SOC_DAPM_PRE_PMU: | ||
| 1079 | wm8994->aif2clk_enable = 1; | ||
| 1080 | break; | ||
| 1081 | } | ||
| 1082 | |||
| 1083 | return 0; | ||
| 1084 | } | ||
| 1085 | |||
| 1086 | static int dac_ev(struct snd_soc_dapm_widget *w, | ||
| 1087 | struct snd_kcontrol *kcontrol, int event) | ||
| 1088 | { | ||
| 1089 | struct snd_soc_codec *codec = w->codec; | ||
| 1090 | unsigned int mask = 1 << w->shift; | ||
| 1091 | |||
| 1092 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | ||
| 1093 | mask, mask); | ||
| 1094 | return 0; | ||
| 1095 | } | ||
| 1096 | |||
| 1007 | static const char *hp_mux_text[] = { | 1097 | static const char *hp_mux_text[] = { |
| 1008 | "Mixer", | 1098 | "Mixer", |
| 1009 | "DAC", | 1099 | "DAC", |
| @@ -1272,6 +1362,47 @@ static const struct soc_enum aif2dacr_src_enum = | |||
| 1272 | static const struct snd_kcontrol_new aif2dacr_src_mux = | 1362 | static const struct snd_kcontrol_new aif2dacr_src_mux = |
| 1273 | SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); | 1363 | SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); |
| 1274 | 1364 | ||
| 1365 | static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = { | ||
| 1366 | SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev, | ||
| 1367 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | ||
| 1368 | SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev, | ||
| 1369 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | ||
| 1370 | |||
| 1371 | SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1372 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1373 | SND_SOC_DAPM_PGA_E("Late DAC1R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1374 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1375 | SND_SOC_DAPM_PGA_E("Late DAC2L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1376 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1377 | SND_SOC_DAPM_PGA_E("Late DAC2R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1378 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1379 | |||
| 1380 | SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev) | ||
| 1381 | }; | ||
| 1382 | |||
| 1383 | static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { | ||
| 1384 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), | ||
| 1385 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0) | ||
| 1386 | }; | ||
| 1387 | |||
| 1388 | static const struct snd_soc_dapm_widget wm8994_dac_revd_widgets[] = { | ||
| 1389 | SND_SOC_DAPM_DAC_E("DAC2L", NULL, SND_SOC_NOPM, 3, 0, | ||
| 1390 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1391 | SND_SOC_DAPM_DAC_E("DAC2R", NULL, SND_SOC_NOPM, 2, 0, | ||
| 1392 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1393 | SND_SOC_DAPM_DAC_E("DAC1L", NULL, SND_SOC_NOPM, 1, 0, | ||
| 1394 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
