Skip to contentSkip to conversation

hwmon: Add support for MPS mp2985

PATCH Applied [email protected] 2 participants 5 messages Apr 14 – Apr 30

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v4 cover hwmon: Add support for MPS mp2985

From: Wensheng Wang <[email protected]>

Add mp2985 driver in hwmon and add dt-bindings for it.

V3 -> V4:
1. Avoid mantissa data overflow in mp2985_linear_exp_transfer() function.

V2 -> V3:
1. The shifted mantissa be clamped to the range [-1024, 1023] before being masked in mp2985_linear_exp_transfer() function.
2. The PMBUS_VOUT_OV_FAULT_LIMIT and PMBUS_VOUT_UV_FAULT_LIMIT value are clamped to 0xFFF before being written to the mp2985.
3. Fix the vout scale issue for vout linear11 mode.

v1 -> v2:
1. add Krzysztof's Acked-by
2. remove duplicate entry in mp2985.rst
3. clamp vout value to 32767
4. simplify the code for obtaining PMBUS_VOUT_MODE bit value
5. add comment for explaining MP2985 supported vout mode
6. switch back to previous page after obtaining vid scale to avoid confusing the PMBus core

Wensheng Wang (2):
dt-bindings: hwmon: Add MPS mp2985
hwmon: add MP2985 driver

 .../devicetree/bindings/trivial-devices.yaml  |   2 +
 Documentation/hwmon/index.rst                 |   1 +
 Documentation/hwmon/mp2985.rst                | 147 +++++++
 MAINTAINERS                                   |   7 +
 drivers/hwmon/pmbus/Kconfig                   |   9 +
 drivers/hwmon/pmbus/Makefile                  |   1 +
 drivers/hwmon/pmbus/mp2985.c                  | 402 ++++++++++++++++++
 7 files changed, 569 insertions(+)
 create mode 100644 Documentation/hwmon/mp2985.rst
 create mode 100644 drivers/hwmon/pmbus/mp2985.c
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v4 1/2 dt-bindings: hwmon: Add MPS mp2985

From: Wensheng Wang <[email protected]>

Add support for MPS mp2985 controller.

---
v1 -> v2:
1. add Krzysztof's Acked-by

 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index a482aeadcd44..d61482269352 100644
@@ -325,6 +325,8 @@ properties:
           - mps,mp29612
             # Monolithic Power Systems Inc. multi-phase controller mp29816
           - mps,mp29816
+            # Monolithic Power Systems Inc. multi-phase controller mp2985
+          - mps,mp2985
             # Monolithic Power Systems Inc. multi-phase controller mp2993
           - mps,mp2993
             # Monolithic Power Systems Inc. hot-swap protection device
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH v4 2/2 hwmon: add MP2985 driver

From: Wensheng Wang <[email protected]>

Add support for MPS mp2985 controller. This driver exposes telemetry and limit value readings and writtings.

---
V3 -> V4:
1. Avoid mantissa data overflow in mp2985_linear_exp_transfer() function.

V2 -> V3:
1. The shifted mantissa be clamped to the range [-1024, 1023] before being masked in mp2985_linear_exp_transfer() function.
2. The PMBUS_VOUT_OV_FAULT_LIMIT and PMBUS_VOUT_UV_FAULT_LIMIT value are clamped to 0xFFF before being written to the mp2985.
3. Fix the vout scale issue for vout linear11 mode.

v1 -> v2:
1. remove duplicate entry in mp2985.rst
2. clamp vout value to 32767
3. simplify the code for obtaining PMBUS_VOUT_MODE bit value
4. add comment for explaining MP2985 supported vout mode
5. switch back to previous page after obtaining vid scale to avoid confusing the PMBus core

 Documentation/hwmon/index.rst  |   1 +
 Documentation/hwmon/mp2985.rst | 147 ++++++++++++
 MAINTAINERS                    |   7 +
 drivers/hwmon/pmbus/Kconfig    |   9 +
 drivers/hwmon/pmbus/Makefile   |   1 +
 drivers/hwmon/pmbus/mp2985.c   | 402 +++++++++++++++++++++++++++++++++
 6 files changed, 567 insertions(+)
 create mode 100644 Documentation/hwmon/mp2985.rst
 create mode 100644 drivers/hwmon/pmbus/mp2985.c
Documentation/hwmon/index.rst +1 -0
index b2ca8513cfcd..1b7007f41b39 100644
@@ -183,6 +183,7 @@ Hardware Monitoring Kernel Drivers
    mp2925
    mp29502
    mp2975
+   mp2985
    mp2993
    mp5023
    mp5920
Documentation/hwmon/mp2985.rst new file +147 -0

147 lines not on this page · raw message

MAINTAINERS +7 -0
index 3adc870d523b..ead04c2d1665 100644
@@ -17933,6 +17933,13 @@ S:	Maintained
 F:	Documentation/hwmon/mp29502.rst
 F:	drivers/hwmon/pmbus/mp29502.c
 
+MPS MP2985 DRIVER
+M:	Wensheng Wang <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/hwmon/mp2985.rst
+F:	drivers/hwmon/pmbus/mp2985.c
+
 MPS MP2993 DRIVER
 M:	Noah Wang <[email protected]>
 L:	[email protected]
drivers/hwmon/pmbus/Kconfig +9 -0
index fc1273abe357..83fe5866c083 100644
@@ -447,6 +447,15 @@ config SENSORS_MP2975
 	  This driver can also be built as a module. If so, the module will
 	  be called mp2975.
 
+config SENSORS_MP2985
+	tristate "MPS MP2985"
+	help
+	  If you say yes here you get hardware monitoring support for MPS
+	  MP2985 Dual Loop Digital Multi-Phase Controller.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called mp2985.
+
 config SENSORS_MP2993
 	tristate "MPS MP2993"
 	help
drivers/hwmon/pmbus/Makefile +1 -0
index d6c86924f887..24505bbee2b0 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_SENSORS_MP2891)	+= mp2891.o
 obj-$(CONFIG_SENSORS_MP2925)	+= mp2925.o
 obj-$(CONFIG_SENSORS_MP29502)	+= mp29502.o
 obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
+obj-$(CONFIG_SENSORS_MP2985)	+= mp2985.o
 obj-$(CONFIG_SENSORS_MP2993)	+= mp2993.o
 obj-$(CONFIG_SENSORS_MP5023)	+= mp5023.o
 obj-$(CONFIG_SENSORS_MP5920)	+= mp5920.o
drivers/hwmon/pmbus/mp2985.c new file +402 -0

402 lines not on this page · raw message

Signature · 1 line
2.25.1