Lines Matching full:usb

14 #include <linux/usb.h>
15 #include <linux/usb/chipidea.h>
16 #include <linux/usb/hcd.h>
17 #include <linux/usb/of.h>
18 #include <linux/usb/phy.h>
106 rst = devm_reset_control_get_shared(dev, "usb"); in tegra_usb_reset_controller()
117 * The 1st USB controller contains some UTMI pad registers that are in tegra_usb_reset_controller()
155 struct tegra_usb *usb = dev_get_drvdata(ci->dev->parent); in tegra_usb_notify_event() local
163 ehci_writel(ehci, usb->soc->txfifothresh << 16, in tegra_usb_notify_event()
181 /* disable USB interrupt */ in tegra_usb_internal_port_reset()
239 struct tegra_usb *usb = dev_get_drvdata(ci->dev->parent); in tegra_ehci_hub_control() local
248 if (wValue != USB_PORT_FEAT_RESET || !usb->needs_double_reset) in tegra_ehci_hub_control()
264 * hang CPU if USB controller is put into low power mode because in tegra_usb_enter_lpm()
265 * AHB USB clock is gated on Tegra in the LPM. in tegra_usb_enter_lpm()
278 struct tegra_usb *usb; in tegra_usb_probe() local
281 usb = devm_kzalloc(&pdev->dev, sizeof(*usb), GFP_KERNEL); in tegra_usb_probe()
282 if (!usb) in tegra_usb_probe()
285 platform_set_drvdata(pdev, usb); in tegra_usb_probe()
293 usb->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); in tegra_usb_probe()
294 if (IS_ERR(usb->phy)) in tegra_usb_probe()
295 return dev_err_probe(&pdev->dev, PTR_ERR(usb->phy), in tegra_usb_probe()
298 usb->clk = devm_clk_get(&pdev->dev, NULL); in tegra_usb_probe()
299 if (IS_ERR(usb->clk)) in tegra_usb_probe()
300 return dev_err_probe(&pdev->dev, PTR_ERR(usb->clk), in tegra_usb_probe()
313 usb->needs_double_reset = true; in tegra_usb_probe()
322 * USB controller registers shouldn't be touched before PHY is in tegra_usb_probe()
324 * PHY driver controls gating of internal USB clocks on Tegra. in tegra_usb_probe()
326 err = usb_phy_init(usb->phy); in tegra_usb_probe()
331 usb->soc = soc; in tegra_usb_probe()
332 usb->data.name = "tegra-usb"; in tegra_usb_probe()
333 usb->data.flags = soc->flags; in tegra_usb_probe()
334 usb->data.usb_phy = usb->phy; in tegra_usb_probe()
335 usb->data.dr_mode = soc->dr_mode; in tegra_usb_probe()
336 usb->data.capoffset = DEF_CAPOFFSET; in tegra_usb_probe()
337 usb->data.enter_lpm = tegra_usb_enter_lpm; in tegra_usb_probe()
338 usb->data.hub_control = tegra_ehci_hub_control; in tegra_usb_probe()
339 usb->data.notify_event = tegra_usb_notify_event; in tegra_usb_probe()
343 usb->data.flags &= ~CI_HDRC_SUPPORTS_RUNTIME_PM; in tegra_usb_probe()
345 usb->dev = ci_hdrc_add_device(&pdev->dev, pdev->resource, in tegra_usb_probe()
346 pdev->num_resources, &usb->data); in tegra_usb_probe()
347 if (IS_ERR(usb->dev)) { in tegra_usb_probe()
348 err = dev_err_probe(&pdev->dev, PTR_ERR(usb->dev), in tegra_usb_probe()
356 usb_phy_shutdown(usb->phy); in tegra_usb_probe()
366 struct tegra_usb *usb = platform_get_drvdata(pdev); in tegra_usb_remove() local
368 ci_hdrc_remove_device(usb->dev); in tegra_usb_remove()
369 usb_phy_shutdown(usb->phy); in tegra_usb_remove()
377 struct tegra_usb *usb = dev_get_drvdata(dev); in tegra_usb_runtime_resume() local
380 err = clk_prepare_enable(usb->clk); in tegra_usb_runtime_resume()
391 struct tegra_usb *usb = dev_get_drvdata(dev); in tegra_usb_runtime_suspend() local
393 clk_disable_unprepare(usb->clk); in tegra_usb_runtime_suspend()
404 .name = "tegra-usb",
413 MODULE_DESCRIPTION("NVIDIA Tegra USB driver");