Lines Matching refs:hcd

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;
47 #define to_da8xx_ohci(hcd) (struct da8xx_ohci_hcd *)(hcd_to_ohci(hcd)->priv)
52 static int ohci_da8xx_enable(struct usb_hcd *hcd)
54 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
79 static void ohci_da8xx_disable(struct usb_hcd *hcd)
81 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
88 static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on)
90 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
91 struct device *dev = hcd->self.controller;
114 static int ohci_da8xx_get_power(struct usb_hcd *hcd)
116 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
124 static int ohci_da8xx_get_oci(struct usb_hcd *hcd)
126 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
146 static int ohci_da8xx_has_set_power(struct usb_hcd *hcd)
148 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
156 static int ohci_da8xx_has_oci(struct usb_hcd *hcd)
158 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
169 static int ohci_da8xx_has_potpgt(struct usb_hcd *hcd)
171 struct device *dev = hcd->self.controller;
188 ohci_da8xx_set_power(da8xx_ohci->hcd, 0);
197 struct device *dev = da8xx_ohci->hcd->self.controller;
210 static int ohci_da8xx_register_notify(struct usb_hcd *hcd)
212 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
213 struct device *dev = hcd->self.controller;
228 static int ohci_da8xx_reset(struct usb_hcd *hcd)
230 struct device *dev = hcd->self.controller;
232 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
238 result = ohci_da8xx_enable(hcd);
248 result = ohci_setup(hcd);
250 ohci_da8xx_disable(hcd);
261 if (ohci_da8xx_has_set_power(hcd)) {
265 if (ohci_da8xx_has_oci(hcd)) {
269 if (ohci_da8xx_has_potpgt(hcd)) {
281 static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf)
283 int length = orig_ohci_hub_status_data(hcd, buf);
287 dev_dbg(hcd->self.controller, "over-current indicator change "
301 static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
304 struct device *dev = hcd->self.controller;
315 temp = roothub_portstatus(hcd_to_ohci(hcd), wIndex - 1);
318 if (!ohci_da8xx_get_power(hcd))
322 if (ohci_da8xx_get_oci(hcd) > 0)
347 return ohci_da8xx_set_power(hcd, temp) ? -EPIPE : 0;
361 return orig_ohci_hub_control(hcd, typeReq, wValue,
379 struct usb_hcd *hcd;
382 hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev));
383 if (!hcd)
386 da8xx_ohci = to_da8xx_ohci(hcd);
387 da8xx_ohci->hcd = hcd;
439 hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &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);
484 struct usb_hcd *hcd = platform_get_drvdata(pdev);
485 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
494 ret = ohci_suspend(hcd, do_wakeup);
498 ohci_da8xx_disable(hcd);
499 hcd->state = HC_STATE_SUSPENDED;
506 struct usb_hcd *hcd = platform_get_drvdata(dev);
507 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
514 ret = ohci_da8xx_enable(hcd);
518 ohci_resume(hcd, false);