Skip to contentSkip to conversation

LTC4286 and LTC4287 driver support

PATCH Applied Delphine CC Chiu 2 participants 5 messages Nov 23, 2023 – Dec 11, 2023

Subsystems (5)
lore
Share & tools
lore

Delphine CC Chiu

author maintainer
#0 lore raw

v7 cover LTC4286 and LTC4287 driver support

v7 - Add LTC4286 and LTC4287 binding document
- Add LTC4286 and LTC4287 driver

Delphine CC Chiu (2):
dt-bindings: hwmon: Add lltc ltc4286 driver bindings
hwmon: pmbus: Add ltc4286 driver

 .../bindings/hwmon/lltc,ltc4286.yaml          |  50 +++++
 Documentation/hwmon/index.rst                 |   1 +
 Documentation/hwmon/ltc4286.rst               |  95 ++++++++++
 MAINTAINERS                                   |  10 +
 drivers/hwmon/pmbus/Kconfig                   |  10 +
 drivers/hwmon/pmbus/Makefile                  |   1 +
 drivers/hwmon/pmbus/ltc4286.c                 | 176 ++++++++++++++++++
 7 files changed, 343 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/lltc,ltc4286.yaml
 create mode 100644 Documentation/hwmon/ltc4286.rst
 create mode 100644 drivers/hwmon/pmbus/ltc4286.c
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v7 1/2 dt-bindings: hwmon: Add lltc ltc4286 driver bindings

Add a device tree bindings for ltc4286 device.

---
Changelog:
v6 - Add "---" under "Changelog" in commit message
- Remove "shunt-resistor-micro-ohms" from required
v5 - Add hyphen under "Changelog" in commit message v4 - Revise some inappropriate writing in yaml file v3 - Revise adi,vrange-select-25p6 to adi,vrange-low-enable v2 - Revise vrange_select_25p6 to adi,vrange-select-25p6
- Add type for adi,vrange-select-25p6
- Revise rsense-micro-ohms to shunt-resistor-micro-ohms

---
 .../bindings/hwmon/lltc,ltc4286.yaml          | 50 +++++++++++++++++++
 MAINTAINERS                                   | 10 ++++
 2 files changed, 60 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/lltc,ltc4286.yaml
Documentation/devicetree/bindings/hwmon/lltc,ltc4286.yaml new file +50 -0
new file mode 100644
index 000000000000..98ca163d3486
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/lltc,ltc4286.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LTC4286 power monitors
+
+maintainers:
+  - Delphine CC Chiu <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - lltc,ltc4286
+      - lltc,ltc4287
+
+  reg:
+    maxItems: 1
+
+  adi,vrange-low-enable:
+    description:
+      This property is a bool parameter to represent the
+      voltage range is 25.6 volts or 102.4 volts for this chip.
+      The default is 102.4 volts.
+    type: boolean
+
+  shunt-resistor-micro-ohms:
+    description:
+      Resistor value micro-ohms.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        power-monitor@40 {
+            compatible = "lltc,ltc4286";
+            reg = <0x40>;
+            adi,vrange-low-enable;
+            shunt-resistor-micro-ohms = <300>;
+        };
+    };
MAINTAINERS +10 -0
index 0e79e24b6c96..33f005319c79 100644
@@ -12628,6 +12628,16 @@ S:	Maintained
 F:	Documentation/hwmon/ltc4261.rst
 F:	drivers/hwmon/ltc4261.c
 
+LTC4286 HARDWARE MONITOR DRIVER
+M:	Delphine CC Chiu <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/hwmon/lltc,ltc4286.yaml
+F:	Documentation/devicetree/bindings/hwmon/ltc4286.rst
+F:	drivers/hwmon/pmbus/Kconfig
+F:	drivers/hwmon/pmbus/Makefile
+F:	drivers/hwmon/pmbus/ltc4286.c
+
 LTC4306 I2C MULTIPLEXER DRIVER
 M:	Michael Hennerich <[email protected]>
 L:	[email protected]
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH v7 2/2 hwmon: pmbus: Add ltc4286 driver

