aboutsummaryrefslogtreecommitdiffstats
path: root/packages/linux/linux/acern30/n30-buttons.patch
blob: ff1214e698b67b567a9b2d9c93b323d67d2d0528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Add support for the buttons on the n30.

Index: linux-2.6.14/arch/arm/mach-s3c2410/mach-n30.c
===================================================================
--- linux-2.6.14.orig/arch/arm/mach-s3c2410/mach-n30.c
+++ linux-2.6.14/arch/arm/mach-s3c2410/mach-n30.c
@@ -46,10 +46,12 @@
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/regs-lcd.h>
 #include <asm/arch/regs-timer.h>
+#include <asm/arch/irqs.h>
 #include <asm/arch/iic.h>
 #include <asm/arch/fb.h>
 #include <asm/arch/lcd.h>
 #include <asm/arch/ts.h>
+#include <asm/arch/buttons.h>
 
 #include <linux/serial_core.h>
 
@@ -194,11 +196,68 @@ static struct s3c2410_ts_mach_info n30_t
 	.oversampling_shift = 6,
 };
 
+static struct s3c2410_button n30_buttons[] = {
+	{ IRQ_EINT0,	S3C2410_GPF0,	S3C2410_GPF0_EINT0,	KEY_POWER,
+	  "Power", 0 },
+
+	{ IRQ_EINT17,	S3C2410_GPG9,	S3C2410_GPG9_EINT17,	KEY_UP,
+	  "Up_arrow", 0 },
+	{ IRQ_EINT16,	S3C2410_GPG8,	S3C2410_GPG8_EINT16,	KEY_DOWN,
+	  "Down_arrow", 0 },
+	{ IRQ_EINT15,	S3C2410_GPG7,   S3C2410_GPG7_EINT15,    KEY_ENTER,
+	  "Select", 0 },
+
+	{ IRQ_EINT7,	S3C2410_GPF7,	S3C2410_GPF7_EINT7,	KEY_HOMEPAGE,
+	  "Home", 0 },
+	{ IRQ_EINT6,	S3C2410_GPF6,	S3C2410_GPF6_EINT6,	KEY_CALENDAR,
+	  "Calendar", 0 },
+	{ IRQ_EINT5,	S3C2410_GPF5,	S3C2410_GPF5_EINT5,	KEY_COFFEE,
+	  "Contacts", 0 },	/* TODO: find a better key :P */
+	{ IRQ_EINT4,	S3C2410_GPF4,	S3C2410_GPF4_EINT4,	KEY_MAIL,
+	  "Mail", 0 },
+};
+
+static struct s3c2410_butt_mach_info n30_buttons_cfg __initdata = {
+	.buttons  = n30_buttons,
+	.size = ARRAY_SIZE(n30_buttons),
+};
+
+static struct s3c2410_button n35_buttons[] = {
+	{ IRQ_EINT0,	S3C2410_GPF0,	S3C2410_GPF0_EINT0,	KEY_POWER,
+	  "Power", 0 },
+
+	{ IRQ_EINT13,	S3C2410_GPG5,	S3C2410_GPG5_EINT13,	KEY_LEFT,
+ 	  "Left_arrow", 0 },
+	{ IRQ_EINT14,	S3C2410_GPG6,	S3C2410_GPG6_EINT14,	KEY_RIGHT,
+	  "Right_arrow", 0 },
+	{ IRQ_EINT17,	S3C2410_GPG9,	S3C2410_GPG9_EINT17,	KEY_UP,
+	  "Up_arrow", 0 },
+	{ IRQ_EINT16,	S3C2410_GPG8,	S3C2410_GPG8_EINT16,	KEY_DOWN,
+	  "Down_arrow", 0 },
+	{ IRQ_EINT15,	S3C2410_GPG7,   S3C2410_GPG7_EINT15,    KEY_ENTER,
+	  "Select", 0 },
+
+	{ IRQ_EINT7,	S3C2410_GPF7,	S3C2410_GPF7_EINT7,	KEY_HOMEPAGE,
+	  "Home", 0 },
+	{ IRQ_EINT6,	S3C2410_GPF6,	S3C2410_GPF6_EINT6,	KEY_CALENDAR,
+	  "Calendar", 0 },
+	{ IRQ_EINT5,	S3C2410_GPF5,	S3C2410_GPF5_EINT5,	KEY_COFFEE,
+	  "Contacts", 0 },	/* TODO: find a better key :P */
+	{ IRQ_EINT4,	S3C2410_GPF4,	S3C2410_GPF4_EINT4,	KEY_MAIL,
+	  "Mail", 0 },
+};
+
+static struct s3c2410_butt_mach_info n35_buttons_cfg __initdata = {
+	.buttons  = n35_buttons,
+	.size = ARRAY_SIZE(n35_buttons),
+};
+
 static struct platform_device *n30_devices[] __initdata = {
 	&s3c_device_usb,
 	&s3c_device_lcd,
 	&s3c_device_bl,
 	&s3c_device_ts,
+	&s3c_device_buttons,
 	&s3c_device_wdt,
 	&s3c_device_i2c,
 	&s3c_device_iis,
@@ -238,6 +297,11 @@ static void __init n30_init(void)
 	set_s3c2410bl_info(&n30_blcfg);
 	set_s3c2410ts_info(&n30_ts_cfg);
 
+	if (machine_is_n30())
+		s3c24xx_butt_set_platdata(&n30_buttons_cfg);
+	if (machine_is_n35())
+		s3c24xx_butt_set_platdata(&n35_buttons_cfg);
+
 	s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
 
 	/* Turn off suspend on both USB ports, and switch the