All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802
@ 2021-04-23 15:33 Erik Rosen
  2021-04-23 15:33 ` [PATCH 1/2] " Erik Rosen
  2021-04-23 15:33 ` [PATCH 2/2] hwmon: (pmbus/zl6100) Update documentation for zl6100 driver Erik Rosen
  0 siblings, 2 replies; 5+ messages in thread
From: Erik Rosen @ 2021-04-23 15:33 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Corbet, linux-hwmon,
	linux-doc, linux-kernel
  Cc: Erik Rosen

Add support for Renesas ZL8802 Dual Channel/Dual Phase PMBus DC/DC
Digital Controller as well as support for the Renesas custom controller
chips ZLS1003 and ZLS4009 to the zl6100 pmbus driver.

The ZL8802 support was tested using a Flex BMR469 converter module,
the ZLS1003 with a Flex BMR466 and the ZLS4009 with a Flex BMR465.

The documentation is updated with new sysfs attribute descriptions and
broken links to technical specifications has been fixed. Also the Renesas
company name was added and Ericsson changed to Flex to reflect new
ownership relations.

Erik Rosen (2):
  Add support for ZLS1003, ZLS4009 and ZL8802
  Update documentation for zl6100 driver

 Documentation/hwmon/zl6100.rst | 132 ++++++++++++++++++++++-----------
 drivers/hwmon/pmbus/zl6100.c   |  94 +++++++++++++++++++----
 2 files changed, 169 insertions(+), 57 deletions(-)


base-commit: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802
  2021-04-23 15:33 [PATCH 0/2] hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802 Erik Rosen
