Commit 7db74d5e authored by Ilya Yanok's avatar Ilya Yanok Committed by Tony Lindgren

ARM: OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided

If platform data is provided by the caller gpio_pendown is put into
unused static ads7846_config structure and effectively has no effect.
Of course caller can set gpio_pendown field in platform data himself
but it seems natural to do this in ads7846_init to remove duplication.
Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
Signed-off-by: default avatarIlya Yanok <yanok@emcraft.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 17e22cac
...@@ -76,13 +76,15 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, ...@@ -76,13 +76,15 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
gpio_set_debounce(gpio_pendown, gpio_debounce); gpio_set_debounce(gpio_pendown, gpio_debounce);
} }
ads7846_config.gpio_pendown = gpio_pendown;
spi_bi->bus_num = bus_num; spi_bi->bus_num = bus_num;
spi_bi->irq = OMAP_GPIO_IRQ(gpio_pendown); spi_bi->irq = OMAP_GPIO_IRQ(gpio_pendown);
if (board_pdata) if (board_pdata) {
board_pdata->gpio_pendown = gpio_pendown;
spi_bi->platform_data = board_pdata; spi_bi->platform_data = board_pdata;
} else {
ads7846_config.gpio_pendown = gpio_pendown;
}
spi_register_board_info(&ads7846_spi_board_info, 1); spi_register_board_info(&ads7846_spi_board_info, 1);
} }
......
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