* [PATCH v3 0/2] hwmon: (pmbus/lm25066) Support SMBus Current Limit configuration
@ 2026-06-15 9:49 Potin Lai
2026-06-15 9:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties Potin Lai
2026-06-15 9:49 ` [PATCH v3 2/2] hwmon: (pmbus/lm25066) add current limit configuration support Potin Lai
0 siblings, 2 replies; 6+ messages in thread
From: Potin Lai @ 2026-06-15 9:49 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Zev Weiss
Cc: linux-hwmon, devicetree, linux-kernel, Cosmo Chou, Mike Hsieh,
Potin Lai, Potin Lai
This series adds support for configuring the current limit behavior via
software override on LM25066-compatible devices (excluding LM25056) using
the DEVICE_SETUP (0xD9) register.
When the 'ti,current-range' property is specified in the device tree,
the driver configures the DEVICE_SETUP register's Current Limit Configuration
bit (bit 2) to activate SMBus/software override and sets the Current Limit
Setting bit (bit 4) to "low" or "high" threshold accordingly.
Since LM25056 does not support software override (bit 2 of DEVICE_SETUP is
reserved), it is explicitly excluded from this support in both the device
tree binding schema and the driver.
---
Changes in v3:
- Renamed property from 'ti,current-limit' to 'ti,current-range' to
resolve the global schema type conflict.
- Updated commit messages and bindings description to document supported
devices and their physical voltage mappings for the low/high settings.
- Link to v2: https://patch.msgid.link/20260615-lm25066-cl-config-v2-0-59be46e67d5a@gmail.com
Changes in v2:
- Replaced the boolean properties ('ti,cl-smbus-high' and 'ti,cl-smbus-low')
with a single string property 'ti,current-limit' ('low' or 'high')
- Excluded lm25056 in the driver from parsing/setting the current limit property.
- Link to v1: https://patch.msgid.link/20260611-lm25066-cl-config-v1-0-02e567bf3d91@gmail.com
To: Guenter Roeck <linux@roeck-us.net>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Zev Weiss <zev@bewilderbeest.net>
Cc: linux-hwmon@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Cosmo Chou <cosmo.chou@quantatw.com>
Cc: Mike Hsieh <Mike_Hsieh@quantatw.com>
Cc: Potin Lai <potin.lai@quantatw.com>
Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
---
Potin Lai (2):
dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties
hwmon: (pmbus/lm25066) add current limit configuration support
.../bindings/hwmon/pmbus/ti,lm25066.yaml | 20 ++++++++++++
drivers/hwmon/pmbus/lm25066.c | 37 ++++++++++++++++++++++
2 files changed, 57 insertions(+)
---
base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
change-id: 20260611-lm25066-cl-config-f81925f7337e
Best regards,
--
Potin Lai <potin.lai.pt@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties
2026-06-15 9:49 [PATCH v3 0/2] hwmon: (pmbus/lm25066) Support SMBus Current Limit configuration Potin Lai
@ 2026-06-15 9:49 ` Potin Lai
2026-06-15 16:36 ` Conor Dooley
2026-06-16 16:06 ` Guenter Roeck
2026-06-15 9:49 ` [PATCH v3 2/2] hwmon: (pmbus/lm25066) add current limit configuration support Potin Lai
1 sibling, 2 replies; 6+ messages in thread
From: Potin Lai @ 2026-06-15 9:49 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Zev Weiss
Cc: linux-hwmon, devicetree, linux-kernel, Cosmo Chou, Mike Hsieh,
Potin Lai, Potin Lai
Add a 'ti,current-range' string property to configure the device's Current
Limit (CL) behavior to "high" or "low" via the register, overriding the
physical CL pin setting.
This configuration is supported on LM25066, LM5064, LM5066, and LM5066i.
LM25056 is excluded because it does not support configuring the current
limit via the DEVICE_SETUP register (bit 2 of DEVICE_SETUP is reserved).
The values "low" and "high" map to the respective low/high threshold
voltages of the chips:
- LM25066: low = 25 mV, high = 46 mV
- LM5064, LM5066, LM5066i: low = 26 mV, high = 50 mV
Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
---
.../devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
index a20f140dc79a..fe42daabaaa8 100644
--- a/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
@@ -46,12 +46,32 @@ properties:
additionalProperties: false
+ ti,current-range:
+ description: |
+ Configure the current limit setting. When present, this property
+ overrides the hardware setting of the physical CL pin by configuring
+ the DEVICE_SETUP register.
+ - "low": maps to 25 mV (LM25066) or 26 mV (LM5064, LM5066, LM5066i)
+ - "high": maps to 46 mV (LM25066) or 50 mV (LM5064, LM5066, LM5066i)
+ $ref: /schemas/types.yaml#/definitions/string
+ enum:
+ - low
+ - high
+
required:
- compatible
- reg
allOf:
- $ref: /schemas/hwmon/hwmon-common.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,lm25056
+ then:
+ properties:
+ ti,current-range: false
unevaluatedProperties: false
--
2.52.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 2/2] hwmon: (pmbus/lm25066) add current limit configuration support
2026-06-15 9:49 [PATCH v3 0/2] hwmon: (pmbus/lm25066) Support SMBus Current Limit configuration Potin Lai
2026-06-15 9:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties Potin Lai
@ 2026-06-15 9:49 ` Potin Lai
2026-06-16 16:07 ` Guenter Roeck
1 sibling, 1 reply; 6+ messages in thread
From: Potin Lai @ 2026-06-15 9:49 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Zev Weiss
Cc: linux-hwmon, devicetree, linux-kernel, Cosmo Chou, Mike Hsieh,
Potin Lai, Potin Lai
Add support for the 'ti,current-range' devicetree property to configure
the current limit via the DEVICE_SETUP (0xD9) register, overriding the
physical CL pin setting.
This configuration is supported on all chips in this driver (LM25066,
LM5064, LM5066, LM5066i) except LM25056.
The property values "low" and "high" map to:
- LM25066: low = 25 mV, high = 46 mV
- LM5064, LM5066, LM5066i: low = 26 mV, high = 50 mV
The Bit 4 mapping to High/Low current limit is handled dynamically on
probe because it is swapped for LM25066 compared to the other supported
chips.
Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
---
drivers/hwmon/pmbus/lm25066.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
index dd7275a67a0a..53d274033d66 100644
--- a/drivers/hwmon/pmbus/lm25066.c
+++ b/drivers/hwmon/pmbus/lm25066.c
@@ -34,6 +34,7 @@ enum chips { lm25056, lm25066, lm5064, lm5066, lm5066i };
#define LM25066_READ_AVG_PIN 0xdf
#define LM25066_DEV_SETUP_CL BIT(4) /* Current limit */
+#define LM25066_DEV_SETUP_CL_CFG BIT(2) /* Current limit configuration */
#define LM25066_SAMPLES_FOR_AVG_MAX 4096
@@ -484,6 +485,42 @@ static int lm25066_probe(struct i2c_client *client)
data->id = (enum chips)(unsigned long)i2c_get_match_data(client);
+ if (data->id != lm25056) {
+ int config_new = config;
+ const char *cl_setting;
+ int ret;
+
+ if (!of_property_read_string(client->dev.of_node,
+ "ti,current-range", &cl_setting)) {
+ config_new |= LM25066_DEV_SETUP_CL_CFG;
+ if (strcmp(cl_setting, "high") == 0) {
+ if (data->id == lm25066)
+ config_new |= LM25066_DEV_SETUP_CL;
+ else
+ config_new &= ~LM25066_DEV_SETUP_CL;
+ } else if (strcmp(cl_setting, "low") == 0) {
+ if (data->id == lm25066)
+ config_new &= ~LM25066_DEV_SETUP_CL;
+ else
+ config_new |= LM25066_DEV_SETUP_CL;
+ } else {
+ dev_err(&client->dev,
+ "invalid current-range setting: %s\n",
+ cl_setting);
+ return -EINVAL;
+ }
+ }
+
+ if (config_new != config) {
+ ret = i2c_smbus_write_byte_data(client,
+ LM25066_DEVICE_SETUP,
+ config_new);
+ if (ret < 0)
+ return ret;
+ config = config_new;
+ }
+ }
+
info = &data->info;
info->pages = 1;
--
2.52.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties
2026-06-15 9:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties Potin Lai
@ 2026-06-15 16:36 ` Conor Dooley
2026-06-16 16:06 ` Guenter Roeck
1 sibling, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2026-06-15 16:36 UTC (permalink / raw)
To: Potin Lai
Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Zev Weiss, linux-hwmon, devicetree, linux-kernel, Cosmo Chou,
Mike Hsieh, Potin Lai
[-- Attachment #1: Type: text/plain, Size: 78 bytes --]
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties
2026-06-15 9:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties Potin Lai
2026-06-15 16:36 ` Conor Dooley
@ 2026-06-16 16:06 ` Guenter Roeck
1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2026-06-16 16:06 UTC (permalink / raw)
To: Potin Lai
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Zev Weiss,
linux-hwmon, devicetree, linux-kernel, Cosmo Chou, Mike Hsieh,
Potin Lai
On Mon, Jun 15, 2026 at 05:49:16PM +0800, Potin Lai wrote:
> Add a 'ti,current-range' string property to configure the device's Current
> Limit (CL) behavior to "high" or "low" via the register, overriding the
> physical CL pin setting.
>
> This configuration is supported on LM25066, LM5064, LM5066, and LM5066i.
> LM25056 is excluded because it does not support configuring the current
> limit via the DEVICE_SETUP register (bit 2 of DEVICE_SETUP is reserved).
>
> The values "low" and "high" map to the respective low/high threshold
> voltages of the chips:
> - LM25066: low = 25 mV, high = 46 mV
> - LM5064, LM5066, LM5066i: low = 26 mV, high = 50 mV
>
> Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Applied to hwmon-next.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (pmbus/lm25066) add current limit configuration support
2026-06-15 9:49 ` [PATCH v3 2/2] hwmon: (pmbus/lm25066) add current limit configuration support Potin Lai
@ 2026-06-16 16:07 ` Guenter Roeck
0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2026-06-16 16:07 UTC (permalink / raw)
To: Potin Lai
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Zev Weiss,
linux-hwmon, devicetree, linux-kernel, Cosmo Chou, Mike Hsieh,
Potin Lai
On Mon, Jun 15, 2026 at 05:49:17PM +0800, Potin Lai wrote:
> Add support for the 'ti,current-range' devicetree property to configure
> the current limit via the DEVICE_SETUP (0xD9) register, overriding the
> physical CL pin setting.
>
> This configuration is supported on all chips in this driver (LM25066,
> LM5064, LM5066, LM5066i) except LM25056.
>
> The property values "low" and "high" map to:
> - LM25066: low = 25 mV, high = 46 mV
> - LM5064, LM5066, LM5066i: low = 26 mV, high = 50 mV
>
> The Bit 4 mapping to High/Low current limit is handled dynamically on
> probe because it is swapped for LM25066 compared to the other supported
> chips.
>
> Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
Applied to hwmon-next.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-16 16:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-15 9:49 [PATCH v3 0/2] hwmon: (pmbus/lm25066) Support SMBus Current Limit configuration Potin Lai
2026-06-15 9:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties Potin Lai
2026-06-15 16:36 ` Conor Dooley
2026-06-16 16:06 ` Guenter Roeck
2026-06-15 9:49 ` [PATCH v3 2/2] hwmon: (pmbus/lm25066) add current limit configuration support Potin Lai
2026-06-16 16:07 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®