diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2010-02-04 09:41:39 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-09 00:30:51 -0500 |
commit | fe5b25c09873faee44077ee6ff8f23eee61b0fa0 (patch) | |
tree | d8879e7869aca5bad4941d69b4c16082cf1a9858 | |
parent | ddaebcabbc18811ac4ac6e84fb9c327e8393a1dc (diff) |
Blackfin: bf537-stamp: add example ADS7846 touchscreen resources
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 9bc7bd3f35f8..7a1d645bbfbb 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -825,6 +825,29 @@ static inline void adf702x_mac_init(void) | |||
825 | static inline void adf702x_mac_init(void) {} | 825 | static inline void adf702x_mac_init(void) {} |
826 | #endif | 826 | #endif |
827 | 827 | ||
828 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
829 | #include <linux/spi/ads7846.h> | ||
830 | static struct bfin5xx_spi_chip ad7873_spi_chip_info = { | ||
831 | .bits_per_word = 8, | ||
832 | }; | ||
833 | |||
834 | static int ads7873_get_pendown_state(void) | ||
835 | { | ||
836 | return gpio_get_value(GPIO_PF6); | ||
837 | } | ||
838 | |||
839 | static struct ads7846_platform_data __initdata ad7873_pdata = { | ||
840 | .model = 7873, /* AD7873 */ | ||
841 | .x_max = 0xfff, | ||
842 | .y_max = 0xfff, | ||
843 | .x_plate_ohms = 620, | ||
844 | .debounce_max = 1, | ||
845 | .debounce_rep = 0, | ||
846 | .debounce_tol = (~0), | ||
847 | .get_pendown_state = ads7873_get_pendown_state, | ||
848 | }; | ||
849 | #endif | ||
850 | |||
828 | #if defined(CONFIG_MTD_DATAFLASH) \ | 851 | #if defined(CONFIG_MTD_DATAFLASH) \ |
829 | || defined(CONFIG_MTD_DATAFLASH_MODULE) | 852 | || defined(CONFIG_MTD_DATAFLASH_MODULE) |
830 | 853 | ||
@@ -1026,7 +1049,18 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
1026 | .mode = SPI_MODE_0, | 1049 | .mode = SPI_MODE_0, |
1027 | }, | 1050 | }, |
1028 | #endif | 1051 | #endif |
1029 | 1052 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | |
1053 | { | ||
1054 | .modalias = "ads7846", | ||
1055 | .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */ | ||
1056 | .bus_num = 0, | ||
1057 | .irq = IRQ_PF6, | ||
1058 | .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */ | ||
1059 | .controller_data = &ad7873_spi_chip_info, | ||
1060 | .platform_data = &ad7873_pdata, | ||
1061 | .mode = SPI_MODE_0, | ||
1062 | }, | ||
1063 | #endif | ||
1030 | }; | 1064 | }; |
1031 | 1065 | ||
1032 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 1066 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |