[alsa-devel] [PATCH v2 0/2] Add earphone speaker in OMAP4
Add support for earphone speaker in SDP4430 board.
Changes from v1: - Separated changes for codec and machine drivers in two patches. - Added Acked-by tag to patches.
Jorge Eduardo Candelaria (2): ASoC: SDP4430: Add support for Earphone speaker ASoC: TWL6040: Enable earphone path in codec
sound/soc/codecs/twl6040.c | 21 ++++++++++++++++++++- sound/soc/omap/sdp4430.c | 4 ++++ 2 files changed, 24 insertions(+), 1 deletions(-)
Enable earphone speaker in sdp4430 machine driver.
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 --- sound/soc/omap/sdp4430.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index 83831ee..3a0c198 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -101,6 +101,7 @@ static const struct snd_soc_dapm_widget sdp4430_twl6040_dapm_widgets[] = { SND_SOC_DAPM_SPK("Ext Spk", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), SND_SOC_DAPM_HP("Headset Stereophone", NULL), + SND_SOC_DAPM_SPK("Earphone Spk", NULL), };
static const struct snd_soc_dapm_route audio_map[] = { @@ -120,6 +121,9 @@ static const struct snd_soc_dapm_route audio_map[] = { /* Headset Stereophone (Headphone): HSOL, HSOR */ {"Headset Stereophone", NULL, "HSOL"}, {"Headset Stereophone", NULL, "HSOR"}, + + /* Earphone speaker */ + {"Earphone Spk", NULL, "EP"}, };
static int sdp4430_twl6040_init(struct snd_soc_codec *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 --- sound/soc/codecs/twl6040.c | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 2ae442e..af36346 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); */ static DECLARE_TLV_DB_SCALE(hf_tlv, -5200, 200, 0);
+/* + * EPGAIN volume control: + * from -24 to 6 dB in 2 dB steps + */ +static DECLARE_TLV_DB_SCALE(ep_tlv, -2400, 200, 0); + /* Left analog microphone selection */ static const char *twl6040_amicl_texts[] = {"Headset Mic", "Main Mic", "Aux/FM Left", "Off"}; @@ -479,6 +485,9 @@ static const struct snd_kcontrol_new hfl_driver_switch_controls = static const struct snd_kcontrol_new hfr_driver_switch_controls = SOC_DAPM_SINGLE("Switch", TWL6040_REG_HFRCTL, 4, 1, 0);
+static const struct snd_kcontrol_new ep_driver_switch_controls = + SOC_DAPM_SINGLE("Switch", TWL6040_REG_EARCTL, 0, 1, 0); + static const struct snd_kcontrol_new twl6040_snd_controls[] = { /* Capture gains */ SOC_DOUBLE_TLV("Capture Preamplifier Volume", @@ -491,7 +500,8 @@ static const struct snd_kcontrol_new twl6040_snd_controls[] = { TWL6040_REG_HSGAIN, 0, 4, 0xF, 1, hs_tlv), SOC_DOUBLE_R_TLV("Handsfree Playback Volume", TWL6040_REG_HFLGAIN, TWL6040_REG_HFRGAIN, 0, 0x1D, 1, hf_tlv), - + SOC_SINGLE_TLV("Earphone Playback Volume", + TWL6040_REG_EARCTL, 1, 0xF, 1, ep_tlv), };
static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { @@ -507,6 +517,7 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("HSOR"), SND_SOC_DAPM_OUTPUT("HFL"), SND_SOC_DAPM_OUTPUT("HFR"), + SND_SOC_DAPM_OUTPUT("EP"),
/* Analog input muxes for the capture amplifiers */ SND_SOC_DAPM_MUX("Analog Left Capture Route", @@ -572,6 +583,10 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { SND_SOC_NOPM, 0, 0, &hfr_driver_switch_controls, twl6040_power_mode_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), + SND_SOC_DAPM_SWITCH_E("Earphone Driver", + SND_SOC_NOPM, 0, 0, &ep_driver_switch_controls, + twl6040_power_mode_event, + SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
/* Analog playback PGAs */ SND_SOC_DAPM_PGA("HFDAC Left PGA", @@ -607,6 +622,10 @@ static const struct snd_soc_dapm_route intercon[] = { {"HSOL", NULL, "Headset Left Driver"}, {"HSOR", NULL, "Headset Right Driver"},
+ /* Earphone playback path */ + {"Earphone Driver", "Switch", "HSDAC Left"}, + {"EP", NULL, "Earphone Driver"}, + /* Handsfree playback path */ {"HFDAC Left Playback", "Switch", "HFDAC Left"}, {"HFDAC Right Playback", "Switch", "HFDAC Right"},
On Tue, 2010-05-18 at 12:44 -0500, Jorge Eduardo Candelaria wrote:
Add support for earphone speaker in SDP4430 board.
Changes from v1:
- Separated changes for codec and machine drivers in two patches.
- Added Acked-by tag to patches.
Jorge Eduardo Candelaria (2): ASoC: SDP4430: Add support for Earphone speaker ASoC: TWL6040: Enable earphone path in codec
sound/soc/codecs/twl6040.c | 21 ++++++++++++++++++++- sound/soc/omap/sdp4430.c | 4 ++++ 2 files changed, 24 insertions(+), 1 deletions(-)
Both applied.
Thanks
Liam
participants (2)
-
Jorge Eduardo Candelaria
-
Liam Girdwood