aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJorge Eduardo Candelaria <jorge.candelaria@ti.com>2010-05-18 13:44:18 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-05-19 09:07:23 -0400
commit871a05a78b4879d768bc2fde4b75439f517e2839 (patch)
tree98dd4253fdaca4dbdda9117e04b441775b489966 /sound
parent7254e2bddc96c47cb5edd30cfd3e1f12a2df9149 (diff)
ASoC: TWL6040: Enable earphone path in codec
Add control to enable earphone driver in TWL6040 codec. This driver is connected to HSDAC Left. Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl6040.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 2ae442edeb9a..af36346ff336 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -432,6 +432,12 @@ static DECLARE_TLV_DB_SCALE(hs_tlv, -3000, 200, 0);
432 */ 432 */
433static DECLARE_TLV_DB_SCALE(hf_tlv, -5200, 200, 0); 433static DECLARE_TLV_DB_SCALE(hf_tlv, -5200, 200, 0);
434 434
435/*
436 * EPGAIN volume control:
437 * from -24 to 6 dB in 2 dB steps
438 */
439static DECLARE_TLV_DB_SCALE(ep_tlv, -2400, 200, 0);
440
435/* Left analog microphone selection */ 441/* Left analog microphone selection */
436static const char *twl6040_amicl_texts[] = 442static const char *twl6040_amicl_texts[] =
437 {"Headset Mic", "Main Mic", "Aux/FM Left", "Off"}; 443 {"Headset Mic", "Main Mic", "Aux/FM Left", "Off"};
@@ -479,6 +485,9 @@ static const struct snd_kcontrol_new hfl_driver_switch_controls =
479static const struct snd_kcontrol_new hfr_driver_switch_controls = 485static const struct snd_kcontrol_new hfr_driver_switch_controls =
480 SOC_DAPM_SINGLE("Switch", TWL6040_REG_HFRCTL, 4, 1, 0); 486 SOC_DAPM_SINGLE("Switch", TWL6040_REG_HFRCTL, 4, 1, 0);
481 487
488static const struct snd_kcontrol_new ep_driver_switch_controls =
489 SOC_DAPM_SINGLE("Switch", TWL6040_REG_EARCTL, 0, 1, 0);
490
482static const struct snd_kcontrol_new twl6040_snd_controls[] = { 491static const struct snd_kcontrol_new twl6040_snd_controls[] = {
483 /* Capture gains */ 492 /* Capture gains */
484 SOC_DOUBLE_TLV("Capture Preamplifier Volume", 493 SOC_DOUBLE_TLV("Capture Preamplifier Volume",
@@ -491,7 +500,8 @@ static const struct snd_kcontrol_new twl6040_snd_controls[] = {
491 TWL6040_REG_HSGAIN, 0, 4, 0xF, 1, hs_tlv), 500 TWL6040_REG_HSGAIN, 0, 4, 0xF, 1, hs_tlv),
492 SOC_DOUBLE_R_TLV("Handsfree Playback Volume", 501 SOC_DOUBLE_R_TLV("Handsfree Playback Volume",
493 TWL6040_REG_HFLGAIN, TWL6040_REG_HFRGAIN, 0, 0x1D, 1, hf_tlv), 502 TWL6040_REG_HFLGAIN, TWL6040_REG_HFRGAIN, 0, 0x1D, 1, hf_tlv),
494 503 SOC_SINGLE_TLV("Earphone Playback Volume",
504 TWL6040_REG_EARCTL, 1, 0xF, 1, ep_tlv),
495}; 505};
496 506
497static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { 507static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
@@ -507,6 +517,7 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
507 SND_SOC_DAPM_OUTPUT("HSOR"), 517 SND_SOC_DAPM_OUTPUT("HSOR"),
508 SND_SOC_DAPM_OUTPUT("HFL"), 518 SND_SOC_DAPM_OUTPUT("HFL"),
509 SND_SOC_DAPM_OUTPUT("HFR"), 519 SND_SOC_DAPM_OUTPUT("HFR"),
520 SND_SOC_DAPM_OUTPUT("EP"),
510 521
511 /* Analog input muxes for the capture amplifiers */ 522 /* Analog input muxes for the capture amplifiers */
512 SND_SOC_DAPM_MUX("Analog Left Capture Route", 523 SND_SOC_DAPM_MUX("Analog Left Capture Route",
@@ -572,6 +583,10 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
572 SND_SOC_NOPM, 0, 0, &hfr_driver_switch_controls, 583 SND_SOC_NOPM, 0, 0, &hfr_driver_switch_controls,
573 twl6040_power_mode_event, 584 twl6040_power_mode_event,
574 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 585 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
586 SND_SOC_DAPM_SWITCH_E("Earphone Driver",
587 SND_SOC_NOPM, 0, 0, &ep_driver_switch_controls,
588 twl6040_power_mode_event,
589 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
575 590
576 /* Analog playback PGAs */ 591 /* Analog playback PGAs */
577 SND_SOC_DAPM_PGA("HFDAC Left PGA", 592 SND_SOC_DAPM_PGA("HFDAC Left PGA",
@@ -607,6 +622,10 @@ static const struct snd_soc_dapm_route intercon[] = {
607 {"HSOL", NULL, "Headset Left Driver"}, 622 {"HSOL", NULL, "Headset Left Driver"},
608 {"HSOR", NULL, "Headset Right Driver"}, 623 {"HSOR", NULL, "Headset Right Driver"},
609 624
625 /* Earphone playback path */
626 {"Earphone Driver", "Switch", "HSDAC Left"},
627 {"EP", NULL, "Earphone Driver"},
628
610 /* Handsfree playback path */ 629 /* Handsfree playback path */
611 {"HFDAC Left Playback", "Switch", "HFDAC Left"}, 630 {"HFDAC Left Playback", "Switch", "HFDAC Left"},
612 {"HFDAC Right Playback", "Switch", "HFDAC Right"}, 631 {"HFDAC Right Playback", "Switch", "HFDAC Right"},