diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 09:19:45 (GMT) |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 09:19:45 (GMT) |
commit | 734f935afad0f1f640a922f17609823c740d36ec (patch) | |
tree | 432b3f7e480bc4bf4a77cc9d60e27872ae4658a7 /drivers/mfd/arizona-spi.c | |
parent | f7d3210e8b45eea8561c08d35502d2baca07593a (diff) | |
parent | e5657054ff508c9e547a8ceb931de07838ee3ba0 (diff) | |
download | linux-fsl-qoriq-734f935afad0f1f640a922f17609823c740d36ec.tar.xz |
Merge tag 'mfd-arizona-v3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc
mfd: arizona: Updates for v3.10
A bunch of enhancements and fixes for the arizona devices, adding a few
new features (the main one being device tree) and improving robustness.
Diffstat (limited to 'drivers/mfd/arizona-spi.c')
-rw-r--r-- | drivers/mfd/arizona-spi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c index b57e642..47be7b3 100644 --- a/drivers/mfd/arizona-spi.c +++ b/drivers/mfd/arizona-spi.c @@ -27,9 +27,14 @@ static int arizona_spi_probe(struct spi_device *spi) const struct spi_device_id *id = spi_get_device_id(spi); struct arizona *arizona; const struct regmap_config *regmap_config; - int ret; + int ret, type; - switch (id->driver_data) { + if (spi->dev.of_node) + type = arizona_of_get_type(&spi->dev); + else + type = id->driver_data; + + switch (type) { #ifdef CONFIG_MFD_WM5102 case WM5102: regmap_config = &wm5102_spi_regmap; @@ -84,6 +89,7 @@ static struct spi_driver arizona_spi_driver = { .name = "arizona", .owner = THIS_MODULE, .pm = &arizona_pm_ops, + .of_match_table = of_match_ptr(arizona_of_match), }, .probe = arizona_spi_probe, .remove = arizona_spi_remove, |