Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293158
b: refs/heads/master
c: 391d9e4
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Jan 20, 2012
1 parent 341c51b commit d588ad4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec2c0fec11f072222b63eb160da6be01773bfe65
refs/heads/master: 391d9e4e5ce50bf14400ed04d13821e7b56e84f7
26 changes: 14 additions & 12 deletions trunk/sound/soc/codecs/wm9090.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,18 +532,6 @@ static int wm9090_probe(struct snd_soc_codec *codec)
return ret;
}

ret = snd_soc_read(codec, WM9090_SOFTWARE_RESET);
if (ret < 0)
return ret;
if (ret != 0x9093) {
dev_err(codec->dev, "Device is not a WM9090, ID=%x\n", ret);
return -EINVAL;
}

ret = snd_soc_write(codec, WM9090_SOFTWARE_RESET, 0);
if (ret < 0)
return ret;

/* Configure some defaults; they will be written out when we
* bring the bias up.
*/
Expand Down Expand Up @@ -631,6 +619,7 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct wm9090_priv *wm9090;
unsigned int reg;
int ret;

wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL);
Expand All @@ -646,6 +635,19 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
return ret;
}

ret = regmap_read(wm9090->regmap, WM9090_SOFTWARE_RESET, &reg);
if (ret < 0)
goto err;
if (reg != 0x9093) {
dev_err(&i2c->dev, "Device is not a WM9090, ID=%x\n", ret);
ret = -ENODEV;
goto err;
}

ret = regmap_write(wm9090->regmap, WM9090_SOFTWARE_RESET, 0);
if (ret < 0)
goto err;

if (i2c->dev.platform_data)
memcpy(&wm9090->pdata, i2c->dev.platform_data,
sizeof(wm9090->pdata));
Expand Down

0 comments on commit d588ad4

Please sign in to comment.