1 diff -Nur c3000_pre/linux/drivers/char/Config.in c3000_work/linux/drivers/char/Config.in
2 --- c3000_pre/linux/drivers/char/Config.in 2004-12-06 16:38:50.000000000 +0900
3 +++ c3000_work/linux/drivers/char/Config.in 2004-12-06 16:41:03.000000000 +0900
6 bool ' SL-series touchscreen pressure value read (EXPERIMENTAL)' CONFIG_SL_TS_PRESSURE
7 dep_bool ' Boot On touchscreen pressure value read' CONFIG_BOOT_PRESSURE_ON $CONFIG_SL_TS_PRESSURE
8 + bool ' SL-series write ts data (EXPERIMENTAL)' CONFIG_SL_WRITE_TS
9 if [ "$CONFIG_SERIAL_SL_SERIES" = "y" ]; then
10 bool ' SL-series Bluetooth support' CONFIG_BLUETOOTH_SL
12 diff -Nur c3000_pre/linux/drivers/char/ads7846_ts.c c3000_work/linux/drivers/char/ads7846_ts.c
13 --- c3000_pre/linux/drivers/char/ads7846_ts.c 2004-12-06 16:38:50.000000000 +0900
14 +++ c3000_work/linux/drivers/char/ads7846_ts.c 2004-12-06 16:50:50.000000000 +0900
16 static int head, tail, sample;
17 static char pendown = 0;
18 static unsigned long Pressure;
19 -#if defined(CONFIG_SL_TS_PRESSURE)
20 +#if defined(CONFIG_SL_TS_PRESSURE) || defined(CONFIG_SL_WRITE_TS)
21 #include <linux/proc_fs.h>
24 @@ -1000,6 +1000,24 @@
29 +#if defined(CONFIG_SL_WRITE_TS)
30 +static void write_new_data(TS_EVENT write_data)
32 + write_data.millisecs = jiffies;
33 + tbuf[head++] = write_data;
35 + if (head >= BUFSIZE) { head = 0; }
37 + if (head == tail && ++tail >= BUFSIZE) { tail = 0; }
40 + kill_fasync(&fasync, SIGIO, POLL_IN);
42 + wake_up_interruptible(&queue);
46 static void cotulla_main_ts_timer(unsigned long irq)
48 // ts_interrupt(irq, NULL, NULL);
49 @@ -1346,10 +1364,54 @@
50 static ssize_t ts_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
52 #if defined(CONFIG_ARCH_PXA_CORGI)
53 - unsigned long param;
55 - wait_after_sync_hs = simple_strtoul(buffer, &endp, 0);
56 - return count+endp-buffer;
58 +#if defined(CONFIG_SL_WRITE_TS)
60 + static TS_EVENT data, raw_data;
64 + if(len>count) len=count;
65 + copy_from_user(tmp,buffer,len);
68 + if (sscanf(tmp,"%d %d %d %d",&data.pressure, &data.x, &data.y, &data.millisecs) == 4) {
69 +// printk("pressure= %d : x= %d : y= %d : millosecs= %d\n", data.pressure, data.x, data.y, data.millisecs);
72 + raw_data.x = (x_rev) ? raw_max_x - ((raw_max_x - raw_min_x) * data.x) / res_x
73 + : raw_min_x + ((raw_max_x - raw_min_x) * data.x) / res_x;
75 + raw_data.y = (y_rev) ? raw_max_y - ((raw_max_y - raw_min_y) * data.y) / res_y
76 + : raw_min_y + ((raw_max_y - raw_min_y) * data.y) / res_y;
79 + raw_data.x = data.x;
80 + raw_data.y = data.y;
84 + short tmp = raw_data.x;
85 + raw_data.x = raw_data.y;
89 + raw_data.pressure = data.pressure;
90 + raw_data.millisecs = data.millisecs;
92 + write_new_data(raw_data);
97 + wait_after_sync_hs = simple_strtol(buffer, &endp, 0);
98 + printk("Wait_after_sync_hs: %d\n",(int) wait_after_sync_hs);
99 + return count+endp-buffer;
101 +#if defined(CONFIG_SL_WRITE_TS)