diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-03-28 05:58:58 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-04-04 12:35:52 -0400 |
commit | 0c2c1f624d4f99825851f0253f1308dd591df6ef (patch) | |
tree | 0a0279e1e48ee8e0293fd4370d558dda803eb7d2 /arch/arm | |
parent | 9475375a5eb2ab9380e644d45173f67cbca0da80 (diff) |
ARM: at91: fix check of valid GPIO for SPI and USB
SPI chip select pins have to be checked by gpio_is_valid().
The USB host overcurrent_pin checking was missing.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 3 |
5 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 7e5651ee9f85..5652dde4bbe2 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -598,6 +598,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
598 | else | 598 | else |
599 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 599 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
600 | 600 | ||
601 | if (!gpio_is_valid(cs_pin)) | ||
602 | continue; | ||
603 | |||
601 | if (devices[i].bus_num == 0) | 604 | if (devices[i].bus_num == 0) |
602 | enable_spi0 = 1; | 605 | enable_spi0 = 1; |
603 | else | 606 | else |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 096da87dc00d..4db961a93085 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -415,6 +415,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
415 | else | 415 | else |
416 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 416 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
417 | 417 | ||
418 | if (!gpio_is_valid(cs_pin)) | ||
419 | continue; | ||
420 | |||
418 | if (devices[i].bus_num == 0) | 421 | if (devices[i].bus_num == 0) |
419 | enable_spi0 = 1; | 422 | enable_spi0 = 1; |
420 | else | 423 | else |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 27cfce3d7845..fe99206de880 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -672,6 +672,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
672 | else | 672 | else |
673 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 673 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
674 | 674 | ||
675 | if (!gpio_is_valid(cs_pin)) | ||
676 | continue; | ||
677 | |||
675 | if (devices[i].bus_num == 0) | 678 | if (devices[i].bus_num == 0) |
676 | enable_spi0 = 1; | 679 | enable_spi0 = 1; |
677 | else | 680 | else |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index ddf210ab8d12..6b008aee1dff 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -133,7 +133,7 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) | |||
133 | 133 | ||
134 | /* Enable overcurrent notification */ | 134 | /* Enable overcurrent notification */ |
135 | for (i = 0; i < data->ports; i++) { | 135 | for (i = 0; i < data->ports; i++) { |
136 | if (data->overcurrent_pin[i]) | 136 | if (gpio_is_valid(data->overcurrent_pin[i])) |
137 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 137 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
138 | } | 138 | } |
139 | 139 | ||
@@ -787,6 +787,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
787 | else | 787 | else |
788 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 788 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
789 | 789 | ||
790 | if (!gpio_is_valid(cs_pin)) | ||
791 | continue; | ||
792 | |||
790 | if (devices[i].bus_num == 0) | 793 | if (devices[i].bus_num == 0) |
791 | enable_spi0 = 1; | 794 | enable_spi0 = 1; |
792 | else | 795 | else |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index eda72e83037d..fe4ae22e8561 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -419,6 +419,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
419 | else | 419 | else |
420 | cs_pin = spi_standard_cs[devices[i].chip_select]; | 420 | cs_pin = spi_standard_cs[devices[i].chip_select]; |
421 | 421 | ||
422 | if (!gpio_is_valid(cs_pin)) | ||
423 | continue; | ||
424 | |||
422 | /* enable chip-select pin */ | 425 | /* enable chip-select pin */ |
423 | at91_set_gpio_output(cs_pin, 1); | 426 | at91_set_gpio_output(cs_pin, 1); |
424 | 427 | ||