mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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>
This commit is contained in:
parent
1f5cafb2c8
commit
68fcde97e4
@ -1258,7 +1258,6 @@ static int wm9081_probe(struct snd_soc_codec *codec)
|
|||||||
{
|
{
|
||||||
struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec);
|
struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec);
|
||||||
int ret;
|
int ret;
|
||||||
u16 reg;
|
|
||||||
|
|
||||||
codec->control_data = wm9081->regmap;
|
codec->control_data = wm9081->regmap;
|
||||||
|
|
||||||
@ -1268,16 +1267,6 @@ static int wm9081_probe(struct snd_soc_codec *codec)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
reg = 0;
|
|
||||||
if (wm9081->pdata.irq_high)
|
|
||||||
reg |= WM9081_IRQ_POL;
|
|
||||||
if (!wm9081->pdata.irq_cmos)
|
|
||||||
reg |= WM9081_IRQ_OP_CTRL;
|
|
||||||
snd_soc_update_bits(codec, WM9081_INTERRUPT_CONTROL,
|
|
||||||
WM9081_IRQ_POL | WM9081_IRQ_OP_CTRL, reg);
|
|
||||||
|
|
||||||
wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
|
||||||
|
|
||||||
/* Enable zero cross by default */
|
/* Enable zero cross by default */
|
||||||
snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT,
|
snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT,
|
||||||
WM9081_LINEOUTZC, WM9081_LINEOUTZC);
|
WM9081_LINEOUTZC, WM9081_LINEOUTZC);
|
||||||
@ -1395,6 +1384,15 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
|
|||||||
memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev),
|
memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev),
|
||||||
sizeof(wm9081->pdata));
|
sizeof(wm9081->pdata));
|
||||||
|
|
||||||
|
reg = 0;
|
||||||
|
if (wm9081->pdata.irq_high)
|
||||||
|
reg |= WM9081_IRQ_POL;
|
||||||
|
if (!wm9081->pdata.irq_cmos)
|
||||||
|
reg |= WM9081_IRQ_OP_CTRL;
|
||||||
|
regmap_update_bits(wm9081->regmap, WM9081_INTERRUPT_CONTROL,
|
||||||
|
WM9081_IRQ_POL | WM9081_IRQ_OP_CTRL, reg);
|
||||||
|
|
||||||
|
|
||||||
ret = snd_soc_register_codec(&i2c->dev,
|
ret = snd_soc_register_codec(&i2c->dev,
|
||||||
&soc_codec_dev_wm9081, &wm9081_dai, 1);
|
&soc_codec_dev_wm9081, &wm9081_dai, 1);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user