powercap: intel_rapl: Use bitmap for Power Limits
authorZhang Rui <rui.zhang@intel.com>
Wed, 19 Apr 2023 02:44:12 +0000 (10:44 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 May 2023 16:46:19 +0000 (18:46 +0200)
commita38f300bb23c896d2d132a4502086d4bfec2a25e
treeefd3d24e5b0dc034565565cbc9fe4e47a6691d48
parent045610c383bd6b740bb7e7c780d6f7729249e60d
powercap: intel_rapl: Use bitmap for Power Limits

Currently, a RAPL package is registered with the number of Power Limits
supported in each RAPL domain. But this doesn't tell which Power Limits
are available. Using the number of Power Limits supported to guess the
availability of each Power Limit is fragile.

Use bitmap to represent the availability of each Power Limit.

Note that PL1 is mandatory thus it does not need to be set explicitly by
the RAPL Interface drivers.

No functional change intended.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wang Wendy <wendy.wang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/intel_rapl_common.c
drivers/powercap/intel_rapl_msr.c
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c