Lines Matching refs:dev
84 struct device *dev;
137 ret = pm_runtime_get_sync(data->dev);
139 pm_runtime_put_noidle(data->dev);
148 dev_info(data->dev,
160 dev_info(data->dev, "detected phy mask %x\n", ~phy_mask);
164 dev_warn(data->dev, "no live phy, scanning all\n");
170 pm_runtime_mark_last_busy(data->dev);
171 pm_runtime_put_autosuspend(data->dev);
199 dev_warn(data->dev, "resetting idled controller\n");
208 dev_err(data->dev, "timed out waiting for user access\n");
221 dev_err(data->dev, "timed out waiting for idle\n");
235 ret = pm_runtime_get_sync(data->dev);
237 pm_runtime_put_noidle(data->dev);
264 pm_runtime_mark_last_busy(data->dev);
265 pm_runtime_put_autosuspend(data->dev);
279 ret = pm_runtime_get_sync(data->dev);
281 pm_runtime_put_noidle(data->dev);
303 pm_runtime_mark_last_busy(data->dev);
304 pm_runtime_put_autosuspend(data->dev);
312 struct device_node *node = pdev->dev.of_node;
319 dev_err(&pdev->dev, "Missing bus_freq property in the DT.\n");
342 struct mdio_platform_data *pdata = dev_get_platdata(&pdev->dev);
343 struct device *dev = &pdev->dev;
350 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
354 data->bus = devm_mdiobus_alloc(dev);
356 dev_err(dev, "failed to alloc mii bus\n");
360 if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
368 of_id = of_match_device(davinci_mdio_of_mtable, &pdev->dev);
383 data->bus->name = dev_name(dev);
387 data->bus->parent = dev;
390 data->clk = devm_clk_get(dev, "fck");
392 dev_err(dev, "failed to get device clock\n");
396 dev_set_drvdata(dev, data);
397 data->dev = dev;
402 data->regs = devm_ioremap(dev, res->start, resource_size(res));
408 pm_runtime_set_autosuspend_delay(&pdev->dev, autosuspend_delay_ms);
409 pm_runtime_use_autosuspend(&pdev->dev);
410 pm_runtime_enable(&pdev->dev);
417 if (dev->of_node && of_get_child_count(dev->of_node))
420 ret = of_mdiobus_register(data->bus, dev->of_node);
428 dev_info(dev, "phy[%d]: device %s, driver %s\n",
437 pm_runtime_dont_use_autosuspend(&pdev->dev);
438 pm_runtime_disable(&pdev->dev);
449 pm_runtime_dont_use_autosuspend(&pdev->dev);
450 pm_runtime_disable(&pdev->dev);
456 static int davinci_mdio_runtime_suspend(struct device *dev)
458 struct davinci_mdio_data *data = dev_get_drvdata(dev);
470 static int davinci_mdio_runtime_resume(struct device *dev)
472 struct davinci_mdio_data *data = dev_get_drvdata(dev);
480 static int davinci_mdio_suspend(struct device *dev)
482 struct davinci_mdio_data *data = dev_get_drvdata(dev);
485 data->active_in_suspend = !pm_runtime_status_suspended(dev);
487 ret = pm_runtime_force_suspend(dev);
492 pinctrl_pm_select_sleep_state(dev);
497 static int davinci_mdio_resume(struct device *dev)
499 struct davinci_mdio_data *data = dev_get_drvdata(dev);
502 pinctrl_pm_select_default_state(dev);
505 pm_runtime_force_resume(dev);