2009-09-03 15:12:25

by vimal singh

[permalink] [raw]
Subject: [PATCH 1/2]: twl4030: register twl4030-pwrbuttonas a child of twl4030-core.c

'twl4030-pwrbutton' was already made as a platform_driver so it can
be registered as a child of twl4030-core.c.

But adding twl4030-pwrbutton as our child in twl4030-core is missing
currently. This patch adds it.

Signed-off-by: Vimal Singh <[email protected]>
CC: Felipe Balbi <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: David Brownell <[email protected]>
---
This patch is compile tested only.
This patch is based on Felipe Balbi's patch posted earlier:
http://lkml.org/lkml/2009/2/28/88

drivers/mfd/twl4030-core.c | 14 ++++++++++++++
1 files changed, 14 insertions(+)

Index: linux-omap-2.6/drivers/mfd/twl4030-core.c
===================================================================
--- linux-omap-2.6.orig/drivers/mfd/twl4030-core.c
+++ linux-omap-2.6/drivers/mfd/twl4030-core.c
@@ -108,6 +108,13 @@
#define twl_has_watchdog() false
#endif

+#if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \
+ || defined(CONFIG_INPUT_TWL4030_PWRBUTTON_MODULE)
+#define twl_has_pwrbutton() true
+#else
+#define twl_has_pwrbutton() false
+#endif
+
/* Triton Core internal information (BEGIN) */

/* Last - for index max*/
@@ -538,6 +545,13 @@ add_children(struct twl4030_platform_dat
return PTR_ERR(child);
}

+ if (twl_has_pwrbutton()) {
+ child = add_child(1, "twl4030_pwrbutton",
+ NULL, 0, true, pdata->irq_base + 8 + 0, 0);
+ if (IS_ERR(child))
+ return PTR_ERR(child);
+ }
+
if (twl_has_regulator()) {
/*
child = add_regulator(TWL4030_REG_VPLL1, pdata->vpll1);