All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator.
@ 2020-12-11  9:46 Charles Hsu
  2020-12-11 15:30 ` Guenter Roeck
  2020-12-15 13:04   ` kernel test robot
  0 siblings, 2 replies; 8+ messages in thread
From: Charles Hsu @ 2020-12-11  9:46 UTC (permalink / raw)
  To: linux-kernel, linux-hwmon, linux; +Cc: alan, Charles Hsu

The output voltage use the MFR_READ_VOUT 0xD4
Vout value returned is linear11.

Signed-off-by: Charles Hsu <hsu.yungteng@gmail.com>
---
v6:
 - Fix misspelling.
v5:
 - Add MAINTAINERS.
v4:
 - Add pm6764tr to Documentation/hwmon/index.rst.
v3:
 - Add Documentation(Documentation/hwmon/pm6764tr.rst).
 - Fix include order.
v2:
 - Fix formatting.
 - Remove pmbus_do_remove.
 - Change from .probe to .probe_new.
v1:
 - Initial patchset.
---
 Documentation/hwmon/index.rst    |  1 +
 Documentation/hwmon/pm6764tr.rst | 32 ++++++++++++++
 MAINTAINERS                      |  7 +++
 drivers/hwmon/pmbus/Kconfig      |  9 ++++
 drivers/hwmon/pmbus/Makefile     |  1 +
 drivers/hwmon/pmbus/pm6764tr.c   | 76 ++++++++++++++++++++++++++++++++
 6 files changed, 126 insertions(+)
 create mode 100644 Documentation/hwmon/pm6764tr.rst
 create mode 100644 drivers/hwmon/pmbus/pm6764tr.c

diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index b797db738225..b3ed0047543b 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -144,6 +144,7 @@ Hardware Monitoring Kernel Drivers
    pc87360
    pc87427
    pcf8591
+   pm6764
    pmbus
    powr1220
    pxe1610
diff --git a/Documentation/hwmon/pm6764tr.rst b/Documentation/hwmon/pm6764tr.rst
new file mode 100644
index 000000000000..4681780d3f0d
--- /dev/null
+++ b/Documentation/hwmon/pm6764tr.rst
@@ -0,0 +1,32 @@
+.. SPDX-License-Identifier: GPL-2.0-only
+
+Kernel driver pm6764tr
+======================
+
+Supported chips:
+
+  * ST PM6764TR
+
+	Prefix: 'pm6764tr'
+
+	Addresses scanned: -
+
+	Datasheet: http://www.st.com/resource/en/data_brief/pm6764.pdf
+
+Authors:
+	<hsu.yungteng@gmail.com>
+
+Description:
+------------
+
+This driver supports the STMicroelectronics PM6764TR chip. The PM6764TR is a high
+performance digital controller designed to power Intel’s VR12.5 processors and memories.
+
+The device utilizes digital technology to implement all control and power management
+functions to provide maximum flexibility and performance. The NVM is embedded to store
+custom configurations. The PM6764TR device features up to 4-phase programmable operation.
+
+The PM6764TR supports power state transitions featuring VFDE, and programmable DPM
+maintaining the best efficiency over all loading conditions without compromising transient
+response. The device assures fast and independent protection against load overcurrent,
+under/overvoltage and feedback disconnections.
diff --git a/MAINTAINERS b/MAINTAINERS
index 2daa6ee673f7..0456a2101622 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13893,6 +13893,13 @@ M:	Logan Gunthorpe <logang@deltatee.com>
 S:	Maintained
 F:	drivers/dma/plx_dma.c
 
+PM6764TR DRIVER
+M:	Charles Hsu	<hsu.yungteng@gmail.com>
+L:	linux-hwmon@vger.kernel.org
+S:	Maintained
+F:	Documentation/hwmon/pm6764tr.rst
+F:	drivers/hwmon/pmbus/pm6764tr.c
+
 PM-GRAPH UTILITY
 M:	"Todd E Brandt" <todd.e.brandt@linux.intel.com>
 L:	linux-pm@vger.kernel.org
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index a25faf69fce3..9c846facce9f 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -220,6 +220,15 @@ config SENSORS_MP2975
 	  This driver can also be built as a module. If so, the module will
 	  be called mp2975.
 
+config SENSORS_PM6764TR
+	tristate "ST PM6764TR"
+	help
+	  If you say yes here you get hardware monitoring support for ST
+	  PM6764TR.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called pm6764tr.
+
 config SENSORS_PXE1610
 	tristate "Infineon PXE1610"
 	help
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
index 4c97ad0bd791..31ebdef5d4a6 100644
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_SENSORS_MAX31785)	+= max31785.o
 obj-$(CONFIG_SENSORS_MAX34440)	+= max34440.o
 obj-$(CONFIG_SENSORS_MAX8688)	+= max8688.o
 obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
+obj-$(CONFIG_SENSORS_PM6764TR)	+= pm6764tr.o
 obj-$(CONFIG_SENSORS_PXE1610)	+= pxe1610.o
 obj-$(CONFIG_SENSORS_TPS40422)	+= tps40422.o
 obj-$(CONFIG_SENSORS_TPS53679)	+= tps53679.o
