Skip to contentSkip to conversation

hwmon: (pmbus) Add support for MPS Multi-phase mp2856/mp2857 controller

PATCH Applied Potin Lai 2 participants 6 messages Dec 11, 2023 – Dec 18, 2023

Subsystems (3)
lore
Share & tools
lore

Potin Lai

author
#0 lore raw

v2 cover hwmon: (pmbus) Add support for MPS Multi-phase mp2856/mp2857 controller

Add support for mp2856/mp2857 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a dual-loop, digital, multi-phase, modulation controller.

changes v1 --> v2:
- mp2856.rst
- fix wordings
- mp2856.c
- fix register naming in defines
- remove unused register defines
- add max_phases and chip_id in struct mp2856_data
- force vout in direct mode
- remove unnecessary functions (ex: mp2856_identify_vid)
- add identify multiphase for both rail1 and rail2

Peter Yin (2):
dt-bindings: Add MP2856/MP2857 voltage regulator device
hwmon: (pmbus) Add support for MPS Multi-phase mp2856/mp2857
controller

 .../devicetree/bindings/trivial-devices.yaml  |   4 +
 Documentation/hwmon/index.rst                 |   1 +
 Documentation/hwmon/mp2856.rst                |  98 ++++
 drivers/hwmon/pmbus/Kconfig                   |   9 +
 drivers/hwmon/pmbus/Makefile                  |   1 +
 drivers/hwmon/pmbus/mp2856.c                  | 477 ++++++++++++++++++
 6 files changed, 590 insertions(+)
 create mode 100644 Documentation/hwmon/mp2856.rst
 create mode 100644 drivers/hwmon/pmbus/mp2856.c
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH v2 1/2 dt-bindings: Add MP2856/MP2857 voltage regulator device

From: Peter Yin <[email protected]>

Monolithic Power Systems, Inc. (MPS) MP2856/MP2857 dual-loop, digital, multi-phase controller.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +4 -0
index 386ebd1471d0e..c847a532283d4 100644
@@ -119,6 +119,10 @@ properties:
           - fsl,mpl3115
             # MPR121: Proximity Capacitive Touch Sensor Controller
           - fsl,mpr121
+            # Monolithic Power Systems Inc. multi-phase controller mp2856
+          - mps,mp2856
+            # Monolithic Power Systems Inc. multi-phase controller mp2857
+          - mps,mp2857
             # Monolithic Power Systems Inc. multi-phase controller mp2888
           - mps,mp2888
             # Monolithic Power Systems Inc. multi-phase controller mp2971
Signature · 1 line
2.31.1
maintainer Applied
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: Add MP2856/MP2857 voltage regulator device

Quoted 7 lines · Potin Lai

From: Peter Yin <[email protected]>

Monolithic Power Systems, Inc. (MPS) MP2856/MP2857 dual-loop, digital, multi-phase controller.

Applied.

Thanks,
Guenter

Quoted 19 lines
---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +4 -0
index 386ebd1471d0e..c847a532283d4 100644
@@ -119,6 +119,10 @@ properties:
           - fsl,mpl3115
             # MPR121: Proximity Capacitive Touch Sensor Controller
           - fsl,mpr121
+            # Monolithic Power Systems Inc. multi-phase controller mp2856
+          - mps,mp2856
+            # Monolithic Power Systems Inc. multi-phase controller mp2857
+          - mps,mp2857
             # Monolithic Power Systems Inc. multi-phase controller mp2888
           - mps,mp2888
             # Monolithic Power Systems Inc. multi-phase controller mp2971
author
#3 lore raw

PATCH v2 2/2 hwmon: (pmbus) Add support for MPS Multi-phase mp2856/mp2857 controller

In reply to Potin Lai

From: Peter Yin <[email protected]>

Add support for mp2856/mp2857 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a dual-loop, digital, multi-phase, modulation controller.

---
 Documentation/hwmon/index.rst  |   1 +
 Documentation/hwmon/mp2856.rst |  98 +++++++
 drivers/hwmon/pmbus/Kconfig    |   9 +
 drivers/hwmon/pmbus/Makefile   |   1 +
 drivers/hwmon/pmbus/mp2856.c   | 471 +++++++++++++++++++++++++++++++++
 5 files changed, 580 insertions(+)
 create mode 100644 Documentation/hwmon/mp2856.rst
 create mode 100644 drivers/hwmon/pmbus/mp2856.c