In reply to Delphine CC Chiu

Add a driver to support ltc4286 chip

---
Changelog:
v7 - Check VRANGE_SELECT bit instead of entire register v6 - Check VRANGE_SELECT before driver loading
v5 - Check the overflow when reading rsense
- Set default rsense value
v4 - Add empty line before "config SENSORS_LTC4286" in Kconfig
- Add ltc4286 to Documentation/hwmon/index.rst
- Revise comment typo
- Use devm_kmemdup instead of memcpy
- Check MBR value before writting into
v3 - Use dev_err_probe() instead of dev_err()
- The VRANGE_SELECT bit only be written if it actually changed
- Avoid the info pointer being overwritten
- Check the MBR value range to avoid overflow
- Revise ltc4286.rst to corrcet description
v2 - Revise Linear Technologies LTC4286 to
Analog Devices LTC4286 in Kconfig
- Add more description for this driver in Kconfig
- Add some comments for MBR setting in ltc4286.c
- Add ltc4286.rst

---
 Documentation/hwmon/index.rst   |   1 +
 Documentation/hwmon/ltc4286.rst |  95 +++++++++++++++++
 drivers/hwmon/pmbus/Kconfig     |  10 ++
 drivers/hwmon/pmbus/Makefile    |   1 +
 drivers/hwmon/pmbus/ltc4286.c   | 176 ++++++++++++++++++++++++++++++++
 5 files changed, 283 insertions(+)
 create mode 100644 Documentation/hwmon/ltc4286.rst
 create mode 100644 drivers/hwmon/pmbus/ltc4286.c
Documentation/hwmon/index.rst +1 -0
index 72f4e6065bae..080827cc4c34 100644
@@ -128,6 +128,7 @@ Hardware Monitoring Kernel Drivers
    ltc4245
    ltc4260
    ltc4261
+   ltc4286
    max127
    max15301
    max16064
Documentation/hwmon/ltc4286.rst new file +95 -0

95 lines not on this page · raw message

drivers/hwmon/pmbus/Kconfig +10 -0
index b4e93bd5835e..2d4f972e5a65 100644
@@ -227,6 +227,16 @@ config SENSORS_LTC3815
 	  This driver can also be built as a module. If so, the module will
 	  be called ltc3815.
 
+config SENSORS_LTC4286
+	bool "Analog Devices LTC4286"
+	help
+	  LTC4286 is an integrated solution for hot swap applications that
+	  allows a board to be safely inserted and removed from a live
+	  backplane.
+	  This chip could be used to monitor voltage, current, ...etc.
+	  If you say yes here you get hardware monitoring support for Analog
+	  Devices LTC4286.
+
 config SENSORS_MAX15301
 	tristate "Maxim MAX15301"
 	help
drivers/hwmon/pmbus/Makefile +1 -0
index 84ee960a6c2d..94e28f6d6a61 100644
@@ -24,6 +24,7 @@ obj-$(CONFIG_SENSORS_LM25066)	+= lm25066.o
 obj-$(CONFIG_SENSORS_LT7182S)	+= lt7182s.o
 obj-$(CONFIG_SENSORS_LTC2978)	+= ltc2978.o
 obj-$(CONFIG_SENSORS_LTC3815)	+= ltc3815.o
+obj-$(CONFIG_SENSORS_LTC4286)	+= ltc4286.o
 obj-$(CONFIG_SENSORS_MAX15301)	+= max15301.o
 obj-$(CONFIG_SENSORS_MAX16064)	+= max16064.o
 obj-$(CONFIG_SENSORS_MAX16601)	+= max16601.o
drivers/hwmon/pmbus/ltc4286.c new file +176 -0

176 lines not on this page · raw message

Signature · 1 line
2.25.1