Lines Matching refs:da8xx_ohci

54 	struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);  in ohci_da8xx_enable()  local
57 ret = clk_prepare_enable(da8xx_ohci->usb11_clk); in ohci_da8xx_enable()
61 ret = phy_init(da8xx_ohci->usb11_phy); in ohci_da8xx_enable()
65 ret = phy_power_on(da8xx_ohci->usb11_phy); in ohci_da8xx_enable()
72 phy_exit(da8xx_ohci->usb11_phy); in ohci_da8xx_enable()
74 clk_disable_unprepare(da8xx_ohci->usb11_clk); in ohci_da8xx_enable()
81 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_disable() local
83 phy_power_off(da8xx_ohci->usb11_phy); in ohci_da8xx_disable()
84 phy_exit(da8xx_ohci->usb11_phy); in ohci_da8xx_disable()
85 clk_disable_unprepare(da8xx_ohci->usb11_clk); in ohci_da8xx_disable()
90 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_set_power() local
94 if (!da8xx_ohci->vbus_reg) in ohci_da8xx_set_power()
98 ret = regulator_enable(da8xx_ohci->vbus_reg); in ohci_da8xx_set_power()
104 ret = regulator_disable(da8xx_ohci->vbus_reg); in ohci_da8xx_set_power()
116 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_power() local
118 if (da8xx_ohci->vbus_reg) in ohci_da8xx_get_power()
119 return regulator_is_enabled(da8xx_ohci->vbus_reg); in ohci_da8xx_get_power()
126 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_oci() local
130 if (da8xx_ohci->oc_gpio) in ohci_da8xx_get_oci()
131 return gpiod_get_value_cansleep(da8xx_ohci->oc_gpio); in ohci_da8xx_get_oci()
133 if (!da8xx_ohci->vbus_reg) in ohci_da8xx_get_oci()
136 ret = regulator_get_error_flags(da8xx_ohci->vbus_reg, &flags); in ohci_da8xx_get_oci()
148 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_set_power() local
150 if (da8xx_ohci->vbus_reg) in ohci_da8xx_has_set_power()
158 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_oci() local
160 if (da8xx_ohci->oc_gpio) in ohci_da8xx_has_oci()
163 if (da8xx_ohci->vbus_reg) in ohci_da8xx_has_oci()
183 struct da8xx_ohci_hcd *da8xx_ohci = in ohci_da8xx_regulator_event() local
188 ohci_da8xx_set_power(da8xx_ohci->hcd, 0); in ohci_da8xx_regulator_event()
196 struct da8xx_ohci_hcd *da8xx_ohci = data; in ohci_da8xx_oc_thread() local
197 struct device *dev = da8xx_ohci->hcd->self.controller; in ohci_da8xx_oc_thread()
200 if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio) && in ohci_da8xx_oc_thread()
201 da8xx_ohci->vbus_reg) { in ohci_da8xx_oc_thread()
202 ret = regulator_disable(da8xx_ohci->vbus_reg); in ohci_da8xx_oc_thread()
212 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_register_notify() local
216 if (!da8xx_ohci->oc_gpio && da8xx_ohci->vbus_reg) { in ohci_da8xx_register_notify()
217 da8xx_ohci->nb.notifier_call = ohci_da8xx_regulator_event; in ohci_da8xx_register_notify()
218 ret = devm_regulator_register_notifier(da8xx_ohci->vbus_reg, in ohci_da8xx_register_notify()
219 &da8xx_ohci->nb); in ohci_da8xx_register_notify()
376 struct da8xx_ohci_hcd *da8xx_ohci; in ohci_da8xx_probe() local
386 da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_probe()
387 da8xx_ohci->hcd = hcd; in ohci_da8xx_probe()
389 da8xx_ohci->usb11_clk = devm_clk_get(dev, NULL); in ohci_da8xx_probe()
390 if (IS_ERR(da8xx_ohci->usb11_clk)) { in ohci_da8xx_probe()
391 error = PTR_ERR(da8xx_ohci->usb11_clk); in ohci_da8xx_probe()
397 da8xx_ohci->usb11_phy = devm_phy_get(dev, "usb-phy"); in ohci_da8xx_probe()
398 if (IS_ERR(da8xx_ohci->usb11_phy)) { in ohci_da8xx_probe()
399 error = PTR_ERR(da8xx_ohci->usb11_phy); in ohci_da8xx_probe()
405 da8xx_ohci->vbus_reg = devm_regulator_get_optional(dev, "vbus"); in ohci_da8xx_probe()
406 if (IS_ERR(da8xx_ohci->vbus_reg)) { in ohci_da8xx_probe()
407 error = PTR_ERR(da8xx_ohci->vbus_reg); in ohci_da8xx_probe()
409 da8xx_ohci->vbus_reg = NULL; in ohci_da8xx_probe()
418 da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN); in ohci_da8xx_probe()
419 if (IS_ERR(da8xx_ohci->oc_gpio)) { in ohci_da8xx_probe()
420 error = PTR_ERR(da8xx_ohci->oc_gpio); in ohci_da8xx_probe()
424 if (da8xx_ohci->oc_gpio) { in ohci_da8xx_probe()
425 oc_irq = gpiod_to_irq(da8xx_ohci->oc_gpio); in ohci_da8xx_probe()
434 "OHCI over-current indicator", da8xx_ohci); in ohci_da8xx_probe()