Lines Matching full:devfreq
3 * A devfreq driver for NVIDIA Tegra SoCs
11 #include <linux/devfreq.h>
180 struct devfreq *devfreq; member
255 u32 band = avg_band_freq * tegra->devfreq->profile->polling_ms; in tegra_devfreq_update_avg_wmark()
268 u32 val = tegra->cur_freq * tegra->devfreq->profile->polling_ms; in tegra_devfreq_update_wmark()
347 target_freq = dev->avg_count / tegra->devfreq->profile->polling_ms; in actmon_device_target_freq()
381 mutex_lock(&tegra->devfreq->lock); in actmon_thread_isr()
392 update_devfreq(tegra->devfreq); in actmon_thread_isr()
394 mutex_unlock(&tegra->devfreq->lock); in actmon_thread_isr()
428 mutex_lock(&tegra->devfreq->lock); in tegra_actmon_delayed_update()
429 update_devfreq(tegra->devfreq); in tegra_actmon_delayed_update()
430 mutex_unlock(&tegra->devfreq->lock); in tegra_actmon_delayed_update()
470 if (mutex_trylock(&tegra->devfreq->lock)) { in tegra_actmon_cpu_notify_cb()
473 mutex_unlock(&tegra->devfreq->lock); in tegra_actmon_cpu_notify_cb()
477 * the moment, then there is no need to update the devfreq's in tegra_actmon_cpu_notify_cb()
507 dev->avg_count = tegra->cur_freq * tegra->devfreq->profile->polling_ms; in tegra_actmon_configure_device()
548 if (!tegra->devfreq->profile->polling_ms || !tegra->started) in tegra_actmon_resume()
551 actmon_writel(tegra, tegra->devfreq->profile->polling_ms - 1, in tegra_actmon_resume()
562 dev_err(tegra->devfreq->dev.parent, in tegra_actmon_resume()
582 dev_err(tegra->devfreq->dev.parent, in tegra_actmon_resume()
616 if (!tegra->devfreq->profile->polling_ms || !tegra->started) in tegra_actmon_pause()
679 stat->total_time = tegra->devfreq->profile->polling_ms * cur_freq; in tegra_devfreq_get_dev_status()
693 static int tegra_governor_get_target(struct devfreq *devfreq, in tegra_governor_get_target() argument
703 err = devfreq_update_stats(devfreq); in tegra_governor_get_target()
707 stat = &devfreq->last_status; in tegra_governor_get_target()
720 * tegra-devfreq driver operates with KHz units, while OPP table in tegra_governor_get_target()
722 * devfreq core. in tegra_governor_get_target()
729 static int tegra_governor_event_handler(struct devfreq *devfreq, in tegra_governor_event_handler() argument
732 struct tegra_devfreq *tegra = dev_get_drvdata(devfreq->dev.parent); in tegra_governor_event_handler()
737 * Couple devfreq-device with the governor early because it is in tegra_governor_event_handler()
740 tegra->devfreq = devfreq; in tegra_governor_event_handler()
744 devfreq_monitor_start(devfreq); in tegra_governor_event_handler()
750 devfreq_monitor_stop(devfreq); in tegra_governor_event_handler()
764 devfreq_update_interval(devfreq, new_delay); in tegra_governor_event_handler()
770 devfreq_monitor_suspend(devfreq); in tegra_governor_event_handler()
774 devfreq_monitor_resume(devfreq); in tegra_governor_event_handler()
838 struct devfreq *devfreq; in tegra_devfreq_probe() local
887 "tegra-devfreq", tegra); in tegra_devfreq_probe()
939 devfreq = devm_devfreq_add_device(&pdev->dev, &tegra_devfreq_profile, in tegra_devfreq_probe()
941 if (IS_ERR(devfreq)) { in tegra_devfreq_probe()
942 dev_err(&pdev->dev, "Failed to add device: %pe\n", devfreq); in tegra_devfreq_probe()
943 return PTR_ERR(devfreq); in tegra_devfreq_probe()
975 .name = "tegra-devfreq",
982 MODULE_DESCRIPTION("Tegra devfreq driver");