Documentation/hwmon/index.rst +1 -0
index 641aa5d97add2..87dc65a6a0982 100644
@@ -155,6 +155,7 @@ Hardware Monitoring Kernel Drivers
    mcp3021
    menf21bmc
    mlxreg-fan
+   mp2856
    mp2888
    mp2975
    mp5023
Documentation/hwmon/mp2856.rst new file +98 -0

98 lines not on this page · raw message

drivers/hwmon/pmbus/Kconfig +9 -0
index 17c98fca5bb6a..ad0e66e67bdef 100644
@@ -299,6 +299,15 @@ config SENSORS_MAX8688
 	  This driver can also be built as a module. If so, the module will
 	  be called max8688.
 
+config SENSORS_MP2856
+	tristate "MPS MP2856"
+	help
+	  If you say yes here you get hardware monitoring support for MPS
+	  MP2856 MP2857 Dual Loop Digital Multi-Phase Controller.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called mp2856.
+
 config SENSORS_MP2888
 	tristate "MPS MP2888"
 	help
drivers/hwmon/pmbus/Makefile +1 -0
index 212d9ca0acc97..f53b51b250ff8 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_SENSORS_MAX20751)	+= max20751.o
 obj-$(CONFIG_SENSORS_MAX31785)	+= max31785.o
 obj-$(CONFIG_SENSORS_MAX34440)	+= max34440.o
 obj-$(CONFIG_SENSORS_MAX8688)	+= max8688.o
+obj-$(CONFIG_SENSORS_MP2856)	+= mp2856.o
 obj-$(CONFIG_SENSORS_MP2888)	+= mp2888.o
 obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
 obj-$(CONFIG_SENSORS_MP5023)	+= mp5023.o
drivers/hwmon/pmbus/mp2856.c new file +471 -0

471 lines not on this page · raw message

Signature · 1 line
2.31.1
maintainer Applied
#4 lore raw
Quoted 8 lines · Potin Lai

From: Peter Yin <[email protected]>

Add support for mp2856/mp2857 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a dual-loop, digital, multi-phase, modulation controller.

Applied, with reservations (because due to lack of datasheet it is all but impossible to validate the code) and several fixups. So this driver comes with even less warranty than usual.

CHECK: Alignment should match open parenthesis
#671: FILE: drivers/hwmon/pmbus/mp2856.c:413:
+ memcpy(data->max_phases, mp2856_max_phases[data->chip_id],
+ sizeof(data->max_phases));

CHECK: Please don't use multiple blank lines
#673: FILE: drivers/hwmon/pmbus/mp2856.c:415:
+
+

CHECK: Please don't use multiple blank lines
#707: FILE: drivers/hwmon/pmbus/mp2856.c:449:
+
+

Fix those, and use i2c_get_match_data().

_Please_ run your patches through checkpatch. The above is really completely unnecessary and creates unnecessary extra work for others (me).

Guenter

author
#5 lore raw
Quoted 30 lines · Guenter Roeck
Quoted 8 lines · Potin Lai

From: Peter Yin <[email protected]>

Add support for mp2856/mp2857 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a dual-loop, digital, multi-phase, modulation controller.

Applied, with reservations (because due to lack of datasheet it is all but impossible to validate the code) and several fixups. So this driver comes with even less warranty than usual.

CHECK: Alignment should match open parenthesis
#671: FILE: drivers/hwmon/pmbus/mp2856.c:413:

drivers/hwmon/pmbus/mp2856.c new file +2 -0
+       memcpy(data->max_phases, mp2856_max_phases[data->chip_id],
+               sizeof(data->max_phases));

CHECK: Please don't use multiple blank lines
#673: FILE: drivers/hwmon/pmbus/mp2856.c:415:

(quoted diff) +2 -0
+
+

CHECK: Please don't use multiple blank lines
#707: FILE: drivers/hwmon/pmbus/mp2856.c:449:

(quoted diff) +2 -0
+
+
Quoted 6 lines

Fix those, and use i2c_get_match_data().

_Please_ run your patches through checkpatch. The above is really completely unnecessary and creates unnecessary extra work for others (me).

Guenter

Apologies for missing the style check issue, I will add "--strict" when running checkpatch.pl in future.
And thank you for fixing the mistakes and applying the driver.

Potin