diff --git a/drivers/hwmon/pmbus/pm6764tr.c b/drivers/hwmon/pmbus/pm6764tr.c
new file mode 100644
index 000000000000..9531f370d7df
--- /dev/null
+++ b/drivers/hwmon/pmbus/pm6764tr.c
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Hardware monitoring driver for STMicroelectronics digital controller PM6764TR
+ */
+
+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pmbus.h>
+#include "pmbus.h"
+
+#define PM6764TR_PMBUS_READ_VOUT	0xD4
+
+static int pm6764tr_read_word_data(struct i2c_client *client, int page, int reg)
+{
+	int ret;
+
+	switch (reg) {
+	case PMBUS_VIRT_READ_VMON:
+		ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
+		break;
+	default:
+		ret = -ENODATA;
+		break;
+	}
+	return ret;
+}
+
+static struct pmbus_driver_info pm6764tr_info = {
+	.pages = 1,
+	.format[PSC_VOLTAGE_IN] = linear,
+	.format[PSC_VOLTAGE_OUT] = vid,
+	.format[PSC_TEMPERATURE] = linear,
+	.format[PSC_CURRENT_OUT] = linear,
+	.format[PSC_POWER] = linear,
+	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN |  PMBUS_HAVE_PIN |
+		PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT | PMBUS_HAVE_VMON |
+		PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_VOUT |
+		PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
+	.read_word_data = pm6764tr_read_word_data,
+};
+
+static int pm6764tr_probe(struct i2c_client *client,
+			  const struct i2c_device_id *id)
+{
+	return pmbus_do_probe(client, id, &pm6764tr_info);
+}
+
+static const struct i2c_device_id pm6764tr_id[] = {
+	{"pm6764tr", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, pm6764tr_id);
+
+static const struct of_device_id pm6764tr_of_match[] = {
+	{.compatible = "st,pm6764tr"},
+	{}
+};
+
+/* This is the driver that will be inserted */
+static struct i2c_driver pm6764tr_driver = {
+	.driver = {
+		   .name = "pm6764tr",
+		   .of_match_table = of_match_ptr(pm6764tr_of_match),
+		   },
+	.probe_new = pm6764tr_probe,
+	.id_table = pm6764tr_id,
+};
+
+module_i2c_driver(pm6764tr_driver);
+
+MODULE_AUTHOR("Charles Hsu");
+MODULE_DESCRIPTION("PMBus driver for  ST PM6764TR");
+MODULE_LICENSE("GPL");
-- 
2.25.1


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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator.
  2020-12-11  9:46 [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator Charles Hsu
@ 2020-12-11 15:30 ` Guenter Roeck
  2020-12-15 13:04   ` kernel test robot
  1 sibling, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-12-11 15:30 UTC (permalink / raw)
  To: Charles Hsu; +Cc: linux-kernel, linux-hwmon, alan

On Fri, Dec 11, 2020 at 05:46:05PM +0800, Charles Hsu wrote:
> The output voltage use the MFR_READ_VOUT 0xD4
> Vout value returned is linear11.
> 
> Signed-off-by: Charles Hsu <hsu.yungteng@gmail.com>

I'll keep the patch I already applied, with all the _compile_
problems fixed. Please check out hwmon-next and submit follow-up
patches if needed.

Guenter

> ---
> v6:
>  - Fix misspelling.
> v5:
>  - Add MAINTAINERS.
> v4:
>  - Add pm6764tr to Documentation/hwmon/index.rst.
> v3:
>  - Add Documentation(Documentation/hwmon/pm6764tr.rst).
>  - Fix include order.
> v2:
>  - Fix formatting.
>  - Remove pmbus_do_remove.
>  - Change from .probe to .probe_new.
> v1:
>  - Initial patchset.
> ---
>  Documentation/hwmon/index.rst    |  1 +
>  Documentation/hwmon/pm6764tr.rst | 32 ++++++++++++++
>  MAINTAINERS                      |  7 +++
>  drivers/hwmon/pmbus/Kconfig      |  9 ++++
>  drivers/hwmon/pmbus/Makefile     |  1 +
>  drivers/hwmon/pmbus/pm6764tr.c   | 76 ++++++++++++++++++++++++++++++++
>  6 files changed, 126 insertions(+)
>  create mode 100644 Documentation/hwmon/pm6764tr.rst
>  create mode 100644 drivers/hwmon/pmbus/pm6764tr.c
> 
> diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
> index b797db738225..b3ed0047543b 100644
> --- a/Documentation/hwmon/index.rst
> +++ b/Documentation/hwmon/index.rst
> @@ -144,6 +144,7 @@ Hardware Monitoring Kernel Drivers
>     pc87360
>     pc87427
>     pcf8591
> +   pm6764
>     pmbus
>     powr1220
>     pxe1610
> diff --git a/Documentation/hwmon/pm6764tr.rst b/Documentation/hwmon/pm6764tr.rst
> new file mode 100644
> index 000000000000..4681780d3f0d
> --- /dev/null
> +++ b/Documentation/hwmon/pm6764tr.rst
> @@ -0,0 +1,32 @@
> +.. SPDX-License-Identifier: GPL-2.0-only
> +
> +Kernel driver pm6764tr
> +======================
> +
> +Supported chips:
> +
> +  * ST PM6764TR
> +
> +	Prefix: 'pm6764tr'
> +
> +	Addresses scanned: -
> +
> +	Datasheet: http://www.st.com/resource/en/data_brief/pm6764.pdf
> +
> +Authors:
> +	<hsu.yungteng@gmail.com>
> +
> +Description:
> +------------
> +
> +This driver supports the STMicroelectronics PM6764TR chip. The PM6764TR is a high
> +performance digital controller designed to power Intel’s VR12.5 processors and memories.
> +
> +The device utilizes digital technology to implement all control and power management
> +functions to provide maximum flexibility and performance. The NVM is embedded to store
> +custom configurations. The PM6764TR device features up to 4-phase programmable operation.
> +
> +The PM6764TR supports power state transitions featuring VFDE, and programmable DPM
> +maintaining the best efficiency over all loading conditions without compromising transient
> +response. The device assures fast and independent protection against load overcurrent,
> +under/overvoltage and feedback disconnections.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 2daa6ee673f7..0456a2101622 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13893,6 +13893,13 @@ M:	Logan Gunthorpe <logang@deltatee.com>
>  S:	Maintained
>  F:	drivers/dma/plx_dma.c
>  
> +PM6764TR DRIVER
> +M:	Charles Hsu	<hsu.yungteng@gmail.com>
> +L:	linux-hwmon@vger.kernel.org
> +S:	Maintained
> +F:	Documentation/hwmon/pm6764tr.rst
> +F:	drivers/hwmon/pmbus/pm6764tr.c
> +
>  PM-GRAPH UTILITY
>  M:	"Todd E Brandt" <todd.e.brandt@linux.intel.com>
>  L:	linux-pm@vger.kernel.org
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index a25faf69fce3..9c846facce9f 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -220,6 +220,15 @@ config SENSORS_MP2975
>  	  This driver can also be built as a module. If so, the module will
>  	  be called mp2975.
>  
> +config SENSORS_PM6764TR
> +	tristate "ST PM6764TR"
> +	help
> +	  If you say yes here you get hardware monitoring support for ST
> +	  PM6764TR.
> +
> +	  This driver can also be built as a module. If so, the module will
> +	  be called pm6764tr.
> +
>  config SENSORS_PXE1610
>  	tristate "Infineon PXE1610"
>  	help
> diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> index 4c97ad0bd791..31ebdef5d4a6 100644
> --- a/drivers/hwmon/pmbus/Makefile
> +++ b/drivers/hwmon/pmbus/Makefile
> @@ -25,6 +25,7 @@ obj-$(CONFIG_SENSORS_MAX31785)	+= max31785.o
>  obj-$(CONFIG_SENSORS_MAX34440)	+= max34440.o
>  obj-$(CONFIG_SENSORS_MAX8688)	+= max8688.o
>  obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
> +obj-$(CONFIG_SENSORS_PM6764TR)	+= pm6764tr.o
>  obj-$(CONFIG_SENSORS_PXE1610)	+= pxe1610.o
>  obj-$(CONFIG_SENSORS_TPS40422)	+= tps40422.o
>  obj-$(CONFIG_SENSORS_TPS53679)	+= tps53679.o
> diff --git a/drivers/hwmon/pmbus/pm6764tr.c b/drivers/hwmon/pmbus/pm6764tr.c
> new file mode 100644
> index 000000000000..9531f370d7df
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/pm6764tr.c
> @@ -0,0 +1,76 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Hardware monitoring driver for STMicroelectronics digital controller PM6764TR
> + */
> +
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/pmbus.h>
> +#include "pmbus.h"
> +
> +#define PM6764TR_PMBUS_READ_VOUT	0xD4
> +
> +static int pm6764tr_read_word_data(struct i2c_client *client, int page, int reg)
> +{
> +	int ret;
> +
> +	switch (reg) {
> +	case PMBUS_VIRT_READ_VMON:
> +		ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
> +		break;
> +	default:
> +		ret = -ENODATA;
> +		break;
> +	}
> +	return ret;
> +}
> +
> +static struct pmbus_driver_info pm6764tr_info = {
> +	.pages = 1,
> +	.format[PSC_VOLTAGE_IN] = linear,
> +	.format[PSC_VOLTAGE_OUT] = vid,
> +	.format[PSC_TEMPERATURE] = linear,
> +	.format[PSC_CURRENT_OUT] = linear,
> +	.format[PSC_POWER] = linear,
> +	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN |  PMBUS_HAVE_PIN |
> +		PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT | PMBUS_HAVE_VMON |
> +		PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_VOUT |
> +		PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
> +	.read_word_data = pm6764tr_read_word_data,
> +};
> +
> +static int pm6764tr_probe(struct i2c_client *client,
> +			  const struct i2c_device_id *id)
> +{
> +	return pmbus_do_probe(client, id, &pm6764tr_info);
> +}
> +
> +static const struct i2c_device_id pm6764tr_id[] = {
> +	{"pm6764tr", 0},
> +	{}
> +};
> +MODULE_DEVICE_TABLE(i2c, pm6764tr_id);
> +
> +static const struct of_device_id pm6764tr_of_match[] = {
> +	{.compatible = "st,pm6764tr"},
> +	{}
> +};
> +
> +/* This is the driver that will be inserted */
> +static struct i2c_driver pm6764tr_driver = {
> +	.driver = {
> +		   .name = "pm6764tr",
> +		   .of_match_table = of_match_ptr(pm6764tr_of_match),
> +		   },
> +	.probe_new = pm6764tr_probe,
> +	.id_table = pm6764tr_id,
> +};
> +
> +module_i2c_driver(pm6764tr_driver);
> +
> +MODULE_AUTHOR("Charles Hsu");
> +MODULE_DESCRIPTION("PMBus driver for  ST PM6764TR");
> +MODULE_LICENSE("GPL");

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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator.
  2020-12-11  9:46 [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator Charles Hsu
@ 2020-12-15 13:04   ` kernel test robot
  2020-12-15 13:04   ` kernel test robot
  1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2020-12-15 13:04 UTC (permalink / raw)
  To: Charles Hsu, linux-kernel, linux-hwmon, linux
  Cc: kbuild-all, clang-built-linux, alan, Charles Hsu

[-- Attachment #1: Type: text/plain, Size: 5241 bytes --]

Hi Charles,

I love your patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.10]
[cannot apply to hwmon/hwmon-next next-20201215]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Charles-Hsu/hwmon-Add-driver-for-STMicroelectronics-PM6764-Voltage-Regulator/20201211-175428
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 09162bc32c880a791c6c0668ce0745cf7958f576
config: x86_64-randconfig-a012-20201215 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project a29ecca7819a6ed4250d3689b12b1f664bb790d7)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/b03a990fad3a963b4dd9801a24c2e4acae91d2cf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Charles-Hsu/hwmon-Add-driver-for-STMicroelectronics-PM6764-Voltage-Regulator/20201211-175428
        git checkout b03a990fad3a963b4dd9801a24c2e4acae91d2cf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/hwmon/pmbus/pm6764tr.c:22:68: error: too few arguments to function call, expected 4, have 3
                   ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
                         ~~~~~~~~~~~~~~~~~~~~                                       ^
   drivers/hwmon/pmbus/pmbus.h:479:5: note: 'pmbus_read_word_data' declared here
   int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
       ^
>> drivers/hwmon/pmbus/pm6764tr.c:42:20: error: incompatible function pointer types initializing 'int (*)(struct i2c_client *, int, int, int)' with an expression of type 'int (struct i2c_client *, int, int)' [-Werror,-Wincompatible-function-pointer-types]
           .read_word_data = pm6764tr_read_word_data,
                             ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/pm6764tr.c:48:36: error: too many arguments to function call, expected 2, have 3
           return pmbus_do_probe(client, id, &pm6764tr_info);
                  ~~~~~~~~~~~~~~             ^~~~~~~~~~~~~~
   drivers/hwmon/pmbus/pmbus.h:492:5: note: 'pmbus_do_probe' declared here
   int pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info);
       ^
>> drivers/hwmon/pmbus/pm6764tr.c:68:15: error: incompatible function pointer types initializing 'int (*)(struct i2c_client *)' with an expression of type 'int (struct i2c_client *, const struct i2c_device_id *)' [-Werror,-Wincompatible-function-pointer-types]
           .probe_new = pm6764tr_probe,
                        ^~~~~~~~~~~~~~
   4 errors generated.

vim +22 drivers/hwmon/pmbus/pm6764tr.c

    15	
    16	static int pm6764tr_read_word_data(struct i2c_client *client, int page, int reg)
    17	{
    18		int ret;
    19	
    20		switch (reg) {
    21		case PMBUS_VIRT_READ_VMON:
  > 22			ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
    23			break;
    24		default:
    25			ret = -ENODATA;
    26			break;
    27		}
    28		return ret;
    29	}
    30	
    31	static struct pmbus_driver_info pm6764tr_info = {
    32		.pages = 1,
    33		.format[PSC_VOLTAGE_IN] = linear,
    34		.format[PSC_VOLTAGE_OUT] = vid,
    35		.format[PSC_TEMPERATURE] = linear,
    36		.format[PSC_CURRENT_OUT] = linear,
    37		.format[PSC_POWER] = linear,
    38		.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN |  PMBUS_HAVE_PIN |
    39			PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT | PMBUS_HAVE_VMON |
    40			PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_VOUT |
    41			PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
  > 42		.read_word_data = pm6764tr_read_word_data,
    43	};
    44	
    45	static int pm6764tr_probe(struct i2c_client *client,
    46				  const struct i2c_device_id *id)
    47	{
  > 48		return pmbus_do_probe(client, id, &pm6764tr_info);
    49	}
    50	
    51	static const struct i2c_device_id pm6764tr_id[] = {
    52		{"pm6764tr", 0},
    53		{}
    54	};
    55	MODULE_DEVICE_TABLE(i2c, pm6764tr_id);
    56	
    57	static const struct of_device_id pm6764tr_of_match[] = {
    58		{.compatible = "st,pm6764tr"},
    59		{}
    60	};
    61	
    62	/* This is the driver that will be inserted */
    63	static struct i2c_driver pm6764tr_driver = {
    64		.driver = {
    65			   .name = "pm6764tr",
    66			   .of_match_table = of_match_ptr(pm6764tr_of_match),
    67			   },
  > 68		.probe_new = pm6764tr_probe,
    69		.id_table = pm6764tr_id,
    70	};
    71	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31402 bytes --]

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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator.
@ 2020-12-15 13:04   ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2020-12-15 13:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5358 bytes --]

