summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch180
1 files changed, 180 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch b/meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch
new file mode 100644
index 0000000000..6fb34ec179
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-rp-2.6.24/sharpsl-rc-r2.patch
@@ -0,0 +1,180 @@
1This patch adds support for Sharp CE-RH2 on Akita and CE-RH1 on C7x0.
2
3This patch is a bit ugly:
4- Device specific functions should be moved to platform infrastructure.
5- Maybe define generic *_scoopexp functions handling Akita x Spitz differences.
6
7Index: linux-2.6.24/drivers/input/keyboard/sharpsl_rc.c
8===================================================================
9--- linux-2.6.24.orig/drivers/input/keyboard/sharpsl_rc.c 2008-03-08 19:29:02.000000000 +0000
10+++ linux-2.6.24/drivers/input/keyboard/sharpsl_rc.c 2008-03-08 22:23:35.000000000 +0000
11@@ -21,12 +21,10 @@
12 #include <linux/module.h>
13 #include <linux/slab.h>
14
15-#ifdef CONFIG_MACH_SPITZ
16+#include <asm/mach-types.h>
17 #include <asm/arch/spitz.h>
18-#endif
19-#ifdef CONFIG_MACH_CORGI
20+#include <asm/arch/akita.h>
21 #include <asm/arch/corgi.h>
22-#endif
23
24 #include <asm/arch/hardware.h>
25 #include <asm/arch/pxa-regs.h>
26@@ -42,12 +40,8 @@
27 unsigned char key;
28 };
29
30-#ifdef CONFIG_MACH_SPITZ
31-#define REMOTE_AKIN_PULLUP SPITZ_SCP2_AKIN_PULLUP
32-#define REMOTE_SCOOP_DEVICE spitzscoop2_device
33-#define REMOTE_GPIO_INT SPITZ_GPIO_AK_INT
34-#define REMOTE_IRQ_INT SPITZ_IRQ_GPIO_AK_INT
35-static struct remote_control_key remote_keys[] = {
36+static struct remote_control_key remote_keys_spitz[] = {
37+ /* CE-RH2 values */
38 { 25, 35, KEY_STOPCD},
39 { 55, 65, KEY_PLAYPAUSE},
40 { 85, 95, KEY_NEXTSONG},
41@@ -56,23 +50,15 @@
42 { 180, 190, KEY_MUTE},
43 { 215, 225, KEY_VOLUMEDOWN},
44 };
45-#endif
46-#ifdef CONFIG_MACH_CORGI
47-#define REMOTE_AKIN_PULLUP CORGI_SCP_AKIN_PULLUP
48-#define REMOTE_SCOOP_DEVICE corgiscoop_device
49-#define REMOTE_GPIO_INT CORGI_GPIO_AK_INT
50-#define REMOTE_IRQ_INT CORGI_IRQ_GPIO_AK_INT
51-static struct remote_control_key remote_keys[] = {
52- //These need to be fixed for the CE-RH1's values
53- { 25, 35, KEY_STOPCD},
54- { 55, 65, KEY_PLAYPAUSE},
55- { 85, 95, KEY_NEXTSONG},
56- { 115, 125, KEY_VOLUMEUP},
57- { 145, 155, KEY_PREVIOUSSONG},
58- { 180, 190, KEY_MUTE},
59- { 215, 225, KEY_VOLUMEDOWN},
60+static struct remote_control_key remote_keys_corgi[] = {
61+ /* CE-RH1 values */
62+ { 27, 35, KEY_STOPCD},
63+ { 7, 13, KEY_PLAYPAUSE},
64+ { 77, 93, KEY_NEXTSONG},
65+ { 115, 132, KEY_VOLUMEUP},
66+ { 46, 58, KEY_PREVIOUSSONG},
67+ { 170, 186, KEY_VOLUMEDOWN},
68 };
69-#endif
70
71 #define RELEASE_HI 230
72 #define MAX_EARPHONE 6
73@@ -98,9 +84,17 @@
74 static int get_remocon_raw(void)
75 {
76 int i, val;
77+ struct remote_control_key *remote_keys;
78+
79+ if (machine_is_borzoi() || machine_is_spitz() || machine_is_akita())
80+ remote_keys = remote_keys_spitz;
81+ else
82+ remote_keys = remote_keys_corgi;
83
84 val = sharpsl_pm_pxa_read_max1111(MAX1111_REMCOM);
85- for (i = 0; i < ARRAY_SIZE(remote_keys); ++i) {
86+ for (i = 0; i < (machine_is_borzoi() || machine_is_spitz() || machine_is_akita() ?
87+ ARRAY_SIZE(remote_keys_spitz) : ARRAY_SIZE(remote_keys_corgi));
88+ ++i) {
89 if (val >= remote_keys[i].min
90 && val <= remote_keys[i].max) {
91 printk("get_remocon_raw: VAL=%i, KEY=%i\n", val, remote_keys[i].key);
92@@ -121,8 +115,12 @@
93 data->state = 0;
94 data->last_key = 0;
95
96- reset_scoop_gpio(&REMOTE_SCOOP_DEVICE.dev, REMOTE_AKIN_PULLUP);
97-
98+ if (machine_is_borzoi() || machine_is_spitz())
99+ reset_scoop_gpio(platform_scoop_config->devs[1].dev, SPITZ_SCP2_AKIN_PULLUP);
100+ else if (machine_is_akita())
101+ akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_AKIN_PULLUP);
102+ else
103+ reset_scoop_gpio(platform_scoop_config->devs[0].dev, CORGI_SCP_AKIN_PULLUP);
104 mod_timer(&data->rctimer, jiffies + msecs_to_jiffies(RC_POLL_MS));
105 }
106 return IRQ_HANDLED;
107@@ -182,7 +180,12 @@
108 if (timer) {
109 mod_timer(&data->rctimer, jiffies + msecs_to_jiffies(RC_POLL_MS));
110 } else {
111- set_scoop_gpio(&REMOTE_SCOOP_DEVICE.dev, REMOTE_AKIN_PULLUP);
112+ if (machine_is_borzoi() || machine_is_spitz())
113+ set_scoop_gpio(platform_scoop_config->devs[1].dev, SPITZ_SCP2_AKIN_PULLUP);
114+ else if (machine_is_akita())
115+ akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_AKIN_PULLUP);
116+ else
117+ set_scoop_gpio(platform_scoop_config->devs[0].dev, CORGI_SCP_AKIN_PULLUP);
118 data->handling_press = 0;
119 }
120 }
121@@ -192,6 +195,7 @@
122 struct sharpsl_rc *sharpsl_rc;
123 struct input_dev *input_dev;
124 int i, ret;
125+ struct remote_control_key *remote_keys;
126
127 dev_dbg(&pdev->dev, "sharpsl_rc_probe\n");
128
129@@ -225,17 +229,32 @@
130
131 input_dev->evbit[0] = BIT(EV_KEY);
132
133- for (i = 0; i <= ARRAY_SIZE(remote_keys); i++)
134+ if (machine_is_borzoi() || machine_is_spitz() || machine_is_akita())
135+ remote_keys = remote_keys_spitz;
136+ else
137+ remote_keys = remote_keys_corgi;
138+ for (i = 0; i < (machine_is_borzoi() || machine_is_spitz() || machine_is_akita() ?
139+ ARRAY_SIZE(remote_keys_spitz) : ARRAY_SIZE(remote_keys_corgi));
140+ ++i)
141 set_bit(remote_keys[i].key, input_dev->keybit);
142
143 input_register_device(sharpsl_rc->input);
144
145- pxa_gpio_mode(REMOTE_GPIO_INT | GPIO_IN);
146- ret = request_irq(REMOTE_IRQ_INT,
147- sharpsl_rc_interrupt,
148- IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED,
149- "sharpsl_rc",
150- sharpsl_rc);
151+ if (machine_is_borzoi() || machine_is_spitz() || machine_is_akita()) {
152+ pxa_gpio_mode(SPITZ_GPIO_AK_INT | GPIO_IN);
153+ ret = request_irq(SPITZ_IRQ_GPIO_AK_INT,
154+ sharpsl_rc_interrupt,
155+ IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED,
156+ "sharpsl_rc",
157+ sharpsl_rc);
158+ } else {
159+ pxa_gpio_mode(CORGI_GPIO_AK_INT | GPIO_IN);
160+ ret = request_irq(CORGI_IRQ_GPIO_AK_INT,
161+ sharpsl_rc_interrupt,
162+ IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED,
163+ "sharpsl_rc",
164+ sharpsl_rc);
165+ }
166 if (ret < 0) {
167 dev_dbg(&pdev->dev, "Can't get IRQ: %d!\n", i);
168 kfree(sharpsl_rc);
169@@ -252,7 +271,10 @@
170
171 dev_dbg(&pdev->dev, "sharpsl_rc_remove\n");
172
173- free_irq(REMOTE_IRQ_INT, sharpsl_rc);
174+ if (machine_is_borzoi() || machine_is_spitz() || machine_is_akita())
175+ free_irq(SPITZ_IRQ_GPIO_AK_INT, sharpsl_rc);
176+ else
177+ free_irq(CORGI_IRQ_GPIO_AK_INT, sharpsl_rc);
178 del_timer_sync(&sharpsl_rc->rctimer);
179 input_unregister_device(sharpsl_rc->input);
180 kfree(sharpsl_rc);