#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
-#include <linux/spinlock.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/platform_data/usb-omap.h>
struct usbhs_omap_platform_data *pdata;
u32 usbhs_rev;
- spinlock_t lock;
};
/*-------------------------------------------------------------------------*/
{
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
struct usbhs_omap_platform_data *pdata = omap->pdata;
- unsigned long flags;
int i, r;
dev_dbg(dev, "usbhs_runtime_resume\n");
omap_tll_enable();
- spin_lock_irqsave(&omap->lock, flags);
if (!IS_ERR(omap->ehci_logic_fck))
clk_enable(omap->ehci_logic_fck);
}
}
- spin_unlock_irqrestore(&omap->lock, flags);
-
return 0;
}
{
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
struct usbhs_omap_platform_data *pdata = omap->pdata;
- unsigned long flags;
int i;
dev_dbg(dev, "usbhs_runtime_suspend\n");
- spin_lock_irqsave(&omap->lock, flags);
-
for (i = 0; i < omap->nports; i++) {
switch (pdata->port_mode[i]) {
case OMAP_EHCI_PORT_MODE_HSIC:
if (!IS_ERR(omap->ehci_logic_fck))
clk_disable(omap->ehci_logic_fck);
- spin_unlock_irqrestore(&omap->lock, flags);
omap_tll_disable();
return 0;
{
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
struct usbhs_omap_platform_data *pdata = omap->pdata;
- unsigned long flags;
unsigned reg;
dev_dbg(dev, "starting TI HSUSB Controller\n");
}
pm_runtime_get_sync(dev);
- spin_lock_irqsave(&omap->lock, flags);
reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
/* setup ULPI bypass and burst configurations */
usbhs_write(omap->uhh_base, OMAP_UHH_HOSTCONFIG, reg);
dev_dbg(dev, "UHH setup done, uhh_hostconfig=%x\n", reg);
- spin_unlock_irqrestore(&omap->lock, flags);
-
pm_runtime_put_sync(dev);
if (pdata->phy_reset) {
/* Hold the PHY in RESET for enough time till
return -EADDRNOTAVAIL;
}
- spin_lock_init(&omap->lock);
-
omap->pdata = pdata;
pm_runtime_enable(dev);