@@ -442,11 +442,21 @@ static int __devexit twl4030_kp_remove(struct platform_device *pdev)
#ifdef CONFIG_PM
static int twl4030_kp_suspend(struct platform_device *pdev, pm_message_t state)
{
+ struct twl4030_keypad_data *pdata = pdev->dev.platform_data;
+
+ if (pdata->on_suspend)
+ pdata->on_suspend(pdata->pm_state);
+
return 0;
}
static int twl4030_kp_resume(struct platform_device *pdev)
{
+ struct twl4030_keypad_data *pdata = pdev->dev.platform_data;
+
+ if (pdata->on_resume)
+ pdata->on_resume(pdata->pm_state);
+
return 0;
}
#else
@@ -487,6 +487,18 @@ struct twl4030_keypad_data {
unsigned rows;
unsigned cols;
bool rep;
+#ifdef CONFIG_PM
+ /*
+ * Board specific information required during suspend, resume.
+ * E.g. configuration as wake-up source.
+ */
+ void *pm_state;
+ /*
+ * Hooks for board specific execution during suspend, resume.
+ */
+ void (*on_suspend)(void *pstate);
+ void (*on_resume)(void *pstate);
+#endif
};
enum twl4030_usb_mode {