summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHu hui <b29976@freescale.com>2010-10-15 16:28:54 +0800
committerJustin Waters <justin.waters@timesys.com>2010-12-13 16:10:28 -0500
commit1cf36989d1997b016047a71ac3c3065dc310235f (patch)
tree5bdc97a0b87f998c9d029893dff1c78da408e1b0 /arch
parent061cba278ac108d103740a905a0e1a2bea0e0214 (diff)
ENGR00132639-1 Power: mxc_pwerkey break mx25 kernel build
MSL Part define a new platform data struct, and Put the pmic callback register into platform data structure, then we can cover all pmic Signed-off-by: Hu Hui <b29976@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx5/mx50_rdp.c17
-rw-r--r--arch/arm/mach-mx5/mx53_evk.c16
2 files changed, 31 insertions, 2 deletions
diff --git a/arch/arm/mach-mx5/mx50_rdp.c b/arch/arm/mach-mx5/mx50_rdp.c
index 31b0f824a29f..8732c04599d9 100644
--- a/arch/arm/mach-mx5/mx50_rdp.c
+++ b/arch/arm/mach-mx5/mx50_rdp.c
@@ -45,6 +45,7 @@
#include <linux/mxcfb.h>
#include <linux/fec.h>
#include <linux/gpmi-nfc.h>
+#include <linux/powerkey.h>
#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -990,6 +991,20 @@ static void mx50_arm2_usb_set_vbus(bool enable)
gpio_set_value(USB_OTG_PWR, enable);
}
+static void mxc_register_powerkey(key_press_call_back kp_cb, void *param)
+{
+ pmic_event_callback_t power_key_event;
+
+ power_key_event.param = param;
+ power_key_event.func = (void *)kp_cb;
+ pmic_event_subscribe(EVENT_PWRONI, power_key_event);
+}
+
+static struct power_key_platform_data pwrkey_data = {
+ .register_key_press_handler = mxc_register_powerkey,
+};
+
+
static int __initdata enable_w1 = { 0 };
static int __init w1_setup(char *__unused)
{
@@ -1180,7 +1195,7 @@ static void __init mxc_board_init(void)
mxc_register_device(&mxs_viim, NULL);
mxc_register_device(&mxc_rngb_device, NULL);
mxc_register_device(&dcp_device, NULL);
- mxc_register_device(&mxc_powerkey_device, NULL);
+ mxc_register_device(&mxc_powerkey_device, &pwrkey_data);
mx50_rdp_init_mc13892();
/*
pm_power_off = mxc_power_off;
diff --git a/arch/arm/mach-mx5/mx53_evk.c b/arch/arm/mach-mx5/mx53_evk.c
index 992bc57dfc55..7a07ccd25444 100644
--- a/arch/arm/mach-mx5/mx53_evk.c
+++ b/arch/arm/mach-mx5/mx53_evk.c
@@ -44,6 +44,7 @@
#include <linux/pwm_backlight.h>
#include <linux/fec.h>
#include <linux/ahci_platform.h>
+#include <linux/powerkey.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/irq.h>
@@ -1253,6 +1254,19 @@ static struct mxc_mlb_platform_data mlb_data = {
.mlb_clk = "mlb_clk",
};
+static void mxc_register_powerkey(key_press_call_back kp_cb, void *param)
+{
+ pmic_event_callback_t power_key_event;
+
+ power_key_event.param = param;
+ power_key_event.func = (void *)kp_cb;
+ pmic_event_subscribe(EVENT_PWRONI, power_key_event);
+}
+
+static struct power_key_platform_data pwrkey_data = {
+ .register_key_press_handler = mxc_register_powerkey,
+};
+
/* NAND Flash Partitions */
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition nand_flash_partitions[] = {
@@ -1674,7 +1688,7 @@ static void __init mxc_board_init(void)
*/
mxc_register_device(&mxc_sgtl5000_device, &sgtl5000_data);
mxc_register_device(&mxc_mlb_device, &mlb_data);
- mxc_register_device(&mxc_powerkey_device, NULL);
+ mxc_register_device(&mxc_powerkey_device, &pwrkey_data);
mx5_set_otghost_vbus_func(mx53_gpio_usbotg_driver_vbus);
mx5_usb_dr_init();
mx5_set_host1_vbus_func(mx53_gpio_host1_driver_vbus);