mbox series

[RFC,0/2] Add SDPM clock monitor driver

Message ID 1617346747-8611-1-git-send-email-manafm@codeaurora.org (mailing list archive)
Headers show
Series Add SDPM clock monitor driver | expand

Message

Manaf Meethalavalappu Pallikunhi April 2, 2021, 6:59 a.m. UTC
RDPM (Rail digital power meter) hardware for a shared rail will
monitor for peak current management. It allocates one simple digital
power monitor(SDPM) for each major consumer of that rail. Each SDPM
estimates the power consumption of the consumer based on operating
frequency for that consumer. The RDPM hardware then aggregates all
SDPMs power estimation and recommends different mitigation levels
based on aggregated power estimation is above or below rail power
consumption specification.

This patch series adds SDPM clock monitor driver which
tracks frequency of different consumers and writes the frequency
into respective SDPM registers. The driver gets the clock source
to monitor and the corresponding SDPM register for a consumer from
devicetree. The SDPM clock monitor driver registers for the clock
change notification for these clock sources and writes the new
frequency value into the SDPM register.

Changes:
* Add dt-binding documentation for sdpm clock monitor driver
* Add SDPM clock monitor driver

Manaf Meethalavalappu Pallikunhi (2):
  dt-bindings: soc: qcom: Add SDPM clock monitor driver documentation in
    yaml
  drivers: soc: qcom: Add SDPM clock monitor driver

 .../devicetree/bindings/soc/qcom/qcom-sdpm.yaml    |  68 +++++++
 drivers/soc/qcom/Kconfig                           |   8 +
 drivers/soc/qcom/Makefile                          |   1 +
 drivers/soc/qcom/sdpm_clk_monitor.c                | 217 +++++++++++++++++++++
 4 files changed, 294 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom-sdpm.yaml
 create mode 100644 drivers/soc/qcom/sdpm_clk_monitor.c

Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>