Commit 37061631 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 2cbde7ab
...@@ -19,6 +19,8 @@ struct wm8960_data { ...@@ -19,6 +19,8 @@ struct wm8960_data {
bool capless; /* Headphone outputs configured in capless mode */ bool capless; /* Headphone outputs configured in capless mode */
int dres; /* Discharge resistance for headphone outputs */ int dres; /* Discharge resistance for headphone outputs */
bool shared_lrclk; /* DAC and ADC LRCLKs are wired together */
}; };
#endif #endif
...@@ -1036,6 +1036,7 @@ static const struct regmap_config wm8960_regmap = { ...@@ -1036,6 +1036,7 @@ static const struct regmap_config wm8960_regmap = {
static __devinit int wm8960_i2c_probe(struct i2c_client *i2c, static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct wm8960_data *pdata = dev_get_platdata(&i2c->dev);
struct wm8960_priv *wm8960; struct wm8960_priv *wm8960;
int ret; int ret;
...@@ -1048,6 +1049,16 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c, ...@@ -1048,6 +1049,16 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
if (IS_ERR(wm8960->regmap)) if (IS_ERR(wm8960->regmap))
return PTR_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); i2c_set_clientdata(i2c, wm8960);
ret = snd_soc_register_codec(&i2c->dev, ret = snd_soc_register_codec(&i2c->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment