From cd0f34b08f98af72bb2f74fe4bd251558fc734d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 12 Jul 2012 09:57:52 +0000 Subject: mfd: mc13xxx: Change probing details for mc13xxx devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Marc Reilly Signed-off-by: Samuel Ortiz --- drivers/mfd/mc13xxx-i2c.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'drivers/mfd/mc13xxx-i2c.c') diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 9d18dde3cd2..4a0afc7f2d4 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -24,7 +24,7 @@ static const struct i2c_device_id mc13xxx_i2c_device_id[] = { { .name = "mc13892", - .driver_data = MC13XXX_ID_MC13892, + .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, }, { /* sentinel */ } @@ -34,7 +34,7 @@ MODULE_DEVICE_TABLE(i2c, mc13xxx_i2c_device_id); static const struct of_device_id mc13xxx_dt_ids[] = { { .compatible = "fsl,mc13892", - .data = (void *) &mc13xxx_i2c_device_id[0], + .data = &mc13xxx_variant_mc13892, }, { /* sentinel */ } @@ -76,11 +76,15 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, return ret; } - ret = mc13xxx_common_init(mc13xxx, pdata, client->irq); + if (client->dev.of_node) { + const struct of_device_id *of_id = + of_match_device(mc13xxx_dt_ids, &client->dev); + mc13xxx->variant = of_id->data; + } else { + mc13xxx->variant = (void *)id->driver_data; + } - if (ret == 0 && (id->driver_data != mc13xxx->ictype)) - dev_warn(mc13xxx->dev, - "device id doesn't match auto detection!\n"); + ret = mc13xxx_common_init(mc13xxx, pdata, client->irq); return ret; } -- cgit v1.2.3 From 0312e024d6cde5ef02900c4c6e2f5bb982e24af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=83=C2=B6nig?= Date: Thu, 12 Jul 2012 09:57:53 +0000 Subject: mfd: mc13xxx: Add support for mc34708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uwe Kleine-König Acked-by: Marc Reilly Signed-off-by: Samuel Ortiz --- drivers/mfd/mc13xxx-i2c.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/mfd/mc13xxx-i2c.c') diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 4a0afc7f2d4..bfc1284537e 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -25,6 +25,9 @@ static const struct i2c_device_id mc13xxx_i2c_device_id[] = { { .name = "mc13892", .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, + }, { + .name = "mc34708", + .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708, }, { /* sentinel */ } @@ -35,6 +38,9 @@ static const struct of_device_id mc13xxx_dt_ids[] = { { .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892, + }, { + .compatible = "fsl,mc34708", + .data = &mc13xxx_variant_mc34708, }, { /* sentinel */ } -- cgit v1.2.3