|
@@ -476,20 +476,6 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
|
|
if (!of_property_read_u32(np, "num-ports", &ports))
|
|
if (!of_property_read_u32(np, "num-ports", &ports))
|
|
|
pdata->ports = ports;
|
|
pdata->ports = ports;
|
|
|
|
|
|
|
|
- at91_for_each_port(i) {
|
|
|
|
|
- gpio = of_get_named_gpio_flags(np, "atmel,vbus-gpio", i, &flags);
|
|
|
|
|
- pdata->vbus_pin[i] = gpio;
|
|
|
|
|
- if (!gpio_is_valid(gpio))
|
|
|
|
|
- continue;
|
|
|
|
|
- pdata->vbus_pin_active_low[i] = flags & OF_GPIO_ACTIVE_LOW;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- at91_for_each_port(i)
|
|
|
|
|
- pdata->overcurrent_pin[i] =
|
|
|
|
|
- of_get_named_gpio_flags(np, "atmel,oc-gpio", i, &flags);
|
|
|
|
|
-
|
|
|
|
|
- pdev->dev.platform_data = pdata;
|
|
|
|
|
-
|
|
|
|
|
at91_for_each_port(i) {
|
|
at91_for_each_port(i) {
|
|
|
/*
|
|
/*
|
|
|
* do not configure PIO if not in relation with
|
|
* do not configure PIO if not in relation with
|
|
@@ -497,13 +483,15 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
|
|
*/
|
|
*/
|
|
|
if (i >= pdata->ports) {
|
|
if (i >= pdata->ports) {
|
|
|
pdata->vbus_pin[i] = -EINVAL;
|
|
pdata->vbus_pin[i] = -EINVAL;
|
|
|
- pdata->overcurrent_pin[i] = -EINVAL;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!gpio_is_valid(pdata->vbus_pin[i]))
|
|
|
|
|
|
|
+ gpio = of_get_named_gpio_flags(np, "atmel,vbus-gpio", i,
|
|
|
|
|
+ &flags);
|
|
|
|
|
+ pdata->vbus_pin[i] = gpio;
|
|
|
|
|
+ if (!gpio_is_valid(gpio))
|
|
|
continue;
|
|
continue;
|
|
|
- gpio = pdata->vbus_pin[i];
|
|
|
|
|
|
|
+ pdata->vbus_pin_active_low[i] = flags & OF_GPIO_ACTIVE_LOW;
|
|
|
|
|
|
|
|
ret = gpio_request(gpio, "ohci_vbus");
|
|
ret = gpio_request(gpio, "ohci_vbus");
|
|
|
if (ret) {
|
|
if (ret) {
|
|
@@ -525,6 +513,14 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
at91_for_each_port(i) {
|
|
at91_for_each_port(i) {
|
|
|
|
|
+ if (i >= pdata->ports) {
|
|
|
|
|
+ pdata->overcurrent_pin[i] = -EINVAL;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ pdata->overcurrent_pin[i] =
|
|
|
|
|
+ of_get_named_gpio_flags(np, "atmel,oc-gpio", i, &flags);
|
|
|
|
|
+
|
|
|
if (!gpio_is_valid(pdata->overcurrent_pin[i]))
|
|
if (!gpio_is_valid(pdata->overcurrent_pin[i]))
|
|
|
continue;
|
|
continue;
|
|
|
gpio = pdata->overcurrent_pin[i];
|
|
gpio = pdata->overcurrent_pin[i];
|
|
@@ -556,6 +552,8 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ pdev->dev.platform_data = pdata;
|
|
|
|
|
+
|
|
|
device_init_wakeup(&pdev->dev, 1);
|
|
device_init_wakeup(&pdev->dev, 1);
|
|
|
return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
|
|
return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
|
|
|
}
|
|
}
|