3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- linux/drivers/char/tosa_ts.c~tosa_ts.patch
7 +++ linux/drivers/char/tosa_ts.c
9 static int head = 0, tail = 0;
12 +#include <linux/pm.h>
13 +static struct pm_dev* tosa_ts_pm_dev;
14 static int tp_suspend = 0;
15 #endif /* CONFIG_PM */
21 -static void ts_exit(void)
25 - free_irq(IRQ_GPIO_TP_INT, NULL);
26 - wm9712_power_mode_ts(WM9712_PWR_OFF);
28 - pxa_ac97_put(&ac97_on);
32 -static void __exit ac97_ts_cleanup(void)
35 - unregister_chrdev(TS_MAJOR, "ts");
37 -module_exit(ac97_ts_cleanup);
40 extern int tc6393fb_lcdMode;
42 int ac97_ad_input(int ch, unsigned short *dat)
47 -static int ts_init(void)
48 +static int tosa_ts_hardware_start(void)
50 pxa_ac97_get(&codec, &ac97_on);
53 /* GPIO3/PENDOWN wakeup */
54 ac97_bit_set(AC97_GPIO_WAKE_UP, CODEC_PENDOWN);
59 //X kernel_thread(ts_pendown, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);
64 - // printk(KERN_INFO "Tosa Touch Screen driver initialized\n");
69 -static int __init ac97_ts_init(void)
70 +static void tosa_ts_hardware_stop(void)
74 + free_irq(IRQ_GPIO_TP_INT, NULL);
75 + wm9712_power_mode_ts(WM9712_PWR_OFF);
77 + pxa_ac97_put(&ac97_on);
81 +static int tosa_ts_pm_callback(struct pm_dev *pm_dev,
82 + pm_request_t req, void *data)
87 + tosa_ts_hardware_stop();
91 + tosa_ts_hardware_start();
99 +static int __init tosa_ts_init(void)
103 @@ -663,28 +672,37 @@
105 if( register_chrdev(TS_MAJOR,DEV_NAME, &ts_fops) ) {
106 printk("unable to get major %d for touch screen\n", TS_MAJOR);
112 + tosa_ts_hardware_start();
115 + tosa_ts_pm_dev = pm_register(PM_SYS_DEV, 0, tosa_ts_pm_callback);
118 kernel_thread(ts_pendown, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);
123 -module_init(ac97_ts_init);
124 +static int __exit tosa_ts_cleanup()
126 + tosa_hardware_stop();
127 + pm_unregister(tosa_ts_pm_dev);
128 + unregister_chrdev(TS_MAJOR, "ts");
131 +module_init(tosa_ts_init);
132 +module_exit(tosa_ts_cleanup);
137 static int ts_open(struct inode *inode, struct file *file)
139 - if( ts_init() < 0 ) {
150 static int ts_release(struct inode *inode, struct file *file)
161 -void tosa_ts_suspend(void)
163 - DEBUG(DBG_L1, "in\n");
166 - DEBUG(DBG_L1, "out\n");
169 -void tosa_ts_resume(void)
171 - DEBUG(DBG_L1, "in\n");
174 - DEBUG(DBG_L1, "out\n");
176 -#endif /* CONFIG_PM */
177 --- linux/drivers/sound/pxa-ac97_tosa.c~tosa_ts.patch
178 +++ linux/drivers/sound/pxa-ac97_tosa.c
180 #include <linux/pm.h>
181 static struct pm_dev* pxa_sound_pm_dev;
182 static int tosa_pm_callback(struct pm_dev *,pm_request_t, void *);
183 -extern void tosa_ts_suspend(void);
184 -extern void tosa_ts_resume(void);
185 #endif /* CONFIG_PM */
187 /************************************************************
188 @@ -2195,9 +2193,6 @@
190 DEBUG(DBG_L1, "PM_SUSPEND: start\n");
192 -#ifdef CONFIG_TOSA_TS
194 -#endif /* CONFIG_TOSA_TS */
195 if ( ac97_audio_state.rd_ref != 0 ) {
196 audio_clear_buf(ac97_audio_state.input_stream);
197 *ac97_audio_state.input_stream->drcmr = 0;
198 @@ -2239,9 +2234,6 @@
199 ac97_audio_state.input_stream->dma_ch = err;
202 -#ifdef CONFIG_TOSA_TS
204 -#endif /* CONFIG_TOSA_TS */
205 DEBUG(DBG_L1, "PM_RESUME: done\n");