aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8904.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-16 08:01:28 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-16 11:58:08 -0400
commitcdce4e9ba7ff86a5f43b971a9af88b25a3f6c9a4 (patch)
treef8993127b71fbdb23f092dcc54cb7021c0e49e47 /sound/soc/codecs/wm8904.c
parent7245387e36e16ae918467685c34510606fd74b7c (diff)
ASoC: Allow configuration of WM8904 GPIO pin functions
Provide platform data allowing the configuration of the GPIO pins on the WM8904 to be selected, allowing alternate functions to be enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8904.c')
-rw-r--r--sound/soc/codecs/wm8904.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 593e47d0e0eb..ce3f004217ae 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -2425,6 +2425,7 @@ EXPORT_SYMBOL_GPL(soc_codec_dev_wm8904);
2425static int wm8904_register(struct wm8904_priv *wm8904, 2425static int wm8904_register(struct wm8904_priv *wm8904,
2426 enum snd_soc_control_type control) 2426 enum snd_soc_control_type control)
2427{ 2427{
2428 struct wm8904_pdata *pdata = wm8904->pdata;
2428 int ret; 2429 int ret;
2429 struct snd_soc_codec *codec = &wm8904->codec; 2430 struct snd_soc_codec *codec = &wm8904->codec;
2430 int i; 2431 int i;
@@ -2530,6 +2531,17 @@ static int wm8904_register(struct wm8904_priv *wm8904,
2530 WM8904_LINEOUTRZC; 2531 WM8904_LINEOUTRZC;
2531 wm8904->reg_cache[WM8904_CLOCK_RATES_0] &= ~WM8904_SR_MODE; 2532 wm8904->reg_cache[WM8904_CLOCK_RATES_0] &= ~WM8904_SR_MODE;
2532 2533
2534 /* Apply configuration from the platform data. */
2535 if (wm8904->pdata) {
2536 for (i = 0; i < WM8904_GPIO_REGS; i++) {
2537 if (!pdata->gpio_cfg[i])
2538 continue;
2539
2540 wm8904->reg_cache[WM8904_GPIO_CONTROL_1 + i]
2541 = pdata->gpio_cfg[i] & 0xffff;
2542 }
2543 }
2544
2533 /* Set Class W by default - this will be managed by the Class 2545 /* Set Class W by default - this will be managed by the Class
2534 * G widget at runtime where bypass paths are available. 2546 * G widget at runtime where bypass paths are available.
2535 */ 2547 */