@ 2021-04-23 15:33 ` Erik Rosen
  2021-05-01  4:17   ` Guenter Roeck
  2021-04-23 15:33 ` [PATCH 2/2] hwmon: (pmbus/zl6100) Update documentation for zl6100 driver Erik Rosen
  1 sibling, 1 reply; 5+ messages in thread
From: Erik Rosen @ 2021-04-23 15:33 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Corbet, linux-hwmon,
	linux-doc, linux-kernel
  Cc: Erik Rosen

Add support for Renesas ZL8802 Dual Channel/Dual Phase PMBus DC/DC
Digital Controller as well as ZLS1003 and ZLS4009 custom DC/DC
controller chips.

Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
---
 drivers/hwmon/pmbus/zl6100.c | 94 ++++++++++++++++++++++++++++++------
 1 file changed, 80 insertions(+), 14 deletions(-)

diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c
index 69120ca7aaa8..757039bb8a62 100644
--- a/drivers/hwmon/pmbus/zl6100.c
+++ b/drivers/hwmon/pmbus/zl6100.c
@@ -18,7 +18,7 @@
 #include "pmbus.h"
 
 enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105,
-	     zl9101, zl9117 };
+	     zl8802, zl9101, zl9117, zls1003, zls4009 };
 
 struct zl6100_data {
 	int id;
@@ -34,6 +34,13 @@ struct zl6100_data {
 
 #define ZL6100_MFR_XTEMP_ENABLE		BIT(7)
 
+#define ZL8802_MFR_USER_GLOBAL_CONFIG	0xe9
+#define ZL8802_MFR_TMON_ENABLE		BIT(12)
+#define ZL8802_MFR_USER_CONFIG		0xd1
+#define ZL8802_MFR_XTEMP_ENABLE_2	BIT(1)
+#define ZL8802_MFR_DDC_CONFIG		0xd3
+#define ZL8802_MFR_PHASES_MASK		0x0007
+
 #define MFR_VMON_OV_FAULT_LIMIT		0xf5
 #define MFR_VMON_UV_FAULT_LIMIT		0xf6
 #define MFR_READ_VMON			0xf7
@@ -132,7 +139,7 @@ static int zl6100_read_word_data(struct i2c_client *client, int page,
 	struct zl6100_data *data = to_zl6100_data(info);
 	int ret, vreg;
 
-	if (page > 0)
+	if (page >= info->pages)
 		return -ENXIO;
 
 	if (data->id == zl2005) {
@@ -191,7 +198,7 @@ static int zl6100_read_byte_data(struct i2c_client *client, int page, int reg)
 	struct zl6100_data *data = to_zl6100_data(info);
 	int ret, status;
 
-	if (page > 0)
+	if (page >= info->pages)
 		return -ENXIO;
 
 	zl6100_wait(data);
@@ -230,7 +237,7 @@ static int zl6100_write_word_data(struct i2c_client *client, int page, int reg,
 	struct zl6100_data *data = to_zl6100_data(info);
 	int ret, vreg;
 
-	if (page > 0)
+	if (page >= info->pages)
 		return -ENXIO;
 
 	switch (reg) {
@@ -271,7 +278,7 @@ static int zl6100_write_byte(struct i2c_client *client, int page, u8 value)
 	struct zl6100_data *data = to_zl6100_data(info);
 	int ret;
 
-	if (page > 0)
+	if (page >= info->pages)
 		return -ENXIO;
 
 	zl6100_wait(data);
@@ -287,6 +294,10 @@ static const struct i2c_device_id zl6100_id[] = {
 	{"bmr462", zl2008},
 	{"bmr463", zl2008},
 	{"bmr464", zl2008},
+	{"bmr465", zls4009},
+	{"bmr466", zls1003},
+	{"bmr467", zls4009},
+	{"bmr469", zl8802},
 	{"zl2004", zl2004},
 	{"zl2005", zl2005},
 	{"zl2006", zl2006},
@@ -295,15 +306,18 @@ static const struct i2c_device_id zl6100_id[] = {
 	{"zl2106", zl2106},
 	{"zl6100", zl6100},
 	{"zl6105", zl6105},
+	{"zl8802", zl8802},
 	{"zl9101", zl9101},
 	{"zl9117", zl9117},
+	{"zls1003", zls1003},
+	{"zls4009", zls4009},
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, zl6100_id);
 
 static int zl6100_probe(struct i2c_client *client)
 {
-	int ret;
+	int ret, i;
 	struct zl6100_data *data;
 	struct pmbus_driver_info *info;
 	u8 device_id[I2C_SMBUS_BLOCK_MAX + 1];
@@ -367,18 +381,70 @@ static int zl6100_probe(struct i2c_client *client)
 	  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
 
 	/*
-	 * ZL2004, ZL9101M, and ZL9117M support monitoring an extra voltage
-	 * (VMON for ZL2004, VDRV for ZL9101M and ZL9117M). Report it as vmon.
+	 * ZL2004, ZL8802, ZL9101M, ZL9117M and ZLS4009 support monitoring
+	 * an extra voltage (VMON for ZL2004, ZL8802 and ZLS4009,
+	 * VDRV for ZL9101M and ZL9117M). Report it as vmon.
 	 */
-	if (data->id == zl2004 || data->id == zl9101 || data->id == zl9117)
+	if (data->id == zl2004 || data->id == zl8802 || data->id == zl9101 ||
+	    data->id == zl9117 || data->id == zls4009)
 		info->func[0] |= PMBUS_HAVE_VMON | PMBUS_HAVE_STATUS_VMON;
 
-	ret = i2c_smbus_read_word_data(client, ZL6100_MFR_CONFIG);
-	if (ret < 0)
-		return ret;
+	/*
+	 * ZL8802 has two outputs that can be used either independently or in
+	 * a current sharing configuration. The driver uses the DDC_CONFIG
+	 * register to check if the module is running with independent or
+	 * shared outputs. If the module is in shared output mode, only one
+	 * output voltage will be reported.
+	 */
+	if (data->id == zl8802) {
+		info->pages = 2;
+		info->func[0] |= PMBUS_HAVE_IIN;
+
+		ret = i2c_smbus_read_word_data(client, ZL8802_MFR_DDC_CONFIG);
+		if (ret < 0)
+			return ret;
+
+		data->access = ktime_get();
+		zl6100_wait(data);
+
+		if (ret & ZL8802_MFR_PHASES_MASK)
+			info->func[1] |= PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
+		else
+			info->func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
+				| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
 
-	if (ret & ZL6100_MFR_XTEMP_ENABLE)
-		info->func[0] |= PMBUS_HAVE_TEMP2;
+		for (i = 0; i < 2; i++) {
+			ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, i);
+			if (ret < 0)
+				return ret;
+
+			data->access = ktime_get();
+			zl6100_wait(data);
+
+			ret = i2c_smbus_read_word_data(client, ZL8802_MFR_USER_CONFIG);
+			if (ret < 0)
+				return ret;
+
+			if (ret & ZL8802_MFR_XTEMP_ENABLE_2)
+				info->func[i] |= PMBUS_HAVE_TEMP2;
+
+			data->access = ktime_get();
+			zl6100_wait(data);
+		}
+		ret = i2c_smbus_read_word_data(client, ZL8802_MFR_USER_GLOBAL_CONFIG);
+		if (ret < 0)
+			return ret;
+
+		if (ret & ZL8802_MFR_TMON_ENABLE)
+			info->func[0] |= PMBUS_HAVE_TEMP3;
+	} else {
+		ret = i2c_smbus_read_word_data(client, ZL6100_MFR_CONFIG);
+		if (ret < 0)
+			return ret;
+
+		if (ret & ZL6100_MFR_XTEMP_ENABLE)
+			info->func[0] |= PMBUS_HAVE_TEMP2;
+	}
 
 	data->access = ktime_get();
 	zl6100_wait(data);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] hwmon: (pmbus/zl6100) Update documentation for zl6100 driver
  2021-04-23 15:33 [PATCH 0/2] hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802 Erik Rosen
  2021-04-23 15:33 ` [PATCH 1/2] " Erik Rosen
