diff options
-rw-r--r-- | drivers/mfd/omap-usb-tll.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c index e45948969907..9658e1843334 100644 --- a/drivers/mfd/omap-usb-tll.c +++ b/drivers/mfd/omap-usb-tll.c | |||
@@ -98,6 +98,7 @@ | |||
98 | struct usbtll_omap { | 98 | struct usbtll_omap { |
99 | struct clk *usbtll_p1_fck; | 99 | struct clk *usbtll_p1_fck; |
100 | struct clk *usbtll_p2_fck; | 100 | struct clk *usbtll_p2_fck; |
101 | int nch; /* num. of channels */ | ||
101 | struct usbhs_omap_platform_data *pdata; | 102 | struct usbhs_omap_platform_data *pdata; |
102 | /* secure the register updates */ | 103 | /* secure the register updates */ |
103 | spinlock_t lock; | 104 | spinlock_t lock; |
@@ -210,7 +211,7 @@ static int usbtll_omap_probe(struct platform_device *pdev) | |||
210 | unsigned reg; | 211 | unsigned reg; |
211 | unsigned long flags; | 212 | unsigned long flags; |
212 | int ret = 0; | 213 | int ret = 0; |
213 | int i, ver, count; | 214 | int i, ver; |
214 | 215 | ||
215 | dev_dbg(dev, "starting TI HSUSB TLL Controller\n"); | 216 | dev_dbg(dev, "starting TI HSUSB TLL Controller\n"); |
216 | 217 | ||
@@ -262,16 +263,18 @@ static int usbtll_omap_probe(struct platform_device *pdev) | |||
262 | ver = usbtll_read(base, OMAP_USBTLL_REVISION); | 263 | ver = usbtll_read(base, OMAP_USBTLL_REVISION); |
263 | switch (ver) { | 264 | switch (ver) { |
264 | case OMAP_USBTLL_REV1: | 265 | case OMAP_USBTLL_REV1: |
265 | case OMAP_USBTLL_REV2: | 266 | tll->nch = OMAP_TLL_CHANNEL_COUNT; |
266 | count = OMAP_TLL_CHANNEL_COUNT; | ||
267 | break; | 267 | break; |
268 | case OMAP_USBTLL_REV2: | ||
268 | case OMAP_USBTLL_REV3: | 269 | case OMAP_USBTLL_REV3: |
269 | count = OMAP_REV2_TLL_CHANNEL_COUNT; | 270 | tll->nch = OMAP_REV2_TLL_CHANNEL_COUNT; |
270 | break; | 271 | break; |
271 | default: | 272 | default: |
272 | dev_err(dev, "TLL version failed\n"); | 273 | tll->nch = OMAP_TLL_CHANNEL_COUNT; |
273 | ret = -ENODEV; | 274 | dev_dbg(dev, |
274 | goto err_ioremap; | 275 | "USB TLL Rev : 0x%x not recognized, assuming %d channels\n", |
276 | ver, tll->nch); | ||
277 | break; | ||
275 | } | 278 | } |
276 | 279 | ||
277 | if (is_ehci_tll_mode(pdata->port_mode[0]) || | 280 | if (is_ehci_tll_mode(pdata->port_mode[0]) || |
@@ -291,7 +294,7 @@ static int usbtll_omap_probe(struct platform_device *pdev) | |||
291 | usbtll_write(base, OMAP_TLL_SHARED_CONF, reg); | 294 | usbtll_write(base, OMAP_TLL_SHARED_CONF, reg); |
292 | 295 | ||
293 | /* Enable channels now */ | 296 | /* Enable channels now */ |
294 | for (i = 0; i < count; i++) { | 297 | for (i = 0; i < tll->nch; i++) { |
295 | reg = usbtll_read(base, OMAP_TLL_CHANNEL_CONF(i)); | 298 | reg = usbtll_read(base, OMAP_TLL_CHANNEL_CONF(i)); |
296 | 299 | ||
297 | if (is_ohci_port(pdata->port_mode[i])) { | 300 | if (is_ohci_port(pdata->port_mode[i])) { |
@@ -319,7 +322,6 @@ static int usbtll_omap_probe(struct platform_device *pdev) | |||
319 | } | 322 | } |
320 | } | 323 | } |
321 | 324 | ||
322 | err_ioremap: | ||
323 | spin_unlock_irqrestore(&tll->lock, flags); | 325 | spin_unlock_irqrestore(&tll->lock, flags); |
324 | iounmap(base); | 326 | iounmap(base); |
325 | pm_runtime_put_sync(dev); | 327 | pm_runtime_put_sync(dev); |