diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-09-22 04:05:49 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-22 12:20:22 -0400 |
commit | 317596a69453772dcba2ab1e6e041de69e762794 (patch) | |
tree | 63d0d63db4a1ebb76dac4a0b8678d22cfd088948 | |
parent | d17bf31832d30b91225a84b53fae380dbdd07d3d (diff) |
ASoC: twl6040: Earphone path correction
Fix the DAPM routing for the earphone path.
Convert the DAPM_SWITCH_E to DAPM_OUT_DRV_E, so we can have correct
power up, and down sequence for EP.
Introduce mute control (Earphone Playback Switch) for users to
enable/disable the EP path.
Note: the EP does not have it's own dedicated DAC. EP is connected to
HSL DAC.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/twl6040.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 96354660c343..3450b11fa7dd 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -61,6 +61,9 @@ | |||
61 | #define TWL6040_REG_SW_SHADOW 0x2F | 61 | #define TWL6040_REG_SW_SHADOW 0x2F |
62 | #define TWL6040_CACHEREGNUM (TWL6040_REG_SW_SHADOW + 1) | 62 | #define TWL6040_CACHEREGNUM (TWL6040_REG_SW_SHADOW + 1) |
63 | 63 | ||
64 | /* TWL6040_REG_SW_SHADOW (0x2F) fields */ | ||
65 | #define TWL6040_EAR_PATH_ENABLE 0x01 | ||
66 | |||
64 | struct twl6040_output { | 67 | struct twl6040_output { |
65 | u16 active; | 68 | u16 active; |
66 | u16 left_vol; | 69 | u16 left_vol; |
@@ -991,8 +994,8 @@ static const struct snd_kcontrol_new hfl_mux_controls = | |||
991 | static const struct snd_kcontrol_new hfr_mux_controls = | 994 | static const struct snd_kcontrol_new hfr_mux_controls = |
992 | SOC_DAPM_ENUM("Route", twl6040_hf_enum[1]); | 995 | SOC_DAPM_ENUM("Route", twl6040_hf_enum[1]); |
993 | 996 | ||
994 | static const struct snd_kcontrol_new ep_driver_switch_controls = | 997 | static const struct snd_kcontrol_new ep_path_enable_control = |
995 | SOC_DAPM_SINGLE("Switch", TWL6040_REG_EARCTL, 0, 1, 0); | 998 | SOC_DAPM_SINGLE("Switch", TWL6040_REG_SW_SHADOW, 0, 1, 0); |
996 | 999 | ||
997 | /* Headset power mode */ | 1000 | /* Headset power mode */ |
998 | static const char *twl6040_power_mode_texts[] = { | 1001 | static const char *twl6040_power_mode_texts[] = { |
@@ -1165,6 +1168,9 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { | |||
1165 | SND_SOC_DAPM_MUX("HS Right Playback", | 1168 | SND_SOC_DAPM_MUX("HS Right Playback", |
1166 | SND_SOC_NOPM, 0, 0, &hsr_mux_controls), | 1169 | SND_SOC_NOPM, 0, 0, &hsr_mux_controls), |
1167 | 1170 | ||
1171 | SND_SOC_DAPM_SWITCH("Earphone Playback", SND_SOC_NOPM, 0, 0, | ||
1172 | &ep_path_enable_control), | ||
1173 | |||
1168 | /* Analog playback drivers */ | 1174 | /* Analog playback drivers */ |
1169 | SND_SOC_DAPM_OUT_DRV_E("Handsfree Left Driver", | 1175 | SND_SOC_DAPM_OUT_DRV_E("Handsfree Left Driver", |
1170 | TWL6040_REG_HFLCTL, 4, 0, NULL, 0, | 1176 | TWL6040_REG_HFLCTL, 4, 0, NULL, 0, |
@@ -1182,8 +1188,8 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { | |||
1182 | TWL6040_REG_HSRCTL, 2, 0, NULL, 0, | 1188 | TWL6040_REG_HSRCTL, 2, 0, NULL, 0, |
1183 | pga_event, | 1189 | pga_event, |
1184 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), | 1190 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), |
1185 | SND_SOC_DAPM_SWITCH_E("Earphone Driver", | 1191 | SND_SOC_DAPM_OUT_DRV_E("Earphone Driver", |
1186 | SND_SOC_NOPM, 0, 0, &ep_driver_switch_controls, | 1192 | TWL6040_REG_EARCTL, 0, 0, NULL, 0, |
1187 | twl6040_power_mode_event, | 1193 | twl6040_power_mode_event, |
1188 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), | 1194 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), |
1189 | 1195 | ||
@@ -1228,7 +1234,8 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1228 | {"HSOR", NULL, "Headset Right Driver"}, | 1234 | {"HSOR", NULL, "Headset Right Driver"}, |
1229 | 1235 | ||
1230 | /* Earphone playback path */ | 1236 | /* Earphone playback path */ |
1231 | {"Earphone Driver", "Switch", "HSDAC Left"}, | 1237 | {"Earphone Playback", "Switch", "HSDAC Left"}, |
1238 | {"Earphone Driver", NULL, "Earphone Playback"}, | ||
1232 | {"EP", NULL, "Earphone Driver"}, | 1239 | {"EP", NULL, "Earphone Driver"}, |
1233 | 1240 | ||
1234 | {"HF Left Playback", "HF DAC", "HFDAC Left"}, | 1241 | {"HF Left Playback", "HF DAC", "HFDAC Left"}, |