@@ -493,19 +493,27 @@ static int usbhs_omap_probe(struct platform_device *pdev)
*/
pm_runtime_put_sync(dev);
- switch (omap->usbhs_rev) {
- case OMAP_USBHS_REV1:
- omap->nports = 3;
- break;
- case OMAP_USBHS_REV2:
- omap->nports = 2;
- break;
- default:
- omap->nports = OMAP3_HS_USB_PORTS;
- dev_dbg(dev,
- "USB HOST Rev : 0x%d not recognized, assuming %d ports\n",
- omap->usbhs_rev, omap->nports);
- break;
+ /*
+ * If platform data contains nports then use that
+ * else make out number of ports from USBHS revision
+ */
+ if (pdata->nports) {
+ omap->nports = pdata->nports;
+ } else {
+ switch (omap->usbhs_rev) {
+ case OMAP_USBHS_REV1:
+ omap->nports = 3;
+ break;
+ case OMAP_USBHS_REV2:
+ omap->nports = 2;
+ break;
+ default:
+ omap->nports = OMAP3_HS_USB_PORTS;
+ dev_dbg(dev,
+ "USB HOST Rev:0x%d not recognized, assuming %d ports\n",
+ omap->usbhs_rev, omap->nports);
+ break;
+ }
}
for (i = 0; i < omap->nports; i++)
@@ -39,6 +39,7 @@ enum usbhs_omap_port_mode {
};
struct usbhs_omap_platform_data {
+ int nports;
enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
int reset_gpio_port[OMAP3_HS_USB_PORTS];
struct regulator *regulator[OMAP3_HS_USB_PORTS];