Skip to contentSkip to conversation

dt-bindings: hwmon: pmbus: mpq8785: add mpm3695-20 and mpm3690s-15 support

PATCH In review Yuxi Wang 2 participants 4 messages Mar 18 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Yuxi Wang

author
#1 lore raw

PATCH 1/2 dt-bindings: hwmon: pmbus: mpq8785: add mpm3695-20 and mpm3690s-15 support

Add device type support for mpm3695-20 and mpm3690s-15.

---
 Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml +2 -0
index 90970a0433e9..86e979cf0a00 100644
@@ -19,6 +19,8 @@ properties:
       - mps,mpm3695-25
       - mps,mpm82504
       - mps,mpq8785
+      - mps,mpm3695-20
+      - mps,mpm3690s-15
 
   reg:
     maxItems: 1
Signature · 1 line
2.39.2
maintainer
#2 lore raw
Quoted 12 lines · Yuxi Wang

Add device type support for mpm3695-20 and mpm3690s-15.

---
  Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 2 ++
  1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml +0 -0
index 90970a0433e9..86e979cf0a00 100644

Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml properties: · line 22

Quoted 4 lines
Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml +1 -0
@@ -19,6 +19,8 @@ properties:
        - mps,mpm3695-25
        - mps,mpm82504
        - mps,mpq8785
+      - mps,mpm3695-20

Alphabetic order, please.

We already have mps,mpm3695 and mps,mpm3695-25. The -20 model is covered by mps,mpm3695, and a separate entry should therefore not be needed.

Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml properties: · line 23

Quoted 1 line
Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml +1 -0
+      - mps,mpm3690s-15

Unless there are other differences, that seems to be register compatible to mps,mpm3695 and should therefore also not need a separate property entry. It should instead be listed as compatible to mps,mpm3695.

Thanks,
Guenter

author
#3 lore raw

PATCH 2/2 hwmon: pmbus: mpq8785: add support for mpm3695-20 and mpm3690s-15

In reply to a message not in the archive

Add support for the MPS mpm3695-20 and mpm3690s-15.

---
 drivers/hwmon/pmbus/mpq8785.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/mpq8785.c +9 -1
index 87bd039c77b9..03889a197c4f 100644
@@ -12,13 +12,15 @@
 
 #define MPM82504_READ_TEMPERATURE_1_SIGN_POS	9
 
-enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785 };
+enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785, mpm3695_20, mpm3690s_15 };
 
 static u16 voltage_scale_loop_max_val[] = {
 	[mpm3695] = GENMASK(9, 0),
 	[mpm3695_25] = GENMASK(11, 0),
 	[mpm82504] = GENMASK(9, 0),
 	[mpq8785] = GENMASK(10, 0),
+	[mpm3695_20] = GENMASK(9, 0),
+	[mpm3690s_15] = GENMASK(9, 0),
 };
 
 static int mpq8785_identify(struct i2c_client *client,
@@ -114,6 +116,8 @@ static const struct i2c_device_id mpq8785_id[] = {
 	{ "mpm3695-25", mpm3695_25 },
 	{ "mpm82504", mpm82504 },
 	{ "mpq8785", mpq8785 },
+	{ "mpm3695-20", mpm3695_20 },
+	{ "mpm3690s-15", mpm3690s_15 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, mpq8785_id);
@@ -123,6 +127,8 @@ static const struct of_device_id __maybe_unused mpq8785_of_match[] = {
 	{ .compatible = "mps,mpm3695-25", .data = (void *)mpm3695_25 },
 	{ .compatible = "mps,mpm82504", .data = (void *)mpm82504 },
 	{ .compatible = "mps,mpq8785", .data = (void *)mpq8785 },
+	{ .compatible = "mps,mpm3695-20", .data = (void *)mpm3695_20 },
+	{ .compatible = "mps,mpm3690s-15", .data = (void *)mpm3690s_15 },
 	{}
 };
 MODULE_DEVICE_TABLE(of, mpq8785_of_match);
@@ -148,6 +154,8 @@ static int mpq8785_probe(struct i2c_client *client)
 	case mpm3695:
 	case mpm3695_25:
 	case mpm82504:
+	case mpm3695_20:
+	case mpm3690s_15:
 		info->format[PSC_VOLTAGE_OUT] = direct;
 		info->m[PSC_VOLTAGE_OUT] = 8;
 		info->b[PSC_VOLTAGE_OUT] = 0;
Signature · 1 line
2.39.2
maintainer
#4 lore raw

Re: [PATCH 2/2] hwmon: pmbus: mpq8785: add support for mpm3695-20 and mpm3690s-15

Quoted 47 lines · Yuxi Wang

Add support for the MPS mpm3695-20 and mpm3690s-15.

---
  drivers/hwmon/pmbus/mpq8785.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/mpq8785.c +7 -1
index 87bd039c77b9..03889a197c4f 100644
@@ -12,13 +12,15 @@
 
  #define MPM82504_READ_TEMPERATURE_1_SIGN_POS	9
 
-enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785 };
+enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785, mpm3695_20, mpm3690s_15 };
 
  static u16 voltage_scale_loop_max_val[] = {
  	[mpm3695] = GENMASK(9, 0),
  	[mpm3695_25] = GENMASK(11, 0),
  	[mpm82504] = GENMASK(9, 0),
  	[mpq8785] = GENMASK(10, 0),
+	[mpm3695_20] = GENMASK(9, 0),
+	[mpm3690s_15] = GENMASK(9, 0),
  };
 
  static int mpq8785_identify(struct i2c_client *client,
@@ -114,6 +116,8 @@ static const struct i2c_device_id mpq8785_id[] = {
  	{ "mpm3695-25", mpm3695_25 },
  	{ "mpm82504", mpm82504 },
  	{ "mpq8785", mpq8785 },
+	{ "mpm3695-20", mpm3695_20 },
+	{ "mpm3690s-15", mpm3690s_15 },
  	{ },
  };
  MODULE_DEVICE_TABLE(i2c, mpq8785_id);
@@ -123,6 +127,8 @@ static const struct of_device_id __maybe_unused mpq8785_of_match[] = {
  	{ .compatible = "mps,mpm3695-25", .data = (void *)mpm3695_25 },
  	{ .compatible = "mps,mpm82504", .data = (void *)mpm82504 },
  	{ .compatible = "mps,mpq8785", .data = (void *)mpq8785 },
+	{ .compatible = "mps,mpm3695-20", .data = (void *)mpm3695_20 },
+	{ .compatible = "mps,mpm3690s-15", .data = (void *)mpm3690s_15 },
  	{}
  };
  MODULE_DEVICE_TABLE(of, mpq8785_of_match);

drivers/hwmon/pmbus/mpq8785.c static int mpq8785_probe(struct i2c_client *client) · line 161

Quoted 8 lines
drivers/hwmon/pmbus/mpq8785.c +2 -0
@@ -148,6 +154,8 @@ static int mpq8785_probe(struct i2c_client *client)
  	case mpm3695:
  	case mpm3695_25:
  	case mpm82504:
+	case mpm3695_20:
+	case mpm3690s_15:
  		info->format[PSC_VOLTAGE_OUT] = direct;
  		info->m[PSC_VOLTAGE_OUT] = 8;
  		info->b[PSC_VOLTAGE_OUT] = 0;

I don't think those changes are needed since both chips appear to be fully register-compatible to other chips supported by the driver (specifically the generic mpm3695 entry for both chips).

Obviously I can not say for sure if that is really the case for mpm3690s_15 since its complete datasheet is not available, so my statement is based on the code above.

Thanks,
Guenter