Hi Charles,

I love your patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.10]
[cannot apply to hwmon/hwmon-next next-20201215]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Charles-Hsu/hwmon-Add-driver-for-STMicroelectronics-PM6764-Voltage-Regulator/20201211-175428
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 09162bc32c880a791c6c0668ce0745cf7958f576
config: x86_64-randconfig-a012-20201215 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project a29ecca7819a6ed4250d3689b12b1f664bb790d7)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/b03a990fad3a963b4dd9801a24c2e4acae91d2cf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Charles-Hsu/hwmon-Add-driver-for-STMicroelectronics-PM6764-Voltage-Regulator/20201211-175428
        git checkout b03a990fad3a963b4dd9801a24c2e4acae91d2cf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/hwmon/pmbus/pm6764tr.c:22:68: error: too few arguments to function call, expected 4, have 3
                   ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
                         ~~~~~~~~~~~~~~~~~~~~                                       ^
   drivers/hwmon/pmbus/pmbus.h:479:5: note: 'pmbus_read_word_data' declared here
   int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
       ^
>> drivers/hwmon/pmbus/pm6764tr.c:42:20: error: incompatible function pointer types initializing 'int (*)(struct i2c_client *, int, int, int)' with an expression of type 'int (struct i2c_client *, int, int)' [-Werror,-Wincompatible-function-pointer-types]
           .read_word_data = pm6764tr_read_word_data,
                             ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/pm6764tr.c:48:36: error: too many arguments to function call, expected 2, have 3
           return pmbus_do_probe(client, id, &pm6764tr_info);
                  ~~~~~~~~~~~~~~             ^~~~~~~~~~~~~~
   drivers/hwmon/pmbus/pmbus.h:492:5: note: 'pmbus_do_probe' declared here
   int pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info);
       ^
