diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-01-05 14:40:50 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-01-06 09:42:30 +0100 |
commit | 78af988e41aad42fa2320e8625cd5602e2c519ab (patch) | |
tree | d0f89dff829b5c112a62a4df89266dd82906a922 /arch/arm/mach-at91/at91rm9200_devices.c | |
parent | d816bb4cc05f1af3cdd11d0b166f7c5bed8f080f (diff) | |
download | barebox-78af988e41aad42fa2320e8625cd5602e2c519ab.tar.gz barebox-78af988e41aad42fa2320e8625cd5602e2c519ab.tar.xz |
at91: add default spi chipselect ressources
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-at91/at91rm9200_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_devices.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 1fc78abf4d..599eb79ee5 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c @@ -158,6 +158,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) {} * -------------------------------------------------------------------- */ #if defined(CONFIG_DRIVER_SPI_ATMEL) +static const unsigned spi_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 }; + +static struct at91_spi_platform_data spi_pdata[] = { + [0] = { + .chipselect = spi_standard_cs, + .num_chipselect = ARRAY_SIZE(spi_standard_cs), + }, +}; + void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) { int i; @@ -165,6 +174,9 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) BUG_ON(spi_id > 0); + if (!pdata) + pdata = &spi_pdata[spi_id]; + for (i = 0; i < pdata->num_chipselect; i++) { cs_pin = pdata->chipselect[i]; |