devfreq: Support suspend and resume in tegra_wmark

When devfreq_suspend_device get called, tegra_wmark will disable the
upper and lower watermark thresholds so that no DFS logic get triggered
after the suspension.

When devfreq_resume_device get called, tegra_wmark will enable back the
upper and lower watermark thresholds so that interrupt-driven DFS logic
can work properly.

Bug 4168788

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I98fa1487db26fdfe95f5c958dbe15bf0f49035d5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2927019
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Johnny Liu
2023-06-27 08:11:04 +00:00
committed by mobile promotions
parent df0489a1e0
commit 0da771f275

View File

@@ -497,6 +497,8 @@ static int devfreq_tegra_wmark_event_handler(struct devfreq *df,
unsigned int event, unsigned int event,
void *data) void *data)
{ {
struct devfreq_tegra_wmark_data *drvdata = df->data;
struct devfreq_tegra_wmark_config wmark_config;
int err; int err;
switch (event) { switch (event) {
@@ -510,6 +512,14 @@ static int devfreq_tegra_wmark_event_handler(struct devfreq *df,
case DEVFREQ_GOV_STOP: case DEVFREQ_GOV_STOP:
tegra_wmark_exit(df); tegra_wmark_exit(df);
break; break;
case DEVFREQ_GOV_SUSPEND:
wmark_config.upper_wmark_enabled = 0;
wmark_config.lower_wmark_enabled = 0;
drvdata->update_wmark_threshold(df, &wmark_config);
break;
case DEVFREQ_GOV_RESUME:
devfreq_update_wmark_threshold(df);
break;
default: default:
break; break;
} }