summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/packages/linux/linux-rp-2.6.20/pxa-serial-hack.patch50
-rw-r--r--meta/packages/linux/linux-rp-2.6.20/sharpsl-rc-r1.patch2
-rw-r--r--meta/packages/linux/linux-rp-2.6.21/connectplus-prevent-oops-HACK.patch17
-rw-r--r--meta/packages/linux/linux-rp-2.6.21/defconfig-spitz1
-rw-r--r--meta/packages/linux/linux-rp-2.6.21/sharpsl-rc-r1.patch519
-rw-r--r--meta/packages/linux/linux-rp.inc28
-rw-r--r--meta/packages/linux/linux-rp_2.6.21.bb26
7 files changed, 602 insertions, 41 deletions
diff --git a/meta/packages/linux/linux-rp-2.6.20/pxa-serial-hack.patch b/meta/packages/linux/linux-rp-2.6.20/pxa-serial-hack.patch
index 9ece71331a..bf20f46a05 100644
--- a/meta/packages/linux/linux-rp-2.6.20/pxa-serial-hack.patch
+++ b/meta/packages/linux/linux-rp-2.6.20/pxa-serial-hack.patch
@@ -5,28 +5,38 @@
5 include/linux/serial_core.h | 1 + 5 include/linux/serial_core.h | 1 +
6 4 files changed, 16 insertions(+), 3 deletions(-) 6 4 files changed, 16 insertions(+), 3 deletions(-)
7 7
8Index: git/drivers/serial/8250.c 8Index: linux-2.6.20/drivers/serial/8250.c
9=================================================================== 9===================================================================
10--- git.orig/drivers/serial/8250.c 2006-10-31 16:29:50.000000000 +0000 10--- linux-2.6.20.orig/drivers/serial/8250.c 2007-04-27 13:37:26.000000000 +0100
11+++ git/drivers/serial/8250.c 2006-10-31 16:29:53.000000000 +0000 11+++ linux-2.6.20/drivers/serial/8250.c 2007-04-27 13:38:16.000000000 +0100
12@@ -2429,7 +2429,12 @@ static struct uart_driver serial8250_reg 12@@ -2429,7 +2429,12 @@
13 .driver_name = "serial", 13 .driver_name = "serial",
14 .dev_name = "ttyS", 14 .dev_name = "ttyS",
15 .major = TTY_MAJOR, 15 .major = TTY_MAJOR,
16+#ifdef CONFIG_SERIAL_PXA 16+#ifdef CONFIG_SERIAL_PXA
17+ .minor = 64 + 3, 17+ .minor = 64 + 4,
18+ .name_base = 3, 18+ .name_base = 4,
19+#else 19+#else
20 .minor = 64, 20 .minor = 64,
21+#endif 21+#endif
22 .nr = UART_NR, 22 .nr = UART_NR,
23 .cons = SERIAL8250_CONSOLE, 23 .cons = SERIAL8250_CONSOLE,
24 }; 24 };
25Index: git/drivers/serial/serial_core.c 25Index: linux-2.6.20/drivers/serial/serial_core.c
26=================================================================== 26===================================================================
27--- git.orig/drivers/serial/serial_core.c 2006-10-31 16:09:17.000000000 +0000 27--- linux-2.6.20.orig/drivers/serial/serial_core.c 2007-02-04 18:44:54.000000000 +0000
28+++ git/drivers/serial/serial_core.c 2006-10-31 16:29:53.000000000 +0000 28+++ linux-2.6.20/drivers/serial/serial_core.c 2007-04-27 13:39:39.000000000 +0100
29@@ -2183,6 +2183,7 @@ int uart_register_driver(struct uart_dri 29@@ -2068,7 +2068,8 @@
30 printk(KERN_INFO "%s%s%s%d at %s (irq = %d) is a %s\n",
31 port->dev ? port->dev->bus_id : "",
32 port->dev ? ": " : "",
33- drv->dev_name, port->line, address, port->irq, uart_type(port));
34+ drv->dev_name, port->line + drv->name_base, address, port->irq,
35+ uart_type(port));
36 }
37
38 static void
39@@ -2183,6 +2184,7 @@
30 normal->owner = drv->owner; 40 normal->owner = drv->owner;
31 normal->driver_name = drv->driver_name; 41 normal->driver_name = drv->driver_name;
32 normal->name = drv->dev_name; 42 normal->name = drv->dev_name;
@@ -34,11 +44,11 @@ Index: git/drivers/serial/serial_core.c
34 normal->major = drv->major; 44 normal->major = drv->major;
35 normal->minor_start = drv->minor; 45 normal->minor_start = drv->minor;
36 normal->type = TTY_DRIVER_TYPE_SERIAL; 46 normal->type = TTY_DRIVER_TYPE_SERIAL;
37Index: git/include/linux/serial_core.h 47Index: linux-2.6.20/include/linux/serial_core.h
38=================================================================== 48===================================================================
39--- git.orig/include/linux/serial_core.h 2006-10-31 16:09:45.000000000 +0000 49--- linux-2.6.20.orig/include/linux/serial_core.h 2007-02-04 18:44:54.000000000 +0000
40+++ git/include/linux/serial_core.h 2006-10-31 16:30:36.000000000 +0000 50+++ linux-2.6.20/include/linux/serial_core.h 2007-04-27 13:37:27.000000000 +0100
41@@ -339,6 +339,7 @@ struct uart_driver { 51@@ -341,6 +341,7 @@
42 struct module *owner; 52 struct module *owner;
43 const char *driver_name; 53 const char *driver_name;
44 const char *dev_name; 54 const char *dev_name;
@@ -46,11 +56,11 @@ Index: git/include/linux/serial_core.h
46 int major; 56 int major;
47 int minor; 57 int minor;
48 int nr; 58 int nr;
49Index: git/drivers/serial/serial_cs.c 59Index: linux-2.6.20/drivers/serial/serial_cs.c
50=================================================================== 60===================================================================
51--- git.orig/drivers/serial/serial_cs.c 2006-10-31 16:09:17.000000000 +0000 61--- linux-2.6.20.orig/drivers/serial/serial_cs.c 2007-02-04 18:44:54.000000000 +0000
52+++ git/drivers/serial/serial_cs.c 2006-10-31 16:29:53.000000000 +0000 62+++ linux-2.6.20/drivers/serial/serial_cs.c 2007-04-27 13:40:34.000000000 +0100
53@@ -390,7 +390,7 @@ static int setup_serial(struct pcmcia_de 63@@ -390,7 +390,7 @@
54 kio_addr_t iobase, int irq) 64 kio_addr_t iobase, int irq)
55 { 65 {
56 struct uart_port port; 66 struct uart_port port;
@@ -59,12 +69,12 @@ Index: git/drivers/serial/serial_cs.c
59 69
60 memset(&port, 0, sizeof (struct uart_port)); 70 memset(&port, 0, sizeof (struct uart_port));
61 port.iobase = iobase; 71 port.iobase = iobase;
62@@ -411,10 +411,16 @@ static int setup_serial(struct pcmcia_de 72@@ -411,10 +411,16 @@
63 return -EINVAL; 73 return -EINVAL;
64 } 74 }
65 75
66+#if CONFIG_SERIAL_PXA 76+#if CONFIG_SERIAL_PXA
67+ linestart = 3; 77+ linestart = 4;
68+#else 78+#else
69+ linestart = 0; 79+ linestart = 0;
70+#endif 80+#endif
diff --git a/meta/packages/linux/linux-rp-2.6.20/sharpsl-rc-r1.patch b/meta/packages/linux/linux-rp-2.6.20/sharpsl-rc-r1.patch
index 8230d53392..da83fdf5eb 100644
--- a/meta/packages/linux/linux-rp-2.6.20/sharpsl-rc-r1.patch
+++ b/meta/packages/linux/linux-rp-2.6.20/sharpsl-rc-r1.patch
@@ -298,7 +298,7 @@ Index: linux-2.6.20/drivers/input/keyboard/sharpsl_rc.c
298+ pxa_gpio_mode(REMOTE_GPIO_INT | GPIO_IN); 298+ pxa_gpio_mode(REMOTE_GPIO_INT | GPIO_IN);
299+ ret = request_irq(REMOTE_IRQ_INT, 299+ ret = request_irq(REMOTE_IRQ_INT,
300+ sharpsl_rc_interrupt, 300+ sharpsl_rc_interrupt,
301+ IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_SHARED, 301+ IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED,
302+ "sharpsl_rc", 302+ "sharpsl_rc",
303+ sharpsl_rc); 303+ sharpsl_rc);
304+ if (ret < 0) { 304+ if (ret < 0) {
diff --git a/meta/packages/linux/linux-rp-2.6.21/connectplus-prevent-oops-HACK.patch b/meta/packages/linux/linux-rp-2.6.21/connectplus-prevent-oops-HACK.patch
new file mode 100644
index 0000000000..b5439c62e7
--- /dev/null
+++ b/meta/packages/linux/linux-rp-2.6.21/connectplus-prevent-oops-HACK.patch
@@ -0,0 +1,17 @@
1Index: linux-2.6.21/drivers/net/wireless/hostap/hostap_hw.c
2===================================================================
3--- linux-2.6.21.orig/drivers/net/wireless/hostap/hostap_hw.c 2007-07-07 12:45:39.000000000 +0100
4+++ linux-2.6.21/drivers/net/wireless/hostap/hostap_hw.c 2007-07-07 12:47:30.000000000 +0100
5@@ -2666,6 +2666,12 @@
6 iface = netdev_priv(dev);
7 local = iface->local;
8
9+ if(dev->base_addr == 0)
10+ {
11+ printk(KERN_DEBUG "%s: IRQ before base_addr set\n", dev->name);
12+ return IRQ_HANDLED;
13+ }
14+
15 prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INTERRUPT, 0, 0);
16
17 if (local->func->card_present && !local->func->card_present(local)) {
diff --git a/meta/packages/linux/linux-rp-2.6.21/defconfig-spitz b/meta/packages/linux/linux-rp-2.6.21/defconfig-spitz
index 3dd84eac46..ce9b90066b 100644
--- a/meta/packages/linux/linux-rp-2.6.21/defconfig-spitz
+++ b/meta/packages/linux/linux-rp-2.6.21/defconfig-spitz
@@ -1778,3 +1778,4 @@ CONFIG_ZLIB_DEFLATE=m
1778CONFIG_PLIST=y 1778CONFIG_PLIST=y
1779CONFIG_HAS_IOMEM=y 1779CONFIG_HAS_IOMEM=y
1780CONFIG_HAS_IOPORT=y 1780CONFIG_HAS_IOPORT=y
1781CONFIG_SHARPSL_RC=m \ No newline at end of file
diff --git a/meta/packages/linux/linux-rp-2.6.21/sharpsl-rc-r1.patch b/meta/packages/linux/linux-rp-2.6.21/sharpsl-rc-r1.patch
new file mode 100644
index 0000000000..da83fdf5eb
--- /dev/null
+++ b/meta/packages/linux/linux-rp-2.6.21/sharpsl-rc-r1.patch
@@ -0,0 +1,519 @@
1Index: linux-2.6.20/arch/arm/mach-pxa/spitz.c
2===================================================================
3--- linux-2.6.20.orig/arch/arm/mach-pxa/spitz.c
4+++ linux-2.6.20/arch/arm/mach-pxa/spitz.c
5@@ -244,6 +244,13 @@ static struct platform_device spitzkbd_d
6 .id = -1,
7 };
8
9+/*
10+ * Spitz Remote Control Device
11+ */
12+static struct platform_device sharpsl_rc_device = {
13+ .name = "sharpsl-remote-control",
14+ .id = -1,
15+};
16
17 /*
18 * Spitz LEDs
19@@ -476,6 +483,7 @@ static struct platform_device *devices[]
20 &spitzscoop_device,
21 &spitzssp_device,
22 &spitzkbd_device,
23+ &sharpsl_rc_device,
24 &spitzts_device,
25 &spitzbl_device,
26 &spitzled_device,
27Index: linux-2.6.20/drivers/input/keyboard/Kconfig
28===================================================================
29--- linux-2.6.20.orig/drivers/input/keyboard/Kconfig
30+++ linux-2.6.20/drivers/input/keyboard/Kconfig
31@@ -154,6 +154,17 @@ config KEYBOARD_SPITZ
32 To compile this driver as a module, choose M here: the
33 module will be called spitzkbd.
34
35+config SHARPSL_RC
36+ tristate "Sharp SL-Cxx00 Remote Control"
37+ depends on PXA_SHARPSL
38+ default y
39+ help
40+ Say Y here to enable the remote on the Sharp Zaurus SL-Cxx00,
41+ SL-C1000, SL-C3000 and Sl-C3100 series of PDAs.
42+
43+ To compile this driver as a module, choose M here: the
44+ module will be called sharpsl_rc.
45+
46 config KEYBOARD_AMIGA
47 tristate "Amiga keyboard"
48 depends on AMIGA
49Index: linux-2.6.20/drivers/input/keyboard/Makefile
50===================================================================
51--- linux-2.6.20.orig/drivers/input/keyboard/Makefile
52+++ linux-2.6.20/drivers/input/keyboard/Makefile
53@@ -14,6 +14,7 @@ obj-$(CONFIG_KEYBOARD_NEWTON) += newton
54 obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
55 obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
56 obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
57+obj-$(CONFIG_SHARPSL_RC) += sharpsl_rc.o
58 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
59 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
60 obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
61Index: linux-2.6.20/drivers/input/keyboard/sharpsl_rc.c
62===================================================================
63--- /dev/null
64+++ linux-2.6.20/drivers/input/keyboard/sharpsl_rc.c
65@@ -0,0 +1,291 @@
66+/*
67+ * Keyboard driver for Sharp Clamshell Models (SL-Cxx00)
68+ *
69+ * Copyright (c) 2004-2005 Richard Purdie
70+ *
71+ * Based on corgikbd.c and Sharp's RC driver
72+ *
73+ * This program is free software; you can redistribute it and/or modify
74+ * it under the terms of the GNU General Public License version 2 as
75+ * published by the Free Software Foundation.
76+ *
77+ */
78+
79+#define DEBUG 1
80+#include <linux/delay.h>
81+#include <linux/platform_device.h>
82+#include <linux/init.h>
83+#include <linux/input.h>
84+#include <linux/interrupt.h>
85+#include <linux/jiffies.h>
86+#include <linux/module.h>
87+#include <linux/slab.h>
88+
89+#ifdef CONFIG_MACH_SPITZ
90+#include <asm/arch/spitz.h>
91+#endif
92+#ifdef CONFIG_MACH_CORGI
93+#include <asm/arch/corgi.h>
94+#endif
95+
96+#include <asm/arch/hardware.h>
97+#include <asm/arch/pxa-regs.h>
98+#include <asm/hardware/scoop.h>
99+#include <asm/arch/sharpsl.h>
100+#include <asm/hardware/sharpsl_pm.h>
101+
102+#define DPRINTK(fmt, args...) dev_dbg(data->dev, fmt "\n", ##args)
103+
104+struct remote_control_key {
105+ unsigned char min;
106+ unsigned char max;
107+ unsigned char key;
108+};
109+
110+#ifdef CONFIG_MACH_SPITZ
111+#define REMOTE_AKIN_PULLUP SPITZ_SCP2_AKIN_PULLUP
112+#define REMOTE_SCOOP_DEVICE spitzscoop2_device
113+#define REMOTE_GPIO_INT SPITZ_GPIO_AK_INT
114+#define REMOTE_IRQ_INT SPITZ_IRQ_GPIO_AK_INT
115+static struct remote_control_key remote_keys[] = {
116+ { 25, 35, KEY_STOPCD},
117+ { 55, 65, KEY_PLAYPAUSE},
118+ { 85, 95, KEY_NEXTSONG},
119+ { 115, 125, KEY_VOLUMEUP},
120+ { 145, 155, KEY_PREVIOUSSONG},
121+ { 180, 190, KEY_MUTE},
122+ { 215, 225, KEY_VOLUMEDOWN},
123+};
124+#endif
125+#ifdef CONFIG_MACH_CORGI
126+#define REMOTE_AKIN_PULLUP CORGI_SCP_AKIN_PULLUP
127+#define REMOTE_SCOOP_DEVICE corgiscoop_device
128+#define REMOTE_GPIO_INT CORGI_GPIO_AK_INT
129+#define REMOTE_IRQ_INT CORGI_IRQ_GPIO_AK_INT
130+static struct remote_control_key remote_keys[] = {
131+ //These need to be fixed for the CE-RH1's values
132+ { 25, 35, KEY_STOPCD},
133+ { 55, 65, KEY_PLAYPAUSE},
134+ { 85, 95, KEY_NEXTSONG},
135+ { 115, 125, KEY_VOLUMEUP},
136+ { 145, 155, KEY_PREVIOUSSONG},
137+ { 180, 190, KEY_MUTE},
138+ { 215, 225, KEY_VOLUMEDOWN},
139+};
140+#endif
141+
142+#define RELEASE_HI 230
143+#define MAX_EARPHONE 6
144+#define RC_POLL_MS 10
145+#define RC_FINISH_MS 500
146+#define WAIT_STATE 3
147+#define NOISE_THRESHOLD 100
148+
149+struct sharpsl_rc {
150+ struct input_dev *input;
151+ struct device *dev;
152+
153+ spinlock_t lock;
154+ struct timer_list rctimer;
155+ struct timer_list rctimer_finish;
156+
157+ unsigned int handling_press;
158+ unsigned int noise;
159+ unsigned int state;
160+ unsigned int last_key;
161+};
162+
163+static int get_remocon_raw(void)
164+{
165+ int i, val;
166+
167+ val = sharpsl_pm_pxa_read_max1111(MAX1111_REMCOM);
168+ for (i = 0; i < ARRAY_SIZE(remote_keys); ++i) {
169+ if (val >= remote_keys[i].min
170+ && val <= remote_keys[i].max) {
171+ printk("get_remocon_raw: VAL=%i, KEY=%i\n", val, remote_keys[i].key);
172+ return remote_keys[i].key;
173+ }
174+ }
175+ return 0;
176+}
177+
178+static irqreturn_t sharpsl_rc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
179+{
180+ struct sharpsl_rc *data = dev_id;
181+ DPRINTK("sharpsl_rc_interrupt %d\n", irq);
182+ if (!data->handling_press) {
183+ DPRINTK("handling interrupt");
184+ data->handling_press = 1;
185+ data->noise = 0;
186+ data->state = 0;
187+ data->last_key = 0;
188+
189+ reset_scoop_gpio(&REMOTE_SCOOP_DEVICE.dev, REMOTE_AKIN_PULLUP);
190+
191+ mod_timer(&data->rctimer, jiffies + msecs_to_jiffies(RC_POLL_MS));
192+ }
193+ return IRQ_HANDLED;
194+}
195+
196+static void sharpsl_rc_timer_callback(unsigned long dataPtr)
197+{
198+ struct sharpsl_rc *data = (struct sharpsl_rc *) dataPtr;
199+ int timer = 1;
200+ int key = get_remocon_raw();
201+ DPRINTK("timer callback, key: %d", key);
202+
203+ //wait for value to stabilize
204+ if (data->state < WAIT_STATE) {
205+ if (data->last_key != key) {
206+ ++data->noise;
207+ if (data->noise > NOISE_THRESHOLD) {
208+ DPRINTK("too much noise, bailing");
209+ timer = 0;
210+ }
211+ data->state = 0;
212+ } else {
213+ ++data->state;
214+ }
215+ data->last_key = key;
216+
217+ //stable value, send event
218+ } else if (data->state == WAIT_STATE) {
219+ data->noise = 0;
220+ //non-key returned, skip the rest of the states and bail now
221+ if (data->last_key == 0) {
222+ DPRINTK("non-key detected %d, noise: %d", data->last_key, data->noise);
223+ timer = 0;
224+ //send button press
225+ } else {
226+ DPRINTK("key press detected %d, noise %d", data->last_key, data->noise);
227+ input_report_key(data->input, data->last_key, 1);
228+ }
229+ ++data->state;
230+
231+ //wait until key is released
232+ } else if (data->state < WAIT_STATE * 2) {
233+ if (key == data->last_key
234+ && data->noise < NOISE_THRESHOLD) {
235+ data->state = WAIT_STATE + 1;
236+ ++data->noise;
237+ } else {
238+ ++data->state;
239+ }
240+ //key is released, send event
241+ } else {
242+ //send button release
243+ DPRINTK("release key %d", data->last_key);
244+ input_report_key(data->input, data->last_key, 0);
245+ timer = 0;
246+ }
247+ if (timer) {
248+ mod_timer(&data->rctimer, jiffies + msecs_to_jiffies(RC_POLL_MS));
249+ } else {
250+ set_scoop_gpio(&REMOTE_SCOOP_DEVICE.dev, REMOTE_AKIN_PULLUP);
251+ data->handling_press = 0;
252+ }
253+}
254+
255+static int __init sharpsl_rc_probe(struct platform_device *pdev)
256+{
257+ struct sharpsl_rc *sharpsl_rc;
258+ struct input_dev *input_dev;
259+ int i, ret;
260+
261+ dev_dbg(&pdev->dev, "sharpsl_rc_probe\n");
262+
263+ sharpsl_rc = kzalloc(sizeof(struct sharpsl_rc), GFP_KERNEL);
264+ input_dev = input_allocate_device();
265+ if (!sharpsl_rc || !input_dev) {
266+ kfree(sharpsl_rc);
267+ input_free_device(input_dev);
268+ return -ENOMEM;
269+ }
270+
271+ platform_set_drvdata(pdev, sharpsl_rc);
272+
273+ sharpsl_rc->dev = &pdev->dev;
274+ sharpsl_rc->input = input_dev;
275+ spin_lock_init(&sharpsl_rc->lock);
276+
277+ /* Init Remote Control Timer */
278+ init_timer(&sharpsl_rc->rctimer);
279+ sharpsl_rc->rctimer.function = sharpsl_rc_timer_callback;
280+ sharpsl_rc->rctimer.data = (unsigned long) sharpsl_rc;
281+
282+ input_dev->name = "Sharp Remote Control CE-RHX";
283+ input_dev->phys = "sharpsl_rc/input0";
284+ input_dev->id.bustype = BUS_HOST;
285+ input_dev->id.vendor = 0x0001;
286+ input_dev->id.product = 0x0001;
287+ input_dev->id.version = 0x0100;
288+ input_dev->cdev.dev = &pdev->dev;
289+ input_dev->private = sharpsl_rc;
290+
291+ input_dev->evbit[0] = BIT(EV_KEY);
292+
293+ for (i = 0; i <= ARRAY_SIZE(remote_keys); i++)
294+ set_bit(remote_keys[i].key, input_dev->keybit);
295+
296+ input_register_device(sharpsl_rc->input);
297+
298+ pxa_gpio_mode(REMOTE_GPIO_INT | GPIO_IN);
299+ ret = request_irq(REMOTE_IRQ_INT,
300+ sharpsl_rc_interrupt,
301+ IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED,
302+ "sharpsl_rc",
303+ sharpsl_rc);
304+ if (ret < 0) {
305+ dev_dbg(&pdev->dev, "Can't get IRQ: %d!\n", i);
306+ kfree(sharpsl_rc);
307+ input_free_device(input_dev);
308+ return ret;
309+ }
310+
311+ return 0;
312+}
313+
314+static int sharpsl_rc_remove(struct platform_device *pdev)
315+{
316+ struct sharpsl_rc *sharpsl_rc = platform_get_drvdata(pdev);
317+
318+ dev_dbg(&pdev->dev, "sharpsl_rc_remove\n");
319+
320+ free_irq(REMOTE_IRQ_INT, sharpsl_rc);
321+ del_timer_sync(&sharpsl_rc->rctimer);
322+ input_unregister_device(sharpsl_rc->input);
323+ kfree(sharpsl_rc);
324+
325+ return 0;
326+}
327+
328+static struct platform_driver sharpsl_rc_driver = {
329+ .probe = sharpsl_rc_probe,
330+ .remove = sharpsl_rc_remove,
331+ .suspend = NULL,
332+ .resume = NULL,
333+ .driver = {
334+ .name = "sharpsl-remote-control",
335+ },
336+};
337+
338+static int __devinit sharpsl_rc_init(void)
339+{
340+ printk("sharpsl_rc_init\n");
341+ return platform_driver_register(&sharpsl_rc_driver);
342+}
343+
344+static void __exit sharpsl_rc_exit(void)
345+{
346+ printk("sharpsl_rc_exit\n");
347+ platform_driver_unregister(&sharpsl_rc_driver);
348+}
349+
350+module_init(sharpsl_rc_init);
351+module_exit(sharpsl_rc_exit);
352+
353+MODULE_AUTHOR("Justin Patrin <papercrane@reversefold.com>");
354+MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
355+MODULE_DESCRIPTION("SharpSL Remote Control Driver");
356+MODULE_LICENSE("GPL");
357Index: linux-2.6.20/drivers/input/keyboard/spitzkbd.c
358===================================================================
359--- linux-2.6.20.orig/drivers/input/keyboard/spitzkbd.c
360+++ linux-2.6.20/drivers/input/keyboard/spitzkbd.c
361@@ -19,6 +19,7 @@
362 #include <linux/jiffies.h>
363 #include <linux/module.h>
364 #include <linux/slab.h>
365+#include <linux/kmod.h>
366
367 #include <asm/arch/spitz.h>
368 #include <asm/arch/hardware.h>
369@@ -279,13 +280,21 @@ static irqreturn_t spitzkbd_hinge_isr(in
370 static int sharpsl_hinge_state;
371 static int hinge_count;
372
373+void spitzkbd_handle_sharpsl_rc(void *arg) {
374+ request_module("sharpsl_rc");
375+}
376+
377+DECLARE_WORK(spitzkbd_work, spitzkbd_handle_sharpsl_rc);
378+
379 static void spitzkbd_hinge_timer(unsigned long data)
380 {
381 struct spitzkbd *spitzkbd_data = (struct spitzkbd *) data;
382 unsigned long state;
383 unsigned long flags;
384+ unsigned int headphone, remote;
385
386 state = GPLR(SPITZ_GPIO_SWA) & (GPIO_bit(SPITZ_GPIO_SWA)|GPIO_bit(SPITZ_GPIO_SWB));
387+ state |= (GPLR(SPITZ_GPIO_HP_IN) & GPIO_bit(SPITZ_GPIO_HP_IN));
388 state |= (GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT));
389 if (state != sharpsl_hinge_state) {
390 hinge_count = 0;
391@@ -299,9 +308,18 @@ static void spitzkbd_hinge_timer(unsigne
392
393 input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0));
394 input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0));
395- input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0));
396+
397+ headphone = ((GPLR(SPITZ_GPIO_HP_IN) & GPIO_bit(SPITZ_GPIO_HP_IN)) != 0);
398+ input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, headphone);
399+
400+ remote = headphone && ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) == 0);
401+ input_report_switch(spitzkbd_data->input, SW_REMOTE_INSERT, remote);
402 input_sync(spitzkbd_data->input);
403
404+ if (remote) {
405+ schedule_work(&spitzkbd_work);
406+ }
407+
408 spin_unlock_irqrestore(&spitzkbd_data->lock, flags);
409 } else {
410 mod_timer(&spitzkbd_data->htimer, jiffies + msecs_to_jiffies(HINGE_SCAN_INTERVAL));
411@@ -394,6 +412,7 @@ static int __init spitzkbd_probe(struct
412 set_bit(SW_LID, input_dev->swbit);
413 set_bit(SW_TABLET_MODE, input_dev->swbit);
414 set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
415+ set_bit(SW_REMOTE_INSERT, input_dev->swbit);
416
417 err = input_register_device(input_dev);
418 if (err)
419@@ -431,9 +450,12 @@ static int __init spitzkbd_probe(struct
420 request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr,
421 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
422 "Spitzkbd SWB", spitzkbd);
423- request_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd_hinge_isr,
424+ request_irq(SPITZ_IRQ_GPIO_HP_IN, spitzkbd_hinge_isr,
425 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
426 "Spitzkbd HP", spitzkbd);
427+ request_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd_hinge_isr,
428+ IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED,
429+ "Spitzkbd HP Type", spitzkbd);
430
431 return 0;
432
433@@ -454,6 +476,7 @@ static int spitzkbd_remove(struct platfo
434 free_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd);
435 free_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd);
436 free_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd);
437+ free_irq(SPITZ_IRQ_GPIO_HP_IN, spitzkbd);
438 free_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd);
439
440 del_timer_sync(&spitzkbd->htimer);
441Index: linux-2.6.20/arch/arm/mach-pxa/sharpsl.h
442===================================================================
443--- linux-2.6.20.orig/arch/arm/mach-pxa/sharpsl.h
444+++ linux-2.6.20/arch/arm/mach-pxa/sharpsl.h
445@@ -50,15 +50,10 @@ void spitz_wait_hsync(void);
446
447 #define READ_GPIO_BIT(x) (GPLR(x) & GPIO_bit(x))
448
449-/* MAX1111 Channel Definitions */
450-#define MAX1111_BATT_VOLT 4u
451-#define MAX1111_BATT_TEMP 2u
452-#define MAX1111_ACIN_VOLT 6u
453-
454 extern struct battery_thresh spitz_battery_levels_acin[];
455 extern struct battery_thresh spitz_battery_levels_noac[];
456 void sharpsl_pm_pxa_init(void);
457 void sharpsl_pm_pxa_remove(void);
458-int sharpsl_pm_pxa_read_max1111(int channel);
459+
460
461
462Index: linux-2.6.20/arch/arm/mach-pxa/sharpsl_pm.c
463===================================================================
464--- linux-2.6.20.orig/arch/arm/mach-pxa/sharpsl_pm.c
465+++ linux-2.6.20/arch/arm/mach-pxa/sharpsl_pm.c
466@@ -135,6 +135,8 @@ int sharpsl_pm_pxa_read_max1111(int chan
467 | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
468 }
469
470+EXPORT_SYMBOL(sharpsl_pm_pxa_read_max1111);
471+
472 void sharpsl_pm_pxa_init(void)
473 {
474 pxa_gpio_mode(sharpsl_pm.machinfo->gpio_acin | GPIO_IN);
475Index: linux-2.6.20/include/asm-arm/hardware/sharpsl_pm.h
476===================================================================
477--- linux-2.6.20.orig/include/asm-arm/hardware/sharpsl_pm.h
478+++ linux-2.6.20/include/asm-arm/hardware/sharpsl_pm.h
479@@ -104,3 +104,10 @@ irqreturn_t sharpsl_ac_isr(int irq, void
480 irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id);
481 irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id);
482
483+/* MAX1111 Channel Definitions */
484+#define MAX1111_REMCOM 0u
485+#define MAX1111_BATT_VOLT 4u
486+#define MAX1111_BATT_TEMP 2u
487+#define MAX1111_ACIN_VOLT 6u
488+
489+int sharpsl_pm_pxa_read_max1111(int channel);
490Index: linux-2.6.20/include/linux/input.h
491===================================================================
492--- linux-2.6.20.orig/include/linux/input.h
493+++ linux-2.6.20/include/linux/input.h
494@@ -602,6 +602,7 @@ struct input_absinfo {
495 #define SW_LID 0x00 /* set = lid shut */
496 #define SW_TABLET_MODE 0x01 /* set = tablet mode */
497 #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
498+#define SW_REMOTE_INSERT 0x04 /* set = remote */
499 #define SW_MAX 0x0f
500
501 /*
502Index: linux-2.6.20/arch/arm/mach-pxa/spitz_pm.c
503===================================================================
504--- linux-2.6.20.orig/arch/arm/mach-pxa/spitz_pm.c
505+++ linux-2.6.20/arch/arm/mach-pxa/spitz_pm.c
506@@ -161,6 +161,13 @@ static int spitz_should_wakeup(unsigned
507 if (resume_on_alarm && (PEDR & PWER_RTC))
508 is_resume |= PWER_RTC;
509
510+ printk("wakeup: PEDR: %x, PKSR: %x, HP_IN: %x, AK_INT: %x\n", PEDR, PKSR, GPIO_bit(SPITZ_GPIO_HP_IN), GPIO_bit(SPITZ_GPIO_AK_INT));
511+
512+ //remote/headphone interrupt, wakeup
513+ if (PEDR == 0 && (PKSR & 0xc0d01) != 0) {
514+ is_resume |= PWER_RTC;
515+ }
516+
517 dev_dbg(sharpsl_pm.dev, "is_resume: %x\n",is_resume);
518 return is_resume;
519 }
diff --git a/meta/packages/linux/linux-rp.inc b/meta/packages/linux/linux-rp.inc
index 10a4847455..aa40ee3041 100644
--- a/meta/packages/linux/linux-rp.inc
+++ b/meta/packages/linux/linux-rp.inc
@@ -17,10 +17,16 @@ EXTRA_OEMAKE = "OPENZAURUS_RELEASE=-${DISTRO_VERSION}"
17COMPATIBLE_HOST = "(arm|i.86).*-linux" 17COMPATIBLE_HOST = "(arm|i.86).*-linux"
18COMPATIBLE_MACHINE = '(collie|poodle|c7x0|akita|spitz|tosa|hx2000|qemuarm|qemux86|bootcdx86|htcuniversal)' 18COMPATIBLE_MACHINE = '(collie|poodle|c7x0|akita|spitz|tosa|hx2000|qemuarm|qemux86|bootcdx86|htcuniversal)'
19 19
20KERNEL_CUSTOM_NAME ?= ""
21KERNEL_DEPLOY_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${KERNEL_CUSTOM_NAME}${MACHINE}-${DATETIME}.bin"
22KERNEL_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${KERNEL_CUSTOM_NAME}${MACHINE}.bin"
23KERNEL_DEFCONFIG ?= "defconfig-${MACHINE}"
24
20CMDLINE_CON = "console=ttyS0,115200n8 console=tty1 noinitrd" 25CMDLINE_CON = "console=ttyS0,115200n8 console=tty1 noinitrd"
26CMDLINE_CON_collie = "console=ttySA0,115200n8 console=tty1 noinitrd"
21CMDLINE_CON_qemuarm = "console=ttyAMA0,115200n8 console=tty1 noinitrd" 27CMDLINE_CON_qemuarm = "console=ttyAMA0,115200n8 console=tty1 noinitrd"
22CMDLINE_ROOT = "root=/dev/mtdblock2 rootfstype=jffs2" 28CMDLINE_ROOT ?= "root=/dev/mtdblock2 rootfstype=jffs2"
23CMDLINE_ROOT_spitz = "root=/dev/hda1 rootfstype=ext3 rootdelay=1 rw" 29CMDLINE_ROOT_spitz ?= "root=/dev/hda1 rootfstype=ext3 rootdelay=1 rw"
24#CMDLINE_ROOT_spitz = "root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=3 rw" 30#CMDLINE_ROOT_spitz = "root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=3 rw"
25CMDLINE_OTHER = "dyntick=enable" 31CMDLINE_OTHER = "dyntick=enable"
26CMDLINE_DEBUG = '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "quiet", d)}' 32CMDLINE_DEBUG = '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "quiet", d)}'
@@ -53,6 +59,8 @@ module_autoload_snd-soc-corgi_c7x0 = "snd-soc-corgi"
53module_autoload_snd-soc-spitz_akita = "snd-soc-spitz" 59module_autoload_snd-soc-spitz_akita = "snd-soc-spitz"
54module_autoload_snd-soc-spitz_spitz = "snd-soc-spitz" 60module_autoload_snd-soc-spitz_spitz = "snd-soc-spitz"
55module_autoload_snd-soc-poodle_poodle = "snd-soc-poodle" 61module_autoload_snd-soc-poodle_poodle = "snd-soc-poodle"
62module_autoload_locomo-spi_collie = "locomo-spi"
63module_autoload_mmc_block_collie = "mmc_block"
56 64
57do_configure() { 65do_configure() {
58 rm -f ${S}/.config 66 rm -f ${S}/.config
@@ -64,7 +72,7 @@ do_configure() {
64 fi 72 fi
65 fi 73 fi
66 74
67 if [ ! -e ${WORKDIR}/defconfig-${MACHINE} ]; then 75 if [ ! -e ${WORKDIR}/${KERNEL_DEFCONFIG} ]; then
68 die "No default configuration for ${MACHINE} available." 76 die "No default configuration for ${MACHINE} available."
69 fi 77 fi
70 78
@@ -105,7 +113,7 @@ do_configure() {
105 echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config 113 echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config
106 fi 114 fi
107 115
108 if [ "${DISTRO}" = "openzaurus" ]; then 116 if [ "${DISTRO}" = "openzaurus" -a "${MACHINE}" != "collie" ]; then
109 case ${MACHINE} in 117 case ${MACHINE} in
110 c7x0 | akita | spitz ) 118 c7x0 | akita | spitz )
111 echo "CONFIG_LOGO_OZ640_CLUT224=y" >> ${S}/.config 119 echo "CONFIG_LOGO_OZ640_CLUT224=y" >> ${S}/.config
@@ -126,7 +134,7 @@ do_configure() {
126 echo "CONFIG_LOGO=y" >> ${S}/.config 134 echo "CONFIG_LOGO=y" >> ${S}/.config
127 echo "# CONFIG_LOGO_LINUX_CLUT224 is not set" >> ${S}/.config 135 echo "# CONFIG_LOGO_LINUX_CLUT224 is not set" >> ${S}/.config
128 echo "# CONFIG_LOGO_OHAND_CLUT224 is not set" >> ${S}/.config 136 echo "# CONFIG_LOGO_OHAND_CLUT224 is not set" >> ${S}/.config
129 elif [ "${DISTRO}" = "poky" ]; then 137 elif [ "${DISTRO}" = "poky" -a "${MACHINE}" != "collie" ]; then
130 echo "CONFIG_LOGO=y" >> ${S}/.config 138 echo "CONFIG_LOGO=y" >> ${S}/.config
131 echo "CONFIG_LOGO_OHAND_CLUT224=y" >> ${S}/.config 139 echo "CONFIG_LOGO_OHAND_CLUT224=y" >> ${S}/.config
132 echo "# CONFIG_LOGO_OZ240_CLUT224 is not set" >> ${S}/.config 140 echo "# CONFIG_LOGO_OZ240_CLUT224 is not set" >> ${S}/.config
@@ -155,7 +163,7 @@ do_configure() {
155 -e '/CONFIG_LOGO_OZ240_CLUT224=/d' \ 163 -e '/CONFIG_LOGO_OZ240_CLUT224=/d' \
156 -e '/CONFIG_LOGO_OZ480_CLUT224=/d' \ 164 -e '/CONFIG_LOGO_OZ480_CLUT224=/d' \
157 -e '/CONFIG_LOGO_OZ640_CLUT224=/d' \ 165 -e '/CONFIG_LOGO_OZ640_CLUT224=/d' \
158 '${WORKDIR}/defconfig-${MACHINE}' >>'${S}/.config' 166 '${WORKDIR}/${KERNEL_DEFCONFIG}' >>'${S}/.config'
159 167
160 yes '' | oe_runmake oldconfig 168 yes '' | oe_runmake oldconfig
161} 169}
@@ -186,11 +194,11 @@ do_compile_append() {
186 194
187do_deploy() { 195do_deploy() {
188 install -d ${DEPLOY_DIR_IMAGE} 196 install -d ${DEPLOY_DIR_IMAGE}
189 install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin 197 install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_DEPLOY_NAME}
190 rm -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin
191 cd ${DEPLOY_DIR_IMAGE} 198 cd ${DEPLOY_DIR_IMAGE}
192 ln -s ${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin ${KERNEL_IMAGETYPE}-${MACHINE}.bin 199 rm -f ${KERNEL_SYMLINK_NAME}
193 tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${KERNEL_RELEASE}-${MACHINE}.tgz -C ${D} lib 200 ln -s ${KERNEL_DEPLOY_NAME} ${KERNEL_SYMLINK_NAME}
201 tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${KERNEL_VERSION}-${MACHINE}.tgz -C ${D} lib
194} 202}
195 203
196do_deploy[dirs] = "${S}" 204do_deploy[dirs] = "${S}"
diff --git a/meta/packages/linux/linux-rp_2.6.21.bb b/meta/packages/linux/linux-rp_2.6.21.bb
index 682ab308e5..3f155942e9 100644
--- a/meta/packages/linux/linux-rp_2.6.21.bb
+++ b/meta/packages/linux/linux-rp_2.6.21.bb
@@ -1,6 +1,6 @@
1require linux-rp.inc 1require linux-rp.inc
2 2
3PR = "r7" 3PR = "r10"
4 4
5# Handy URLs 5# Handy URLs
6# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git;protocol=git;tag=ef7d1b244fa6c94fb76d5f787b8629df64ea4046 6# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git;protocol=git;tag=ef7d1b244fa6c94fb76d5f787b8629df64ea4046
@@ -49,8 +49,10 @@ SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2 \
49 ${RPSRC}/pxa_cf_initorder_hack-r1.patch;patch=1;status=hack \ 49 ${RPSRC}/pxa_cf_initorder_hack-r1.patch;patch=1;status=hack \
50 file://pxa-serial-hack.patch;patch=1;status=hack \ 50 file://pxa-serial-hack.patch;patch=1;status=hack \
51 file://connectplus-remove-ide-HACK.patch;patch=1;status=hack \ 51 file://connectplus-remove-ide-HACK.patch;patch=1;status=hack \
52 file://connectplus-prevent-oops-HACK.patch;patch=1;status=hack \
52 file://squashfs3.0-2.6.15.patch;patch=1;status=external \ 53 file://squashfs3.0-2.6.15.patch;patch=1;status=external \
53 file://vesafb-tng-1.0-rc2-2.6.20-rc2.patch;patch=1;status=external \ 54 file://vesafb-tng-1.0-rc2-2.6.20-rc2.patch;patch=1;status=external \
55 file://sharpsl-rc-r1.patch;patch=1 \
54 file://defconfig-c7x0 \ 56 file://defconfig-c7x0 \
55 file://defconfig-hx2000 \ 57 file://defconfig-hx2000 \
56 file://defconfig-collie \ 58 file://defconfig-collie \
@@ -72,16 +74,20 @@ SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2 \
72# (Pavel Machek's git tree has updated versions of this?) 74# (Pavel Machek's git tree has updated versions of this?)
73# ${JLSRC}/zaurus-lcd-2.6.11.diff.gz;patch=1 75# ${JLSRC}/zaurus-lcd-2.6.11.diff.gz;patch=1
74 76
75# These patches are extracted from Pavel Machek's git tree
76# (diff against vanilla kernel)
77SRC_URI_append_collie = "\ 77SRC_URI_append_collie = "\
78 ${DOSRC}/collie/mtd-sharp-flash-hack-r0.patch;patch=1 \ 78 ${TKSRC}/mtd-sharp-flash-hack-r2.patch;patch=1 \
79 ${DOSRC}/collie/collie-r0.patch;patch=1 \ 79 ${TKSRC}/ucb1x00-touch-audio-r1.patch;patch=1 \
80 ${DOSRC}/collie/locomolcd-backlight-r0.patch;patch=1 \ 80 ${TKSRC}/mcp-sa11x0-r0.patch;patch=1 \
81 ${DOSRC}/collie/ucb1x00-touch-audio-r0.patch;patch=1 \ 81 ${TKSRC}/sa1100-udc-r2.patch;patch=1 \
82 file://collie-mcp-r1.patch;patch=1 \ 82 ${TKSRC}/mmc_spi-r4.patch;patch=1 \
83 ${DOSRC}/collie/sa1100-udc-r0.patch;patch=1 \ 83 ${TKSRC}/locomo-r0.patch;patch=1 \
84# ${DOSRC}/collie/collie-pm-r1.patch;patch=1 \ 84 ${TKSRC}/collie-kexec.patch;patch=1 \
85 ${TKSRC}/locomo_spi-r4.patch;patch=1 \
86 ${TKSRC}/sharpsl_pm-r2.patch;patch=1 \
87 ${TKSRC}/collie_pm-r2.patch;patch=1 \
88 ${TKSRC}/locomokeyb_suspendkey-2.patch;patch=1 \
89 ${TKSRC}/pcmcia_suspend.patch;patch=1 \
90 ${TKSRC}/ucb1x00_suspend.patch;patch=1 \
85" 91"
86 92
87SRC_URI_append_tosa = "\ 93SRC_URI_append_tosa = "\