aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2013-11-14 17:06:15 +0100
committerH. Nikolaus Schaller <hns@goldelico.com>2013-11-14 17:06:15 +0100
commitf5b856a63d09170fd0fa7098a9c0adf885e83d02 (patch)
treef19c69e18ba76c35449d8cf1a1a1c68c67187b8a /sound
parentd20a7277d1798c428231432c68081bf26e9c3c20 (diff)
downloadkernel_goldelico_gta04-f5b856a63d09170fd0fa7098a9c0adf885e83d02.zip
kernel_goldelico_gta04-f5b856a63d09170fd0fa7098a9c0adf885e83d02.tar.gz
kernel_goldelico_gta04-f5b856a63d09170fd0fa7098a9c0adf885e83d02.tar.bz2
fixed enabling/disabling voice interface for hw/sw routing
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl4030.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index acc66dd..0822821 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1236,6 +1236,7 @@ static int twl4030_voice_route_put(struct snd_kcontrol *kcontrol,
struct snd_soc_dai dai = {
.codec = codec
};
+ u8 reg;
twl4030->voice_enabled = ucontrol->value.enumerated.item[0];
if (powered)
twl4030_codec_enable(codec, 0);
@@ -1245,20 +1246,32 @@ static int twl4030_voice_route_put(struct snd_kcontrol *kcontrol,
* need to find a better place for this,
* disables mcbsp4_dx, so that it can be used by
* the twl4030_codec
+ *
+ * we should look up the DAI link we are connected to and
+ * do a tristate on the other end
*/
/* set McBSP4-DX to tristate (safe mode) */
omap_mux_set_gpio(OMAP_MUX_MODE7, 154);
+ // TWL4030_VIF_SLAVE_EN can be done through twl4030_voice_set_dai_fmt()
+ reg = twl4030_read_reg_cache(codec, TWL4030_REG_VOICE_IF);
+ reg |= TWL4030_VIF_SLAVE_EN | TWL4030_VIF_DIN_EN |
+ TWL4030_VIF_DOUT_EN | TWL4030_VIF_EN;
+ twl4030_write(codec, TWL4030_REG_VOICE_IF, reg);
twl4030_voice_set_tristate(&dai, 0);
-/* twl4030_write(codec, TWL4030_REG_VOICE_IF,
- TWL4030_VIF_SLAVE_EN | TWL4030_VIF_DIN_EN |
- TWL4030_VIF_DOUT_EN | TWL4030_VIF_EN);
- */
} else {
+ // TWL4030_VIF_SLAVE_EN can be done through twl4030_voice_set_dai_fmt()
twl4030_voice_set_tristate(&dai, 1);
+ reg = twl4030_read_reg_cache(codec, TWL4030_REG_VOICE_IF);
+ reg &= ~(TWL4030_VIF_SLAVE_EN | TWL4030_VIF_DIN_EN |
+ TWL4030_VIF_DOUT_EN | TWL4030_VIF_EN);
+ twl4030_write(codec, TWL4030_REG_VOICE_IF, reg);
/*
* need to find a better place for this,
* enables mcbsp4_dx, so that it can be used by
* the mcbsp4 interface
+ *
+ * we should look up the DAI link we are connected to and
+ * do a tristate on the other end
*/
omap_mux_set_gpio(OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT, 154);
}