Lines Matching refs:da8xx_ohci
53 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_enable() local
56 ret = clk_prepare_enable(da8xx_ohci->usb11_clk); in ohci_da8xx_enable()
60 ret = phy_init(da8xx_ohci->usb11_phy); in ohci_da8xx_enable()
64 ret = phy_power_on(da8xx_ohci->usb11_phy); in ohci_da8xx_enable()
71 phy_exit(da8xx_ohci->usb11_phy); in ohci_da8xx_enable()
73 clk_disable_unprepare(da8xx_ohci->usb11_clk); in ohci_da8xx_enable()
80 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_disable() local
82 phy_power_off(da8xx_ohci->usb11_phy); in ohci_da8xx_disable()
83 phy_exit(da8xx_ohci->usb11_phy); in ohci_da8xx_disable()
84 clk_disable_unprepare(da8xx_ohci->usb11_clk); in ohci_da8xx_disable()
89 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_set_power() local
93 if (!da8xx_ohci->vbus_reg) in ohci_da8xx_set_power()
97 ret = regulator_enable(da8xx_ohci->vbus_reg); in ohci_da8xx_set_power()
103 ret = regulator_disable(da8xx_ohci->vbus_reg); in ohci_da8xx_set_power()
115 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_power() local
117 if (da8xx_ohci->vbus_reg) in ohci_da8xx_get_power()
118 return regulator_is_enabled(da8xx_ohci->vbus_reg); in ohci_da8xx_get_power()
125 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_oci() local
129 if (da8xx_ohci->oc_gpio) in ohci_da8xx_get_oci()
130 return gpiod_get_value_cansleep(da8xx_ohci->oc_gpio); in ohci_da8xx_get_oci()
132 if (!da8xx_ohci->vbus_reg) in ohci_da8xx_get_oci()
135 ret = regulator_get_error_flags(da8xx_ohci->vbus_reg, &flags); in ohci_da8xx_get_oci()
147 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_set_power() local
149 if (da8xx_ohci->vbus_reg) in ohci_da8xx_has_set_power()
157 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_oci() local
159 if (da8xx_ohci->oc_gpio) in ohci_da8xx_has_oci()
162 if (da8xx_ohci->vbus_reg) in ohci_da8xx_has_oci()
182 struct da8xx_ohci_hcd *da8xx_ohci = in ohci_da8xx_regulator_event() local
187 ohci_da8xx_set_power(da8xx_ohci->hcd, 0); in ohci_da8xx_regulator_event()
195 struct da8xx_ohci_hcd *da8xx_ohci = data; in ohci_da8xx_oc_thread() local
196 struct device *dev = da8xx_ohci->hcd->self.controller; in ohci_da8xx_oc_thread()
199 if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio) && in ohci_da8xx_oc_thread()
200 da8xx_ohci->vbus_reg) { in ohci_da8xx_oc_thread()
201 ret = regulator_disable(da8xx_ohci->vbus_reg); in ohci_da8xx_oc_thread()
211 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_register_notify() local
215 if (!da8xx_ohci->oc_gpio && da8xx_ohci->vbus_reg) { in ohci_da8xx_register_notify()
216 da8xx_ohci->nb.notifier_call = ohci_da8xx_regulator_event; in ohci_da8xx_register_notify()
217 ret = devm_regulator_register_notifier(da8xx_ohci->vbus_reg, in ohci_da8xx_register_notify()
218 &da8xx_ohci->nb); in ohci_da8xx_register_notify()
375 struct da8xx_ohci_hcd *da8xx_ohci; in ohci_da8xx_probe() local
385 da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_probe()
386 da8xx_ohci->hcd = hcd; in ohci_da8xx_probe()
388 da8xx_ohci->usb11_clk = devm_clk_get(dev, NULL); in ohci_da8xx_probe()
389 if (IS_ERR(da8xx_ohci->usb11_clk)) { in ohci_da8xx_probe()
390 error = PTR_ERR(da8xx_ohci->usb11_clk); in ohci_da8xx_probe()
396 da8xx_ohci->usb11_phy = devm_phy_get(dev, "usb-phy"); in ohci_da8xx_probe()
397 if (IS_ERR(da8xx_ohci->usb11_phy)) { in ohci_da8xx_probe()
398 error = PTR_ERR(da8xx_ohci->usb11_phy); in ohci_da8xx_probe()
404 da8xx_ohci->vbus_reg = devm_regulator_get_optional(dev, "vbus"); in ohci_da8xx_probe()
405 if (IS_ERR(da8xx_ohci->vbus_reg)) { in ohci_da8xx_probe()
406 error = PTR_ERR(da8xx_ohci->vbus_reg); in ohci_da8xx_probe()
408 da8xx_ohci->vbus_reg = NULL; in ohci_da8xx_probe()
417 da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN); in ohci_da8xx_probe()
418 if (IS_ERR(da8xx_ohci->oc_gpio)) { in ohci_da8xx_probe()
419 error = PTR_ERR(da8xx_ohci->oc_gpio); in ohci_da8xx_probe()
423 if (da8xx_ohci->oc_gpio) { in ohci_da8xx_probe()
424 oc_irq = gpiod_to_irq(da8xx_ohci->oc_gpio); in ohci_da8xx_probe()
433 "OHCI over-current indicator", da8xx_ohci); in ohci_da8xx_probe()