aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-12 13:31:26 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-14 21:13:05 -0500
commit68fcde97e42af0ddd4a3665aeec0f5286577f0b5 (patch)
treefcf87145699acc95f3adee5f1c5b15fe4a8039f6
parent1f5cafb2c88efc8d8ab611917282c04e85ceaf27 (diff)
ASoC: wm9081: Move WM9081 IRQ platform data handling into I2C probe
Better style and better supports idle_bias_off which we're going to implement. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm9081.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index ebd3a8a03a23..c4b3fd923f28 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1258,7 +1258,6 @@ static int wm9081_probe(struct snd_soc_codec *codec)
1258{ 1258{
1259 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); 1259 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec);
1260 int ret; 1260 int ret;
1261 u16 reg;
1262 1261
1263 codec->control_data = wm9081->regmap; 1262 codec->control_data = wm9081->regmap;
1264 1263
@@ -1268,16 +1267,6 @@ static int wm9081_probe(struct snd_soc_codec *codec)
1268 return ret; 1267 return ret;
1269 } 1268 }
1270 1269
1271 reg = 0;
1272 if (wm9081->pdata.irq_high)
1273 reg |= WM9081_IRQ_POL;
1274 if (!wm9081->pdata.irq_cmos)
1275 reg |= WM9081_IRQ_OP_CTRL;
1276 snd_soc_update_bits(codec, WM9081_INTERRUPT_CONTROL,
1277 WM9081_IRQ_POL | WM9081_IRQ_OP_CTRL, reg);
1278
1279 wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1280
1281 /* Enable zero cross by default */ 1270 /* Enable zero cross by default */
1282 snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT, 1271 snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT,
1283 WM9081_LINEOUTZC, WM9081_LINEOUTZC); 1272 WM9081_LINEOUTZC, WM9081_LINEOUTZC);
@@ -1395,6 +1384,15 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
1395 memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev), 1384 memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev),
1396 sizeof(wm9081->pdata)); 1385 sizeof(wm9081->pdata));
1397 1386
1387 reg = 0;
1388 if (wm9081->pdata.irq_high)
1389 reg |= WM9081_IRQ_POL;
1390 if (!wm9081->pdata.irq_cmos)
1391 reg |= WM9081_IRQ_OP_CTRL;
1392 regmap_update_bits(wm9081->regmap, WM9081_INTERRUPT_CONTROL,
1393 WM9081_IRQ_POL | WM9081_IRQ_OP_CTRL, reg);
1394
1395
1398 ret = snd_soc_register_codec(&i2c->dev, 1396 ret = snd_soc_register_codec(&i2c->dev,
1399 &soc_codec_dev_wm9081, &wm9081_dai, 1); 1397 &soc_codec_dev_wm9081, &wm9081_dai, 1);
1400 if (ret < 0) 1398 if (ret < 0)