@ 2021-04-23 15:33 ` Erik Rosen
  2021-05-01  4:17   ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Erik Rosen @ 2021-04-23 15:33 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Corbet, linux-hwmon,
	linux-doc, linux-kernel
  Cc: Erik Rosen

Update documentation for zl6100 driver and fix dead links to technical
specifications

Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
---
 Documentation/hwmon/zl6100.rst | 132 ++++++++++++++++++++++-----------
 1 file changed, 89 insertions(+), 43 deletions(-)

diff --git a/Documentation/hwmon/zl6100.rst b/Documentation/hwmon/zl6100.rst
index 968aff10ce0a..d42ed9d3ac69 100644
--- a/Documentation/hwmon/zl6100.rst
+++ b/Documentation/hwmon/zl6100.rst
@@ -3,87 +3,103 @@ Kernel driver zl6100
 
 Supported chips:
 
-  * Intersil / Zilker Labs ZL2004
+  * Renesas / Intersil / Zilker Labs ZL2004
 
     Prefix: 'zl2004'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6847.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl2004-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL2005
+  * Renesas / Intersil / Zilker Labs ZL2005
 
     Prefix: 'zl2005'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6848.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl2005-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL2006
+  * Renesas / Intersil / Zilker Labs ZL2006
 
     Prefix: 'zl2006'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6850.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl2006-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL2008
+  * Renesas / Intersil / Zilker Labs ZL2008
 
     Prefix: 'zl2008'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6859.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl2008-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL2105
+  * Renesas / Intersil / Zilker Labs ZL2105
 
     Prefix: 'zl2105'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6851.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl2105-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL2106
+  * Renesas / Intersil / Zilker Labs ZL2106
 
     Prefix: 'zl2106'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6852.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl2106-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL6100
+  * Renesas / Intersil / Zilker Labs ZL6100
 
     Prefix: 'zl6100'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6876.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl6100-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL6105
+  * Renesas / Intersil / Zilker Labs ZL6105
 
     Prefix: 'zl6105'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn6906.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl6105-datasheet.pdf
 
-  * Intersil / Zilker Labs ZL9101M
+  * Renesas / Intersil / Zilker Labs ZL8802
+
+    Prefix: 'zl8802'
+
+    Addresses scanned: -
+
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl8802-datasheet
+
+  * Renesas / Intersil / Zilker Labs ZL9101M
 
     Prefix: 'zl9101'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn7669.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl9101m-datasheet
 
-  * Intersil / Zilker Labs ZL9117M
+  * Renesas / Intersil / Zilker Labs ZL9117M
 
     Prefix: 'zl9117'
 
     Addresses scanned: -
 
-    Datasheet: http://www.intersil.com/data/fn/fn7914.pdf
+    Datasheet: https://www.renesas.com/us/en/document/dst/zl9117m-datasheet
+
+  * Renesas / Intersil / Zilker Labs ZLS1003, ZLS4009
+
+    Prefix: 'zls1003', zls4009
+
+    Addresses scanned: -
+
+    Datasheet: Not published
 
-  * Ericsson BMR450, BMR451
+  * Flex BMR450, BMR451
 
     Prefix: 'bmr450', 'bmr451'
 
@@ -91,17 +107,39 @@ Supported chips:
 
     Datasheet:
 
-http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146401
+https://flexpowermodules.com/resources/fpm-techspec-bmr450-digital-pol-regulators-20a
 
-  * Ericsson BMR462, BMR463, BMR464
+  * Flex BMR462, BMR463, BMR464
 
     Prefixes: 'bmr462', 'bmr463', 'bmr464'
 
     Addresses scanned: -
 
-    Datasheet:
+    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr462
+
+  * Flex BMR465, BMR467
+
+    Prefixes: 'bmr465', 'bmr467'
+
+    Addresses scanned: -
+
+    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr465-digital-pol
+
+  * Flex BMR466
+
+    Prefixes: 'bmr466'
+
+    Addresses scanned: -
+
+    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr466-8x12
 
-	http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146256
+  * Flex BMR469
+
+    Prefixes: 'bmr469'
+
+    Addresses scanned: -
+
+    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr4696001
 
 Author: Guenter Roeck <linux@roeck-us.net>
 
@@ -109,8 +147,8 @@ Author: Guenter Roeck <linux@roeck-us.net>
 Description
 -----------
 
-This driver supports hardware monitoring for Intersil / Zilker Labs ZL6100 and
-compatible digital DC-DC controllers.
+This driver supports hardware monitoring for Renesas / Intersil / Zilker Labs
+ZL6100 and compatible digital DC-DC controllers.
 
 The driver is a client driver to the core PMBus driver. Please see
 Documentation/hwmon/pmbus.rst and Documentation.hwmon/pmbus-core for details
@@ -147,12 +185,12 @@ Module parameters
 delay
 -----
 
-Intersil/Zilker Labs DC-DC controllers require a minimum interval between I2C
-bus accesses. According to Intersil, the minimum interval is 2 ms, though 1 ms
-appears to be sufficient and has not caused any problems in testing. The problem
-is known to affect all currently supported chips. For manual override, the
-driver provides a writeable module parameter, 'delay', which can be used to set
-the interval to a value between 0 and 65,535 microseconds.
+Renesas/Intersil/Zilker Labs DC-DC controllers require a minimum interval
+between I2C bus accesses. According to Intersil, the minimum interval is 2 ms,
+though 1 ms appears to be sufficient and has not caused any problems in testing.
+The problem is known to affect all currently supported chips. For manual override,
+the driver provides a writeable module parameter, 'delay', which can be used
+to set the interval to a value between 0 and 65,535 microseconds.
 
 
 Sysfs entries
@@ -182,24 +220,32 @@ in2_crit		Critical maximum VMON/VDRV voltage.
 in2_lcrit_alarm		VMON/VDRV voltage critical low alarm.
 in2_crit_alarm		VMON/VDRV voltage critical high alarm.
 
-			vmon attributes are supported on ZL2004, ZL9101M,
-			and ZL9117M only.
+			vmon attributes are supported on ZL2004, ZL8802,
+			ZL9101M, ZL9117M and ZLS4009 only.
 
-inX_label		"vout1"
+inX_label		"vout[12]"
 inX_input		Measured output voltage.
 inX_lcrit		Critical minimum output Voltage.
 inX_crit		Critical maximum output voltage.
 inX_lcrit_alarm		Critical output voltage critical low alarm.
 inX_crit_alarm		Critical output voltage critical high alarm.
 
-			X is 3 for ZL2004, ZL9101M, and ZL9117M, 2 otherwise.
+			X is 3 for ZL2004, ZL9101M, and ZL9117M,
+			3, 4 for ZL8802 and 2 otherwise.
+
+curr1_label		"iin"
+curr1_input		Measured input current.
+
+			iin attributes are supported on ZL8802 only
+
+currY_label		"iout[12]"
+currY_input		Measured output current.
+currY_lcrit		Critical minimum output current.
+currY_crit		Critical maximum output current.
+currY_lcrit_alarm	Output current critical low alarm.
+currY_crit_alarm	Output current critical high alarm.
 
-curr1_label		"iout1"
-curr1_input		Measured output current.
-curr1_lcrit		Critical minimum output current.
-curr1_crit		Critical maximum output current.
-curr1_lcrit_alarm	Output current critical low alarm.
-curr1_crit_alarm	Output current critical high alarm.
+			Y is 2, 3 for ZL8802, 1 otherwise
 
 temp[12]_input		Measured temperature.
 temp[12]_min		Minimum temperature.
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802
  2021-04-23 15:33 ` [PATCH 1/2] " Erik Rosen
