Lines Matching full:usb3
21 static void rzv2m_usb3drd_set_bit(struct rzv2m_usb3drd *usb3, u32 bits, in rzv2m_usb3drd_set_bit() argument
24 u32 val = readl(usb3->reg + offs); in rzv2m_usb3drd_set_bit()
27 writel(val, usb3->reg + offs); in rzv2m_usb3drd_set_bit()
30 static void rzv2m_usb3drd_clear_bit(struct rzv2m_usb3drd *usb3, u32 bits, in rzv2m_usb3drd_clear_bit() argument
33 u32 val = readl(usb3->reg + offs); in rzv2m_usb3drd_clear_bit()
36 writel(val, usb3->reg + offs); in rzv2m_usb3drd_clear_bit()
41 struct rzv2m_usb3drd *usb3 = dev_get_drvdata(dev); in rzv2m_usb3drd_reset() local
44 rzv2m_usb3drd_clear_bit(usb3, USB_PERI_DRD_CON_PERI_CON, in rzv2m_usb3drd_reset()
46 rzv2m_usb3drd_clear_bit(usb3, USB_PERI_DRD_CON_HOST_RST, in rzv2m_usb3drd_reset()
48 rzv2m_usb3drd_set_bit(usb3, USB_PERI_DRD_CON_PERI_RST, in rzv2m_usb3drd_reset()
51 rzv2m_usb3drd_set_bit(usb3, USB_PERI_DRD_CON_PERI_CON, in rzv2m_usb3drd_reset()
53 rzv2m_usb3drd_set_bit(usb3, USB_PERI_DRD_CON_HOST_RST, in rzv2m_usb3drd_reset()
55 rzv2m_usb3drd_clear_bit(usb3, USB_PERI_DRD_CON_PERI_RST, in rzv2m_usb3drd_reset()
63 struct rzv2m_usb3drd *usb3 = platform_get_drvdata(pdev); in rzv2m_usb3drd_remove() local
65 of_platform_depopulate(usb3->dev); in rzv2m_usb3drd_remove()
66 pm_runtime_put(usb3->dev); in rzv2m_usb3drd_remove()
68 reset_control_assert(usb3->drd_rstc); in rzv2m_usb3drd_remove()
73 struct rzv2m_usb3drd *usb3; in rzv2m_usb3drd_probe() local
76 usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL); in rzv2m_usb3drd_probe()
77 if (!usb3) in rzv2m_usb3drd_probe()
80 usb3->dev = &pdev->dev; in rzv2m_usb3drd_probe()
82 usb3->drd_irq = platform_get_irq_byname(pdev, "drd"); in rzv2m_usb3drd_probe()
83 if (usb3->drd_irq < 0) in rzv2m_usb3drd_probe()
84 return usb3->drd_irq; in rzv2m_usb3drd_probe()
86 usb3->reg = devm_platform_ioremap_resource(pdev, 0); in rzv2m_usb3drd_probe()
87 if (IS_ERR(usb3->reg)) in rzv2m_usb3drd_probe()
88 return PTR_ERR(usb3->reg); in rzv2m_usb3drd_probe()
90 platform_set_drvdata(pdev, usb3); in rzv2m_usb3drd_probe()
92 usb3->drd_rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); in rzv2m_usb3drd_probe()
93 if (IS_ERR(usb3->drd_rstc)) in rzv2m_usb3drd_probe()
94 return dev_err_probe(&pdev->dev, PTR_ERR(usb3->drd_rstc), in rzv2m_usb3drd_probe()
97 reset_control_deassert(usb3->drd_rstc); in rzv2m_usb3drd_probe()
99 ret = pm_runtime_resume_and_get(usb3->dev); in rzv2m_usb3drd_probe()
103 ret = of_platform_populate(usb3->dev->of_node, NULL, NULL, usb3->dev); in rzv2m_usb3drd_probe()
110 pm_runtime_put(usb3->dev); in rzv2m_usb3drd_probe()
114 reset_control_assert(usb3->drd_rstc); in rzv2m_usb3drd_probe()