Skip to contentSkip to conversation

hwmon: Add driver for MPS MPQ8785 Synchronous Step-Down Converter

PATCH Superseded Charles Hsu 2 participants 3 messages Jan 26, 2024 – Jan 28, 2024

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Add driver for MPS MPQ8785 Synchronous Step-Down Converter

Add support for mpq8785 device from Monolithic Power Systems, Inc. (MPS) vendor. This is synchronous step-down controller.

---
Change in v1:
Initial patchset.

---
 Documentation/hwmon/index.rst   |  1 +
 Documentation/hwmon/mpq8785.rst | 86 +++++++++++++++++++++++++++++++++
 drivers/hwmon/pmbus/Kconfig     |  9 ++++
 drivers/hwmon/pmbus/Makefile    |  1 +
 drivers/hwmon/pmbus/mpq8785.c   | 55 +++++++++++++++++++++
 5 files changed, 152 insertions(+)
 create mode 100644 Documentation/hwmon/mpq8785.rst
 create mode 100644 drivers/hwmon/pmbus/mpq8785.c
Documentation/hwmon/index.rst +1 -0
index c7ed1f73ac06..085ad6ca9b05 100644
@@ -163,6 +163,7 @@ Hardware Monitoring Kernel Drivers
    mp2975
    mp5023
    mp5990
+   mpq8785
    nct6683
    nct6775
    nct7802
Documentation/hwmon/mpq8785.rst new file +86 -0

86 lines not on this page · raw message

drivers/hwmon/pmbus/Kconfig +9 -0
index 294808f5240a..557ae0c414b0 100644
@@ -377,6 +377,15 @@ config SENSORS_MPQ7932
 	  This driver can also be built as a module. If so, the module will
 	  be called mpq7932.
 
+config SENSORS_MPQ8785
+	tristate "MPS MPQ8785"
+	help
+	  If you say yes here you get hardware monitoring functionality support
+	  for power management IC MPS MPQ8785.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called mpq8785.
+
 config SENSORS_PIM4328
 	tristate "Flex PIM4328 and compatibles"
 	help
drivers/hwmon/pmbus/Makefile +1 -0
index cf8a76744545..f14ecf03ad77 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
 obj-$(CONFIG_SENSORS_MP5023)	+= mp5023.o
 obj-$(CONFIG_SENSORS_MP5990)	+= mp5990.o
 obj-$(CONFIG_SENSORS_MPQ7932)	+= mpq7932.o
+obj-$(CONFIG_SENSORS_MPQ8785)	+= mpq8785.o
 obj-$(CONFIG_SENSORS_PLI1209BC)	+= pli1209bc.o
 obj-$(CONFIG_SENSORS_PM6764TR)	+= pm6764tr.o
 obj-$(CONFIG_SENSORS_PXE1610)	+= pxe1610.o
drivers/hwmon/pmbus/mpq8785.c new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 3 lines · Charles Hsu

Add support for mpq8785 device from Monolithic Power Systems, Inc. (MPS) vendor. This is synchronous step-down controller.

"(MPS) vendor" above has no value.

I find no reference that this chip actually exists. Sorry, but I can not apply such patches without confirmation that the chip actually exists.

Quoted 4 lines

---
Change in v1:
Initial patchset.

A change log or v1 tag is not needed for the first version of a patch or patch series.

Quoted 1 line

---

...

drivers/hwmon/pmbus/mpq8785.c line 28

Quoted 2 lines
drivers/hwmon/pmbus/mpq8785.c new file +2 -0
+		PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT |
+		PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP,

I am not too happy that all those drivers claim to have no output status registers. It always makes me wonder if the definitions are just copied from one driver to the next.

drivers/hwmon/pmbus/mpq8785.c line 38

Quoted 3 lines
drivers/hwmon/pmbus/mpq8785.c new file +3 -0
+static const struct of_device_id __maybe_unused mpq8785_of_match[] = {
+	{ .compatible = "mps,mpq8785", },
+	{}

checkpatch says:

WARNING: DT compatible string "mps,mpq8785" appears un-documented -- check ./Documentation/devicetree/bindings/ #293: FILE: drivers/hwmon/pmbus/mpq8785.c:37:
+ { .compatible = "mps,mpq8785", },

I don't care about the also missing entry in MAINTAINERS, but the device needs to be be documented in Documentation/devicetree/bindings/trivial-devices.yaml.

Quoted 6 lines
drivers/hwmon/pmbus/mpq8785.c new file +6 -0
+};
+
+MODULE_DEVICE_TABLE(of, mpq8785_of_match);
+
+static struct i2c_driver mpq8785_driver = {
+	.driver = {

drivers/hwmon/pmbus/mpq8785.c line 54

Quoted 10 lines
drivers/hwmon/pmbus/mpq8785.c new file +10 -0
+		   .name = "mpq8785",
+		   .of_match_table = of_match_ptr(mpq8785_of_match),
+	},
+	.probe_new = mpq8785_probe,
+};
+
+module_i2c_driver(mpq8785_driver);
+
+MODULE_AUTHOR("Charles Hsu <[email protected]>");
+MODULE_DESCRIPTION("MPQ8785 PMIC regulator driver");

Is this copied from the mpq7932 driver ? This driver does not include a regulator component, so it is a bit misleading to label it as regulator driver.

Guenter

maintainer
#2 lore raw
Quoted 10 lines · Guenter Roeck
Quoted 3 lines · Charles Hsu

Add support for mpq8785 device from Monolithic Power Systems, Inc. (MPS) vendor. This is synchronous step-down controller.

"(MPS) vendor" above has no value.

I find no reference that this chip actually exists. Sorry, but I can not apply such patches without confirmation that the chip actually exists.

I since learned that the chip does exist, so this is no longer a concern.

Quoted 8 lines
Quoted 4 lines

---
Change in v1:
Initial patchset.

A change log or v1 tag is not needed for the first version of a patch or patch series.

Quoted 8 lines
Quoted 1 line

---

...

drivers/hwmon/pmbus/mpq8785.c line 28

Quoted 2 lines
drivers/hwmon/pmbus/mpq8785.c new file +2 -0
+		PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT |
+		PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP,

I am not too happy that all those drivers claim to have no output status registers. It always makes me wonder if the definitions are just copied from one driver to the next.

I also learned that the chip supports additional status registers. Please list all supported status registers.

I also learned that the chips voltage output mode is configurable. As such,

+ .format[PSC_CURRENT_OUT] = direct,

won't do because it cause instantiation to fail due to mode mismatch in pmbus_identify_common() if the mode is configured to linear or vid mode. This will need to be addressed.

Thanks,
Guenter