omap2430.c (2f7711642559851c187d09795a3eb51c2bde36ec) omap2430.c (baef653a500476ccb2d08cf4bb648c56c0170e21)
1/*
2 * Copyright (C) 2005-2007 by Texas Instruments
3 * Some code has been taken from tusb6010.c
4 * Copyrights for that are attributable to:
5 * Copyright (C) 2006 Nokia Corporation
6 * Tony Lindgren <tony@atomide.com>
7 *
8 * This file is part of the Inventra Controller Driver for Linux.

--- 319 unchanged lines hidden (view full) ---

328
329static void omap_musb_mailbox_work(struct work_struct *mailbox_work)
330{
331 struct omap2430_glue *glue = container_of(mailbox_work,
332 struct omap2430_glue, omap_musb_mailbox_work);
333 omap_musb_set_mailbox(glue);
334}
335
1/*
2 * Copyright (C) 2005-2007 by Texas Instruments
3 * Some code has been taken from tusb6010.c
4 * Copyrights for that are attributable to:
5 * Copyright (C) 2006 Nokia Corporation
6 * Tony Lindgren <tony@atomide.com>
7 *
8 * This file is part of the Inventra Controller Driver for Linux.

--- 319 unchanged lines hidden (view full) ---

328
329static void omap_musb_mailbox_work(struct work_struct *mailbox_work)
330{
331 struct omap2430_glue *glue = container_of(mailbox_work,
332 struct omap2430_glue, omap_musb_mailbox_work);
333 omap_musb_set_mailbox(glue);
334}
335
336static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci)
337{
338 unsigned long flags;
339 irqreturn_t retval = IRQ_NONE;
340 struct musb *musb = __hci;
341
342 spin_lock_irqsave(&musb->lock, flags);
343
344 musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
345 musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
346 musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
347
348 if (musb->int_usb || musb->int_tx || musb->int_rx)
349 retval = musb_interrupt(musb);
350
351 spin_unlock_irqrestore(&musb->lock, flags);
352
353 return retval;
354}
355
336static int omap2430_musb_init(struct musb *musb)
337{
338 u32 l;
339 int status = 0;
340 struct device *dev = musb->controller;
341 struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
342 struct musb_hdrc_platform_data *plat = dev->platform_data;
343 struct omap_musb_board_data *data = plat->board_data;
344
345 /* We require some kind of external transceiver, hooked
346 * up through ULPI. TWL4030-family PMICs include one,
347 * which needs a driver, drivers aren't always needed.
348 */
349 musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
350 if (IS_ERR_OR_NULL(musb->xceiv)) {
351 pr_err("HS USB OTG: no transceiver configured\n");
352 return -ENODEV;
353 }
354
356static int omap2430_musb_init(struct musb *musb)
357{
358 u32 l;
359 int status = 0;
360 struct device *dev = musb->controller;
361 struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
362 struct musb_hdrc_platform_data *plat = dev->platform_data;
363 struct omap_musb_board_data *data = plat->board_data;
364
365 /* We require some kind of external transceiver, hooked
366 * up through ULPI. TWL4030-family PMICs include one,
367 * which needs a driver, drivers aren't always needed.
368 */
369 musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
370 if (IS_ERR_OR_NULL(musb->xceiv)) {
371 pr_err("HS USB OTG: no transceiver configured\n");
372 return -ENODEV;
373 }
374
375 musb->isr = omap2430_musb_interrupt;
376
355 status = pm_runtime_get_sync(dev);
356 if (status < 0) {
357 dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
358 goto err1;
359 }
360
361 l = musb_readl(musb->mregs, OTG_INTERFSEL);
362

--- 315 unchanged lines hidden ---
377 status = pm_runtime_get_sync(dev);
378 if (status < 0) {
379 dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
380 goto err1;
381 }
382
383 l = musb_readl(musb->mregs, OTG_INTERFSEL);
384

--- 315 unchanged lines hidden ---