aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8993.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-30 09:16:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-30 10:51:37 -0400
commitaa983d9d63c38f596fb87754205da9b7a8d2f6fd (patch)
treef5641b0aa475d3bc3b54ed144ea8c1582f08f075 /sound/soc/codecs/wm8993.c
parent4c0bccbe66ffe34f7bc88d29c345f9a7888656eb (diff)
ASoC: Factor out analogue platform data from WM8993
This is also shared with newer CODECs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8993.c')
-rw-r--r--sound/soc/codecs/wm8993.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index 6b32a2852603..dac397712147 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
@@ -1572,33 +1572,15 @@ static int wm8993_i2c_probe(struct i2c_client *i2c,
1572 /* Use automatic clock configuration */ 1572 /* Use automatic clock configuration */
1573 snd_soc_update_bits(codec, WM8993_CLOCKING_4, WM8993_SR_MODE, 0); 1573 snd_soc_update_bits(codec, WM8993_CLOCKING_4, WM8993_SR_MODE, 0);
1574 1574
1575 if (!wm8993->pdata.lineout1_diff) 1575 wm_hubs_handle_analogue_pdata(codec, wm8993->pdata.lineout1_diff,
1576 snd_soc_update_bits(codec, WM8993_LINE_MIXER1, 1576 wm8993->pdata.lineout2_diff,
1577 WM8993_LINEOUT1_MODE, 1577 wm8993->pdata.lineout1fb,
1578 WM8993_LINEOUT1_MODE); 1578 wm8993->pdata.lineout2fb,
1579 if (!wm8993->pdata.lineout2_diff) 1579 wm8993->pdata.jd_scthr,
1580 snd_soc_update_bits(codec, WM8993_LINE_MIXER2, 1580 wm8993->pdata.jd_thr,
1581 WM8993_LINEOUT2_MODE, 1581 wm8993->pdata.micbias1_lvl,
1582 WM8993_LINEOUT2_MODE); 1582 wm8993->pdata.micbias2_lvl);
1583 1583
1584 if (wm8993->pdata.lineout1fb)
1585 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL,
1586 WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB);
1587
1588 if (wm8993->pdata.lineout2fb)
1589 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL,
1590 WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB);
1591
1592 /* Apply the microphone bias/detection configuration - the
1593 * platform data is directly applicable to the register. */
1594 snd_soc_update_bits(codec, WM8993_MICBIAS,
1595 WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK |
1596 WM8993_MICB1_LVL | WM8993_MICB2_LVL,
1597 wm8993->pdata.jd_scthr << WM8993_JD_SCTHR_SHIFT |
1598 wm8993->pdata.jd_thr << WM8993_JD_THR_SHIFT |
1599 wm8993->pdata.micbias1_lvl |
1600 wm8993->pdata.micbias1_lvl << 1);
1601
1602 ret = wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1584 ret = wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1603 if (ret != 0) 1585 if (ret != 0)
1604 goto err; 1586 goto err;