Add a powercap driver that, using the ARM SCMI Protocol to query the SCMI
platform firmware for the list of existing Powercap domains, registers all
of such discovered domains under the new 'arm-scmi' powercap control type.
A new simple powercap zone and constraint is registered for all the SCMI
powercap zones that are found.
Cc: Rafael J. Wysocki <rafael@xxxxxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxx
Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
---
v1 --> v2
- using clamp_t() to simplify normalizations
- cleanup style in block of var declarations
- refactor scale conversions code
- add MAINTAINER entry
- refactored normalizations and added dev_dbg
vOLD --> v1
- fix _init cleaning up powerctrl zone on failure
- removed uneeded casting
- simplified normalization helpers
---
MAINTAINERS | 1 +
drivers/powercap/Kconfig | 13 +
drivers/powercap/Makefile | 1 +
drivers/powercap/arm_scmi_powercap.c | 508 +++++++++++++++++++++++++++
4 files changed, 523 insertions(+)
create mode 100644 drivers/powercap/arm_scmi_powercap.c