summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-05-20 09:22:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 14:17:42 +0200
commit62d725b1d38856c50aebc5542707c6f5ea07a451 (patch)
treea34e75148b647ff4615a730ad4d7380e429d7168 /arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
parentebb4fc821d02b356a3685dc03c2948744a84c28e (diff)
downloadlwn-62d725b1d38856c50aebc5542707c6f5ea07a451.tar.gz
lwn-62d725b1d38856c50aebc5542707c6f5ea07a451.zip
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/arm/mach-mx2/eukrea_mbimx27-baseboard.c')
-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 @@
#include <mach/hardware.h>
#include <mach/mmc.h>
#include <mach/imx-uart.h>
+#include <mach/spi.h>
#include "devices.h"
@@ -88,7 +89,6 @@ static int eukrea_mbimx27_pins[] = {
PA30_PF_CONTRAST,
PA31_PF_OE_ACD,
/* SPI1 */
- PD28_PF_CSPI1_SS0,
PD29_PF_CSPI1_SCLK,
PD30_PF_CSPI1_MISO,
PD31_PF_CSPI1_MOSI,
@@ -236,7 +236,7 @@ static struct imxuart_platform_data uart_pdata[] = {
},
};
-#if defined(CONFIG_TOUCHSCREEN_ADS7846)
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) \
|| defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
#define ADS7846_PENDOWN (GPIO_PORTD | 25)
@@ -247,7 +247,6 @@ static void ads7846_dev_init(void)
printk(KERN_ERR "can't get ads746 pen down GPIO\n");
return;
}
-
gpio_direction_input(ADS7846_PENDOWN);
}
@@ -260,7 +259,9 @@ static struct ads7846_platform_data ads7846_config __initdata = {
.get_pendown_state = ads7846_get_pendown_state,
.keep_vref_on = 1,
};
+#endif
+#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = {
[0] = {
.modalias = "ads7846",
@@ -305,15 +306,19 @@ void __init eukrea_mbimx27_baseboard_init(void)
mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data);
mxc_register_device(&mxc_sdhc_device0, NULL);
-#if defined(CONFIG_TOUCHSCREEN_ADS7846)
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) \
|| defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
- /* SPI and ADS7846 Touchscreen controler init */
- mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
+ /* ADS7846 Touchscreen controller init */
mxc_gpio_mode(GPIO_PORTD | 25 | GPIO_GPIO | GPIO_IN);
+ ads7846_dev_init();
+#endif
+
+#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
+ /* SPI_CS0 init */
+ mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
mxc_register_device(&mxc_spi_device0, &eukrea_mbimx27_spi_0_data);
spi_register_board_info(eukrea_mbimx27_spi_board_info,
ARRAY_SIZE(eukrea_mbimx27_spi_board_info));
- ads7846_dev_init();
#endif
/* Leds configuration */