mbox series

[v6,0/2] dt-bindings: hwmon: pmbus: add bindings for isl68137

Message ID cover.1730326915.git.grantpeltier93@gmail.com
Headers show
Series dt-bindings: hwmon: pmbus: add bindings for isl68137 | expand

Message

Grant Peltier Oct. 30, 2024, 10:40 p.m. UTC
Renesas digital multiphase voltage regulators are capable of regulating
output voltages that exceed the range that their Vsense pins can detect.
In such applications, users may place a voltage divider between Vout and
the Vsense pin for a given rail. However, the driver currently has no
way of knowing if a voltage divider is being used which results in
erroneous telemetry being reported over hwmon.

This patch set defines a devicetree bindings schema for Renesas digital
multiphase voltage regulators that are supported by the isl68137 driver
to allow users to add voltage divider definitions for any rail powered
by the device. This patch set also includes the required changes to the
isl68137 driver to enable scaling Vout/Pout telemetry for rails with a
defined voltage divider.

v6:
- Amend patch commit messages to explain why the vout-voltage-divider
  property was copied from the max20730 instead of using the iio
  voltage-divider property

v5:
- Fix clang compilation errors related to C23 syntax

v4:
- Revert devicetree property name to "vout-voltage-divider" and refactor
  property description and driver implementation to match existing
  vout-voltage-divider implementation in max20730 as no suitable generic
  voltage divider schema exists.
- Minor fixes based on Guenter's review of v2.
- Initialize voltage dividers for all channels to defaults that simplify
  logic in PMBus word read/write functions.

v3:
- Report and return errors reading the vout-voltage-divider property from
  the devicetree when the property is defined
- Change u64 division/rounding operations to use explicit math64 macros

v2:
- Fix devicetree bindings schema errors
- Add "renesas," vendor prefix to "vout-voltage-divider" property
- Rebase patch series on v6.12-rc1

Grant Peltier (2):
  hwmon: (pmbus/isl68137) add support for voltage divider on Vout
  dt-bindings: hwmon: isl68137: add bindings to support voltage dividers

 .../hwmon/pmbus/renesas,isl68137.yaml         | 147 ++++++++++++
 drivers/hwmon/pmbus/isl68137.c                | 209 +++++++++++++++++-
 2 files changed, 351 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/renesas,isl68137.yaml

Comments

Guenter Roeck Nov. 1, 2024, 2:31 p.m. UTC | #1
On Wed, Oct 30, 2024 at 05:40:58PM -0500, Grant Peltier wrote:
> Some applications require Vout to be higher than the detectable voltage
> range of the Vsense pin for a given rail. In such applications, a voltage
> divider may be placed between Vout and the Vsense pin, but this results
> in erroneous telemetry being read back from the part. This change adds
> support for a voltage divider to be defined in the devicetree for a (or
> multiple) specific rail(s) for a supported digital multiphase device and
> for the applicable Vout telemetry to be scaled based on the voltage
> divider configuration.
> 
> This change copies the implementation of the vout-voltage-divider
> devicetree property defined in the maxim,max20730 bindings schema since
> it is the best fit for the use case of scaling hwmon PMBus telemetry. The
> generic voltage-divider property used by many iio drivers was determined
> to be a poor fit because that schema is tied directly to iio and the
> isl68137 driver is not an iio driver.
> 
> Signed-off-by: Grant Peltier <grantpeltier93@gmail.com>

Applied, after fixing several alignment problems reported by
checkpatch --strict.

Guenter