summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2013-06-20 16:55:03 +0200
committerMichael Grzeschik <m.grzeschik@pengutronix.de>2013-09-06 00:21:52 +0200
commitd4b2b61a606cb83e3bc5229f9ffcb20fd5374d7b (patch)
treef0aeac5e82b26cfe964ee2360ab6cd23134c3be3
parent2f312e11fbe330237566ddf5f0bf6e3696739b89 (diff)
downloadlinux-d4b2b61a606cb83e3bc5229f9ffcb20fd5374d7b.tar.gz
mfd: mc13xxx: make it possible to use the codec without pdata
In case of devicetree, we currently don't have a way to append pdata for the codec. This patch makes it possible to probe the codec without pdata for that case. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
-rw-r--r--drivers/mfd/mc13xxx-core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 278601f..e1b89e6 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -687,10 +687,6 @@ err_revision:
if (mc13xxx->flags & MC13XXX_USE_ADC)
mc13xxx_add_subdevice(mc13xxx, "%s-adc");
- if (mc13xxx->flags & MC13XXX_USE_CODEC)
- mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec",
- pdata->codec, sizeof(*pdata->codec));
-
if (mc13xxx->flags & MC13XXX_USE_RTC)
mc13xxx_add_subdevice(mc13xxx, "%s-rtc");
@@ -705,6 +701,10 @@ err_revision:
if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-ts",
&pdata->touch, sizeof(pdata->touch));
+
+ if (mc13xxx->flags & MC13XXX_USE_CODEC)
+ mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec",
+ pdata->codec, sizeof(*pdata->codec));
} else {
mc13xxx_add_subdevice(mc13xxx, "%s-regulator");
mc13xxx_add_subdevice(mc13xxx, "%s-led");
@@ -712,6 +712,9 @@ err_revision:
if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
mc13xxx_add_subdevice(mc13xxx, "%s-ts");
+
+ if (mc13xxx->flags & MC13XXX_USE_CODEC)
+ mc13xxx_add_subdevice(mc13xxx, "%s-codec");
}
return 0;