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>
This commit is contained in:
parent
d816bb4cc0
commit
78af988e41
|
@ -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];
|
||||
|
||||
|
|
|
@ -155,6 +155,21 @@ void at91_add_device_nand(struct atmel_nand_data *data) {}
|
|||
* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(CONFIG_DRIVER_SPI_ATMEL)
|
||||
static int spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, AT91_PIN_PC17 };
|
||||
|
||||
static int spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, AT91_PIN_PC3 };
|
||||
|
||||
static struct at91_spi_platform_data spi_pdata[] = {
|
||||
[0] = {
|
||||
.chipselect = spi0_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi0_standard_cs),
|
||||
},
|
||||
[1] = {
|
||||
.chipselect = spi1_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi1_standard_cs),
|
||||
},
|
||||
};
|
||||
|
||||
void __init at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
||||
{
|
||||
int i;
|
||||
|
@ -163,6 +178,9 @@ void __init at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata
|
|||
|
||||
BUG_ON(spi_id > 1);
|
||||
|
||||
if (!pdata)
|
||||
pdata = &spi_pdata[spi_id];
|
||||
|
||||
for (i = 0; i < pdata->num_chipselect; i++) {
|
||||
cs_pin = pdata->chipselect[i];
|
||||
|
||||
|
|
|
@ -107,6 +107,21 @@ void at91_add_device_nand(struct atmel_nand_data *data) {}
|
|||
* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(CONFIG_DRIVER_SPI_ATMEL)
|
||||
static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
|
||||
|
||||
static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB28, AT91_PIN_PA24, AT91_PIN_PA25, AT91_PIN_PA26 };
|
||||
|
||||
static struct at91_spi_platform_data spi_pdata[] = {
|
||||
[0] = {
|
||||
.chipselect = spi0_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi0_standard_cs),
|
||||
},
|
||||
[1] = {
|
||||
.chipselect = spi1_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi1_standard_cs),
|
||||
},
|
||||
};
|
||||
|
||||
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
||||
{
|
||||
int i;
|
||||
|
@ -115,6 +130,9 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
|||
|
||||
BUG_ON(spi_id > 1);
|
||||
|
||||
if (!pdata)
|
||||
pdata = &spi_pdata[spi_id];
|
||||
|
||||
for (i = 0; i < pdata->num_chipselect; i++) {
|
||||
cs_pin = pdata->chipselect[i];
|
||||
|
||||
|
|
|
@ -157,6 +157,21 @@ void at91_add_device_nand(struct atmel_nand_data *data) {}
|
|||
* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(CONFIG_DRIVER_SPI_ATMEL)
|
||||
static int spi0_standard_cs[4] = { AT91_PIN_PA5, AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PB11 };
|
||||
|
||||
static int spi1_standard_cs[4] = { AT91_PIN_PB15, AT91_PIN_PB16, AT91_PIN_PB17, AT91_PIN_PB18 };
|
||||
|
||||
static struct at91_spi_platform_data spi_pdata[] = {
|
||||
[0] = {
|
||||
.chipselect = spi0_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi0_standard_cs),
|
||||
},
|
||||
[1] = {
|
||||
.chipselect = spi1_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi1_standard_cs),
|
||||
},
|
||||
};
|
||||
|
||||
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
||||
{
|
||||
int i;
|
||||
|
@ -165,6 +180,9 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
|||
|
||||
BUG_ON(spi_id > 1);
|
||||
|
||||
if (!pdata)
|
||||
pdata = &spi_pdata[spi_id];
|
||||
|
||||
for (i = 0; i < pdata->num_chipselect; i++) {
|
||||
cs_pin = pdata->chipselect[i];
|
||||
|
||||
|
|
|
@ -295,6 +295,21 @@ void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data) {}
|
|||
|
||||
#if defined(CONFIG_DRIVER_SPI_ATMEL)
|
||||
/* SPI */
|
||||
static const unsigned spi0_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PB18, AT91_PIN_PB19, AT91_PIN_PD27 };
|
||||
|
||||
static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB17, AT91_PIN_PD28, AT91_PIN_PD18, AT91_PIN_PD19 };
|
||||
|
||||
static struct at91_spi_platform_data spi_pdata[] = {
|
||||
[0] = {
|
||||
.chipselect = spi0_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi0_standard_cs),
|
||||
},
|
||||
[1] = {
|
||||
.chipselect = spi1_standard_cs,
|
||||
.num_chipselect = ARRAY_SIZE(spi1_standard_cs),
|
||||
},
|
||||
};
|
||||
|
||||
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
||||
{
|
||||
int i;
|
||||
|
@ -303,6 +318,9 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
|
|||
|
||||
BUG_ON(spi_id > 1);
|
||||
|
||||
if (!pdata)
|
||||
pdata = &spi_pdata[spi_id];
|
||||
|
||||
for (i = 0; i < pdata->num_chipselect; i++) {
|
||||
cs_pin = pdata->chipselect[i];
|
||||
|
||||
|
|
Loading…
Reference in New Issue