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>
This commit is contained in:

committed by
Samuel Ortiz

parent
5ab9059d7f
commit
30fc7ac3f6
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user