>> drivers/hwmon/pmbus/pm6764tr.c:68:15: error: incompatible function pointer types initializing 'int (*)(struct i2c_client *)' with an expression of type 'int (struct i2c_client *, const struct i2c_device_id *)' [-Werror,-Wincompatible-function-pointer-types]
           .probe_new = pm6764tr_probe,
                        ^~~~~~~~~~~~~~
   4 errors generated.

vim +22 drivers/hwmon/pmbus/pm6764tr.c

    15	
    16	static int pm6764tr_read_word_data(struct i2c_client *client, int page, int reg)
    17	{
    18		int ret;
    19	
    20		switch (reg) {
    21		case PMBUS_VIRT_READ_VMON:
  > 22			ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
    23			break;
    24		default:
    25			ret = -ENODATA;
    26			break;
    27		}
    28		return ret;
    29	}
    30	
    31	static struct pmbus_driver_info pm6764tr_info = {
    32		.pages = 1,
    33		.format[PSC_VOLTAGE_IN] = linear,
    34		.format[PSC_VOLTAGE_OUT] = vid,
    35		.format[PSC_TEMPERATURE] = linear,
    36		.format[PSC_CURRENT_OUT] = linear,
    37		.format[PSC_POWER] = linear,
    38		.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN |  PMBUS_HAVE_PIN |
    39			PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT | PMBUS_HAVE_VMON |
    40			PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_VOUT |
    41			PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
  > 42		.read_word_data = pm6764tr_read_word_data,
    43	};
    44	
    45	static int pm6764tr_probe(struct i2c_client *client,
    46				  const struct i2c_device_id *id)
    47	{
  > 48		return pmbus_do_probe(client, id, &pm6764tr_info);
    49	}
    50	
    51	static const struct i2c_device_id pm6764tr_id[] = {
    52		{"pm6764tr", 0},
    53		{}
    54	};
    55	MODULE_DEVICE_TABLE(i2c, pm6764tr_id);
    56	
    57	static const struct of_device_id pm6764tr_of_match[] = {
    58		{.compatible = "st,pm6764tr"},
    59		{}
    60	};
    61	
    62	/* This is the driver that will be inserted */
    63	static struct i2c_driver pm6764tr_driver = {
    64		.driver = {
    65			   .name = "pm6764tr",
    66			   .of_match_table = of_match_ptr(pm6764tr_of_match),
    67			   },
  > 68		.probe_new = pm6764tr_probe,
    69		.id_table = pm6764tr_id,
    70	};
    71	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31402 bytes --]

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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator
  2020-12-03 15:48   ` Guenter Roeck
@ 2020-12-04  1:02     ` Charles
  0 siblings, 0 replies; 8+ messages in thread
