Lines Matching full:hcd
3 * OHCI HCD (Host Controller Driver) for USB.
24 #include <linux/usb/hcd.h>
34 static int (*orig_ohci_hub_control)(struct usb_hcd *hcd, u16 typeReq,
36 static int (*orig_ohci_hub_status_data)(struct usb_hcd *hcd, char *buf);
39 struct usb_hcd *hcd; member
47 #define to_da8xx_ohci(hcd) (struct da8xx_ohci_hcd *)(hcd_to_ohci(hcd)->priv) argument
52 static int ohci_da8xx_enable(struct usb_hcd *hcd) in ohci_da8xx_enable() argument
54 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_enable()
79 static void ohci_da8xx_disable(struct usb_hcd *hcd) in ohci_da8xx_disable() argument
81 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_disable()
88 static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on) in ohci_da8xx_set_power() argument
90 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_set_power()
91 struct device *dev = hcd->self.controller; in ohci_da8xx_set_power()
114 static int ohci_da8xx_get_power(struct usb_hcd *hcd) in ohci_da8xx_get_power() argument
116 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_power()
124 static int ohci_da8xx_get_oci(struct usb_hcd *hcd) in ohci_da8xx_get_oci() argument
126 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_oci()
146 static int ohci_da8xx_has_set_power(struct usb_hcd *hcd) in ohci_da8xx_has_set_power() argument
148 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_set_power()
156 static int ohci_da8xx_has_oci(struct usb_hcd *hcd) in ohci_da8xx_has_oci() argument
158 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_oci()
169 static int ohci_da8xx_has_potpgt(struct usb_hcd *hcd) in ohci_da8xx_has_potpgt() argument
171 struct device *dev = hcd->self.controller; in ohci_da8xx_has_potpgt()
188 ohci_da8xx_set_power(da8xx_ohci->hcd, 0); in ohci_da8xx_regulator_event()
197 struct device *dev = da8xx_ohci->hcd->self.controller; in ohci_da8xx_oc_thread()
210 static int ohci_da8xx_register_notify(struct usb_hcd *hcd) in ohci_da8xx_register_notify() argument
212 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_register_notify()
213 struct device *dev = hcd->self.controller; in ohci_da8xx_register_notify()
228 static int ohci_da8xx_reset(struct usb_hcd *hcd) in ohci_da8xx_reset() argument
230 struct device *dev = hcd->self.controller; in ohci_da8xx_reset()
232 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_da8xx_reset()
238 result = ohci_da8xx_enable(hcd); in ohci_da8xx_reset()
248 result = ohci_setup(hcd); in ohci_da8xx_reset()
250 ohci_da8xx_disable(hcd); in ohci_da8xx_reset()
261 if (ohci_da8xx_has_set_power(hcd)) { in ohci_da8xx_reset()
265 if (ohci_da8xx_has_oci(hcd)) { in ohci_da8xx_reset()
269 if (ohci_da8xx_has_potpgt(hcd)) { in ohci_da8xx_reset()
281 static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf) in ohci_da8xx_hub_status_data() argument
283 int length = orig_ohci_hub_status_data(hcd, buf); in ohci_da8xx_hub_status_data()
287 dev_dbg(hcd->self.controller, "over-current indicator change " in ohci_da8xx_hub_status_data()
301 static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, in ohci_da8xx_hub_control() argument
304 struct device *dev = hcd->self.controller; in ohci_da8xx_hub_control()
315 temp = roothub_portstatus(hcd_to_ohci(hcd), wIndex - 1); in ohci_da8xx_hub_control()
318 if (!ohci_da8xx_get_power(hcd)) in ohci_da8xx_hub_control()
322 if (ohci_da8xx_get_oci(hcd) > 0) in ohci_da8xx_hub_control()
347 return ohci_da8xx_set_power(hcd, temp) ? -EPIPE : 0; in ohci_da8xx_hub_control()
361 return orig_ohci_hub_control(hcd, typeReq, wValue, in ohci_da8xx_hub_control()
379 struct usb_hcd *hcd; in ohci_da8xx_probe() local
382 hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev)); in ohci_da8xx_probe()
383 if (!hcd) in ohci_da8xx_probe()
386 da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_probe()
387 da8xx_ohci->hcd = hcd; in ohci_da8xx_probe()
439 hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); in ohci_da8xx_probe()
440 if (IS_ERR(hcd->regs)) { in ohci_da8xx_probe()
441 error = PTR_ERR(hcd->regs); in ohci_da8xx_probe()
444 hcd->rsrc_start = mem->start; in ohci_da8xx_probe()
445 hcd->rsrc_len = resource_size(mem); in ohci_da8xx_probe()
453 error = usb_add_hcd(hcd, hcd_irq, 0); in ohci_da8xx_probe()
457 device_wakeup_enable(hcd->self.controller); in ohci_da8xx_probe()
459 error = ohci_da8xx_register_notify(hcd); in ohci_da8xx_probe()
466 usb_remove_hcd(hcd); in ohci_da8xx_probe()
468 usb_put_hcd(hcd); in ohci_da8xx_probe()
474 struct usb_hcd *hcd = platform_get_drvdata(pdev); in ohci_da8xx_remove() local
476 usb_remove_hcd(hcd); in ohci_da8xx_remove()
477 usb_put_hcd(hcd); in ohci_da8xx_remove()
484 struct usb_hcd *hcd = platform_get_drvdata(pdev); in ohci_da8xx_suspend() local
485 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_da8xx_suspend()
494 ret = ohci_suspend(hcd, do_wakeup); in ohci_da8xx_suspend()
498 ohci_da8xx_disable(hcd); in ohci_da8xx_suspend()
499 hcd->state = HC_STATE_SUSPENDED; in ohci_da8xx_suspend()
506 struct usb_hcd *hcd = platform_get_drvdata(dev); in ohci_da8xx_resume() local
507 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_da8xx_resume()
514 ret = ohci_da8xx_enable(hcd); in ohci_da8xx_resume()
518 ohci_resume(hcd, false); in ohci_da8xx_resume()