@ 2021-05-01  4:17   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2021-05-01  4:17 UTC (permalink / raw)
  To: Erik Rosen
  Cc: Jean Delvare, Jonathan Corbet, linux-hwmon, linux-doc, linux-kernel

On Fri, Apr 23, 2021 at 05:33:28PM +0200, Erik Rosen wrote:
> Add support for Renesas ZL8802 Dual Channel/Dual Phase PMBus DC/DC
> Digital Controller as well as ZLS1003 and ZLS4009 custom DC/DC
> controller chips.
> 
> Signed-off-by: Erik Rosen <erik.rosen@metormote.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/zl6100.c | 94 ++++++++++++++++++++++++++++++------
>  1 file changed, 80 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c
> index 69120ca7aaa8..757039bb8a62 100644
> --- a/drivers/hwmon/pmbus/zl6100.c
> +++ b/drivers/hwmon/pmbus/zl6100.c
> @@ -18,7 +18,7 @@
>  #include "pmbus.h"
>  
>  enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105,
> -	     zl9101, zl9117 };
> +	     zl8802, zl9101, zl9117, zls1003, zls4009 };
>  
>  struct zl6100_data {
>  	int id;
> @@ -34,6 +34,13 @@ struct zl6100_data {
>  
>  #define ZL6100_MFR_XTEMP_ENABLE		BIT(7)
>  
> +#define ZL8802_MFR_USER_GLOBAL_CONFIG	0xe9
> +#define ZL8802_MFR_TMON_ENABLE		BIT(12)
> +#define ZL8802_MFR_USER_CONFIG		0xd1
> +#define ZL8802_MFR_XTEMP_ENABLE_2	BIT(1)
> +#define ZL8802_MFR_DDC_CONFIG		0xd3
> +#define ZL8802_MFR_PHASES_MASK		0x0007
> +
>  #define MFR_VMON_OV_FAULT_LIMIT		0xf5
>  #define MFR_VMON_UV_FAULT_LIMIT		0xf6
>  #define MFR_READ_VMON			0xf7
> @@ -132,7 +139,7 @@ static int zl6100_read_word_data(struct i2c_client *client, int page,
>  	struct zl6100_data *data = to_zl6100_data(info);
>  	int ret, vreg;
>  
> -	if (page > 0)
> +	if (page >= info->pages)
>  		return -ENXIO;
>  
>  	if (data->id == zl2005) {
> @@ -191,7 +198,7 @@ static int zl6100_read_byte_data(struct i2c_client *client, int page, int reg)
>  	struct zl6100_data *data = to_zl6100_data(info);
>  	int ret, status;
>  
> -	if (page > 0)
> +	if (page >= info->pages)
>  		return -ENXIO;
>  
>  	zl6100_wait(data);
> @@ -230,7 +237,7 @@ static int zl6100_write_word_data(struct i2c_client *client, int page, int reg,
>  	struct zl6100_data *data = to_zl6100_data(info);
>  	int ret, vreg;
>  
> -	if (page > 0)
> +	if (page >= info->pages)
>  		return -ENXIO;
>  
>  	switch (reg) {
> @@ -271,7 +278,7 @@ static int zl6100_write_byte(struct i2c_client *client, int page, u8 value)
>  	struct zl6100_data *data = to_zl6100_data(info);
>  	int ret;
>  
> -	if (page > 0)
> +	if (page >= info->pages)
>  		return -ENXIO;
>  
>  	zl6100_wait(data);
> @@ -287,6 +294,10 @@ static const struct i2c_device_id zl6100_id[] = {
>  	{"bmr462", zl2008},
>  	{"bmr463", zl2008},
>  	{"bmr464", zl2008},
> +	{"bmr465", zls4009},
> +	{"bmr466", zls1003},
> +	{"bmr467", zls4009},
> +	{"bmr469", zl8802},
>  	{"zl2004", zl2004},
>  	{"zl2005", zl2005},
>  	{"zl2006", zl2006},
> @@ -295,15 +306,18 @@ static const struct i2c_device_id zl6100_id[] = {
>  	{"zl2106", zl2106},
>  	{"zl6100", zl6100},
>  	{"zl6105", zl6105},
> +	{"zl8802", zl8802},
>  	{"zl9101", zl9101},
>  	{"zl9117", zl9117},
> +	{"zls1003", zls1003},
> +	{"zls4009", zls4009},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, zl6100_id);
>  
>  static int zl6100_probe(struct i2c_client *client)
>  {
> -	int ret;
> +	int ret, i;
>  	struct zl6100_data *data;
>  	struct pmbus_driver_info *info;
>  	u8 device_id[I2C_SMBUS_BLOCK_MAX + 1];
> @@ -367,18 +381,70 @@ static int zl6100_probe(struct i2c_client *client)
>  	  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
>  
>  	/*
> -	 * ZL2004, ZL9101M, and ZL9117M support monitoring an extra voltage
> -	 * (VMON for ZL2004, VDRV for ZL9101M and ZL9117M). Report it as vmon.
> +	 * ZL2004, ZL8802, ZL9101M, ZL9117M and ZLS4009 support monitoring
> +	 * an extra voltage (VMON for ZL2004, ZL8802 and ZLS4009,
> +	 * VDRV for ZL9101M and ZL9117M). Report it as vmon.
>  	 */
> -	if (data->id == zl2004 || data->id == zl9101 || data->id == zl9117)
> +	if (data->id == zl2004 || data->id == zl8802 || data->id == zl9101 ||
> +	    data->id == zl9117 || data->id == zls4009)
>  		info->func[0] |= PMBUS_HAVE_VMON | PMBUS_HAVE_STATUS_VMON;
>  
> -	ret = i2c_smbus_read_word_data(client, ZL6100_MFR_CONFIG);
> -	if (ret < 0)
> -		return ret;
> +	/*
> +	 * ZL8802 has two outputs that can be used either independently or in
> +	 * a current sharing configuration. The driver uses the DDC_CONFIG
> +	 * register to check if the module is running with independent or
> +	 * shared outputs. If the module is in shared output mode, only one
> +	 * output voltage will be reported.
> +	 */
> +	if (data->id == zl8802) {
> +		info->pages = 2;
> +		info->func[0] |= PMBUS_HAVE_IIN;
> +
> +		ret = i2c_smbus_read_word_data(client, ZL8802_MFR_DDC_CONFIG);
> +		if (ret < 0)
> +			return ret;
> +
> +		data->access = ktime_get();
> +		zl6100_wait(data);
> +
> +		if (ret & ZL8802_MFR_PHASES_MASK)
> +			info->func[1] |= PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
> +		else
> +			info->func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
> +				| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
>  
> -	if (ret & ZL6100_MFR_XTEMP_ENABLE)
> -		info->func[0] |= PMBUS_HAVE_TEMP2;
> +		for (i = 0; i < 2; i++) {
> +			ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, i);
> +			if (ret < 0)
> +				return ret;
> +
> +			data->access = ktime_get();
> +			zl6100_wait(data);
> +
> +			ret = i2c_smbus_read_word_data(client, ZL8802_MFR_USER_CONFIG);
> +			if (ret < 0)
> +				return ret;
> +
> +			if (ret & ZL8802_MFR_XTEMP_ENABLE_2)
> +				info->func[i] |= PMBUS_HAVE_TEMP2;
> +
> +			data->access = ktime_get();
> +			zl6100_wait(data);
> +		}
> +		ret = i2c_smbus_read_word_data(client, ZL8802_MFR_USER_GLOBAL_CONFIG);
> +		if (ret < 0)
> +			return ret;
> +
> +		if (ret & ZL8802_MFR_TMON_ENABLE)
> +			info->func[0] |= PMBUS_HAVE_TEMP3;
> +	} else {
> +		ret = i2c_smbus_read_word_data(client, ZL6100_MFR_CONFIG);
> +		if (ret < 0)
> +			return ret;
> +
> +		if (ret & ZL6100_MFR_XTEMP_ENABLE)
> +			info->func[0] |= PMBUS_HAVE_TEMP2;
> +	}
>  
>  	data->access = ktime_get();
>  	zl6100_wait(data);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] hwmon: (pmbus/zl6100) Update documentation for zl6100 driver
  2021-04-23 15:33 ` [PATCH 2/2] hwmon: (pmbus/zl6100) Update documentation for zl6100 driver Erik Rosen
@ 2021-05-01  4:17   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2021-05-01  4:17 UTC (permalink / raw)
  To: Erik Rosen
  Cc: Jean Delvare, Jonathan Corbet, linux-hwmon, linux-doc, linux-kernel

On Fri, Apr 23, 2021 at 05:33:29PM +0200, Erik Rosen wrote:
> Update documentation for zl6100 driver and fix dead links to technical
> specifications
> 
> Signed-off-by: Erik Rosen <erik.rosen@metormote.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  Documentation/hwmon/zl6100.rst | 132 ++++++++++++++++++++++-----------
>  1 file changed, 89 insertions(+), 43 deletions(-)
> 
> diff --git a/Documentation/hwmon/zl6100.rst b/Documentation/hwmon/zl6100.rst
> index 968aff10ce0a..d42ed9d3ac69 100644
> --- a/Documentation/hwmon/zl6100.rst
> +++ b/Documentation/hwmon/zl6100.rst
> @@ -3,87 +3,103 @@ Kernel driver zl6100
>  
>  Supported chips:
>  
> -  * Intersil / Zilker Labs ZL2004
> +  * Renesas / Intersil / Zilker Labs ZL2004
>  
>      Prefix: 'zl2004'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6847.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl2004-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL2005
> +  * Renesas / Intersil / Zilker Labs ZL2005
>  
>      Prefix: 'zl2005'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6848.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl2005-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL2006
> +  * Renesas / Intersil / Zilker Labs ZL2006
>  
>      Prefix: 'zl2006'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6850.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl2006-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL2008
> +  * Renesas / Intersil / Zilker Labs ZL2008
>  
>      Prefix: 'zl2008'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6859.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl2008-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL2105
> +  * Renesas / Intersil / Zilker Labs ZL2105
>  
>      Prefix: 'zl2105'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6851.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl2105-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL2106
> +  * Renesas / Intersil / Zilker Labs ZL2106
>  
>      Prefix: 'zl2106'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6852.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl2106-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL6100
> +  * Renesas / Intersil / Zilker Labs ZL6100
>  
>      Prefix: 'zl6100'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6876.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl6100-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL6105
> +  * Renesas / Intersil / Zilker Labs ZL6105
>  
>      Prefix: 'zl6105'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn6906.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl6105-datasheet.pdf
>  
> -  * Intersil / Zilker Labs ZL9101M
> +  * Renesas / Intersil / Zilker Labs ZL8802
> +
> +    Prefix: 'zl8802'
> +
> +    Addresses scanned: -
> +
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl8802-datasheet
> +
> +  * Renesas / Intersil / Zilker Labs ZL9101M
>  
>      Prefix: 'zl9101'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn7669.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl9101m-datasheet
>  
> -  * Intersil / Zilker Labs ZL9117M
> +  * Renesas / Intersil / Zilker Labs ZL9117M
>  
>      Prefix: 'zl9117'
>  
>      Addresses scanned: -
>  
> -    Datasheet: http://www.intersil.com/data/fn/fn7914.pdf
> +    Datasheet: https://www.renesas.com/us/en/document/dst/zl9117m-datasheet
> +
> +  * Renesas / Intersil / Zilker Labs ZLS1003, ZLS4009
> +
> +    Prefix: 'zls1003', zls4009
> +
> +    Addresses scanned: -
> +
> +    Datasheet: Not published
>  
> -  * Ericsson BMR450, BMR451
> +  * Flex BMR450, BMR451
>  
>      Prefix: 'bmr450', 'bmr451'
>  
> @@ -91,17 +107,39 @@ Supported chips:
>  
>      Datasheet:
>  
> -http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146401
> +https://flexpowermodules.com/resources/fpm-techspec-bmr450-digital-pol-regulators-20a
>  
> -  * Ericsson BMR462, BMR463, BMR464
> +  * Flex BMR462, BMR463, BMR464
>  
>      Prefixes: 'bmr462', 'bmr463', 'bmr464'
>  
>      Addresses scanned: -
>  
> -    Datasheet:
> +    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr462
> +
> +  * Flex BMR465, BMR467
> +
> +    Prefixes: 'bmr465', 'bmr467'
> +
> +    Addresses scanned: -
> +
> +    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr465-digital-pol
> +
> +  * Flex BMR466
> +
> +    Prefixes: 'bmr466'
> +
> +    Addresses scanned: -
> +
> +    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr466-8x12
>  
> -	http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146256
> +  * Flex BMR469
> +
> +    Prefixes: 'bmr469'
> +
> +    Addresses scanned: -
> +
> +    Datasheet: https://flexpowermodules.com/resources/fpm-techspec-bmr4696001
>  
>  Author: Guenter Roeck <linux@roeck-us.net>
>  
> @@ -109,8 +147,8 @@ Author: Guenter Roeck <linux@roeck-us.net>
>  Description
>  -----------
>  
> -This driver supports hardware monitoring for Intersil / Zilker Labs ZL6100 and
> -compatible digital DC-DC controllers.
> +This driver supports hardware monitoring for Renesas / Intersil / Zilker Labs
> +ZL6100 and compatible digital DC-DC controllers.
>  
>  The driver is a client driver to the core PMBus driver. Please see
>  Documentation/hwmon/pmbus.rst and Documentation.hwmon/pmbus-core for details
> @@ -147,12 +185,12 @@ Module parameters
>  delay
>  -----
>  
> -Intersil/Zilker Labs DC-DC controllers require a minimum interval between I2C
> -bus accesses. According to Intersil, the minimum interval is 2 ms, though 1 ms
> -appears to be sufficient and has not caused any problems in testing. The problem
> -is known to affect all currently supported chips. For manual override, the
> -driver provides a writeable module parameter, 'delay', which can be used to set
> -the interval to a value between 0 and 65,535 microseconds.
> +Renesas/Intersil/Zilker Labs DC-DC controllers require a minimum interval
> +between I2C bus accesses. According to Intersil, the minimum interval is 2 ms,
> +though 1 ms appears to be sufficient and has not caused any problems in testing.
> +The problem is known to affect all currently supported chips. For manual override,
> +the driver provides a writeable module parameter, 'delay', which can be used
> +to set the interval to a value between 0 and 65,535 microseconds.
>  
>  
>  Sysfs entries
> @@ -182,24 +220,32 @@ in2_crit		Critical maximum VMON/VDRV voltage.
>  in2_lcrit_alarm		VMON/VDRV voltage critical low alarm.
>  in2_crit_alarm		VMON/VDRV voltage critical high alarm.
>  
> -			vmon attributes are supported on ZL2004, ZL9101M,
> -			and ZL9117M only.
> +			vmon attributes are supported on ZL2004, ZL8802,
> +			ZL9101M, ZL9117M and ZLS4009 only.
>  
> -inX_label		"vout1"
> +inX_label		"vout[12]"
>  inX_input		Measured output voltage.
>  inX_lcrit		Critical minimum output Voltage.
>  inX_crit		Critical maximum output voltage.
>  inX_lcrit_alarm		Critical output voltage critical low alarm.
>  inX_crit_alarm		Critical output voltage critical high alarm.
>  
> -			X is 3 for ZL2004, ZL9101M, and ZL9117M, 2 otherwise.
> +			X is 3 for ZL2004, ZL9101M, and ZL9117M,
> +			3, 4 for ZL8802 and 2 otherwise.
> +
> +curr1_label		"iin"
> +curr1_input		Measured input current.
> +
> +			iin attributes are supported on ZL8802 only
> +
> +currY_label		"iout[12]"
> +currY_input		Measured output current.
> +currY_lcrit		Critical minimum output current.
> +currY_crit		Critical maximum output current.
> +currY_lcrit_alarm	Output current critical low alarm.
> +currY_crit_alarm	Output current critical high alarm.
>  
> -curr1_label		"iout1"
> -curr1_input		Measured output current.
> -curr1_lcrit		Critical minimum output current.
> -curr1_crit		Critical maximum output current.
> -curr1_lcrit_alarm	Output current critical low alarm.
> -curr1_crit_alarm	Output current critical high alarm.
> +			Y is 2, 3 for ZL8802, 1 otherwise
>  
>  temp[12]_input		Measured temperature.
>  temp[12]_min		Minimum temperature.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-01  4:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 15:33 [PATCH 0/2] hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802 Erik Rosen
2021-04-23 15:33 ` [PATCH 1/2] " Erik Rosen
2021-05-01  4:17   ` Guenter Roeck
2021-04-23 15:33 ` [PATCH 2/2] hwmon: (pmbus/zl6100) Update documentation for zl6100 driver Erik Rosen
2021-05-01  4:17   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.