Lines Matching refs:dev
56 hsotg->dr_mode = usb_get_dr_mode(hsotg->dev);
64 dev_err(hsotg->dev,
71 dev_err(hsotg->dev,
84 dev_warn(hsotg->dev,
96 struct platform_device *pdev = to_platform_device(hsotg->dev);
166 struct platform_device *pdev = to_platform_device(hsotg->dev);
215 hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2");
217 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->reset),
221 ret = devm_add_action_or_reset(hsotg->dev, dwc2_reset_control_assert,
226 hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc");
228 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->reset_ecc),
232 ret = devm_add_action_or_reset(hsotg->dev, dwc2_reset_control_assert,
241 hsotg->phy = devm_phy_get(hsotg->dev, "usb2-phy");
250 return dev_err_probe(hsotg->dev, ret, "error getting phy\n");
255 hsotg->uphy = devm_usb_get_phy(hsotg->dev, USB_PHY_TYPE_USB2);
264 return dev_err_probe(hsotg->dev, ret, "error getting usb phy\n");
269 hsotg->plat = dev_get_platdata(hsotg->dev);
272 hsotg->clk = devm_clk_get_optional(hsotg->dev, "otg");
274 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->clk), "cannot get otg clock\n");
276 hsotg->utmi_clk = devm_clk_get_optional(hsotg->dev, "utmi");
278 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->utmi_clk),
285 ret = devm_regulator_bulk_get(hsotg->dev, ARRAY_SIZE(hsotg->supplies),
288 return dev_err_probe(hsotg->dev, ret, "failed to request supplies\n");
297 * @dev: Platform device
304 static void dwc2_driver_remove(struct platform_device *dev)
306 struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
320 dev_err(hsotg->dev,
328 dev_err(hsotg->dev,
359 * @dev: Platform device
368 static void dwc2_driver_shutdown(struct platform_device *dev)
370 struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
413 dev_err(hsotg->dev, "Bad value for GSNPSID: 0x%08x\n",
418 dev_dbg(hsotg->dev, "Core Release: %1x.%1x%1x%1x (snpsid=%x)\n",
428 * @dev: Platform device
436 static int dwc2_driver_probe(struct platform_device *dev)
442 hsotg = devm_kzalloc(&dev->dev, sizeof(*hsotg), GFP_KERNEL);
446 hsotg->dev = &dev->dev;
451 if (!dev->dev.dma_mask)
452 dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
453 retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
455 dev_err(&dev->dev, "can't set coherent DMA mask: %d\n", retval);
459 hsotg->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res);
463 dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
472 hsotg->irq = platform_get_irq(dev, 0);
476 dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
478 retval = devm_request_irq(hsotg->dev, hsotg->irq,
480 dev_name(hsotg->dev), hsotg);
484 hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus");
503 of_property_read_bool(dev->dev.of_node,
541 hsotg->usb33d = devm_regulator_get(hsotg->dev, "usb33d");
544 dev_err_probe(hsotg->dev, retval, "failed to request usb33d supply\n");
549 dev_err_probe(hsotg->dev, retval, "failed to enable usb33d supply\n");
564 dev_err_probe(hsotg->dev, retval, "failed to initialize dual-role\n");
581 device_set_wakeup_capable(&dev->dev, true);
584 of_property_read_bool(dev->dev.of_node,
587 dev_warn(hsotg->dev,
602 platform_set_drvdata(dev, hsotg);
615 retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
644 static int __maybe_unused dwc2_suspend(struct device *dev)
646 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
695 static int __maybe_unused dwc2_resume(struct device *dev)
697 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);