diff options
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9rlek.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/board.h | 7 |
3 files changed, 25 insertions, 4 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index d345f5453dbe..53aaa94df75a 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -622,6 +622,7 @@ static void __init at91_add_device_tc(void) { } | |||
622 | 622 | ||
623 | #if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE) | 623 | #if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE) |
624 | static u64 tsadcc_dmamask = DMA_BIT_MASK(32); | 624 | static u64 tsadcc_dmamask = DMA_BIT_MASK(32); |
625 | static struct at91_tsadcc_data tsadcc_data; | ||
625 | 626 | ||
626 | static struct resource tsadcc_resources[] = { | 627 | static struct resource tsadcc_resources[] = { |
627 | [0] = { | 628 | [0] = { |
@@ -642,22 +643,27 @@ static struct platform_device at91sam9rl_tsadcc_device = { | |||
642 | .dev = { | 643 | .dev = { |
643 | .dma_mask = &tsadcc_dmamask, | 644 | .dma_mask = &tsadcc_dmamask, |
644 | .coherent_dma_mask = DMA_BIT_MASK(32), | 645 | .coherent_dma_mask = DMA_BIT_MASK(32), |
646 | .platform_data = &tsadcc_data, | ||
645 | }, | 647 | }, |
646 | .resource = tsadcc_resources, | 648 | .resource = tsadcc_resources, |
647 | .num_resources = ARRAY_SIZE(tsadcc_resources), | 649 | .num_resources = ARRAY_SIZE(tsadcc_resources), |
648 | }; | 650 | }; |
649 | 651 | ||
650 | void __init at91_add_device_tsadcc(void) | 652 | void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) |
651 | { | 653 | { |
654 | if (!data) | ||
655 | return; | ||
656 | |||
652 | at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */ | 657 | at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */ |
653 | at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */ | 658 | at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */ |
654 | at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */ | 659 | at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */ |
655 | at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */ | 660 | at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */ |
656 | 661 | ||
662 | tsadcc_data = *data; | ||
657 | platform_device_register(&at91sam9rl_tsadcc_device); | 663 | platform_device_register(&at91sam9rl_tsadcc_device); |
658 | } | 664 | } |
659 | #else | 665 | #else |
660 | void __init at91_add_device_tsadcc(void) {} | 666 | void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {} |
661 | #endif | 667 | #endif |
662 | 668 | ||
663 | 669 | ||
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index bd28e989e54e..7ac20f3a2067 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -243,6 +243,16 @@ static struct gpio_led ek_leds[] = { | |||
243 | 243 | ||
244 | 244 | ||
245 | /* | 245 | /* |
246 | * Touchscreen | ||
247 | */ | ||
248 | static struct at91_tsadcc_data ek_tsadcc_data = { | ||
249 | .adc_clock = 1000000, | ||
250 | .pendet_debounce = 0x0f, | ||
251 | .ts_sample_hold_time = 0x03, | ||
252 | }; | ||
253 | |||
254 | |||
255 | /* | ||
246 | * GPIO Buttons | 256 | * GPIO Buttons |
247 | */ | 257 | */ |
248 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 258 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
@@ -310,7 +320,7 @@ static void __init ek_board_init(void) | |||
310 | /* AC97 */ | 320 | /* AC97 */ |
311 | at91_add_device_ac97(&ek_ac97_data); | 321 | at91_add_device_ac97(&ek_ac97_data); |
312 | /* Touch Screen Controller */ | 322 | /* Touch Screen Controller */ |
313 | at91_add_device_tsadcc(); | 323 | at91_add_device_tsadcc(&ek_tsadcc_data); |
314 | /* LEDs */ | 324 | /* LEDs */ |
315 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 325 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); |
316 | /* Push Buttons */ | 326 | /* Push Buttons */ |
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 2f4fcedc02ba..6f1579f8abdd 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -186,7 +186,12 @@ extern void __init at91_add_device_ac97(struct ac97c_platform_data *data); | |||
186 | extern void __init at91_add_device_isi(void); | 186 | extern void __init at91_add_device_isi(void); |
187 | 187 | ||
188 | /* Touchscreen Controller */ | 188 | /* Touchscreen Controller */ |
189 | extern void __init at91_add_device_tsadcc(void); | 189 | struct at91_tsadcc_data { |
190 | unsigned int adc_clock; | ||
191 | u8 pendet_debounce; | ||
192 | u8 ts_sample_hold_time; | ||
193 | }; | ||
194 | extern void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data); | ||
190 | 195 | ||
191 | /* CAN */ | 196 | /* CAN */ |
192 | struct at91_can_data { | 197 | struct at91_can_data { |