aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPhilippe Rétornaz <philippe.retornaz@epfl.ch>2011-09-18 12:10:53 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-24 08:09:14 -0400
commit30fc7ac3f62945a714d9842edae313a757efb49d (patch)
tree1ded2a47f35e465785c9dcea562e52b96da845ec /drivers/mfd
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')
-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)
703 enum mc13xxx_id id; 703 enum mc13xxx_id id;
704 int ret; 704 int ret;
705 705
706 if (!pdata) {
707 dev_err(&spi->dev, "invalid platform data\n");
708 return -EINVAL;
709 }
710
706 mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL); 711 mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
707 if (!mc13xxx) 712 if (!mc13xxx)
708 return -ENOMEM; 713 return -ENOMEM;
@@ -763,6 +768,10 @@ err_revision:
763 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led", 768 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
764 pdata->leds, sizeof(*pdata->leds)); 769 pdata->leds, sizeof(*pdata->leds));
765 770
771 if (pdata->buttons)
772 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-pwrbutton",
773 pdata->buttons, sizeof(*pdata->buttons));
774
766 return 0; 775 return 0;
767} 776}
768 777