devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] hwmon: (pmbus/lm25066) Configurable sense resistor, other cleanups
@ 2021-09-28  9:22 Zev Weiss
  2021-09-28  9:22 ` [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC Zev Weiss
  0 siblings, 1 reply; 4+ messages in thread
From: Zev Weiss @ 2021-09-28  9:22 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Zev Weiss, Jean Delvare, linux-hwmon, linux-kernel,
	Jonathan Corbet, linux-doc, Rob Herring, devicetree

Hello,

I'm working with a board that uses LM25066s with sense resistor values
significantly different than the 1mOhm assumed by the coefficients
provided in the datasheet; the power and current readings produced by
the existing driver are thus fairly inaccurate.

This patch series started out as merely adding support for a
shunt-resistor-micro-ohms DT property as found in the adm1275 driver,
but along the way I noticed a number of other minor bits in the
lm25066 driver that looked like they could use some fixes, so I've
included those as well.

Patches 1 and 2 bring the m/b/R coefficients in line with what's in
the relevant datasheets, patches 3 through 5 are fairly generic
(minor) code cleanups, and patches 6 through 8 add the desired OF
support for the driver.


Thanks,
Zev


Zev Weiss (8):
  hwmon: (pmbus/lm25066) Add offset coefficients
  hwmon: (pmbus/lm25066) Adjust lm25066 PSC_CURRENT_IN_L mantissa
  hwmon: (pmbus/lm25066) Avoid forward declaration of lm25066_id
  hwmon: (pmbus/lm25066) Let compiler determine outer dimension of
    lm25066_coeff
  hwmon: (pmbus/lm25066) Mark lm25066_coeff array const
  hwmon: (pmbus/lm25066) Add OF device ID table
  hwmon: (pmbus/lm25066) Support configurable sense resistor values
  dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC

 .../bindings/hwmon/pmbus/ti,lm25066.yaml      | 54 +++++++++++
 Documentation/hwmon/lm25066.rst               |  2 +
 drivers/hwmon/pmbus/lm25066.c                 | 90 +++++++++++++++----
 3 files changed, 128 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml

-- 
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC
  2021-09-28  9:22 [PATCH 0/8] hwmon: (pmbus/lm25066) Configurable sense resistor, other cleanups Zev Weiss
@ 2021-09-28  9:22 ` Zev Weiss
  2021-10-04 18:28   ` Rob Herring
  2021-10-08 14:05   ` Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Zev Weiss @ 2021-09-28  9:22 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Zev Weiss, Jean Delvare, Rob Herring, linux-hwmon, devicetree,
	linux-kernel

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
 .../bindings/hwmon/pmbus/ti,lm25066.yaml      | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
new file mode 100644
index 000000000000..da8292bc32f5
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/pmbus/ti,lm25066.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: National Semiconductor/Texas Instruments LM250x6/LM506x power-management ICs
+
+maintainers:
+  - Zev Weiss <zev@bewilderbeest.net>
+
+description: |
+  The LM25066 family of power-management ICs (a.k.a. hot-swap
+  controllers or eFuses in various contexts) are PMBus devices that
+  offer temperature, current, voltage, and power monitoring.
+
+  Datasheet: https://www.ti.com/lit/ds/symlink/lm25066.pdf
+
+properties:
+  compatible:
+    enum:
+      - ti,lm25056
+      - ti,lm25066
+      - ti,lm5064
+      - ti,lm5066
+      - ti,lm5066i
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description:
+      Shunt (sense) resistor value in micro-Ohms
+    default: 1000
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pmic@40 {
+            compatible = "ti,lm25066";
+            reg = <0x40>;
+            shunt-resistor-micro-ohms = <675>;
+        };
+    };
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC
  2021-09-28  9:22 ` [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC Zev Weiss
@ 2021-10-04 18:28   ` Rob Herring
  2021-10-08 14:05   ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2021-10-04 18:28 UTC (permalink / raw)
  To: Zev Weiss
  Cc: Rob Herring, devicetree, linux-kernel, Guenter Roeck, linux-hwmon,
	Jean Delvare

On Tue, 28 Sep 2021 02:22:42 -0700, Zev Weiss wrote:
> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
> ---
>  .../bindings/hwmon/pmbus/ti,lm25066.yaml      | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC
  2021-09-28  9:22 ` [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC Zev Weiss
  2021-10-04 18:28   ` Rob Herring
@ 2021-10-08 14:05   ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-10-08 14:05 UTC (permalink / raw)
  To: Zev Weiss
  Cc: Jean Delvare, Rob Herring, linux-hwmon, devicetree, linux-kernel

On Tue, Sep 28, 2021 at 02:22:42AM -0700, Zev Weiss wrote:
> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied.

Thanks,
Guenter

> ---
>  .../bindings/hwmon/pmbus/ti,lm25066.yaml      | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
> new file mode 100644
> index 000000000000..da8292bc32f5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/pmbus/ti,lm25066.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: National Semiconductor/Texas Instruments LM250x6/LM506x power-management ICs
> +
> +maintainers:
> +  - Zev Weiss <zev@bewilderbeest.net>
> +
> +description: |
> +  The LM25066 family of power-management ICs (a.k.a. hot-swap
> +  controllers or eFuses in various contexts) are PMBus devices that
> +  offer temperature, current, voltage, and power monitoring.
> +
> +  Datasheet: https://www.ti.com/lit/ds/symlink/lm25066.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - ti,lm25056
> +      - ti,lm25066
> +      - ti,lm5064
> +      - ti,lm5066
> +      - ti,lm5066i
> +
> +  reg:
> +    maxItems: 1
> +
> +  shunt-resistor-micro-ohms:
> +    description:
> +      Shunt (sense) resistor value in micro-Ohms
> +    default: 1000
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        pmic@40 {
> +            compatible = "ti,lm25066";
> +            reg = <0x40>;
> +            shunt-resistor-micro-ohms = <675>;
> +        };
> +    };

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-08 14:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28  9:22 [PATCH 0/8] hwmon: (pmbus/lm25066) Configurable sense resistor, other cleanups Zev Weiss
2021-09-28  9:22 ` [PATCH 8/8] dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management IC Zev Weiss
2021-10-04 18:28   ` Rob Herring
2021-10-08 14:05   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).