aboutsummaryrefslogtreecommitdiffstats
path: root/patches.at91/0079-USB-ohci-at91-fix-PIO-handling-in-relation-with-numb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches.at91/0079-USB-ohci-at91-fix-PIO-handling-in-relation-with-numb.patch')
-rw-r--r--patches.at91/0079-USB-ohci-at91-fix-PIO-handling-in-relation-with-numb.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/patches.at91/0079-USB-ohci-at91-fix-PIO-handling-in-relation-with-numb.patch b/patches.at91/0079-USB-ohci-at91-fix-PIO-handling-in-relation-with-numb.patch
new file mode 100644
index 00000000000000..6491324bab7481
--- /dev/null
+++ b/patches.at91/0079-USB-ohci-at91-fix-PIO-handling-in-relation-with-numb.patch
@@ -0,0 +1,43 @@
+From 2b2b3800d382a683216a2e0fc6a27ba480716f2a Mon Sep 17 00:00:00 2001
+From: Nicolas Ferre <nicolas.ferre@atmel.com>
+Date: Wed, 29 Aug 2012 11:49:18 +0200
+Subject: USB: ohci-at91: fix PIO handling in relation with number of ports
+
+commit 6fffb77c8393151b0cf8cef1b9c2ba90587dd2e8 upstream.
+
+If the number of ports present on the SoC/board is not the maximum
+and that the platform data is not filled with all data, there is
+an easy way to mess the PIO setup for this interface.
+This quick fix addresses mis-configuration in USB host platform data
+that is common in at91 boards since commit 0ee6d1e (USB: ohci-at91:
+change maximum number of ports) that did not modified the associatd
+board files.
+
+Reported-by: Klaus Falkner <klaus.falkner@solectrix.de>
+Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Cc: Stable <stable@vger.kernel.org> [3.4+]
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/ohci-at91.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/usb/host/ohci-at91.c
++++ b/drivers/usb/host/ohci-at91.c
+@@ -647,6 +647,16 @@ static int __devexit ohci_hcd_at91_drv_r
+
+ if (pdata) {
+ at91_for_each_port(i) {
++ /*
++ * do not configure PIO if not in relation with
++ * real USB port on board
++ */
++ if (i >= pdata->ports) {
++ pdata->vbus_pin[i] = -EINVAL;
++ pdata->overcurrent_pin[i] = -EINVAL;
++ break;
++ }
++
+ if (!gpio_is_valid(pdata->vbus_pin[i]))
+ continue;
+ ohci_at91_usb_set_power(pdata, i, 0);