From: Charles @ 2020-12-04  1:02 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-kernel, linux-hwmon, alan

On 3/12/2020 下午11:48, Guenter Roeck wrote:
> On Thu, Dec 03, 2020 at 08:34:32PM +0800, Charles wrote:
> [ ... ]
>> It's really weird. I sent a mail to myself, and it looks good.
>> @@ -220,6 +220,15 @@ config SENSORS_MP2975
>>   	  This driver can also be built as a module. If so, the module will
>>   	  be called mp2975.
>> +config SENSORS_PM6764TR
>>
> But the above doesn't look good. The empty line is again missing.
> It looks like your e-mail system manipulates/modifies the message
> and removes that line.
>
>> I have applied my patch with "git am", and it did work.
>> Applying: Add-driver-for-STMicroelectronics-PM6764-Voltage-Regulator
>>
>> I think I should use another e-mail system.
> That may be a good idea. FWIW, I use msmtp, and git send-email.
>
> Thanks,
> Guenter

I will try this way to send my patch, thank you.

Charles


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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator
       [not found] <SL2PR03MB46031075A5DABF77D39815D381F20@SL2PR03MB4603.apcprd03.prod.outlook.com>
@ 2020-12-03 15:58 ` Guenter Roeck
  0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-12-03 15:58 UTC (permalink / raw)
  To: hsu.yungteng; +Cc: linux-kernel, linux-hwmon, alan, hsu.yungteng

On Thu, Dec 03, 2020 at 01:30:30PM +0000, hsu.yungteng@outlook.com wrote:
> Add the pmbus driver for the STMicroelectronics pm6764 voltage regulator.
> 
> the output voltage use the MFR_READ_VOUT 0xD4
> vout value returned is linear11
> 

checkpatch --strict reports:

total: 3 errors, 7 warnings, 2 checks, 160 lines checked

This includes (again) "ERROR: patch seems to be corrupt",
as well as various formatting problems. Some of those
suggest more corruptions. As far as I can see, tabs were
replaced with spaces.

Guenter

> Signed-off-by: Charles Hsu <hsu.yungteng@gmail.com>
> ---
> v6:
>  - Fix misspelling.
> v5:
>  - Add MAINTAINERS.
>  - Add a reference into trivial-devices.yaml.
> v4:
>  - Add pm6764tr to Documentation/hwmon/index.rst.
> v3:
>  - Add Documentation(Documentation/hwmon/pm6764tr.rst).
>  - Fix include order.
> v2:
>  - Fix formatting.
>  - Remove pmbus_do_remove.
>  - Change from .probe to .probe_new.
> v1:
>  - Initial patchset.
> ---
>  Documentation/hwmon/index.rst    |  1 +
>  Documentation/hwmon/pm6764tr.rst | 32 ++++++++++++++
>  MAINTAINERS                      |  7 +++
>  drivers/hwmon/pmbus/Kconfig      |  9 ++++
>  drivers/hwmon/pmbus/Makefile     |  1 +
>  drivers/hwmon/pmbus/pm6764tr.c   | 76 ++++++++++++++++++++++++++++++++
>  6 files changed, 126 insertions(+)
>  create mode 100644 Documentation/hwmon/pm6764tr.rst
>  create mode 100644 drivers/hwmon/pmbus/pm6764tr.c
> 
> diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
> index b797db738225..1bbd05e41de4 100644
> --- a/Documentation/hwmon/index.rst
> +++ b/Documentation/hwmon/index.rst
> @@ -144,6 +144,7 @@ Hardware Monitoring Kernel Drivers
>     pc87360
>     pc87427
>     pcf8591
> +   pm6764tr
>     pmbus
>     powr1220
>     pxe1610
> diff --git a/Documentation/hwmon/pm6764tr.rst b/Documentation/hwmon/pm6764tr.rst
> new file mode 100644
> index 000000000000..a1fb8fea2326
> --- /dev/null
> +++ b/Documentation/hwmon/pm6764tr.rst
> @@ -0,0 +1,32 @@
> +.. SPDX-License-Identifier: GPL-2.0-only
> +
> +Kernel driver pm6764tr
> +======================
> +
> +Supported chips:
> +
> +  * ST PM6764TR
> +
> +    Prefix: 'pm6764tr'
> +
> +    Addresses scanned: -
> +
> +    Datasheet: http://www.st.com/resource/en/data_brief/pm6764.pdf
> +
> +Authors:
> +       <hsu.yungteng@gmail.com>
> +
> +Description:
> +------------
> +
> +This driver supports the STMicroelectronics PM6764TR chip. The PM6764TR is a high
> +performance digital controller designed to power Intel’s VR12.5 processors and memories.
> +
> +The device utilizes digital technology to implement all control and power management
> +functions to provide maximum flexibility and performance. The NVM is embedded to store
> +custom configurations. The PM6764TR device features up to 4-phase programmable operation.
> +
> +The PM6764TR supports power state transitions featuring VFDE, and programmable DPM
> +maintaining the best efficiency over all loading conditions without compromising transient
> +response. The device assures fast and independent protection against load overcurrent,
> +under/overvoltage and feedback disconnections.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 94ac10a153c7..a3fea132c4ed 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13904,6 +13904,13 @@ M:     Logan Gunthorpe <logang@deltatee.com>
>  S:      Maintained
>  F:      drivers/dma/plx_dma.c
>  
> +PM6764TR DRIVER
> +M:     Charles Hsu     <hsu.yungteng@gmail.com>
> +L:     linux-hwmon@vger.kernel.org
> +S:     Maintained
> +F:     Documentation/hwmon/pm6764tr.rst
> +F:     drivers/hwmon/pmbus/pm6764tr.c
> +
>  PM-GRAPH UTILITY
>  M:      "Todd E Brandt" <todd.e.brandt@linux.intel.com>
>  L:      linux-pm@vger.kernel.org
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index a25faf69fce3..9c846facce9f 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -220,6 +220,15 @@ config SENSORS_MP2975
>            This driver can also be built as a module. If so, the module will
>            be called mp2975.
>  
> +config SENSORS_PM6764TR
> +       tristate "ST PM6764TR"
> +       help
> +         If you say yes here you get hardware monitoring support for ST
> +         PM6764TR.
> +
> +         This driver can also be built as a module. If so, the module will
> +         be called pm6764tr.
> +
>  config SENSORS_PXE1610
>          tristate "Infineon PXE1610"
>          help
> diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> index 4c97ad0bd791..31ebdef5d4a6 100644
> --- a/drivers/hwmon/pmbus/Makefile
> +++ b/drivers/hwmon/pmbus/Makefile
> @@ -25,6 +25,7 @@ obj-$(CONFIG_SENSORS_MAX31785)        += max31785.o
>  obj-$(CONFIG_SENSORS_MAX34440)  += max34440.o
>  obj-$(CONFIG_SENSORS_MAX8688)   += max8688.o
>  obj-$(CONFIG_SENSORS_MP2975)    += mp2975.o
> +obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o
>  obj-$(CONFIG_SENSORS_PXE1610)   += pxe1610.o
>  obj-$(CONFIG_SENSORS_TPS40422)  += tps40422.o
>  obj-$(CONFIG_SENSORS_TPS53679)  += tps53679.o
> diff --git a/drivers/hwmon/pmbus/pm6764tr.c b/drivers/hwmon/pmbus/pm6764tr.c
> new file mode 100644
> index 000000000000..70747c21c66e
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/pm6764tr.c
> @@ -0,0 +1,76 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Hardware monitoring driver for STMicroelectronics digital controller PM6764TR
> + */
> +
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/pmbus.h>
> +#include "pmbus.h"
> +
> +#define PM6764TR_PMBUS_READ_VOUT       0xD4
> +
> +static int pm6764tr_read_word_data(struct i2c_client *client, int page, int reg)
> +{
> +       int ret;
> +
> +       switch (reg) {
> +       case PMBUS_VIRT_READ_VMON:
> +               ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
> +               break;
> +       default:
> +               ret = -ENODATA;
> +               break;
> +       }
> +       return ret;
> +}
> +
> +static struct pmbus_driver_info pm6764tr_info = {
> +       .pages = 1,
> +       .format[PSC_VOLTAGE_IN] = linear,
> +       .format[PSC_VOLTAGE_OUT] = vid,
> +       .format[PSC_TEMPERATURE] = linear,
> +       .format[PSC_CURRENT_OUT] = linear,
> +       .format[PSC_POWER] = linear,
> +       .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN |  PMBUS_HAVE_PIN |
> +           PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT | PMBUS_HAVE_VMON |
> +               PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_VOUT |
> +               PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
> +       .read_word_data = pm6764tr_read_word_data,
> +};
> +
> +static int pm6764tr_probe(struct i2c_client *client,
> +                         const struct i2c_device_id *id)
> +{
> +       return pmbus_do_probe(client, id, &pm6764tr_info);
> +}
> +
> +static const struct i2c_device_id pm6764tr_id[] = {
> +       {"pm6764tr", 0},
> +       {}
> +};
> +MODULE_DEVICE_TABLE(i2c, pm6764tr_id);
> +
> +static const struct of_device_id pm6764tr_of_match[] = {
> +       {.compatible = "st,pm6764tr"},
> +       {}
> +};
> +
> +/* This is the driver that will be inserted */
> +static struct i2c_driver pm6764tr_driver = {
> +       .driver = {
> +                  .name = "pm6764tr",
> +                  .of_match_table = of_match_ptr(pm6764tr_of_match),
> +                  },
> +       .probe_new = pm6764tr_probe,
> +       .id_table = pm6764tr_id,
> +};
> +
> +module_i2c_driver(pm6764tr_driver);
> +
> +MODULE_AUTHOR("Charles Hsu");
> +MODULE_DESCRIPTION("PMBus driver for  ST PM6764TR");
> +MODULE_LICENSE("GPL");
> --
> 2.25.1

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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator
       [not found] ` <339c66fe-e946-d8b7-1ca7-aa33c3ad1eb3@gmail.com>
