Commit 73b34ead authored by Mark Brown's avatar Mark Brown

ASoC: Add GPIO configuration support for WM8903

Allow users to pass in a default configuration for the GPIOs of
the WM8903 as platform data. This allows configuration of the pin
muxing of the device.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent da34183e
This diff is collapsed.
...@@ -1531,7 +1531,7 @@ static __devinit int wm8903_i2c_probe(struct i2c_client *i2c, ...@@ -1531,7 +1531,7 @@ static __devinit int wm8903_i2c_probe(struct i2c_client *i2c,
{ {
struct wm8903_priv *wm8903; struct wm8903_priv *wm8903;
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
int ret; int ret, i;
u16 val; u16 val;
wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL); wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL);
...@@ -1578,6 +1578,17 @@ static __devinit int wm8903_i2c_probe(struct i2c_client *i2c, ...@@ -1578,6 +1578,17 @@ static __devinit int wm8903_i2c_probe(struct i2c_client *i2c,
wm8903_reset(codec); wm8903_reset(codec);
/* Set up GPIOs */
if (pdata) {
for (i = 0; i < ARRAY_SIZE(pdata->gpio_cfg); i++) {
if (!pdata->gpio_cfg[i])
continue;
snd_soc_write(codec, WM8903_GPIO_CONTROL_1 + i,
pdata->gpio_cfg[i] & 0xffff);
}
}
/* power on device */ /* power on device */
wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY); wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
......
This diff is collapsed.
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