summaryrefslogtreecommitdiff
path: root/drivers/mfd/arizona-i2c.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-25 04:11:27 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-20 17:13:36 +0400
commitd781009ca6bb5b9711c74700242855e0a70ee7a3 (patch)
tree310ac48498eaca141f5643803bebe21383dca965 /drivers/mfd/arizona-i2c.c
parent67c992969172473e129984a51ceb77950a2aa16c (diff)
downloadlinux-d781009ca6bb5b9711c74700242855e0a70ee7a3.tar.xz
mfd: Add device tree bindings for Arizona class devices
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/mfd/arizona-i2c.c')
-rw-r--r--drivers/mfd/arizona-i2c.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index 44a1bb969841..deb267ebf84e 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -27,9 +27,14 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
{
struct arizona *arizona;
const struct regmap_config *regmap_config;
- int ret;
+ int ret, type;
- switch (id->driver_data) {
+ if (i2c->dev.of_node)
+ type = arizona_of_get_type(&i2c->dev);
+ else
+ type = id->driver_data;
+
+ switch (type) {
#ifdef CONFIG_MFD_WM5102
case WM5102:
regmap_config = &wm5102_i2c_regmap;
@@ -84,6 +89,7 @@ static struct i2c_driver arizona_i2c_driver = {
.name = "arizona",
.owner = THIS_MODULE,
.pm = &arizona_pm_ops,
+ .of_match_table = of_match_ptr(arizona_of_match),
},
.probe = arizona_i2c_probe,
.remove = arizona_i2c_remove,