Lines Matching defs:hcd

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;
46 #define to_da8xx_ohci(hcd) (struct da8xx_ohci_hcd *)(hcd_to_ohci(hcd)->priv)
51 static int ohci_da8xx_enable(struct usb_hcd *hcd)
53 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
78 static void ohci_da8xx_disable(struct usb_hcd *hcd)
80 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
87 static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on)
89 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
90 struct device *dev = hcd->self.controller;
113 static int ohci_da8xx_get_power(struct usb_hcd *hcd)
115 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
123 static int ohci_da8xx_get_oci(struct usb_hcd *hcd)
125 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
145 static int ohci_da8xx_has_set_power(struct usb_hcd *hcd)
147 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
155 static int ohci_da8xx_has_oci(struct usb_hcd *hcd)
157 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
168 static int ohci_da8xx_has_potpgt(struct usb_hcd *hcd)
170 struct device *dev = hcd->self.controller;
187 ohci_da8xx_set_power(da8xx_ohci->hcd, 0);
196 struct device *dev = da8xx_ohci->hcd->self.controller;
209 static int ohci_da8xx_register_notify(struct usb_hcd *hcd)
211 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
212 struct device *dev = hcd->self.controller;
227 static int ohci_da8xx_reset(struct usb_hcd *hcd)
229 struct device *dev = hcd->self.controller;
231 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
237 result = ohci_da8xx_enable(hcd);
247 result = ohci_setup(hcd);
249 ohci_da8xx_disable(hcd);
260 if (ohci_da8xx_has_set_power(hcd)) {
264 if (ohci_da8xx_has_oci(hcd)) {
268 if (ohci_da8xx_has_potpgt(hcd)) {
280 static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf)
282 int length = orig_ohci_hub_status_data(hcd, buf);
286 dev_dbg(hcd->self.controller, "over-current indicator change "
300 static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
303 struct device *dev = hcd->self.controller;
314 temp = roothub_portstatus(hcd_to_ohci(hcd), wIndex - 1);
317 if (!ohci_da8xx_get_power(hcd))
321 if (ohci_da8xx_get_oci(hcd) > 0)
346 return ohci_da8xx_set_power(hcd, temp) ? -EPIPE : 0;
360 return orig_ohci_hub_control(hcd, typeReq, wValue,
378 struct usb_hcd *hcd;
381 hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev));
382 if (!hcd)
385 da8xx_ohci = to_da8xx_ohci(hcd);
386 da8xx_ohci->hcd = hcd;
439 hcd->regs = devm_ioremap_resource(dev, mem);
440 if (IS_ERR(hcd->regs)) {
441 error = PTR_ERR(hcd->regs);
444 hcd->rsrc_start = mem->start;
445 hcd->rsrc_len = resource_size(mem);
453 error = usb_add_hcd(hcd, hcd_irq, 0);
457 device_wakeup_enable(hcd->self.controller);
459 error = ohci_da8xx_register_notify(hcd);
466 usb_remove_hcd(hcd);
468 usb_put_hcd(hcd);
474 struct usb_hcd *hcd = platform_get_drvdata(pdev);
476 usb_remove_hcd(hcd);
477 usb_put_hcd(hcd);
486 struct usb_hcd *hcd = platform_get_drvdata(pdev);
487 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
496 ret = ohci_suspend(hcd, do_wakeup);
500 ohci_da8xx_disable(hcd);
501 hcd->state = HC_STATE_SUSPENDED;
508 struct usb_hcd *hcd = platform_get_drvdata(dev);
509 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
516 ret = ohci_da8xx_enable(hcd);
520 ohci_resume(hcd, false);