Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148246
b: refs/heads/master
c: ee8f689
h: refs/heads/master
v: v3
  • Loading branch information
Lopez Cruz, Misael authored and Mark Brown committed May 5, 2009
1 parent 40d1fe7 commit 2f781e6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcd274a345875b05c348ba19bc6b3dd48ecbb7d0
refs/heads/master: ee8f6894f358b6a04d8190fd78990749de98a498
27 changes: 25 additions & 2 deletions trunk/sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,18 @@ static const struct snd_kcontrol_new twl4030_dapm_dbypassr_control =
TWL4030_REG_ATX2ARXPGA, 0, 7, 0,
twl4030_dapm_dbypass_tlv);

/*
* Voice Sidetone GAIN volume control:
* from -51 to -10 dB in 1 dB steps (mute instead of -51 dB)
*/
static DECLARE_TLV_DB_SCALE(twl4030_dapm_dbypassv_tlv, -5100, 100, 1);

/* Digital bypass voice: sidetone (VUL -> VDL)*/
static const struct snd_kcontrol_new twl4030_dapm_dbypassv_control =
SOC_DAPM_SINGLE_TLV("Volume",
TWL4030_REG_VSTPGA, 0, 0x29, 0,
twl4030_dapm_dbypassv_tlv);

static int micpath_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
Expand Down Expand Up @@ -607,12 +619,18 @@ static int bypass_event(struct snd_soc_dapm_widget *w,
twl4030->bypass_state |= (1 << 4);
else
twl4030->bypass_state &= ~(1 << 4);
} else if (m->reg == TWL4030_REG_VSTPGA) {
/* Voice digital bypass */
if (reg)
twl4030->bypass_state |= (1 << 5);
else
twl4030->bypass_state &= ~(1 << 5);
} else {
/* Digital bypass */
if (reg & (0x7 << m->shift))
twl4030->bypass_state |= (1 << (m->shift ? 6 : 5));
twl4030->bypass_state |= (1 << (m->shift ? 7 : 6));
else
twl4030->bypass_state &= ~(1 << (m->shift ? 6 : 5));
twl4030->bypass_state &= ~(1 << (m->shift ? 7 : 6));
}

/* Enable master analog loopback mode if any analog switch is enabled*/
Expand Down Expand Up @@ -991,6 +1009,9 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
SND_SOC_DAPM_SWITCH_E("Right Digital Loopback", SND_SOC_NOPM, 0, 0,
&twl4030_dapm_dbypassr_control, bypass_event,
SND_SOC_DAPM_POST_REG),
SND_SOC_DAPM_SWITCH_E("Voice Digital Loopback", SND_SOC_NOPM, 0, 0,
&twl4030_dapm_dbypassv_control, bypass_event,
SND_SOC_DAPM_POST_REG),

SND_SOC_DAPM_MIXER("Analog R1 Playback Mixer", TWL4030_REG_AVDAC_CTL,
0, 0, NULL, 0),
Expand Down Expand Up @@ -1203,9 +1224,11 @@ static const struct snd_soc_dapm_route intercon[] = {
/* Digital bypass routes */
{"Right Digital Loopback", "Volume", "TX1 Capture Route"},
{"Left Digital Loopback", "Volume", "TX1 Capture Route"},
{"Voice Digital Loopback", "Volume", "TX2 Capture Route"},

{"Analog R2 Playback Mixer", NULL, "Right Digital Loopback"},
{"Analog L2 Playback Mixer", NULL, "Left Digital Loopback"},
{"Analog Voice Playback Mixer", NULL, "Voice Digital Loopback"},

};

Expand Down

0 comments on commit 2f781e6

Please sign in to comment.