summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm1250-ev1.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-10-26 23:51:48 +0200
committerTakashi Iwai <tiwai@suse.de>2011-10-26 23:51:48 +0200
commit9430148d800dd929ad73da4c6afb67f793f8af43 (patch)
tree437d0aec41428cbb310a202100ba581c63fbe89e /sound/soc/codecs/wm1250-ev1.c
parentd22665702226e9c40bc331098559e3d55e7cd43d (diff)
parent88e24c3a4b30a6bd361f2b5ce602667a8161b2e8 (diff)
downloadblackbird-obmc-linux-9430148d800dd929ad73da4c6afb67f793f8af43.tar.gz
blackbird-obmc-linux-9430148d800dd929ad73da4c6afb67f793f8af43.zip
Merge branch 'topic/remove-irqf_disable' into for-linus
Diffstat (limited to 'sound/soc/codecs/wm1250-ev1.c')
-rw-r--r--sound/soc/codecs/wm1250-ev1.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c
index bcc208967917..4523c4cec02b 100644
--- a/sound/soc/codecs/wm1250-ev1.c
+++ b/sound/soc/codecs/wm1250-ev1.c
@@ -56,8 +56,26 @@ static struct snd_soc_codec_driver soc_codec_dev_wm1250_ev1 = {
};
static int __devinit wm1250_ev1_probe(struct i2c_client *i2c,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *i2c_id)
{
+ int id, board, rev;
+
+ board = i2c_smbus_read_byte_data(i2c, 0);
+ if (board < 0) {
+ dev_err(&i2c->dev, "Failed to read ID: %d\n", board);
+ return board;
+ }
+
+ id = (board & 0xfe) >> 2;
+ rev = board & 0x3;
+
+ if (id != 1) {
+ dev_err(&i2c->dev, "Unknown board ID %d\n", id);
+ return -ENODEV;
+ }
+
+ dev_info(&i2c->dev, "revision %d\n", rev + 1);
+
return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm1250_ev1,
&wm1250_ev1_dai, 1);
}
OpenPOWER on IntegriCloud