Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149355
b: refs/heads/master
c: 1ce2c51
h: refs/heads/master
i:
  149353: 141a253
  149351: 93e3807
v: v3
  • Loading branch information
Antonio Ospite authored and Eric Miao committed Jun 5, 2009
1 parent 3f7c9e6 commit a923590
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0ba401769a5ca0b69e60914ef03e4fc373c3a02
refs/heads/master: 1ce2c51e6d594d19126f51bba88aa9f57eb7cea6
175 changes: 168 additions & 7 deletions trunk/arch/arm/mach-pxa/ezx.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/delay.h>
#include <linux/pwm_backlight.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>

#include <asm/setup.h>
#include <asm/mach-types.h>
Expand All @@ -32,6 +33,12 @@
#include "devices.h"
#include "generic.h"

#define GPIO12_A780_FLIP_LID 12
#define GPIO15_A1200_FLIP_LID 15
#define GPIO15_A910_FLIP_LID 15
#define GPIO12_E680_LOCK_SWITCH 12
#define GPIO15_E6_LOCK_SWITCH 15

static struct platform_pwm_backlight_data ezx_backlight_data = {
.pwm_id = 0,
.max_brightness = 1023,
Expand Down Expand Up @@ -88,7 +95,7 @@ static struct pxafb_mach_info ezx_fb_info_2 = {
.lcd_conn = LCD_COLOR_TFT_18BPP,
};

static struct platform_device *devices[] __initdata = {
static struct platform_device *ezx_devices[] __initdata = {
&ezx_backlight_device,
};

Expand Down Expand Up @@ -651,6 +658,35 @@ static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
#endif /* CONFIG_MACH_EZX_E2 */

#ifdef CONFIG_MACH_EZX_A780
/* gpio_keys */
static struct gpio_keys_button a780_buttons[] = {
[0] = {
.code = SW_LID,
.gpio = GPIO12_A780_FLIP_LID,
.active_low = 0,
.desc = "A780 flip lid",
.type = EV_SW,
.wakeup = 1,
},
};

static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
.buttons = a780_buttons,
.nbuttons = ARRAY_SIZE(a780_buttons),
};

static struct platform_device a780_gpio_keys = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &a780_gpio_keys_platform_data,
},
};

static struct platform_device *a780_devices[] __initdata = {
&a780_gpio_keys,
};

static void __init a780_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Expand All @@ -663,7 +699,8 @@ static void __init a780_init(void)

pxa_set_keypad_info(&a780_keypad_platform_data);

platform_add_devices(devices, ARRAY_SIZE(devices));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(a780_devices));
}

MACHINE_START(EZX_A780, "Motorola EZX A780")
Expand All @@ -678,10 +715,39 @@ MACHINE_END
#endif

#ifdef CONFIG_MACH_EZX_E680
/* gpio_keys */
static struct gpio_keys_button e680_buttons[] = {
[0] = {
.code = KEY_SCREENLOCK,
.gpio = GPIO12_E680_LOCK_SWITCH,
.active_low = 0,
.desc = "E680 lock switch",
.type = EV_KEY,
.wakeup = 1,
},
};

static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
.buttons = e680_buttons,
.nbuttons = ARRAY_SIZE(e680_buttons),
};

static struct platform_device e680_gpio_keys = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &e680_gpio_keys_platform_data,
},
};

static struct i2c_board_info __initdata e680_i2c_board_info[] = {
{ I2C_BOARD_INFO("tea5767", 0x81) },
};

static struct platform_device *e680_devices[] __initdata = {
&e680_gpio_keys,
};

static void __init e680_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Expand All @@ -695,7 +761,8 @@ static void __init e680_init(void)

pxa_set_keypad_info(&e680_keypad_platform_data);

platform_add_devices(devices, ARRAY_SIZE(devices));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(e680_devices));
}

MACHINE_START(EZX_E680, "Motorola EZX E680")
Expand All @@ -710,10 +777,39 @@ MACHINE_END
#endif

