diff options
| author | Christer Weinigel <christer@weinigel.se> | 2008-07-07 13:12:43 -0400 |
|---|---|---|
| committer | Ben Dooks <ben-linux@fluff.org> | 2008-07-07 13:13:03 -0400 |
| commit | 620657500263cca4a4d9845eeaeba47e03447075 (patch) | |
| tree | 968e867fa8cc52463db089d5ce314efb1b8a9ac8 | |
| parent | d088e5fe586287da003341e7bbfdad15e0f432f7 (diff) | |
[ARM] Acer n30: GPIO buttons support
Add support for the GPIO buttons on the Acer N30.
Signed-off-by: Christer Weinigel <christer@weinigel.se>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| -rw-r--r-- | arch/arm/mach-s3c2410/mach-n30.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c index 8edc0c0eb043..631f3a9e7a60 100644 --- a/arch/arm/mach-s3c2410/mach-n30.c +++ b/arch/arm/mach-s3c2410/mach-n30.c | |||
| @@ -17,7 +17,9 @@ | |||
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | 18 | ||
| 19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
| 20 | #include <linux/gpio_keys.h> | ||
| 20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/input.h> | ||
| 21 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 22 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 23 | #include <linux/serial_core.h> | 25 | #include <linux/serial_core.h> |
| @@ -98,6 +100,70 @@ static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = { | |||
| 98 | .vbus_pin_inverted = 0, | 100 | .vbus_pin_inverted = 0, |
| 99 | }; | 101 | }; |
| 100 | 102 | ||
| 103 | static struct gpio_keys_button n30_buttons[] = { | ||
| 104 | { | ||
| 105 | .gpio = S3C2410_GPF0, | ||
| 106 | .code = KEY_POWER, | ||
| 107 | .desc = "Power", | ||
| 108 | .active_low = 0, | ||
| 109 | }, | ||
| 110 | { | ||
| 111 | .gpio = S3C2410_GPG9, | ||
| 112 | .code = KEY_UP, | ||
| 113 | .desc = "Thumbwheel Up", | ||
| 114 | .active_low = 0, | ||
| 115 | }, | ||
| 116 | { | ||
| 117 | .gpio = S3C2410_GPG8, | ||
| 118 | .code = KEY_DOWN, | ||
| 119 | .desc = "Thumbwheel Down", | ||
| 120 | .active_low = 0, | ||
| 121 | }, | ||
| 122 | { | ||
| 123 | .gpio = S3C2410_GPG7, | ||
| 124 | .code = KEY_ENTER, | ||
| 125 | .desc = "Thumbwheel Press", | ||
| 126 | .active_low = 0, | ||
| 127 | }, | ||
| 128 | { | ||
| 129 | .gpio = S3C2410_GPF7, | ||
| 130 | .code = KEY_HOMEPAGE, | ||
| 131 | .desc = "Home", | ||
| 132 | .active_low = 0, | ||
| 133 | }, | ||
| 134 | { | ||
| 135 | .gpio = S3C2410_GPF6, | ||
| 136 | .code = KEY_CALENDAR, | ||
| 137 | .desc = "Calendar", | ||
| 138 | .active_low = 0, | ||
| 139 | }, | ||
| 140 | { | ||
| 141 | .gpio = S3C2410_GPF5, | ||
| 142 | .code = KEY_ADDRESSBOOK, | ||
| 143 | .desc = "Contacts", | ||
| 144 | .active_low = 0, | ||
| 145 | }, | ||
| 146 | { | ||
| 147 | .gpio = S3C2410_GPF4, | ||
| 148 | .code = KEY_MAIL, | ||
| 149 | .desc = "Mail", | ||
| 150 | .active_low = 0, | ||
| 151 | }, | ||
| 152 | }; | ||
| 153 | |||
| 154 | static struct gpio_keys_platform_data n30_button_data = { | ||
| 155 | .buttons = n30_buttons, | ||
| 156 | .nbuttons = ARRAY_SIZE(n30_buttons), | ||
| 157 | }; | ||
| 158 | |||
| 159 | static struct platform_device n30_button_device = { | ||
| 160 | .name = "gpio-keys", | ||
| 161 | .id = -1, | ||
| 162 | .dev = { | ||
| 163 | .platform_data = &n30_button_data, | ||
| 164 | } | ||
| 165 | }; | ||
| 166 | |||
| 101 | static struct platform_device *n30_devices[] __initdata = { | 167 | static struct platform_device *n30_devices[] __initdata = { |
| 102 | &s3c_device_lcd, | 168 | &s3c_device_lcd, |
| 103 | &s3c_device_wdt, | 169 | &s3c_device_wdt, |
| @@ -105,6 +171,7 @@ static struct platform_device *n30_devices[] __initdata = { | |||
| 105 | &s3c_device_iis, | 171 | &s3c_device_iis, |
| 106 | &s3c_device_usb, | 172 | &s3c_device_usb, |
| 107 | &s3c_device_usbgadget, | 173 | &s3c_device_usbgadget, |
| 174 | &n30_button_device, | ||
| 108 | }; | 175 | }; |
| 109 | 176 | ||
| 110 | static struct s3c2410_platform_i2c n30_i2ccfg = { | 177 | static struct s3c2410_platform_i2c n30_i2ccfg = { |
