Lines Matching +full:self +full:- +full:powered
1 // SPDX-License-Identifier: GPL-1.0+
6 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
7 * (C) Copyright 2002 Hewlett-Packard Company
14 * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c
28 #include <linux/platform_data/usb-ohci-s3c2410.h>
55 return dev_get_platdata(hcd->self.controller); in to_s3c2410_info()
60 struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev); in s3c2410_start_hc()
62 dev_dbg(&dev->dev, "s3c2410_start_hc:\n"); in s3c2410_start_hc()
70 info->hcd = hcd; in s3c2410_start_hc()
71 info->report_oc = s3c2410_hcd_oc; in s3c2410_start_hc()
73 if (info->enable_oc != NULL) in s3c2410_start_hc()
74 (info->enable_oc)(info, 1); in s3c2410_start_hc()
80 struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev); in s3c2410_stop_hc()
82 dev_dbg(&dev->dev, "s3c2410_stop_hc:\n"); in s3c2410_stop_hc()
85 info->report_oc = NULL; in s3c2410_stop_hc()
86 info->hcd = NULL; in s3c2410_stop_hc()
88 if (info->enable_oc != NULL) in s3c2410_stop_hc()
89 (info->enable_oc)(info, 0); in s3c2410_stop_hc()
115 port = &info->port[0]; in ohci_s3c2410_hub_status_data()
120 if (port->oc_changed == 1 && in ohci_s3c2410_hub_status_data()
121 port->flags & S3C_HCDFLG_USED) { in ohci_s3c2410_hub_status_data()
122 dev_dbg(hcd->self.controller, in ohci_s3c2410_hub_status_data()
147 if (info->power_control != NULL) { in s3c2410_usb_set_power()
148 info->port[port-1].power = to; in s3c2410_usb_set_power()
149 (info->power_control)(port-1, to); in s3c2410_usb_set_power()
156 * to take any action or over-ride the results from the
170 int ret = -EINVAL; in ohci_s3c2410_hub_control()
173 dev_dbg(hcd->self.controller, in ohci_s3c2410_hub_control()
191 dev_dbg(hcd->self.controller, "SetPortFeat: POWER\n"); in ohci_s3c2410_hub_control()
200 dev_dbg(hcd->self.controller, in ohci_s3c2410_hub_control()
204 info->port[wIndex-1].oc_changed = 0; in ohci_s3c2410_hub_control()
205 info->port[wIndex-1].oc_status = 0; in ohci_s3c2410_hub_control()
211 dev_dbg(hcd->self.controller, in ohci_s3c2410_hub_control()
215 info->port[wIndex-1].oc_status = 0; in ohci_s3c2410_hub_control()
220 dev_dbg(hcd->self.controller, in ohci_s3c2410_hub_control()
242 if (info->power_control == NULL) in ohci_s3c2410_hub_control()
245 dev_dbg(hcd->self.controller, "wHubCharacteristics 0x%04x\n", in ohci_s3c2410_hub_control()
246 desc->wHubCharacteristics); in ohci_s3c2410_hub_control()
248 /* remove the old configurations for power-switching, and in ohci_s3c2410_hub_control()
249 * over-current protection, and insert our new configuration in ohci_s3c2410_hub_control()
252 desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_LPSM); in ohci_s3c2410_hub_control()
253 desc->wHubCharacteristics |= cpu_to_le16( in ohci_s3c2410_hub_control()
256 if (info->enable_oc) { in ohci_s3c2410_hub_control()
257 desc->wHubCharacteristics &= ~cpu_to_le16( in ohci_s3c2410_hub_control()
259 desc->wHubCharacteristics |= cpu_to_le16( in ohci_s3c2410_hub_control()
263 dev_dbg(hcd->self.controller, "wHubCharacteristics after 0x%04x\n", in ohci_s3c2410_hub_control()
264 desc->wHubCharacteristics); in ohci_s3c2410_hub_control()
271 dev_dbg(hcd->self.controller, "GetPortStatus(%d)\n", wIndex); in ohci_s3c2410_hub_control()
274 if (info->port[wIndex-1].oc_changed) in ohci_s3c2410_hub_control()
277 if (info->port[wIndex-1].oc_status) in ohci_s3c2410_hub_control()
288 * handle an over-current report
300 port = &info->port[0]; in s3c2410_hcd_oc()
306 port->flags & S3C_HCDFLG_USED) { in s3c2410_hcd_oc()
307 port->oc_status = 1; in s3c2410_hcd_oc()
308 port->oc_changed = 1; in s3c2410_hcd_oc()
310 /* ok, once over-current is detected, in s3c2410_hcd_oc()
311 the port needs to be powered down */ in s3c2410_hcd_oc()
323 * ohci_hcd_s3c2410_remove - shutdown processing for HCD
343 * ohci_hcd_s3c2410_probe - initialize S3C2410-based HCDs
355 struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev); in ohci_hcd_s3c2410_probe()
361 hcd = usb_create_hcd(&ohci_s3c2410_hc_driver, &dev->dev, "s3c24xx"); in ohci_hcd_s3c2410_probe()
363 return -ENOMEM; in ohci_hcd_s3c2410_probe()
365 hcd->rsrc_start = dev->resource[0].start; in ohci_hcd_s3c2410_probe()
366 hcd->rsrc_len = resource_size(&dev->resource[0]); in ohci_hcd_s3c2410_probe()
368 hcd->regs = devm_ioremap_resource(&dev->dev, &dev->resource[0]); in ohci_hcd_s3c2410_probe()
369 if (IS_ERR(hcd->regs)) { in ohci_hcd_s3c2410_probe()
370 retval = PTR_ERR(hcd->regs); in ohci_hcd_s3c2410_probe()
374 clk = devm_clk_get(&dev->dev, "usb-host"); in ohci_hcd_s3c2410_probe()
376 dev_err(&dev->dev, "cannot get usb-host clock\n"); in ohci_hcd_s3c2410_probe()
381 usb_clk = devm_clk_get(&dev->dev, "usb-bus-host"); in ohci_hcd_s3c2410_probe()
383 dev_err(&dev->dev, "cannot get usb-bus-host clock\n"); in ohci_hcd_s3c2410_probe()
400 device_wakeup_enable(hcd->self.controller); in ohci_hcd_s3c2410_probe()
411 /*-------------------------------------------------------------------------*/
452 { .compatible = "samsung,s3c2410-ohci" },
463 .name = "s3c2410-ohci",
472 return -ENODEV; in ohci_s3c2410_init()
478 * Sumsung-specific workarounds. We override certain hc_driver in ohci_s3c2410_init()
500 MODULE_ALIAS("platform:s3c2410-ohci");