Skip to content

Commit

Permalink
USB: ohci-at91: fix PIO handling in relation with number of ports
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Ferre authored and gregkh committed Sep 5, 2012
1 parent 26a538b commit 6fffb77
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/usb/host/ohci-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,16 @@ static int __devinit ohci_hcd_at91_drv_probe(struct platform_device *pdev)

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;
gpio = pdata->vbus_pin[i];
Expand Down

0 comments on commit 6fffb77

Please sign in to comment.