1 Index: linux-tosa/arch/arm/mach-pxa/tosa.c
2 ===================================================================
3 --- linux-tosa.orig/arch/arm/mach-pxa/tosa.c 2006-08-29 16:52:59.000000000 +0100
4 +++ linux-tosa/arch/arm/mach-pxa/tosa.c 2006-08-29 16:55:25.959706776 +0100
6 * Support for Sharp SL-C6000x PDAs
9 + * Copyright (c) 2006 Wolfson Microelectronics PLC.
10 * Copyright (c) 2005 Dirk Opfer
12 * Based on code written by Sharp/Lineo for 2.4 kernels
14 #include <asm/hardware/tmio.h>
15 #include <asm/mach/sharpsl_param.h>
17 +#include <linux/wm97xx.h>
28 + * Tosa Touchscreen device
31 +static struct wm97xx_machinfo tosa_ts_machinfo = {
32 + .get_hsync_time = tosa_get_hsync_time,
33 + .wait_hsync = tosa_wait_hsync,
40 GPSR(TOSA_GPIO_ON_RESET) = GPIO_bit(TOSA_GPIO_ON_RESET);
43 + wm97xx_unset_machinfo();
46 static void tosa_restart(void)
48 platform_scoop_config = &tosa_pcmcia_config;
50 platform_add_devices(devices, ARRAY_SIZE(devices));
52 + wm97xx_set_machinfo(&tosa_ts_machinfo);
55 static void __init fixup_tosa(struct machine_desc *desc,
56 Index: linux-tosa/arch/arm/mach-pxa/tosa_lcd.c
57 ===================================================================
58 --- linux-tosa.orig/arch/arm/mach-pxa/tosa_lcd.c 2006-08-29 16:52:59.000000000 +0100
59 +++ linux-tosa/arch/arm/mach-pxa/tosa_lcd.c 2006-08-29 16:55:32.818664056 +0100
62 * LCD / Backlight control code for Sharp SL-6000x (tosa)
64 + * Copyright (c) 2006 Wolfson Microelectronics PLC.
65 * Copyright (c) 2005 Dirk Opfer
67 * This program is free software; you can redistribute it and/or modify
69 static struct ssp_dev tosa_nssp_dev;
70 static struct ssp_state tosa_nssp_state;
71 static spinlock_t tosa_nssp_lock;
73 +static unsigned long hsync_time;
75 static unsigned short normal_i2c[] = {
78 pxa_nssp_output(TG_GPOSR,0x02); /* GPOS0=powercontrol, GPOS1=GPIO, GPOS2=TCTL */
81 +static unsigned long calc_hsync_time(const struct fb_videomode *mode) {
82 + /* The 25 and 44 'magic numbers' are from Sharp's 2.4 patches */
83 + if (mode->yres == 640) {
86 + if (mode->yres == 320) {
92 static void tosa_lcd_tg_on(struct device *dev, const struct fb_videomode *mode)
94 const int value = TG_REG0_COLOR | TG_REG0_UD | TG_REG0_LR;
96 /* set common voltage */
97 i2c_smbus_write_byte_data(tosa_i2c_dac, DAC_CH1, comadj);
100 + hsync_time = calc_hsync_time(mode);
103 static void tosa_lcd_tg_off(struct device *dev)
107 reset_scoop_gpio( &tosascoop_jc_device.dev,TOSA_SCOOP_JC_TC3693_L3V_ON);
112 static int tosa_detect_client(struct i2c_adapter* adapter, int address, int kind) {
117 +unsigned long tosa_get_hsync_time(void)
119 +/* This method should eventually contain the correct algorithm for calculating
127 +void tosa_wait_hsync(void)
129 + /* Waits for a rising edge on the VGA line */
130 + while((GPLR(TOSA_GPIO_VGA_LINE) & GPIO_bit(TOSA_GPIO_VGA_LINE)) == 0);
131 + while((GPLR(TOSA_GPIO_VGA_LINE) & GPIO_bit(TOSA_GPIO_VGA_LINE)) != 0);
134 static struct i2c_driver tosa_driver={
135 .id = TOSA_LCD_I2C_DEVICEID,
136 .attach_adapter = tosa_attach_adapter,
137 Index: linux-tosa/include/asm-arm/arch-pxa/tosa.h
138 ===================================================================
139 --- linux-tosa.orig/include/asm-arm/arch-pxa/tosa.h 2006-08-29 16:52:59.000000000 +0100
140 +++ linux-tosa/include/asm-arm/arch-pxa/tosa.h 2006-08-29 16:55:12.442761664 +0100
143 * Hardware specific definitions for Sharp SL-C6000x series of PDAs
145 + * Copyright (c) 2006 Wolfson Microelectronics PLC.
146 * Copyright (c) 2005 Dirk Opfer
148 * Based on Sharp's 2.4 kernel patches
150 extern struct platform_device tosascoop_jc_device;
151 extern struct platform_device tosascoop_device;
152 extern struct platform_device tc6393_device;
154 +unsigned long tosa_get_hsync_time(void);
155 +void tosa_wait_hsync(void);
157 #endif /* _ASM_ARCH_TOSA_H_ */