diff options
Diffstat (limited to 'arch/arm/mach-at91/board-sam9263ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 8fdce11a880c..f57458559fb6 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
28 | #include <linux/spi/ads7846.h> | ||
28 | 29 | ||
29 | #include <asm/hardware.h> | 30 | #include <asm/hardware.h> |
30 | #include <asm/setup.h> | 31 | #include <asm/setup.h> |
@@ -86,6 +87,40 @@ static struct at91_udc_data __initdata ek_udc_data = { | |||
86 | 87 | ||
87 | 88 | ||
88 | /* | 89 | /* |
90 | * ADS7846 Touchscreen | ||
91 | */ | ||
92 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
93 | static int ads7843_pendown_state(void) | ||
94 | { | ||
95 | return !at91_get_gpio_value(AT91_PIN_PA15); /* Touchscreen PENIRQ */ | ||
96 | } | ||
97 | |||
98 | static struct ads7846_platform_data ads_info = { | ||
99 | .model = 7843, | ||
100 | .x_min = 150, | ||
101 | .x_max = 3830, | ||
102 | .y_min = 190, | ||
103 | .y_max = 3830, | ||
104 | .vref_delay_usecs = 100, | ||
105 | .x_plate_ohms = 450, | ||
106 | .y_plate_ohms = 250, | ||
107 | .pressure_max = 15000, | ||
108 | .debounce_max = 1, | ||
109 | .debounce_rep = 0, | ||
110 | .debounce_tol = (~0), | ||
111 | .get_pendown_state = ads7843_pendown_state, | ||
112 | }; | ||
113 | |||
114 | static void __init ek_add_device_ts(void) | ||
115 | { | ||
116 | at91_set_B_periph(AT91_PIN_PA15, 1); /* External IRQ1, with pullup */ | ||
117 | at91_set_gpio_input(AT91_PIN_PA31, 1); /* Touchscreen BUSY signal */ | ||
118 | } | ||
119 | #else | ||
120 | static void __init ek_add_device_ts(void) {} | ||
121 | #endif | ||
122 | |||
123 | /* | ||
89 | * SPI devices. | 124 | * SPI devices. |
90 | */ | 125 | */ |
91 | static struct spi_board_info ek_spi_devices[] = { | 126 | static struct spi_board_info ek_spi_devices[] = { |
@@ -97,6 +132,16 @@ static struct spi_board_info ek_spi_devices[] = { | |||
97 | .bus_num = 0, | 132 | .bus_num = 0, |
98 | }, | 133 | }, |
99 | #endif | 134 | #endif |
135 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
136 | { | ||
137 | .modalias = "ads7846", | ||
138 | .chip_select = 3, | ||
139 | .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ | ||
140 | .bus_num = 0, | ||
141 | .platform_data = &ads_info, | ||
142 | .irq = AT91SAM9263_ID_IRQ1, | ||
143 | }, | ||
144 | #endif | ||
100 | }; | 145 | }; |
101 | 146 | ||
102 | 147 | ||
@@ -112,6 +157,14 @@ static struct at91_mmc_data __initdata ek_mmc_data = { | |||
112 | 157 | ||
113 | 158 | ||
114 | /* | 159 | /* |
160 | * MACB Ethernet device | ||
161 | */ | ||
162 | static struct at91_eth_data __initdata ek_macb_data = { | ||
163 | .is_rmii = 1, | ||
164 | }; | ||
165 | |||
166 | |||
167 | /* | ||
115 | * NAND flash | 168 | * NAND flash |
116 | */ | 169 | */ |
117 | static struct mtd_partition __initdata ek_nand_partition[] = { | 170 | static struct mtd_partition __initdata ek_nand_partition[] = { |
@@ -148,6 +201,14 @@ static struct at91_nand_data __initdata ek_nand_data = { | |||
148 | }; | 201 | }; |
149 | 202 | ||
150 | 203 | ||
204 | /* | ||
205 | * AC97 | ||
206 | */ | ||
207 | static struct atmel_ac97_data ek_ac97_data = { | ||
208 | .reset_pin = AT91_PIN_PA13, | ||
209 | }; | ||
210 | |||
211 | |||
151 | static void __init ek_board_init(void) | 212 | static void __init ek_board_init(void) |
152 | { | 213 | { |
153 | /* Serial */ | 214 | /* Serial */ |
@@ -157,11 +218,20 @@ static void __init ek_board_init(void) | |||
157 | /* USB Device */ | 218 | /* USB Device */ |
158 | at91_add_device_udc(&ek_udc_data); | 219 | at91_add_device_udc(&ek_udc_data); |
159 | /* SPI */ | 220 | /* SPI */ |
221 | at91_set_gpio_output(AT91_PIN_PE20, 1); /* select spi0 clock */ | ||
160 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | 222 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); |
223 | /* Touchscreen */ | ||
224 | ek_add_device_ts(); | ||
161 | /* MMC */ | 225 | /* MMC */ |
162 | at91_add_device_mmc(1, &ek_mmc_data); | 226 | at91_add_device_mmc(1, &ek_mmc_data); |
227 | /* Ethernet */ | ||
228 | at91_add_device_eth(&ek_macb_data); | ||
163 | /* NAND */ | 229 | /* NAND */ |
164 | at91_add_device_nand(&ek_nand_data); | 230 | at91_add_device_nand(&ek_nand_data); |
231 | /* I2C */ | ||
232 | at91_add_device_i2c(); | ||
233 | /* AC97 */ | ||
234 | at91_add_device_ac97(&ek_ac97_data); | ||
165 | } | 235 | } |
166 | 236 | ||
167 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") | 237 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") |