AT91: add platform parameters for atmel_tsadcc in at91sam9rlek
Setup platform parameters in at91sam9rl-ek board to be passed to atmel_tsadcc touchscreen. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
970435a141
commit
423c9b0dc3
@ -622,6 +622,7 @@ static void __init at91_add_device_tc(void) { }
|
|||||||
|
|
||||||
#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
|
#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
|
||||||
static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
|
static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
|
||||||
|
static struct at91_tsadcc_data tsadcc_data;
|
||||||
|
|
||||||
static struct resource tsadcc_resources[] = {
|
static struct resource tsadcc_resources[] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
@ -642,22 +643,27 @@ static struct platform_device at91sam9rl_tsadcc_device = {
|
|||||||
.dev = {
|
.dev = {
|
||||||
.dma_mask = &tsadcc_dmamask,
|
.dma_mask = &tsadcc_dmamask,
|
||||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||||
|
.platform_data = &tsadcc_data,
|
||||||
},
|
},
|
||||||
.resource = tsadcc_resources,
|
.resource = tsadcc_resources,
|
||||||
.num_resources = ARRAY_SIZE(tsadcc_resources),
|
.num_resources = ARRAY_SIZE(tsadcc_resources),
|
||||||
};
|
};
|
||||||
|
|
||||||
void __init at91_add_device_tsadcc(void)
|
void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data)
|
||||||
{
|
{
|
||||||
|
if (!data)
|
||||||
|
return;
|
||||||
|
|
||||||
at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */
|
at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */
|
||||||
at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */
|
at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */
|
||||||
at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */
|
at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */
|
||||||
at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */
|
at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */
|
||||||
|
|
||||||
|
tsadcc_data = *data;
|
||||||
platform_device_register(&at91sam9rl_tsadcc_device);
|
platform_device_register(&at91sam9rl_tsadcc_device);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void __init at91_add_device_tsadcc(void) {}
|
void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,6 +242,16 @@ static struct gpio_led ek_leds[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Touchscreen
|
||||||
|
*/
|
||||||
|
static struct at91_tsadcc_data ek_tsadcc_data = {
|
||||||
|
.adc_clock = 1000000,
|
||||||
|
.pendet_debounce = 0x0f,
|
||||||
|
.ts_sample_hold_time = 0x03,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIO Buttons
|
* GPIO Buttons
|
||||||
*/
|
*/
|
||||||
@ -310,7 +320,7 @@ static void __init ek_board_init(void)
|
|||||||
/* AC97 */
|
/* AC97 */
|
||||||
at91_add_device_ac97(&ek_ac97_data);
|
at91_add_device_ac97(&ek_ac97_data);
|
||||||
/* Touch Screen Controller */
|
/* Touch Screen Controller */
|
||||||
at91_add_device_tsadcc();
|
at91_add_device_tsadcc(&ek_tsadcc_data);
|
||||||
/* LEDs */
|
/* LEDs */
|
||||||
at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
|
at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
|
||||||
/* Push Buttons */
|
/* Push Buttons */
|
||||||
|
@ -186,7 +186,12 @@ extern void __init at91_add_device_ac97(struct ac97c_platform_data *data);
|
|||||||
extern void __init at91_add_device_isi(void);
|
extern void __init at91_add_device_isi(void);
|
||||||
|
|
||||||
/* Touchscreen Controller */
|
/* Touchscreen Controller */
|
||||||
extern void __init at91_add_device_tsadcc(void);
|
struct at91_tsadcc_data {
|
||||||
|
unsigned int adc_clock;
|
||||||
|
u8 pendet_debounce;
|
||||||
|
u8 ts_sample_hold_time;
|
||||||
|
};
|
||||||
|
extern void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data);
|
||||||
|
|
||||||
/* CAN */
|
/* CAN */
|
||||||
struct at91_can_data {
|
struct at91_can_data {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user