summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-13 11:46:58 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-18 23:23:51 -0400
commit3706163140939bccd58fba739a9820f1d5eebeaf (patch)
tree0f445627169d77ed69753411ca3e944f5cc7e50d /sound/soc
parent2cbde7abfdd8c3e2c1293b7096477e8bcf10b755 (diff)
downloadblackbird-obmc-linux-3706163140939bccd58fba739a9820f1d5eebeaf.tar.gz
blackbird-obmc-linux-3706163140939bccd58fba739a9820f1d5eebeaf.zip
ASoC: wm8960: Support shared LRCLK
If the LRCLK is shared and the WM8960 is clock master then we should enable the LRCM bit to tell the device that it should drive LRCLK when either ADC or DAC is enabled rather than separately driving the two LRCLKs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8960.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 066250e3f7f4..782faa0a3b49 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -1036,6 +1036,7 @@ static const struct regmap_config wm8960_regmap = {
static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
+ struct wm8960_data *pdata = dev_get_platdata(&i2c->dev);
struct wm8960_priv *wm8960;
int ret;
@@ -1048,6 +1049,16 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
if (IS_ERR(wm8960->regmap))
return PTR_ERR(wm8960->regmap);
+ if (pdata && pdata->shared_lrclk) {
+ ret = regmap_update_bits(wm8960->regmap, WM8960_ADDCTL2,
+ 0x4, 0x4);
+ if (ret != 0) {
+ dev_err(&i2c->dev, "Failed to enable LRCM: %d\n",
+ ret);
+ return ret;
+ }
+ }
+
i2c_set_clientdata(i2c, wm8960);
ret = snd_soc_register_codec(&i2c->dev,
OpenPOWER on IntegriCloud