aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2009-03-05 05:48:49 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-06 08:37:11 -0500
commit89492be88616aa20b3a6c3eb512f83c0c7d0c8a3 (patch)
tree8759cbc7ffc9454c4aae3d69c961a23e29b500ee /sound/soc/codecs/twl4030.c
parenta1b3eaeb146937e954cdb6dcb67f8761b73e2eef (diff)
ASoC: TWL4030: Make the HS ramp delay configurable
Enum type for selecting the desired ramp delay for the headset output. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r--sound/soc/codecs/twl4030.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 535d8ce2c328..86bb15cc82ce 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -584,12 +584,11 @@ static int headsetl_event(struct snd_soc_dapm_widget *w,
584 584
585 /* Save the current volume */ 585 /* Save the current volume */
586 hs_gain = twl4030_read_reg_cache(w->codec, TWL4030_REG_HS_GAIN_SET); 586 hs_gain = twl4030_read_reg_cache(w->codec, TWL4030_REG_HS_GAIN_SET);
587 hs_pop = twl4030_read_reg_cache(w->codec, TWL4030_REG_HS_POPN_SET);
587 588
588 switch (event) { 589 switch (event) {
589 case SND_SOC_DAPM_POST_PMU: 590 case SND_SOC_DAPM_POST_PMU:
590 /* Do the anti-pop/bias ramp enable according to the TRM */ 591 /* Do the anti-pop/bias ramp enable according to the TRM */
591 hs_pop = TWL4030_RAMP_DELAY_645MS;
592 twl4030_write(w->codec, TWL4030_REG_HS_POPN_SET, hs_pop);
593 hs_pop |= TWL4030_VMID_EN; 592 hs_pop |= TWL4030_VMID_EN;
594 twl4030_write(w->codec, TWL4030_REG_HS_POPN_SET, hs_pop); 593 twl4030_write(w->codec, TWL4030_REG_HS_POPN_SET, hs_pop);
595 /* Is this needed? Can we just use whatever gain here? */ 594 /* Is this needed? Can we just use whatever gain here? */
@@ -603,8 +602,6 @@ static int headsetl_event(struct snd_soc_dapm_widget *w,
603 break; 602 break;
604 case SND_SOC_DAPM_POST_PMD: 603 case SND_SOC_DAPM_POST_PMD:
605 /* Do the anti-pop/bias ramp disable according to the TRM */ 604 /* Do the anti-pop/bias ramp disable according to the TRM */
606 hs_pop = twl4030_read_reg_cache(w->codec,
607 TWL4030_REG_HS_POPN_SET);
608 hs_pop &= ~TWL4030_RAMP_EN; 605 hs_pop &= ~TWL4030_RAMP_EN;
609 twl4030_write(w->codec, TWL4030_REG_HS_POPN_SET, hs_pop); 606 twl4030_write(w->codec, TWL4030_REG_HS_POPN_SET, hs_pop);
610 /* Bypass the reg_cache to mute the headset */ 607 /* Bypass the reg_cache to mute the headset */
@@ -847,6 +844,17 @@ static DECLARE_TLV_DB_SCALE(digital_capture_tlv, 0, 100, 0);
847 */ 844 */
848static DECLARE_TLV_DB_SCALE(input_gain_tlv, 0, 600, 0); 845static DECLARE_TLV_DB_SCALE(input_gain_tlv, 0, 600, 0);
849 846
847static const char *twl4030_rampdelay_texts[] = {
848 "27/20/14 ms", "55/40/27 ms", "109/81/55 ms", "218/161/109 ms",
849 "437/323/218 ms", "874/645/437 ms", "1748/1291/874 ms",
850 "3495/2581/1748 ms"
851};
852
853static const struct soc_enum twl4030_rampdelay_enum =
854 SOC_ENUM_SINGLE(TWL4030_REG_HS_POPN_SET, 2,
855 ARRAY_SIZE(twl4030_rampdelay_texts),
856 twl4030_rampdelay_texts);
857
850static const struct snd_kcontrol_new twl4030_snd_controls[] = { 858static const struct snd_kcontrol_new twl4030_snd_controls[] = {
851 /* Common playback gain controls */ 859 /* Common playback gain controls */
852 SOC_DOUBLE_R_TLV("DAC1 Digital Fine Playback Volume", 860 SOC_DOUBLE_R_TLV("DAC1 Digital Fine Playback Volume",
@@ -901,6 +909,8 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = {
901 909
902 SOC_DOUBLE_TLV("Analog Capture Volume", TWL4030_REG_ANAMIC_GAIN, 910 SOC_DOUBLE_TLV("Analog Capture Volume", TWL4030_REG_ANAMIC_GAIN,
903 0, 3, 5, 0, input_gain_tlv), 911 0, 3, 5, 0, input_gain_tlv),
912
913 SOC_ENUM("HS ramp delay", twl4030_rampdelay_enum),
904}; 914};
905 915
906static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { 916static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {