|
@@ -308,3 +308,155 @@ struct gpio_led z2_gpio_leds[] = {
|
|
|
.gpio = GPIO10_ZIPITZ2_LED_WIFI,
|
|
|
.active_low = 1,
|
|
|
}, {
|
|
|
+ .name = "z2:green:charged",
|
|
|
+ .default_trigger = "mmc0",
|
|
|
+ .gpio = GPIO85_ZIPITZ2_LED_CHARGED,
|
|
|
+ .active_low = 1,
|
|
|
+}, {
|
|
|
+ .name = "z2:amber:charging",
|
|
|
+ .default_trigger = "Z2-charging-or-full",
|
|
|
+ .gpio = GPIO83_ZIPITZ2_LED_CHARGING,
|
|
|
+ .active_low = 1,
|
|
|
+},
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_led_platform_data z2_gpio_led_info = {
|
|
|
+ .leds = z2_gpio_leds,
|
|
|
+ .num_leds = ARRAY_SIZE(z2_gpio_leds),
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device z2_leds = {
|
|
|
+ .name = "leds-gpio",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &z2_gpio_led_info,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+static void __init z2_leds_init(void)
|
|
|
+{
|
|
|
+ platform_device_register(&z2_leds);
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void z2_leds_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+/******************************************************************************
|
|
|
+ * GPIO keyboard
|
|
|
+ ******************************************************************************/
|
|
|
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
|
|
|
+static unsigned int z2_matrix_keys[] = {
|
|
|
+ KEY(0, 0, KEY_OPTION),
|
|
|
+ KEY(1, 0, KEY_UP),
|
|
|
+ KEY(2, 0, KEY_DOWN),
|
|
|
+ KEY(3, 0, KEY_LEFT),
|
|
|
+ KEY(4, 0, KEY_RIGHT),
|
|
|
+ KEY(5, 0, KEY_END),
|
|
|
+ KEY(6, 0, KEY_KPPLUS),
|
|
|
+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AYCD),
|
|
|
+ KEY(1, 7, KEY_U),
|
|
|
+ KEY(2, 7, KEY_F),
|
|
|
+ KEY(3, 7, KEY_Z),
|
|
|
+ KEY(4, 7, KEY_SEMICOLON),
|
|
|
+ KEY(5, 7, KEY_DOT),
|
|
|
+};
|
|
|
+
|
|
|
+static struct pxa27x_keypad_platform_data z2_keypad_platform_data = {
|
|
|
+ .matrix_key_rows = 7,
|
|
|
+ .matrix_key_cols = 8,
|
|
|
+ .matrix_key_map = z2_matrix_keys,
|
|
|
+ .matrix_key_map_size = ARRAY_SIZE(z2_matrix_keys),
|
|
|
+
|
|
|
+ .debounce_interval = 30,
|
|
|
+};
|
|
|
+
|
|
|
+static void __init z2_mkp_init(void)
|
|
|
+{
|
|
|
+ pxa_set_keypad_info(&z2_keypad_platform_data);
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void z2_mkp_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+/******************************************************************************
|
|
|
+ * GPIO keys
|
|
|
+ ******************************************************************************/
|
|
|
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
|
|
|
+static struct gpio_keys_button z2_pxa_buttons[] = {
|
|
|
+ {
|
|
|
+ .code = KEY_POWER,
|
|
|
+ .gpio = GPIO1_ZIPITZ2_POWER_BUTTON,
|
|
|
+ .active_low = 0,
|
|
|
+ .desc = "Power Button",
|
|
|
+ .wakeup = 1,
|
|
|
+ .type = EV_KEY,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .code = SW_LID,
|
|
|
+ .gpio = GPIO98_ZIPITZ2_LID_BUTTON,
|
|
|
+ .active_low = 1,
|
|
|
+ .desc = "Lid Switch",
|
|
|
+ .wakeup = 0,
|
|
|
+ .type = EV_SW,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_keys_platform_data z2_pxa_keys_data = {
|
|
|
+ .buttons = z2_pxa_buttons,
|
|
|
+ .nbuttons = ARRAY_SIZE(z2_pxa_buttons),
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device z2_pxa_keys = {
|
|
|
+ .name = "gpio-keys",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &z2_pxa_keys_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static void __init z2_keys_init(void)
|
|
|
+{
|