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