Lines Matching refs:histb
49 static int xhci_histb_config(struct xhci_hcd_histb *histb) in xhci_histb_config() argument
51 struct device_node *np = histb->dev->of_node; in xhci_histb_config()
56 regval = readl(histb->ctrl + REG_GUSB2PHYCFG0); in xhci_histb_config()
60 writel(regval, histb->ctrl + REG_GUSB2PHYCFG0); in xhci_histb_config()
71 regval = readl(histb->ctrl + REG_GUSB3PIPECTL0); in xhci_histb_config()
75 writel(regval, histb->ctrl + REG_GUSB3PIPECTL0); in xhci_histb_config()
78 writel(0x23100000, histb->ctrl + GTXTHRCFG); in xhci_histb_config()
79 writel(0x23100000, histb->ctrl + GRXTHRCFG); in xhci_histb_config()
84 static int xhci_histb_clks_get(struct xhci_hcd_histb *histb) in xhci_histb_clks_get() argument
86 struct device *dev = histb->dev; in xhci_histb_clks_get()
88 histb->bus_clk = devm_clk_get(dev, "bus"); in xhci_histb_clks_get()
89 if (IS_ERR(histb->bus_clk)) { in xhci_histb_clks_get()
91 return PTR_ERR(histb->bus_clk); in xhci_histb_clks_get()
94 histb->utmi_clk = devm_clk_get(dev, "utmi"); in xhci_histb_clks_get()
95 if (IS_ERR(histb->utmi_clk)) { in xhci_histb_clks_get()
97 return PTR_ERR(histb->utmi_clk); in xhci_histb_clks_get()
100 histb->pipe_clk = devm_clk_get(dev, "pipe"); in xhci_histb_clks_get()
101 if (IS_ERR(histb->pipe_clk)) { in xhci_histb_clks_get()
103 return PTR_ERR(histb->pipe_clk); in xhci_histb_clks_get()
106 histb->suspend_clk = devm_clk_get(dev, "suspend"); in xhci_histb_clks_get()
107 if (IS_ERR(histb->suspend_clk)) { in xhci_histb_clks_get()
109 return PTR_ERR(histb->suspend_clk); in xhci_histb_clks_get()
115 static int xhci_histb_host_enable(struct xhci_hcd_histb *histb) in xhci_histb_host_enable() argument
119 ret = clk_prepare_enable(histb->bus_clk); in xhci_histb_host_enable()
121 dev_err(histb->dev, "failed to enable bus clk\n"); in xhci_histb_host_enable()
125 ret = clk_prepare_enable(histb->utmi_clk); in xhci_histb_host_enable()
127 dev_err(histb->dev, "failed to enable utmi clk\n"); in xhci_histb_host_enable()
131 ret = clk_prepare_enable(histb->pipe_clk); in xhci_histb_host_enable()
133 dev_err(histb->dev, "failed to enable pipe clk\n"); in xhci_histb_host_enable()
137 ret = clk_prepare_enable(histb->suspend_clk); in xhci_histb_host_enable()
139 dev_err(histb->dev, "failed to enable suspend clk\n"); in xhci_histb_host_enable()
143 reset_control_deassert(histb->soft_reset); in xhci_histb_host_enable()
148 clk_disable_unprepare(histb->pipe_clk); in xhci_histb_host_enable()
150 clk_disable_unprepare(histb->utmi_clk); in xhci_histb_host_enable()
152 clk_disable_unprepare(histb->bus_clk); in xhci_histb_host_enable()
157 static void xhci_histb_host_disable(struct xhci_hcd_histb *histb) in xhci_histb_host_disable() argument
159 reset_control_assert(histb->soft_reset); in xhci_histb_host_disable()
161 clk_disable_unprepare(histb->suspend_clk); in xhci_histb_host_disable()
162 clk_disable_unprepare(histb->pipe_clk); in xhci_histb_host_disable()
163 clk_disable_unprepare(histb->utmi_clk); in xhci_histb_host_disable()
164 clk_disable_unprepare(histb->bus_clk); in xhci_histb_host_disable()
180 struct xhci_hcd_histb *histb = hcd_to_histb(hcd); in xhci_histb_setup() local
184 ret = xhci_histb_config(histb); in xhci_histb_setup()
200 struct xhci_hcd_histb *histb; in xhci_histb_probe() local
212 histb = devm_kzalloc(dev, sizeof(*histb), GFP_KERNEL); in xhci_histb_probe()
213 if (!histb) in xhci_histb_probe()
216 histb->dev = dev; in xhci_histb_probe()
222 histb->ctrl = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in xhci_histb_probe()
223 if (IS_ERR(histb->ctrl)) in xhci_histb_probe()
224 return PTR_ERR(histb->ctrl); in xhci_histb_probe()
226 ret = xhci_histb_clks_get(histb); in xhci_histb_probe()
230 histb->soft_reset = devm_reset_control_get(dev, "soft"); in xhci_histb_probe()
231 if (IS_ERR(histb->soft_reset)) { in xhci_histb_probe()
233 return PTR_ERR(histb->soft_reset); in xhci_histb_probe()
251 hcd->regs = histb->ctrl; in xhci_histb_probe()
255 histb->hcd = hcd; in xhci_histb_probe()
256 dev_set_drvdata(hcd->self.controller, histb); in xhci_histb_probe()
258 ret = xhci_histb_host_enable(histb); in xhci_histb_probe()
312 xhci_histb_host_disable(histb); in xhci_histb_probe()
324 struct xhci_hcd_histb *histb = platform_get_drvdata(dev); in xhci_histb_remove() local
325 struct usb_hcd *hcd = histb->hcd; in xhci_histb_remove()
338 xhci_histb_host_disable(histb); in xhci_histb_remove()
348 struct xhci_hcd_histb *histb = dev_get_drvdata(dev); in xhci_histb_suspend() local
349 struct usb_hcd *hcd = histb->hcd; in xhci_histb_suspend()
356 xhci_histb_host_disable(histb); in xhci_histb_suspend()
363 struct xhci_hcd_histb *histb = dev_get_drvdata(dev); in xhci_histb_resume() local
364 struct usb_hcd *hcd = histb->hcd; in xhci_histb_resume()
368 xhci_histb_host_enable(histb); in xhci_histb_resume()