Lines Matching refs:dev
26 struct device *dev; member
93 static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags) in exynos_bus_target() argument
95 struct exynos_bus *bus = dev_get_drvdata(dev); in exynos_bus_target()
100 new_opp = devfreq_recommended_opp(dev, freq, flags); in exynos_bus_target()
102 dev_err(dev, "failed to get recommended opp instance\n"); in exynos_bus_target()
110 ret = dev_pm_opp_set_rate(dev, *freq); in exynos_bus_target()
119 static int exynos_bus_get_dev_status(struct device *dev, in exynos_bus_get_dev_status() argument
122 struct exynos_bus *bus = dev_get_drvdata(dev); in exynos_bus_get_dev_status()
130 dev_err(dev, "failed to get event from devfreq-event devices\n"); in exynos_bus_get_dev_status()
138 dev_dbg(dev, "Usage of devfreq-event : %lu/%lu\n", stat->busy_time, in exynos_bus_get_dev_status()
144 dev_err(dev, "failed to set event to devfreq-event devices\n"); in exynos_bus_get_dev_status()
151 static void exynos_bus_exit(struct device *dev) in exynos_bus_exit() argument
153 struct exynos_bus *bus = dev_get_drvdata(dev); in exynos_bus_exit()
158 dev_warn(dev, "failed to disable the devfreq-event devices\n"); in exynos_bus_exit()
162 dev_pm_opp_of_remove_table(dev); in exynos_bus_exit()
167 static void exynos_bus_passive_exit(struct device *dev) in exynos_bus_passive_exit() argument
169 struct exynos_bus *bus = dev_get_drvdata(dev); in exynos_bus_passive_exit()
173 dev_pm_opp_of_remove_table(dev); in exynos_bus_passive_exit()
180 struct device *dev = bus->dev; in exynos_bus_parent_parse_of() local
184 ret = dev_pm_opp_set_regulators(dev, supplies); in exynos_bus_parent_parse_of()
186 dev_err(dev, "failed to set regulators %d\n", ret); in exynos_bus_parent_parse_of()
196 count = devfreq_event_get_edev_count(dev, "devfreq-events"); in exynos_bus_parent_parse_of()
198 dev_err(dev, "failed to get the count of devfreq-event dev\n"); in exynos_bus_parent_parse_of()
205 bus->edev = devm_kzalloc(dev, size, GFP_KERNEL); in exynos_bus_parent_parse_of()
212 bus->edev[i] = devfreq_event_get_edev_by_phandle(dev, in exynos_bus_parent_parse_of()
244 struct device *dev = bus->dev; in exynos_bus_parse_of() local
250 bus->clk = devm_clk_get(dev, "bus"); in exynos_bus_parse_of()
252 dev_err(dev, "failed to get bus clock\n"); in exynos_bus_parse_of()
258 dev_err(dev, "failed to get enable clock\n"); in exynos_bus_parse_of()
263 ret = dev_pm_opp_of_add_table(dev); in exynos_bus_parse_of()
265 dev_err(dev, "failed to get OPP table\n"); in exynos_bus_parse_of()
271 opp = devfreq_recommended_opp(dev, &rate, 0); in exynos_bus_parse_of()
273 dev_err(dev, "failed to find dev_pm_opp\n"); in exynos_bus_parse_of()
283 dev_pm_opp_of_remove_table(dev); in exynos_bus_parse_of()
293 struct device *dev = bus->dev; in exynos_bus_profile_init() local
303 ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); in exynos_bus_profile_init()
311 bus->devfreq = devm_devfreq_add_device(dev, profile, in exynos_bus_profile_init()
315 dev_err(dev, "failed to add devfreq device\n"); in exynos_bus_profile_init()
320 ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq); in exynos_bus_profile_init()
322 dev_err(dev, "failed to register opp notifier\n"); in exynos_bus_profile_init()
332 dev_err(dev, "failed to enable devfreq-event devices\n"); in exynos_bus_profile_init()
338 dev_err(dev, "failed to set event to devfreq-event devices\n"); in exynos_bus_profile_init()
346 dev_warn(dev, "failed to disable the devfreq-event devices\n"); in exynos_bus_profile_init()
354 struct device *dev = bus->dev; in exynos_bus_profile_init_passive() local
363 parent_devfreq = devfreq_get_devfreq_by_phandle(dev, "devfreq", 0); in exynos_bus_profile_init_passive()
367 passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); in exynos_bus_profile_init_passive()
374 bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, in exynos_bus_profile_init_passive()
377 dev_err(dev, in exynos_bus_profile_init_passive()
387 struct device *dev = &pdev->dev; in exynos_bus_probe() local
388 struct device_node *np = dev->of_node, *node; in exynos_bus_probe()
396 dev_err(dev, "failed to find devicetree node\n"); in exynos_bus_probe()
400 bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); in exynos_bus_probe()
404 bus->dev = &pdev->dev; in exynos_bus_probe()
407 profile = devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL); in exynos_bus_probe()
411 node = of_parse_phandle(dev->of_node, "devfreq", 0); in exynos_bus_probe()
435 if (of_property_present(dev->of_node, "#interconnect-cells")) { in exynos_bus_probe()
437 dev, "exynos-generic-icc", in exynos_bus_probe()
450 dev_name(dev), min_freq, max_freq); in exynos_bus_probe()
455 dev_pm_opp_of_remove_table(dev); in exynos_bus_probe()
465 struct exynos_bus *bus = dev_get_drvdata(&pdev->dev); in exynos_bus_shutdown()
471 static int exynos_bus_resume(struct device *dev) in exynos_bus_resume() argument
473 struct exynos_bus *bus = dev_get_drvdata(dev); in exynos_bus_resume()
478 dev_err(dev, "failed to enable the devfreq-event devices\n"); in exynos_bus_resume()
485 static int exynos_bus_suspend(struct device *dev) in exynos_bus_suspend() argument
487 struct exynos_bus *bus = dev_get_drvdata(dev); in exynos_bus_suspend()
492 dev_err(dev, "failed to disable the devfreq-event devices\n"); in exynos_bus_suspend()