diff options
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/Kconfig | 9 | ||||
-rw-r--r-- | drivers/usb/host/ehci-atmel.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-nxp.c | 80 | ||||
-rw-r--r-- | drivers/usb/host/ohci.h | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mtk.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/xhci-plat.c | 6 |
8 files changed, 28 insertions, 95 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 8c20ebbc049c..3050b18b2447 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -18,7 +18,7 @@ config USB_C67X00_HCD config USB_XHCI_HCD tristate "xHCI HCD (USB 3.0) support" - depends on HAS_IOMEM + depends on HAS_DMA && HAS_IOMEM ---help--- The eXtensible Host Controller Interface (xHCI) is standard for USB 3.0 "SuperSpeed" host controller hardware. @@ -73,7 +73,7 @@ endif # USB_XHCI_HCD config USB_EHCI_HCD tristate "EHCI HCD (USB 2.0) support" - depends on HAS_IOMEM + depends on HAS_DMA && HAS_IOMEM ---help--- The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0 "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware. @@ -364,8 +364,7 @@ config USB_ISP1362_HCD config USB_FOTG210_HCD tristate "FOTG210 HCD support" - depends on USB - depends on HAS_IOMEM + depends on USB && HAS_DMA && HAS_IOMEM ---help--- Faraday FOTG210 is an OTG controller which can be configured as an USB2.0 host. It is designed to meet USB2.0 EHCI specification @@ -387,7 +386,7 @@ config USB_MAX3421_HCD config USB_OHCI_HCD tristate "OHCI HCD (USB 1.1) support" - depends on HAS_IOMEM + depends on HAS_DMA && HAS_IOMEM ---help--- The Open Host Controller Interface (OHCI) is a standard for accessing USB 1.1 host controller hardware. It does more in hardware than Intel's diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index be0964a801e8..7440722bfbf0 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -185,8 +185,7 @@ static int ehci_atmel_drv_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int ehci_atmel_drv_suspend(struct device *dev) +static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); @@ -200,7 +199,7 @@ static int ehci_atmel_drv_suspend(struct device *dev) return 0; } -static int ehci_atmel_drv_resume(struct device *dev) +static int __maybe_unused ehci_atmel_drv_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); @@ -208,7 +207,6 @@ static int ehci_atmel_drv_resume(struct device *dev) atmel_start_clock(atmel_ehci); return ehci_resume(hcd, false); } -#endif #ifdef CONFIG_OF static const struct of_device_id atmel_ehci_dt_ids[] = { diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 2ddf35203c05..3f3b74aeca97 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -888,12 +888,10 @@ extern int ehci_handshake(struct ehci_hcd *ehci, void __iomem *ptr, u32 mask, u32 done, int usec); extern int ehci_reset(struct ehci_hcd *ehci); -#ifdef CONFIG_PM extern int ehci_suspend(struct usb_hcd *hcd, bool do_wakeup); extern int ehci_resume(struct usb_hcd *hcd, bool force_reset); extern void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, bool suspending, bool do_wakeup); -#endif /* CONFIG_PM */ extern int ehci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength); diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 8c6e15bd6ff0..f789d2954c5d 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -583,9 +583,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM - -static int +static int __maybe_unused ohci_hcd_at91_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -630,7 +628,8 @@ ohci_hcd_at91_drv_suspend(struct device *dev) return ret; } -static int ohci_hcd_at91_drv_resume(struct device *dev) +static int __maybe_unused +ohci_hcd_at91_drv_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); @@ -643,7 +642,6 @@ static int ohci_hcd_at91_drv_resume(struct device *dev) ohci_resume(hcd, false); return 0; } -#endif static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend, ohci_hcd_at91_drv_resume); diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index ebacf97fc406..b7d4756232ae 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c @@ -34,16 +34,6 @@ #include <mach/hardware.h> #define USB_CONFIG_BASE 0x31020000 -#define PWRMAN_BASE 0x40004000 - -#define USB_CTRL IO_ADDRESS(PWRMAN_BASE + 0x64) - -/* USB_CTRL bit defines */ -#define USB_SLAVE_HCLK_EN (1 << 24) -#define USB_DEV_NEED_CLK_EN (1 << 22) -#define USB_HOST_NEED_CLK_EN (1 << 21) -#define PAD_CONTROL_LAST_DRIVEN (1 << 19) - #define USB_OTG_STAT_CONTROL IO_ADDRESS(USB_CONFIG_BASE + 0x110) /* USB_OTG_STAT_CONTROL bit defines */ @@ -68,9 +58,7 @@ static struct i2c_client *isp1301_i2c_client; extern int usb_disabled(void); -static struct clk *usb_pll_clk; -static struct clk *usb_dev_clk; -static struct clk *usb_otg_clk; +static struct clk *usb_host_clk; static void isp1301_configure_lpc32xx(void) { @@ -110,9 +98,6 @@ static void isp1301_configure_lpc32xx(void) i2c_smbus_write_byte_data(isp1301_i2c_client, ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0); - /* Enable usb_need_clk clock after transceiver is initialized */ - __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL); - printk(KERN_INFO "ISP1301 Vendor ID : 0x%04x\n", i2c_smbus_read_word_data(isp1301_i2c_client, 0x00)); printk(KERN_INFO "ISP1301 Product ID : 0x%04x\n", @@ -185,59 +170,20 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev) goto fail_disable; } - /* Enable AHB slave USB clock, needed for further USB clock control */ - __raw_writel(USB_SLAVE_HCLK_EN | PAD_CONTROL_LAST_DRIVEN, USB_CTRL); - - /* Enable USB PLL */ - usb_pll_clk = devm_clk_get(&pdev->dev, "ck_pll5"); - if (IS_ERR(usb_pll_clk)) { - dev_err(&pdev->dev, "failed to acquire USB PLL\n"); - ret = PTR_ERR(usb_pll_clk); + /* Enable USB host clock */ + usb_host_clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(usb_host_clk)) { + dev_err(&pdev->dev, "failed to acquire USB OHCI clock\n"); + ret = PTR_ERR(usb_host_clk); goto fail_disable; } - ret = clk_prepare_enable(usb_pll_clk); + ret = clk_prepare_enable(usb_host_clk); if (ret < 0) { - dev_err(&pdev->dev, "failed to start USB PLL\n"); + dev_err(&pdev->dev, "failed to start USB OHCI clock\n"); goto fail_disable; } - ret = clk_set_rate(usb_pll_clk, 48000); - if (ret < 0) { - dev_err(&pdev->dev, "failed to set USB clock rate\n"); - goto fail_rate; - } - - /* Enable USB device clock */ - usb_dev_clk = devm_clk_get(&pdev->dev, "ck_usbd"); - if (IS_ERR(usb_dev_clk)) { - dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n"); - ret = PTR_ERR(usb_dev_clk); - goto fail_rate; - } - - ret = clk_prepare_enable(usb_dev_clk); - if (ret < 0) { - dev_err(&pdev->dev, "failed to start USB DEV Clock\n"); - goto fail_rate; - } - - /* Enable USB otg clocks */ - usb_otg_clk = devm_clk_get(&pdev->dev, "ck_usb_otg"); - if (IS_ERR(usb_otg_clk)) { - dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n"); - ret = PTR_ERR(usb_otg_clk); - goto fail_otg; - } - - __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL); - - ret = clk_prepare_enable(usb_otg_clk); - if (ret < 0) { - dev_err(&pdev->dev, "failed to start USB DEV Clock\n"); - goto fail_otg; - } - isp1301_configure(); hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); @@ -276,11 +222,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev) fail_resource: usb_put_hcd(hcd); fail_hcd: - clk_disable_unprepare(usb_otg_clk); -fail_otg: - clk_disable_unprepare(usb_dev_clk); -fail_rate: - clk_disable_unprepare(usb_pll_clk); + clk_disable_unprepare(usb_host_clk); fail_disable: isp1301_i2c_client = NULL; return ret; @@ -293,9 +235,7 @@ static int ohci_hcd_nxp_remove(struct platform_device *pdev) usb_remove_hcd(hcd); ohci_nxp_stop_hc(); usb_put_hcd(hcd); - clk_disable_unprepare(usb_otg_clk); - clk_disable_unprepare(usb_dev_clk); - clk_disable_unprepare(usb_pll_clk); + clk_disable_unprepare(usb_host_clk); isp1301_i2c_client = NULL; return 0; diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index bc462288cfb0..37f1725e7a46 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -735,10 +735,8 @@ extern void ohci_init_driver(struct hc_driver *drv, const struct ohci_driver_overrides *over); extern int ohci_restart(struct ohci_hcd *ohci); extern int ohci_setup(struct usb_hcd *hcd); -#ifdef CONFIG_PM extern int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup); extern int ohci_resume(struct usb_hcd *hcd, bool hibernated); -#endif extern int ohci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength); extern int ohci_hub_status_data(struct usb_hcd *hcd, char *buf); diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 9532f5aef71b..79959f17c38c 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -695,7 +695,6 @@ static int xhci_mtk_remove(struct platform_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP /* * if ip sleep fails, and all clocks are disabled, access register will hang * AHB bus, so stop polling roothubs to avoid regs access on bus suspend. @@ -703,7 +702,7 @@ static int xhci_mtk_remove(struct platform_device *dev) * to wake up system immediately after system suspend complete if ip sleep * fails, it is what we wanted. */ -static int xhci_mtk_suspend(struct device *dev) +static int __maybe_unused xhci_mtk_suspend(struct device *dev) { struct xhci_hcd_mtk *mtk = dev_get_drvdata(dev); struct usb_hcd *hcd = mtk->hcd; @@ -722,7 +721,7 @@ static int xhci_mtk_suspend(struct device *dev) return 0; } -static int xhci_mtk_resume(struct device *dev) +static int __maybe_unused xhci_mtk_resume(struct device *dev) { struct xhci_hcd_mtk *mtk = dev_get_drvdata(dev); struct usb_hcd *hcd = mtk->hcd; @@ -744,10 +743,7 @@ static int xhci_mtk_resume(struct device *dev) static const struct dev_pm_ops xhci_mtk_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(xhci_mtk_suspend, xhci_mtk_resume) }; -#define DEV_PM_OPS (&xhci_mtk_pm_ops) -#else -#define DEV_PM_OPS NULL -#endif /* CONFIG_PM */ +#define DEV_PM_OPS IS_ENABLED(CONFIG_PM) ? &xhci_mtk_pm_ops : NULL #ifdef CONFIG_OF static const struct of_device_id mtk_xhci_of_match[] = { diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index d39d6bf1d090..5c15e9bc5f7a 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -110,7 +110,13 @@ static const struct of_device_id usb_xhci_of_match[] = { .compatible = "renesas,xhci-r8a7795", .data = &xhci_plat_renesas_rcar_gen3, }, { + .compatible = "renesas,rcar-gen2-xhci", + .data = &xhci_plat_renesas_rcar_gen2, + }, { + .compatible = "renesas,rcar-gen3-xhci", + .data = &xhci_plat_renesas_rcar_gen3, }, + {}, }; MODULE_DEVICE_TABLE(of, usb_xhci_of_match); #endif |