aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-07-13 05:29:18 -0400
committerArnd Bergmann <arnd@arndb.de>2011-09-10 17:03:13 -0400
commit1fcaea7e4c932b2bcc2612fafec6e1917944d192 (patch)
treea0b1d124ee43fb9496914c779e8aeafcdb731df9 /arch
parentaa6e52a35d388e730f4df0ec2ec48294590cc459 (diff)
at91: at91-ohci: configure overcurrent pins as input GPIOs
As a new overcurrent_pin[] array has been added to the at91_usbh_data structure, those pins must be muxed to work properly. This commit implements this muxing for all AT91 SoCs that support the AT91 OHCI. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [nicolas.ferre@atmel.com: added i variable declaration for the loop] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c6
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c8
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c8
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c8
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c6
6 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index dba0d8d8a4bd..b46615a59355 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -80,6 +80,12 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
80 at91_set_gpio_output(data->vbus_pin[i], 0); 80 at91_set_gpio_output(data->vbus_pin[i], 0);
81 } 81 }
82 82
83 /* Enable overcurrent notification */
84 for (i = 0; i < data->ports; i++) {
85 if (data->overcurrent_pin[i])
86 at91_set_gpio_input(data->overcurrent_pin[i], 1);
87 }
88
83 usbh_data = *data; 89 usbh_data = *data;
84 platform_device_register(&at91_usbh_device); 90 platform_device_register(&at91_usbh_device);
85} 91}
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 7227755ffec6..3f2711391a69 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -60,9 +60,17 @@ static struct platform_device at91rm9200_usbh_device = {
60 60
61void __init at91_add_device_usbh(struct at91_usbh_data *data) 61void __init at91_add_device_usbh(struct at91_usbh_data *data)
62{ 62{
63 int i;
64
63 if (!data) 65 if (!data)
64 return; 66 return;
65 67
68 /* Enable overcurrent notification */
69 for (i = 0; i < data->ports; i++) {
70 if (data->overcurrent_pin[i])
71 at91_set_gpio_input(data->overcurrent_pin[i], 1);
72 }
73
66 usbh_data = *data; 74 usbh_data = *data;
67 platform_device_register(&at91rm9200_usbh_device); 75 platform_device_register(&at91rm9200_usbh_device);
68} 76}
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 39f81f47b4ba..344075fbb39e 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -61,9 +61,17 @@ static struct platform_device at91_usbh_device = {
61 61
62void __init at91_add_device_usbh(struct at91_usbh_data *data) 62void __init at91_add_device_usbh(struct at91_usbh_data *data)
63{ 63{
64 int i;
65
64 if (!data) 66 if (!data)
65 return; 67 return;
66 68
69 /* Enable overcurrent notification */
70 for (i = 0; i < data->ports; i++) {
71 if (data->overcurrent_pin[i])
72 at91_set_gpio_input(data->overcurrent_pin[i], 1);
73 }
74
67 usbh_data = *data; 75 usbh_data = *data;
68 platform_device_register(&at91_usbh_device); 76 platform_device_register(&at91_usbh_device);
69} 77}
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 0f917928eeb7..3b8fb79d6b10 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -64,9 +64,17 @@ static struct platform_device at91sam9261_usbh_device = {
64 64
65void __init at91_add_device_usbh(struct at91_usbh_data *data) 65void __init at91_add_device_usbh(struct at91_usbh_data *data)
66{ 66{
67 int i;
68
67 if (!data) 69 if (!data)
68 return; 70 return;
69 71
72 /* Enable overcurrent notification */
73 for (i = 0; i < data->ports; i++) {
74 if (data->overcurrent_pin[i])
75 at91_set_gpio_input(data->overcurrent_pin[i], 1);
76 }
77
70 usbh_data = *data; 78 usbh_data = *data;
71 platform_device_register(&at91sam9261_usbh_device); 79 platform_device_register(&at91sam9261_usbh_device);
72} 80}
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index a050f41fc860..d4aef76a092d 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -74,6 +74,12 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
74 at91_set_gpio_output(data->vbus_pin[i], 0); 74 at91_set_gpio_output(data->vbus_pin[i], 0);
75 } 75 }
76 76
77 /* Enable overcurrent notification */
78 for (i = 0; i < data->ports; i++) {
79 if (data->overcurrent_pin[i])
80 at91_set_gpio_input(data->overcurrent_pin[i], 1);
81 }
82
77 usbh_data = *data; 83 usbh_data = *data;
78 platform_device_register(&at91_usbh_device); 84 platform_device_register(&at91_usbh_device);
79} 85}
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 600bffb01edb..e4a98574893d 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -124,6 +124,12 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
124 at91_set_gpio_output(data->vbus_pin[i], 0); 124 at91_set_gpio_output(data->vbus_pin[i], 0);
125 } 125 }
126 126
127 /* Enable overcurrent notification */
128 for (i = 0; i < data->ports; i++) {
129 if (data->overcurrent_pin[i])
130 at91_set_gpio_input(data->overcurrent_pin[i], 1);
131 }
132
127 usbh_ohci_data = *data; 133 usbh_ohci_data = *data;
128 platform_device_register(&at91_usbh_ohci_device); 134 platform_device_register(&at91_usbh_ohci_device);
129} 135}