aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-05-20 03:22:28 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:17:42 -0400
commit62d725b1d38856c50aebc5542707c6f5ea07a451 (patch)
treea34e75148b647ff4615a730ad4d7380e429d7168 /arch
parentebb4fc821d02b356a3685dc03c2948744a84c28e (diff)
eukrea_mbimx27: fix ADS7846 support
Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
index fff6c8dc4b3b..385abd100002 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -35,6 +35,7 @@
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/mmc.h> 36#include <mach/mmc.h>
37#include <mach/imx-uart.h> 37#include <mach/imx-uart.h>
38#include <mach/spi.h>
38 39
39#include "devices.h" 40#include "devices.h"
40 41
@@ -88,7 +89,6 @@ static int eukrea_mbimx27_pins[] = {
88 PA30_PF_CONTRAST, 89 PA30_PF_CONTRAST,
89 PA31_PF_OE_ACD, 90 PA31_PF_OE_ACD,
90 /* SPI1 */ 91 /* SPI1 */
91 PD28_PF_CSPI1_SS0,
92 PD29_PF_CSPI1_SCLK, 92 PD29_PF_CSPI1_SCLK,
93 PD30_PF_CSPI1_MISO, 93 PD30_PF_CSPI1_MISO,
94 PD31_PF_CSPI1_MOSI, 94 PD31_PF_CSPI1_MOSI,
@@ -236,7 +236,7 @@ static struct imxuart_platform_data uart_pdata[] = {
236 }, 236 },
237}; 237};
238 238
239#if defined(CONFIG_TOUCHSCREEN_ADS7846) 239#if defined(CONFIG_TOUCHSCREEN_ADS7846) \
240 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 240 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
241 241
242#define ADS7846_PENDOWN (GPIO_PORTD | 25) 242#define ADS7846_PENDOWN (GPIO_PORTD | 25)
@@ -247,7 +247,6 @@ static void ads7846_dev_init(void)
247 printk(KERN_ERR "can't get ads746 pen down GPIO\n"); 247 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
248 return; 248 return;
249 } 249 }
250
251 gpio_direction_input(ADS7846_PENDOWN); 250 gpio_direction_input(ADS7846_PENDOWN);
252} 251}
253 252
@@ -260,7 +259,9 @@ static struct ads7846_platform_data ads7846_config __initdata = {
260 .get_pendown_state = ads7846_get_pendown_state, 259 .get_pendown_state = ads7846_get_pendown_state,
261 .keep_vref_on = 1, 260 .keep_vref_on = 1,
262}; 261};
262#endif
263 263
264#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
264static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = { 265static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = {
265 [0] = { 266 [0] = {
266 .modalias = "ads7846", 267 .modalias = "ads7846",
@@ -305,15 +306,19 @@ void __init eukrea_mbimx27_baseboard_init(void)
305 mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data); 306 mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data);
306 mxc_register_device(&mxc_sdhc_device0, NULL); 307 mxc_register_device(&mxc_sdhc_device0, NULL);
307 308
308#if defined(CONFIG_TOUCHSCREEN_ADS7846) 309#if defined(CONFIG_TOUCHSCREEN_ADS7846) \
309 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 310 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
310 /* SPI and ADS7846 Touchscreen controler init */ 311 /* ADS7846 Touchscreen controller init */
311 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
312 mxc_gpio_mode(GPIO_PORTD | 25 | GPIO_GPIO | GPIO_IN); 312 mxc_gpio_mode(GPIO_PORTD | 25 | GPIO_GPIO | GPIO_IN);
313 ads7846_dev_init();
314#endif
315
316#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
317 /* SPI_CS0 init */
318 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
313 mxc_register_device(&mxc_spi_device0, &eukrea_mbimx27_spi_0_data); 319 mxc_register_device(&mxc_spi_device0, &eukrea_mbimx27_spi_0_data);
314 spi_register_board_info(eukrea_mbimx27_spi_board_info, 320 spi_register_board_info(eukrea_mbimx27_spi_board_info,
315 ARRAY_SIZE(eukrea_mbimx27_spi_board_info)); 321 ARRAY_SIZE(eukrea_mbimx27_spi_board_info));
316 ads7846_dev_init();
317#endif 322#endif
318 323
319 /* Leds configuration */ 324 /* Leds configuration */