Commit 3e36c0de authored by Eric Miao's avatar Eric Miao

[ARM] pxa: make ads7846 on corgi and spitz to sync on HSYNC

Signed-off-by: default avatarEric Miao <eric.miao@marvell.com>
parent 36b5437f
...@@ -427,12 +427,22 @@ static struct pxa2xx_spi_master corgi_spi_info = { ...@@ -427,12 +427,22 @@ static struct pxa2xx_spi_master corgi_spi_info = {
.num_chipselect = 3, .num_chipselect = 3,
}; };
static void corgi_wait_for_hsync(void)
{
while (gpio_get_value(CORGI_GPIO_HSYNC))
cpu_relax();
while (!gpio_get_value(CORGI_GPIO_HSYNC))
cpu_relax();
}
static struct ads7846_platform_data corgi_ads7846_info = { static struct ads7846_platform_data corgi_ads7846_info = {
.model = 7846, .model = 7846,
.vref_delay_usecs = 100, .vref_delay_usecs = 100,
.x_plate_ohms = 419, .x_plate_ohms = 419,
.y_plate_ohms = 486, .y_plate_ohms = 486,
.gpio_pendown = CORGI_GPIO_TP_INT, .gpio_pendown = CORGI_GPIO_TP_INT,
.wait_for_sync = corgi_wait_for_hsync,
}; };
static void corgi_ads7846_cs(u32 command) static void corgi_ads7846_cs(u32 command)
......
...@@ -299,12 +299,22 @@ static struct pxa2xx_spi_master spitz_spi_info = { ...@@ -299,12 +299,22 @@ static struct pxa2xx_spi_master spitz_spi_info = {
.num_chipselect = 3, .num_chipselect = 3,
}; };
static void spitz_wait_for_hsync(void)
{
while (gpio_get_value(SPITZ_GPIO_HSYNC))
cpu_relax();
while (!gpio_get_value(SPITZ_GPIO_HSYNC))
cpu_relax();
}
static struct ads7846_platform_data spitz_ads7846_info = { static struct ads7846_platform_data spitz_ads7846_info = {
.model = 7846, .model = 7846,
.vref_delay_usecs = 100, .vref_delay_usecs = 100,
.x_plate_ohms = 419, .x_plate_ohms = 419,
.y_plate_ohms = 486, .y_plate_ohms = 486,
.gpio_pendown = SPITZ_GPIO_TP_INT, .gpio_pendown = SPITZ_GPIO_TP_INT,
.wait_for_sync = spitz_wait_for_hsync,
}; };
static void spitz_ads7846_cs(u32 command) static void spitz_ads7846_cs(u32 command)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment