]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050602/P06-C3000-WRITETS_041206.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / openzaurus-pxa27x-2.4.20-rmk2-embedix20050602 / P06-C3000-WRITETS_041206.patch
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
4 @@ -166,6 +166,7 @@
5     fi
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
11     fi
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
15 @@ -87,7 +87,7 @@
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>
22  #endif
23  
24 @@ -1000,6 +1000,24 @@
25  }
26  #endif
27  
28 +/// write ts data
29 +#if defined(CONFIG_SL_WRITE_TS)
30 +static void write_new_data(TS_EVENT write_data)
31 +{
32 +       write_data.millisecs = jiffies;
33 +       tbuf[head++] = write_data;
34 +
35 +       if (head >= BUFSIZE) { head = 0; }
36 +
37 +       if (head == tail && ++tail >= BUFSIZE) { tail = 0; }
38 +
39 +       if (fasync)
40 +               kill_fasync(&fasync, SIGIO, POLL_IN);
41 +
42 +       wake_up_interruptible(&queue);
43 +}
44 +#endif
45 +
46  static void cotulla_main_ts_timer(unsigned long irq)
47  {
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)
51  {
52  #if defined(CONFIG_ARCH_PXA_CORGI)
53 -       unsigned long param;
54 -       char *endp;
55 -       wait_after_sync_hs = simple_strtoul(buffer, &endp, 0);
56 -       return count+endp-buffer;
57 +       char *endp;
58 +#if defined(CONFIG_SL_WRITE_TS)
59 +
60 +       static TS_EVENT data, raw_data;
61 +       char tmp[50];
62 +       int len;
63 +       len=49;
64 +       if(len>count) len=count;
65 +       copy_from_user(tmp,buffer,len);
66 +       tmp[len]='\0';
67 +
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);
70 +
71 +               if (cal_ok) {
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;
74 +
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;
77 +
78 +               } else {
79 +                       raw_data.x = data.x;
80 +                       raw_data.y = data.y;
81 +               }
82 +
83 +               if (xyswap) {
84 +                   short tmp = raw_data.x;
85 +                   raw_data.x = raw_data.y;
86 +                   raw_data.y = tmp;
87 +               }
88 +
89 +               raw_data.pressure = data.pressure;
90 +               raw_data.millisecs = data.millisecs;
91 +
92 +               write_new_data(raw_data);
93 +               return count;
94 +
95 +       }else {
96 +#endif
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;
100 +
101 +#if defined(CONFIG_SL_WRITE_TS)
102 +       }
103 +#endif
104 +
105  #else
106         return 0;
107  #endif