summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mc13xxx-core.c
diff options
context:
space:
mode:
authorPhilippe Rétornaz <philippe.retornaz@epfl.ch>2011-09-18 18:10:53 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-24 14:09:14 +0200
commit30fc7ac3f62945a714d9842edae313a757efb49d (patch)
tree1ded2a47f35e465785c9dcea562e52b96da845ec /drivers/mfd/mc13xxx-core.c
parent5ab9059d7f2055f434140046e74d3d811e4cbb15 (diff)
input: Add power button support for mc13783
This adds support for the power-on buttons of MC13783 PMIC. Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/mc13xxx-core.c')
-rw-r--r--drivers/mfd/mc13xxx-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index e55b2213623..edcd397cae1 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -703,6 +703,11 @@ static int mc13xxx_probe(struct spi_device *spi)
enum mc13xxx_id id;
int ret;
+ if (!pdata) {
+ dev_err(&spi->dev, "invalid platform data\n");
+ return -EINVAL;
+ }
+
mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
if (!mc13xxx)
return -ENOMEM;
@@ -763,6 +768,10 @@ err_revision:
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
pdata->leds, sizeof(*pdata->leds));
+ if (pdata->buttons)
+ mc13xxx_add_subdevice_pdata(mc13xxx, "%s-pwrbutton",
+ pdata->buttons, sizeof(*pdata->buttons));
+
return 0;
}