Lines Matching refs:dev
44 static int ohci_platform_power_on(struct platform_device *dev) in ohci_platform_power_on() argument
46 struct usb_hcd *hcd = platform_get_drvdata(dev); in ohci_platform_power_on()
65 static void ohci_platform_power_off(struct platform_device *dev) in ohci_platform_power_off() argument
67 struct usb_hcd *hcd = platform_get_drvdata(dev); in ohci_platform_power_off()
89 static int ohci_platform_probe(struct platform_device *dev) in ohci_platform_probe() argument
93 struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); in ohci_platform_probe()
108 err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); in ohci_platform_probe()
112 irq = platform_get_irq(dev, 0); in ohci_platform_probe()
116 hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev, in ohci_platform_probe()
117 dev_name(&dev->dev)); in ohci_platform_probe()
121 platform_set_drvdata(dev, hcd); in ohci_platform_probe()
122 dev->dev.platform_data = pdata; in ohci_platform_probe()
126 if (pdata == &ohci_platform_defaults && dev->dev.of_node) { in ohci_platform_probe()
127 if (of_property_read_bool(dev->dev.of_node, "big-endian-regs")) in ohci_platform_probe()
130 if (of_property_read_bool(dev->dev.of_node, "big-endian-desc")) in ohci_platform_probe()
133 if (of_property_read_bool(dev->dev.of_node, "big-endian")) in ohci_platform_probe()
136 if (of_property_read_bool(dev->dev.of_node, "no-big-frame-no")) in ohci_platform_probe()
139 if (of_property_read_bool(dev->dev.of_node, in ohci_platform_probe()
143 of_property_read_u32(dev->dev.of_node, "num-ports", in ohci_platform_probe()
147 priv->clks[clk] = of_clk_get(dev->dev.of_node, clk); in ohci_platform_probe()
158 &dev->dev); in ohci_platform_probe()
180 dev_err(&dev->dev, in ohci_platform_probe()
188 dev_err(&dev->dev, in ohci_platform_probe()
195 pm_runtime_set_active(&dev->dev); in ohci_platform_probe()
196 pm_runtime_enable(&dev->dev); in ohci_platform_probe()
198 err = pdata->power_on(dev); in ohci_platform_probe()
203 hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem); in ohci_platform_probe()
211 hcd->tpl_support = of_usb_host_tpl_support(dev->dev.of_node); in ohci_platform_probe()
219 platform_set_drvdata(dev, hcd); in ohci_platform_probe()
225 pdata->power_off(dev); in ohci_platform_probe()
227 pm_runtime_disable(&dev->dev); in ohci_platform_probe()
234 dev->dev.platform_data = NULL; in ohci_platform_probe()
241 static void ohci_platform_remove(struct platform_device *dev) in ohci_platform_remove() argument
243 struct usb_hcd *hcd = platform_get_drvdata(dev); in ohci_platform_remove()
244 struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); in ohci_platform_remove()
248 pm_runtime_get_sync(&dev->dev); in ohci_platform_remove()
252 pdata->power_off(dev); in ohci_platform_remove()
261 pm_runtime_put_sync(&dev->dev); in ohci_platform_remove()
262 pm_runtime_disable(&dev->dev); in ohci_platform_remove()
265 dev->dev.platform_data = NULL; in ohci_platform_remove()
269 static int ohci_platform_suspend(struct device *dev) in ohci_platform_suspend() argument
271 struct usb_hcd *hcd = dev_get_drvdata(dev); in ohci_platform_suspend()
272 struct usb_ohci_pdata *pdata = dev->platform_data; in ohci_platform_suspend()
273 struct platform_device *pdev = to_platform_device(dev); in ohci_platform_suspend()
274 bool do_wakeup = device_may_wakeup(dev); in ohci_platform_suspend()
287 static int ohci_platform_resume_common(struct device *dev, bool hibernated) in ohci_platform_resume_common() argument
289 struct usb_hcd *hcd = dev_get_drvdata(dev); in ohci_platform_resume_common()
290 struct usb_ohci_pdata *pdata = dev_get_platdata(dev); in ohci_platform_resume_common()
291 struct platform_device *pdev = to_platform_device(dev); in ohci_platform_resume_common()
301 pm_runtime_disable(dev); in ohci_platform_resume_common()
302 pm_runtime_set_active(dev); in ohci_platform_resume_common()
303 pm_runtime_enable(dev); in ohci_platform_resume_common()
308 static int ohci_platform_resume(struct device *dev) in ohci_platform_resume() argument
310 return ohci_platform_resume_common(dev, false); in ohci_platform_resume()
313 static int ohci_platform_restore(struct device *dev) in ohci_platform_restore() argument
315 return ohci_platform_resume_common(dev, true); in ohci_platform_restore()