From abdafaeccc17edc34d9e07a4b90df589e42209ae Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Tue, 10 Dec 2019 07:34:59 -0600 Subject: [PATCH] drivers/power: Fix PM build failure with CONFIG_PM_GOVERNOR_MEMORY==1 --- drivers/power/Kconfig | 47 ++++++++++++++++--------------- drivers/power/activity_governor.c | 13 +++++---- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 73744919cc..14e7a8f157 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -85,7 +85,7 @@ config PM_GOVERNOR_SLICEMS interval is applied to an averaging algorithm to determine the activity level. - CONFIG_GOVERNOR_PM_SLICEMS provides the duration of that time slice in + CONFIG_PM_GOVERNOR_SLICEMS provides the duration of that time slice in milliseconds. Default: 100 Milliseconds config PM_GOVERNOR_MEMORY @@ -99,54 +99,55 @@ config PM_GOVERNOR_MEMORY activity. These weights may be negative and a limited to the range of int16_t. - CONFIG_PM_MEMORY provides the memory for the algorithm. Default: 2 - CONFIG_PM_COEFn provides weight for each sample. Default: 1 + CONFIG_PM_GOVERNOR_MEMORY provides the memory for the algorithm. + Default: 2 + CONFIG_PM_GOVERNOR_COEFn provides weight for each sample. Default: 1 - Setting CONFIG_PM_MEMORY=1 disables all smoothing. + Setting CONFIG_PM_GOVERNOR_MEMORY=1 disables all smoothing. config PM_GOVERNOR_COEFN int "PM coefficient" default 1 ---help--- - See help associated with CONFIG_PM_MEMORY. + See help associated with CONFIG_PM_GOVERNOR_MEMORY. config PM_GOVERNOR_COEF1 int "PM coefficient 1" default 1 ---help--- - See help associated with CONFIG_PM_MEMORY. + See help associated with CONFIG_PM_GOVERNOR_MEMORY. config PM_GOVERNOR_COEF2 int "PM coefficient 2" default 1 ---help--- - See help associated with CONFIG_PM_MEMORY + See help associated with CONFIG_PM_GOVERNOR_MEMORY - Ignored if CONFIG_PM_MEMORY <= 2 + Ignored if CONFIG_PM_GOVERNOR_MEMORY <= 2 config PM_GOVERNOR_COEF3 int "PM coefficient 3" default 1 ---help--- - See help associated with CONFIG_PM_MEMORY + See help associated with CONFIG_PM_GOVERNOR_MEMORY - Ignored if CONFIG_PM_MEMORY <= 3 + Ignored if CONFIG_PM_GOVERNOR_MEMORY <= 3 config PM_GOVERNOR_COEF4 int "PM coefficient 4" default 1 ---help--- - See help associated with CONFIG_PM_MEMORY + See help associated with CONFIG_PM_GOVERNOR_MEMORY - Ignored if CONFIG_PM_MEMORY <= 4 + Ignored if CONFIG_PM_GOVERNOR_MEMORY <= 4 config PM_GOVERNOR_COEF5 int "PM coefficient 5" default 1 ---help--- - See help associated with CONFIG_PM_MEMORY + See help associated with CONFIG_PM_GOVERNOR_MEMORY - Ignored if CONFIG_PM_MEMORY <= 5 + Ignored if CONFIG_PM_GOVERNOR_MEMORY <= 5 config PM_GOVERNOR_IDLEENTER_THRESH int "PM IDLE enter threshold" @@ -159,7 +160,7 @@ config PM_GOVERNOR_IDLEENTER_THRESH CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: <=1: Essentially no activity @@ -174,7 +175,7 @@ config PM_GOVERNOR_IDLEEXIT_THRESH CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: >=2: Active @@ -189,7 +190,7 @@ config PM_GOVERNOR_IDLEENTER_COUNT CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: Thirty IDLE slices to enter IDLE mode from normal @@ -204,7 +205,7 @@ config PM_GOVERNOR_STANDBYENTER_THRESH CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: <=1: Essentially no activity @@ -219,7 +220,7 @@ config PM_GOVERNOR_STANDBYEXIT_THRESH CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: >=2: Active @@ -234,7 +235,7 @@ config PM_GOVERNOR_STANDBYENTER_COUNT CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: Fifty IDLE slices to enter STANDBY mode from IDLE @@ -249,7 +250,7 @@ config PM_GOVERNOR_SLEEPENTER_THRESH CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: <=1: Essentially no activity @@ -264,7 +265,7 @@ config PM_GOVERNOR_SLEEPEXIT_THRESH CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: >=2: Active @@ -279,7 +280,7 @@ config PM_GOVERNOR_SLEEPENTER_COUNT CONFIG_PM_xxxENTER_COUNT is the count for entering state xxx. Resuming to normal state, on the other hand, is usually immediate and - controlled by wakeup conditions established by the platform. The PM + controlled by wakeup conditions established by the platform. Default: Fifty IDLE slices to enter SLEEP mode from STANDBY diff --git a/drivers/power/activity_governor.c b/drivers/power/activity_governor.c index 96ffa4eeef..3173a2f4e1 100644 --- a/drivers/power/activity_governor.c +++ b/drivers/power/activity_governor.c @@ -78,7 +78,7 @@ struct pm_domain_state_s /* recommended - The recommended state based on the governor policy * mndex - The index to the next slot in the memory[] array to use. * mcnt - A tiny counter used only at start up. The actual - * algorithm cannot be applied until CONFIG_PM_MEMORY + * algorithm cannot be applied until CONFIG_PM_GOVERNOR_MEMORY * samples have been collected. */ @@ -96,7 +96,8 @@ struct pm_domain_state_s * length of the "memory", Ai is the weight applied to each value, and X is * the current activity. * - * CONFIG_PM_MEMORY provides the memory for the algorithm. Default: 2 + * CONFIG_PM_GOVERNOR_MEMORY provides the memory for the algorithm. + * Default: 2 * CONFIG_PM_COEFn provides weight for each sample. Default: 1 */ @@ -136,9 +137,9 @@ struct pm_activity_governor_s const int32_t pmexitthresh[3]; - /* CONFIG_PM_MEMORY is the total number of time slices (including the - * current time slice). The history of previous values is then - * CONFIG_PM_MEMORY-1. + /* CONFIG_PM_GOVERNOR_MEMORY is the total number of time slices (including + * the current time slice). The history of previous values is then + * CONFIG_PM_GOVERNOR_MEMORY-1. */ #if CONFIG_PM_GOVERNOR_MEMORY > 1 @@ -393,7 +394,7 @@ static void governor_update(int domain, int16_t accum) /* No smoothing */ - Y = accum; + y = accum; #endif /* First check if increased activity should cause us to return to the