Lines Matching full:hcd
3 * OHCI HCD (Host Controller Driver) for USB.
23 #include <linux/usb/hcd.h>
33 static int (*orig_ohci_hub_control)(struct usb_hcd *hcd, u16 typeReq,
35 static int (*orig_ohci_hub_status_data)(struct usb_hcd *hcd, char *buf);
38 struct usb_hcd *hcd; member
46 #define to_da8xx_ohci(hcd) (struct da8xx_ohci_hcd *)(hcd_to_ohci(hcd)->priv) argument
51 static int ohci_da8xx_enable(struct usb_hcd *hcd) in ohci_da8xx_enable() argument
53 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_enable()
78 static void ohci_da8xx_disable(struct usb_hcd *hcd) in ohci_da8xx_disable() argument
80 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_disable()
87 static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on) in ohci_da8xx_set_power() argument
89 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_set_power()
90 struct device *dev = hcd->self.controller; in ohci_da8xx_set_power()
113 static int ohci_da8xx_get_power(struct usb_hcd *hcd) in ohci_da8xx_get_power() argument
115 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_power()
123 static int ohci_da8xx_get_oci(struct usb_hcd *hcd) in ohci_da8xx_get_oci() argument
125 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_get_oci()
145 static int ohci_da8xx_has_set_power(struct usb_hcd *hcd) in ohci_da8xx_has_set_power() argument
147 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_set_power()
155 static int ohci_da8xx_has_oci(struct usb_hcd *hcd) in ohci_da8xx_has_oci() argument
157 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_has_oci()
168 static int ohci_da8xx_has_potpgt(struct usb_hcd *hcd) in ohci_da8xx_has_potpgt() argument
170 struct device *dev = hcd->self.controller; in ohci_da8xx_has_potpgt()
187 ohci_da8xx_set_power(da8xx_ohci->hcd, 0); in ohci_da8xx_regulator_event()
196 struct device *dev = da8xx_ohci->hcd->self.controller; in ohci_da8xx_oc_thread()
209 static int ohci_da8xx_register_notify(struct usb_hcd *hcd) in ohci_da8xx_register_notify() argument
211 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_register_notify()
212 struct device *dev = hcd->self.controller; in ohci_da8xx_register_notify()
227 static int ohci_da8xx_reset(struct usb_hcd *hcd) in ohci_da8xx_reset() argument
229 struct device *dev = hcd->self.controller; in ohci_da8xx_reset()
231 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_da8xx_reset()
237 result = ohci_da8xx_enable(hcd); in ohci_da8xx_reset()
247 result = ohci_setup(hcd); in ohci_da8xx_reset()
249 ohci_da8xx_disable(hcd); in ohci_da8xx_reset()
260 if (ohci_da8xx_has_set_power(hcd)) { in ohci_da8xx_reset()
264 if (ohci_da8xx_has_oci(hcd)) { in ohci_da8xx_reset()
268 if (ohci_da8xx_has_potpgt(hcd)) { in ohci_da8xx_reset()
280 static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf) in ohci_da8xx_hub_status_data() argument
282 int length = orig_ohci_hub_status_data(hcd, buf); in ohci_da8xx_hub_status_data()
286 dev_dbg(hcd->self.controller, "over-current indicator change " in ohci_da8xx_hub_status_data()
300 static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, in ohci_da8xx_hub_control() argument
303 struct device *dev = hcd->self.controller; in ohci_da8xx_hub_control()
314 temp = roothub_portstatus(hcd_to_ohci(hcd), wIndex - 1); in ohci_da8xx_hub_control()
317 if (!ohci_da8xx_get_power(hcd)) in ohci_da8xx_hub_control()
321 if (ohci_da8xx_get_oci(hcd) > 0) in ohci_da8xx_hub_control()
346 return ohci_da8xx_set_power(hcd, temp) ? -EPIPE : 0; in ohci_da8xx_hub_control()
360 return orig_ohci_hub_control(hcd, typeReq, wValue, in ohci_da8xx_hub_control()
378 struct usb_hcd *hcd; in ohci_da8xx_probe() local
381 hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev)); in ohci_da8xx_probe()
382 if (!hcd) in ohci_da8xx_probe()
385 da8xx_ohci = to_da8xx_ohci(hcd); in ohci_da8xx_probe()
386 da8xx_ohci->hcd = hcd; in ohci_da8xx_probe()
439 hcd->regs = devm_ioremap_resource(dev, 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()
486 struct usb_hcd *hcd = platform_get_drvdata(pdev); in ohci_da8xx_suspend() local
487 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_da8xx_suspend()
496 ret = ohci_suspend(hcd, do_wakeup); in ohci_da8xx_suspend()
500 ohci_da8xx_disable(hcd); in ohci_da8xx_suspend()
501 hcd->state = HC_STATE_SUSPENDED; in ohci_da8xx_suspend()
508 struct usb_hcd *hcd = platform_get_drvdata(dev); in ohci_da8xx_resume() local
509 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_da8xx_resume()
516 ret = ohci_da8xx_enable(hcd); in ohci_da8xx_resume()
520 ohci_resume(hcd, false); in ohci_da8xx_resume()