diff options
author | Ramneek Mehresh <ramneek.mehresh@freescale.com> | 2013-04-18 10:13:33 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-12-12 07:32:41 (GMT) |
commit | e11bc97f0e926a688a7d18100bbac3955d3b8f92 (patch) | |
tree | e0bc77484c6a91f7704dcda4948ee3c08b9851e9 /drivers/usb | |
parent | e1e457f4eb95c625e553082195155c339ec8aade (diff) | |
download | linux-e11bc97f0e926a688a7d18100bbac3955d3b8f92.tar.xz |
usb: fsl: Fix compilation error
Commit 42a1431068088 in the LSDK 4.9 kernel("usb: host: Add support
to add/remove usb host driver") introduced the compilation error. We fix it now.
Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 94 |
1 files changed, 40 insertions, 54 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 7b82fb8..43650d1 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -82,13 +82,23 @@ struct ccsr_usb_phy { #define DRV_NAME "ehci-fsl" static struct hc_driver __read_mostly fsl_ehci_hc_driver; + struct ehci_fsl { - /* store current hcd state for otg; - * have_hcd is true when host drv al already part of otg framework, - * otherwise false; - * hcd_add is true when otg framework wants to add host - * drv as part of otg;flase when it wants to remove it - */ + struct ehci_hcd ehci; + +#ifdef CONFIG_PM +struct ehci_regs saved_regs; +struct ccsr_usb_phy saved_phy_regs; +/* Saved USB PHY settings, need to restore after deep sleep. */ +u32 usb_ctrl; +#endif + /* + * store current hcd state for otg; + * have_hcd is true when host drv al already part of otg framework, + * otherwise false; + * hcd_add is true when otg framework wants to add host + * drv as part of otg;flase when it wants to remove it + */ unsigned have_hcd:1; unsigned hcd_add:1; }; @@ -115,7 +125,7 @@ int retval; /* host, gadget and otg share same int line */ retval = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED); if (retval == 0) - ehci_fsl->have_hcd = 1; + ehci_fsl->have_hcd = 1; } else if (!ehci_fsl->hcd_add && ehci_fsl->have_hcd) { usb_remove_hcd(hcd); ehci_fsl->have_hcd = 0; @@ -123,53 +133,26 @@ int retval; } #endif -struct ehci_fsl { - struct ehci_hcd ehci; - -#ifdef CONFIG_PM -struct ehci_regs saved_regs; -struct ccsr_usb_phy saved_phy_regs; -/* Saved USB PHY settings, need to restore after deep sleep. */ -u32 usb_ctrl; -#endif - /* - * store current hcd state for otg; - * have_hcd is true when host drv al already part of otg framework, - * otherwise false; - * hcd_add is true when otg framework wants to add host - * drv as part of otg;flase when it wants to remove it - */ -unsigned have_hcd:1; -unsigned hcd_add:1; -}; - -static strut ehci_fsl *hcd_to_ehci_fsl(struct usb_hcd *hcd) -{ -struct ehci_hcd *ehci = hcd_to_ehci(hcd); - -return container_of(ehci, struct ehci_fsl, ehci); -} - #if defined(CONFIG_FSL_USB2_OTG) || defined(CONFIG_FSL_USB2_OTG_MODULE) static void do_change_hcd(struct work_struct *work) { -struct ehci_hcd *ehci = container_of(work, struct ehci_hcd, -change_hcd_work); -struct usb_hcd *hcd = ehci_to_hcd(ehci); -struct ehci_fsl *ehci_fsl = hcd_to_ehci_fsl(hcd); -void __iomem *non_ehci = hcd->regs; -int retval; + struct ehci_hcd *ehci = container_of(work, struct ehci_hcd, + change_hcd_work); + struct usb_hcd *hcd = ehci_to_hcd(ehci); + struct ehci_fsl *ehci_fsl = hcd_to_ehci_fsl(hcd); + void __iomem *non_ehci = hcd->regs; + int retval; -if (ehci_fsl->hcd_add && !ehci_fsl->have_hcd) { -writel(USBMODE_CM_HOST, non_ehci + FSL_SOC_USB_USBMODE); -/* host, gadget and otg share same int line */ -retval = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED); -if (retval == 0) -ehci_fsl->have_hcd = 1; -} else if (!ehci_fsl->hcd_add && ehci_fsl->have_hcd) { - usb_remove_hcd(hcd); -ehci_fsl->have_hcd = 0; -} + if (ehci_fsl->hcd_add && !ehci_fsl->have_hcd) { + writel(USBMODE_CM_HOST, non_ehci + FSL_SOC_USB_USBMODE); + /* host, gadget and otg share same int line */ + retval = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED); + if (retval == 0) + ehci_fsl->have_hcd = 1; + } else if (!ehci_fsl->hcd_add && ehci_fsl->have_hcd) { + usb_remove_hcd(hcd); + ehci_fsl->have_hcd = 0; + } } #endif @@ -324,8 +307,7 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) return retval; } -static bool usb_phy_clk_valid(struct usb_hcd *hcd, - enum fsl_usb2_phy_modes phy_mode) +static bool usb_phy_clk_valid(struct usb_hcd *hcd) { void __iomem *non_ehci = hcd->regs; bool ret = true; @@ -755,7 +737,9 @@ static int ehci_fsl_drv_suspend(struct device *dev) #ifdef CONFIG_PPC suspend_state_t pm_state; -pm_state = pm_suspend_state(); +/* FIXME:Need to port fsl_pm.h before enable below code. */ +/*pm_state = pm_suspend_state();*/ +pm_state = PM_SUSPEND_MEM; if (pm_state == PM_SUSPEND_MEM) ehci_fsl_save_context(hcd); @@ -800,7 +784,9 @@ static int ehci_fsl_drv_resume(struct device *dev) #ifdef CONFIG_PPC suspend_state_t pm_state; -pm_state = pm_suspend_state(); +/* FIXME:Need to port fsl_pm.h before enable below code.*/ +/* pm_state = pm_suspend_state(); */ +pm_state = PM_SUSPEND_MEM; if (pm_state == PM_SUSPEND_MEM) ehci_fsl_restore_context(hcd); |