diff options
author | Eric Miao <eric.miao@marvell.com> | 2009-02-06 03:49:23 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-04-26 23:45:53 -0400 |
commit | 3e36c0deea118e277f4ff9fa947bcde5f88426ca (patch) | |
tree | da650c6368cf1bbce39666466998a39b53880368 | |
parent | 36b5437f33fb95196bef2345dede39fdcab3e431 (diff) |
[ARM] pxa: make ads7846 on corgi and spitz to sync on HSYNC
Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r-- | arch/arm/mach-pxa/corgi.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index cdf21dd135b4..930e364ccde9 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -427,12 +427,22 @@ static struct pxa2xx_spi_master corgi_spi_info = { | |||
427 | .num_chipselect = 3, | 427 | .num_chipselect = 3, |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static void corgi_wait_for_hsync(void) | ||
431 | { | ||
432 | while (gpio_get_value(CORGI_GPIO_HSYNC)) | ||
433 | cpu_relax(); | ||
434 | |||
435 | while (!gpio_get_value(CORGI_GPIO_HSYNC)) | ||
436 | cpu_relax(); | ||
437 | } | ||
438 | |||
430 | static struct ads7846_platform_data corgi_ads7846_info = { | 439 | static struct ads7846_platform_data corgi_ads7846_info = { |
431 | .model = 7846, | 440 | .model = 7846, |
432 | .vref_delay_usecs = 100, | 441 | .vref_delay_usecs = 100, |
433 | .x_plate_ohms = 419, | 442 | .x_plate_ohms = 419, |
434 | .y_plate_ohms = 486, | 443 | .y_plate_ohms = 486, |
435 | .gpio_pendown = CORGI_GPIO_TP_INT, | 444 | .gpio_pendown = CORGI_GPIO_TP_INT, |
445 | .wait_for_sync = corgi_wait_for_hsync, | ||
436 | }; | 446 | }; |
437 | 447 | ||
438 | static void corgi_ads7846_cs(u32 command) | 448 | static void corgi_ads7846_cs(u32 command) |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 8c61ddac119e..c18e34acafcb 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -299,12 +299,22 @@ static struct pxa2xx_spi_master spitz_spi_info = { | |||
299 | .num_chipselect = 3, | 299 | .num_chipselect = 3, |
300 | }; | 300 | }; |
301 | 301 | ||
302 | static void spitz_wait_for_hsync(void) | ||
303 | { | ||
304 | while (gpio_get_value(SPITZ_GPIO_HSYNC)) | ||
305 | cpu_relax(); | ||
306 | |||
307 | while (!gpio_get_value(SPITZ_GPIO_HSYNC)) | ||
308 | cpu_relax(); | ||
309 | } | ||
310 | |||
302 | static struct ads7846_platform_data spitz_ads7846_info = { | 311 | static struct ads7846_platform_data spitz_ads7846_info = { |
303 | .model = 7846, | 312 | .model = 7846, |
304 | .vref_delay_usecs = 100, | 313 | .vref_delay_usecs = 100, |
305 | .x_plate_ohms = 419, | 314 | .x_plate_ohms = 419, |
306 | .y_plate_ohms = 486, | 315 | .y_plate_ohms = 486, |
307 | .gpio_pendown = SPITZ_GPIO_TP_INT, | 316 | .gpio_pendown = SPITZ_GPIO_TP_INT, |
317 | .wait_for_sync = spitz_wait_for_hsync, | ||
308 | }; | 318 | }; |
309 | 319 | ||
310 | static void spitz_ads7846_cs(u32 command) | 320 | static void spitz_ads7846_cs(u32 command) |