@ 2020-12-03 15:48   ` Guenter Roeck
  2020-12-04  1:02     ` Charles
  0 siblings, 1 reply; 8+ messages in thread
From: Guenter Roeck @ 2020-12-03 15:48 UTC (permalink / raw)
  To: Charles; +Cc: linux-kernel, linux-hwmon, alan

On Thu, Dec 03, 2020 at 08:34:32PM +0800, Charles wrote:
[ ... ]
> 
> It's really weird. I sent a mail to myself, and it looks good.
> @@ -220,6 +220,15 @@ config SENSORS_MP2975
>  	  This driver can also be built as a module. If so, the module will
>  	  be called mp2975.
> +config SENSORS_PM6764TR
> 
But the above doesn't look good. The empty line is again missing.
It looks like your e-mail system manipulates/modifies the message
and removes that line.

> I have applied my patch with "git am", and it did work.
> Applying: Add-driver-for-STMicroelectronics-PM6764-Voltage-Regulator
> 
> I think I should use another e-mail system.

That may be a good idea. FWIW, I use msmtp, and git send-email.

Thanks,
Guenter

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

* Re: [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator
@ 2020-12-02 13:23 Guenter Roeck
       [not found] ` <339c66fe-e946-d8b7-1ca7-aa33c3ad1eb3@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Guenter Roeck @ 2020-12-02 13:23 UTC (permalink / raw)
  To: Charles; +Cc: linux-kernel, linux-hwmon, alan

On Wed, Dec 02, 2020 at 02:11:04PM +0800, Charles wrote:
> Add the pmbus driver for the STMicroelectronics pm6764 voltage regulator.
> 
> the output voltage use the MFR_READ_VOUT 0xD4
> vout value returned is linear11
> 
> Signed-off-by: Charles Hsu <hsu.yungteng@gmail.com>
> ---
> 
> v6:
>  - Fix misspelling.
> v5:
>  - Add MAINTAINERS.
>  - Add a reference into trivial-devices.yaml.
> v4:
>  - Add pm6764tr to Documentation/hwmon/index.rst.
> v3:
>  - Add Documentation(Documentation/hwmon/pm6764tr.rst).
>  - Fix include order.
> v2:
>  - Fix formatting.
>  - Remove pmbus_do_remove.
>  - Change from .probe to .probe_new.
> v1:
>  - Initial patchset.
> 
> ---
>  Documentation/hwmon/index.rst    |  1 +
>  Documentation/hwmon/pm6764tr.rst | 32 ++++++++++++++
>  MAINTAINERS                      |  7 +++
>  drivers/hwmon/pmbus/Kconfig      |  9 ++++
>  drivers/hwmon/pmbus/Makefile     |  1 +
>  drivers/hwmon/pmbus/pm6764tr.c   | 76 ++++++++++++++++++++++++++++++++
>  6 files changed, 126 insertions(+)
>  create mode 100644 Documentation/hwmon/pm6764tr.rst
>  create mode 100644 drivers/hwmon/pmbus/pm6764tr.c
> 
> diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
> index b797db738225..1bbd05e41de4 100644
> --- a/Documentation/hwmon/index.rst
> +++ b/Documentation/hwmon/index.rst
> @@ -144,6 +144,7 @@ Hardware Monitoring Kernel Drivers
>     pc87360
>     pc87427
>     pcf8591
> +   pm6764tr
>     pmbus
>     powr1220
>     pxe1610
> diff --git a/Documentation/hwmon/pm6764tr.rst b/Documentation/hwmon/pm6764tr.rst
> new file mode 100644
> index 000000000000..a1fb8fea2326
> --- /dev/null
> +++ b/Documentation/hwmon/pm6764tr.rst
> @@ -0,0 +1,32 @@
> +.. SPDX-License-Identifier: GPL-2.0-only
> +
> +Kernel driver pm6764tr
> +======================
> +
> +Supported chips:
> +
> +  * ST PM6764TR
> +
> +    Prefix: 'pm6764tr'
> +
> +    Addresses scanned: -
> +
> +    Datasheet: http://www.st.com/resource/en/data_brief/pm6764.pdf
> +
> +Authors:
> +	<hsu.yungteng@gmail.com>
> +
> +Description:
> +------------
> +
> +This driver supports the STMicroelectronics PM6764TR chip. The PM6764TR is a high
> +performance digital controller designed to power Intel’s VR12.5 processors and memories.
> +
> +The device utilizes digital technology to implement all control and power management
> +functions to provide maximum flexibility and performance. The NVM is embedded to store
> +custom configurations. The PM6764TR device features up to 4-phase programmable operation.
> +
> +The PM6764TR supports power state transitions featuring VFDE, and programmable DPM
> +maintaining the best efficiency over all loading conditions without compromising transient
> +response. The device assures fast and independent protection against load overcurrent,
> +under/overvoltage and feedback disconnections.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 94ac10a153c7..a3fea132c4ed 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13904,6 +13904,13 @@ M:	Logan Gunthorpe <logang@deltatee.com>
>  S:	Maintained
>  F:	drivers/dma/plx_dma.c
> +PM6764TR DRIVER

I dn't know what happened, but this line ...

> +M:	Charles Hsu	<hsu.yungteng@gmail.com>
> +L:	linux-hwmon@vger.kernel.org
> +S:	Maintained
> +F:	Documentation/hwmon/pm6764tr.rst
> +F:	drivers/hwmon/pmbus/pm6764tr.c
> +
>  PM-GRAPH UTILITY
>  M:	"Todd E Brandt" <todd.e.brandt@linux.intel.com>
>  L:	linux-pm@vger.kernel.org
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index a25faf69fce3..9c846facce9f 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -220,6 +220,15 @@ config SENSORS_MP2975
>  	  This driver can also be built as a module. If so, the module will
>  	  be called mp2975.
> +config SENSORS_PM6764TR

... and this line report that the patch is corrupted when I try to apply it.
Looking into the files, there is supposed to be an empty line before
"config SENSORS_PM6764TR" and before "PM6764TR DRIVER". If I add those
empty lines, the patch applies. checkpatch also reports problems associated
with that corruption as well as other problems. On top of that, the patch
does not show up in patchwork.

Please fix whatever is causing those problems and resubmit. I would suggest
to try to apply the patch yourself with "git am ..." before you send it out.

You'll also need a separate patch to add st,pm6764tr to trivial_devices.

Thanks,
Guenter

> +	tristate "ST PM6764TR"
> +	help
> +	  If you say yes here you get hardware monitoring support for ST
> +	  PM6764TR.
> +
> +	  This driver can also be built as a module. If so, the module will
> +	  be called pm6764tr.
> +
>  config SENSORS_PXE1610
>  	tristate "Infineon PXE1610"
>  	help
> diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> index 4c97ad0bd791..31ebdef5d4a6 100644
> --- a/drivers/hwmon/pmbus/Makefile
> +++ b/drivers/hwmon/pmbus/Makefile
> @@ -25,6 +25,7 @@ obj-$(CONFIG_SENSORS_MAX31785)	+= max31785.o
>  obj-$(CONFIG_SENSORS_MAX34440)	+= max34440.o
>  obj-$(CONFIG_SENSORS_MAX8688)	+= max8688.o
>  obj-$(CONFIG_SENSORS_MP2975)	+= mp2975.o
> +obj-$(CONFIG_SENSORS_PM6764TR)	+= pm6764tr.o
>  obj-$(CONFIG_SENSORS_PXE1610)	+= pxe1610.o
>  obj-$(CONFIG_SENSORS_TPS40422)	+= tps40422.o
>  obj-$(CONFIG_SENSORS_TPS53679)	+= tps53679.o
> diff --git a/drivers/hwmon/pmbus/pm6764tr.c b/drivers/hwmon/pmbus/pm6764tr.c
> new file mode 100644
> index 000000000000..70747c21c66e
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/pm6764tr.c
> @@ -0,0 +1,76 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Hardware monitoring driver for STMicroelectronics digital controller PM6764TR
> + */
> +
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/pmbus.h>
> +#include "pmbus.h"
> +
> +#define PM6764TR_PMBUS_READ_VOUT	0xD4
> +
> +static int pm6764tr_read_word_data(struct i2c_client *client, int page, int reg)
> +{
> +	int ret;
> +
> +	switch (reg) {
> +	case PMBUS_VIRT_READ_VMON:
> +		ret = pmbus_read_word_data(client, page, PM6764TR_PMBUS_READ_VOUT);
> +		break;
> +	default:
> +		ret = -ENODATA;
> +		break;
> +	}
> +	return ret;
> +}
> +
> +static struct pmbus_driver_info pm6764tr_info = {
> +	.pages = 1,
> +	.format[PSC_VOLTAGE_IN] = linear,
> +	.format[PSC_VOLTAGE_OUT] = vid,
> +	.format[PSC_TEMPERATURE] = linear,
> +	.format[PSC_CURRENT_OUT] = linear,
> +	.format[PSC_POWER] = linear,
> +	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN |  PMBUS_HAVE_PIN |
> +	    PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT | PMBUS_HAVE_VMON |
> +		PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_VOUT |
> +		PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
> +	.read_word_data = pm6764tr_read_word_data,
> +};
> +
> +static int pm6764tr_probe(struct i2c_client *client,
> +			  const struct i2c_device_id *id)
> +{
> +	return pmbus_do_probe(client, id, &pm6764tr_info);
> +}
> +
> +static const struct i2c_device_id pm6764tr_id[] = {
> +	{"pm6764tr", 0},
> +	{}
> +};
> +MODULE_DEVICE_TABLE(i2c, pm6764tr_id);
> +
> +static const struct of_device_id pm6764tr_of_match[] = {
> +	{.compatible = "st,pm6764tr"},
> +	{}
> +};
> +
> +/* This is the driver that will be inserted */
> +static struct i2c_driver pm6764tr_driver = {
> +	.driver = {
> +		   .name = "pm6764tr",
> +		   .of_match_table = of_match_ptr(pm6764tr_of_match),
> +		   },
> +	.probe_new = pm6764tr_probe,
> +	.id_table = pm6764tr_id,
> +};
> +
> +module_i2c_driver(pm6764tr_driver);
> +
> +MODULE_AUTHOR("Charles Hsu");
> +MODULE_DESCRIPTION("PMBus driver for  ST PM6764TR");
> +MODULE_LICENSE("GPL");
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2020-12-15 13:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11  9:46 [PATCH v6] hwmon: Add driver for STMicroelectronics PM6764 Voltage Regulator Charles Hsu
2020-12-11 15:30 ` Guenter Roeck
2020-12-15 13:04 ` kernel test robot
2020-12-15 13:04   ` kernel test robot
     [not found] <SL2PR03MB46031075A5DABF77D39815D381F20@SL2PR03MB4603.apcprd03.prod.outlook.com>
2020-12-03 15:58 ` Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2020-12-02 13:23 Guenter Roeck
     [not found] ` <339c66fe-e946-d8b7-1ca7-aa33c3ad1eb3@gmail.com>
2020-12-03 15:48   ` Guenter Roeck
2020-12-04  1:02     ` Charles

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.