diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2012-07-12 05:57:52 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-06 17:11:42 -0500 |
commit | cd0f34b08f98af72bb2f74fe4bd251558fc734d3 (patch) | |
tree | caee50770690b553ffbc10df5fb031fdde5e187c /drivers/mfd/mc13xxx-i2c.c | |
parent | 5e53a69b44e893227b046a7bc74db3cb40d7f39b (diff) |
mfd: mc13xxx: Change probing details for mc13xxx devices
This removes auto-detection of which variant of mc13xxx is used because
mc34708 uses a different layout in the revision register that doesn't
allow differentiation any more.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/mc13xxx-i2c.c')
-rw-r--r-- | drivers/mfd/mc13xxx-i2c.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 9d18dde3cd2a..4a0afc7f2d4e 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c | |||
@@ -24,7 +24,7 @@ | |||
24 | static const struct i2c_device_id mc13xxx_i2c_device_id[] = { | 24 | static const struct i2c_device_id mc13xxx_i2c_device_id[] = { |
25 | { | 25 | { |
26 | .name = "mc13892", | 26 | .name = "mc13892", |
27 | .driver_data = MC13XXX_ID_MC13892, | 27 | .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, |
28 | }, { | 28 | }, { |
29 | /* sentinel */ | 29 | /* sentinel */ |
30 | } | 30 | } |
@@ -34,7 +34,7 @@ MODULE_DEVICE_TABLE(i2c, mc13xxx_i2c_device_id); | |||
34 | static const struct of_device_id mc13xxx_dt_ids[] = { | 34 | static const struct of_device_id mc13xxx_dt_ids[] = { |
35 | { | 35 | { |
36 | .compatible = "fsl,mc13892", | 36 | .compatible = "fsl,mc13892", |
37 | .data = (void *) &mc13xxx_i2c_device_id[0], | 37 | .data = &mc13xxx_variant_mc13892, |
38 | }, { | 38 | }, { |
39 | /* sentinel */ | 39 | /* sentinel */ |
40 | } | 40 | } |
@@ -76,11 +76,15 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, | |||
76 | return ret; | 76 | return ret; |
77 | } | 77 | } |
78 | 78 | ||
79 | ret = mc13xxx_common_init(mc13xxx, pdata, client->irq); | 79 | if (client->dev.of_node) { |
80 | const struct of_device_id *of_id = | ||
81 | of_match_device(mc13xxx_dt_ids, &client->dev); | ||
82 | mc13xxx->variant = of_id->data; | ||
83 | } else { | ||
84 | mc13xxx->variant = (void *)id->driver_data; | ||
85 | } | ||
80 | 86 | ||
81 | if (ret == 0 && (id->driver_data != mc13xxx->ictype)) | 87 | ret = mc13xxx_common_init(mc13xxx, pdata, client->irq); |
82 | dev_warn(mc13xxx->dev, | ||
83 | "device id doesn't match auto detection!\n"); | ||
84 | 88 | ||
85 | return ret; | 89 | return ret; |
86 | } | 90 | } |