• Zhang Rui's avatar
    powercap: intel_rapl: Change primitive order · 045610c3
    Zhang Rui authored
    The same set of operations are shared by different Powert Limits,
    including Power Limit get/set, Power Limit enable/disable, clamping
    enable/disable, time window get/set, and max power get/set, etc.
    
    But the same operation for different Power Limit has different
    primitives because they use different registers/register bits.
    
    A lot of dirty/duplicate code was introduced to handle this difference.
    
    Instead of using hardcoded primitive name directly, using Power Limit id
    + operation type is much cleaner.
    
    For this sense, move POWER_LIMIT1/POWER_LIMIT2/POWER_LIMIT4 to the
    beginning of enum rapl_primitives so that they can be reused as
    Power Limit ids.
    
    No functional change.
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    Tested-by: default avatarWang Wendy <wendy.wang@intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    045610c3
intel_rapl_common.c 43.5 KB