#ifdef CONFIG_MACH_EZX_A1200
/* gpio_keys */
static struct gpio_keys_button a1200_buttons[] = {
[0] = {
.code = SW_LID,
.gpio = GPIO15_A1200_FLIP_LID,
.active_low = 0,
.desc = "A1200 flip lid",
.type = EV_SW,
.wakeup = 1,
},
};

static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
.buttons = a1200_buttons,
.nbuttons = ARRAY_SIZE(a1200_buttons),
};

static struct platform_device a1200_gpio_keys = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &a1200_gpio_keys_platform_data,
},
};

static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
{ I2C_BOARD_INFO("tea5767", 0x81) },
};

static struct platform_device *a1200_devices[] __initdata = {
&a1200_gpio_keys,
};

static void __init a1200_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Expand All @@ -727,7 +823,8 @@ static void __init a1200_init(void)

pxa_set_keypad_info(&a1200_keypad_platform_data);

platform_add_devices(devices, ARRAY_SIZE(devices));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
}

MACHINE_START(EZX_A1200, "Motorola EZX A1200")
Expand All @@ -742,6 +839,35 @@ MACHINE_END
#endif

#ifdef CONFIG_MACH_EZX_A910
/* gpio_keys */
static struct gpio_keys_button a910_buttons[] = {
[0] = {
.code = SW_LID,
.gpio = GPIO15_A910_FLIP_LID,
.active_low = 0,
.desc = "A910 flip lid",
.type = EV_SW,
.wakeup = 1,
},
};

static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
.buttons = a910_buttons,
.nbuttons = ARRAY_SIZE(a910_buttons),
};

static struct platform_device a910_gpio_keys = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &a910_gpio_keys_platform_data,
},
};

static struct platform_device *a910_devices[] __initdata = {
&a910_gpio_keys,
};

static void __init a910_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Expand All @@ -754,7 +880,8 @@ static void __init a910_init(void)

pxa_set_keypad_info(&a910_keypad_platform_data);

platform_add_devices(devices, ARRAY_SIZE(devices));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(a910_devices));
}

MACHINE_START(EZX_A910, "Motorola EZX A910")
Expand All @@ -769,10 +896,39 @@ MACHINE_END
#endif

#ifdef CONFIG_MACH_EZX_E6
/* gpio_keys */
static struct gpio_keys_button e6_buttons[] = {
[0] = {
.code = KEY_SCREENLOCK,
.gpio = GPIO15_E6_LOCK_SWITCH,
.active_low = 0,
.desc = "E6 lock switch",
.type = EV_KEY,
.wakeup = 1,
},
};

static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
.buttons = e6_buttons,
.nbuttons = ARRAY_SIZE(e6_buttons),
};

static struct platform_device e6_gpio_keys = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &e6_gpio_keys_platform_data,
},
};

static struct i2c_board_info __initdata e6_i2c_board_info[] = {
{ I2C_BOARD_INFO("tea5767", 0x81) },
};

static struct platform_device *e6_devices[] __initdata = {
&e6_gpio_keys,
};

static void __init e6_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Expand All @@ -786,7 +942,8 @@ static void __init e6_init(void)

pxa_set_keypad_info(&e6_keypad_platform_data);

platform_add_devices(devices, ARRAY_SIZE(devices));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(e6_devices));
}

MACHINE_START(EZX_E6, "Motorola EZX E6")
Expand All @@ -805,6 +962,9 @@ static struct i2c_board_info __initdata e2_i2c_board_info[] = {
{ I2C_BOARD_INFO("tea5767", 0x81) },
};

static struct platform_device *e2_devices[] __initdata = {
};

static void __init e2_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
Expand All @@ -818,7 +978,8 @@ static void __init e2_init(void)

pxa_set_keypad_info(&e2_keypad_platform_data);

platform_add_devices(devices, ARRAY_SIZE(devices));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(e2_devices));
}

MACHINE_START(EZX_E2, "Motorola EZX E2")
Expand Down

0 comments on commit a923590

Please sign in to comment.