summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2012-12-14 10:55:46 -0700
committerEric Nelson <eric.nelson@boundarydevices.com>2012-12-14 10:55:46 -0700
commit2a4aa35268cb27f091fcec2c266ef91e8bb5ea44 (patch)
treeeaeaf30d21da2b141a9574de0989c3d173cbf4ba
parent23e50de473fec3ba33505768b020d9966f5610f6 (diff)
mx6qsabrelite: export buttons as GPIO if no KEYBOARD_GPIO3.0-boundary-imx6-ts1
-rw-r--r--arch/arm/mach-mx6/board-mx6q_sabrelite.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabrelite.c b/arch/arm/mach-mx6/board-mx6q_sabrelite.c
index 6b66ea339587..2c0cbe220d2d 100644
--- a/arch/arm/mach-mx6/board-mx6q_sabrelite.c
+++ b/arch/arm/mach-mx6/board-mx6q_sabrelite.c
@@ -780,7 +780,6 @@ static const struct pm_platform_data mx6_sabrelite_pm_data __initconst = {
.suspend_exit = sabrelite_suspend_exit,
};
-#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \
{ \
.gpio = gpio_num, \
@@ -800,6 +799,7 @@ static struct gpio_keys_button sabrelite_buttons[] = {
GPIO_BUTTON(MX6_SABRELITE_VOL_DOWN_KEY, KEY_VOLUMEDOWN, 1, "volume-down", 0),
};
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
static struct gpio_keys_platform_data sabrelite_button_data = {
.buttons = sabrelite_buttons,
.nbuttons = ARRAY_SIZE(sabrelite_buttons),
@@ -819,7 +819,15 @@ static void __init sabrelite_add_device_buttons(void)
platform_device_register(&sabrelite_button_device);
}
#else
-static void __init sabrelite_add_device_buttons(void) {}
+static void __init sabrelite_add_device_buttons(void)
+{
+ int i;
+ for (i=0; i < ARRAY_SIZE(sabrelite_buttons);i++) {
+ int gpio = sabrelite_buttons[i].gpio;
+ pr_debug("%s: exporting gpio %d\n", __func__, gpio);
+ gpio_export(gpio,1);
+ }
+}
#endif
#ifdef CONFIG_WL12XX_PLATFORM_DATA