Support XDPE112
Subsystems (3)
cover Support XDPE112
Add support for Infineon Multi-phase XDPE112 family regulator. The main difference to the XDPE122 family is it uses a different format for voltage out. Add the required logic to the existing xdpe12284 driver accordingly.
Marcello Sylvester Bauer (3):
dt-bindings: trivial-devices: Add xdpe11280
hwmon (xdpe12284): Add support for xdpe11280
hwmon (xdpe12284): Add regulator support
.../devicetree/bindings/trivial-devices.yaml | 2 ++ Documentation/hwmon/xdpe12284.rst | 10 +++++-- drivers/hwmon/pmbus/Kconfig | 6 ++++ drivers/hwmon/pmbus/xdpe12284.c | 28 ++++++++++++++++++- 4 files changed, 42 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/3 dt-bindings: trivial-devices: Add xdpe11280
Add Infineon Multi-phase Digital Controller XDPE11280.
--- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -137,6 +137,8 @@ properties: - infineon,slb9645tt # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor - infineon,tlv493d-a1b6 + # Infineon Multi-phase Digital VR Controller xdpe11280 + - infineon,xdpe11280 # Infineon Multi-phase Digital VR Controller xdpe12254 - infineon,xdpe12254 # Infineon Multi-phase Digital VR Controller xdpe12284
Signature · 1 line
2.34.1
PATCH 2/3 hwmon (xdpe12284): Add support for xdpe11280
In reply to Marcello Sylvester BauerAdd support for another family of Infineon Multi-phase controllers. The xdpe11280 uses linear instead of vid data format for VOUT. Add the required logic to detect VOUT_MODE during identification, and set the format accordingly.
--- Documentation/hwmon/xdpe12284.rst | 10 +++++++--- drivers/hwmon/pmbus/xdpe12284.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-)
Documentation/hwmon/xdpe12284.rst +7 -3
@@ -5,6 +5,10 @@ Kernel driver xdpe122 Supported chips: + * Infineon XDPE11280 + + Prefix: 'xdpe11280' + * Infineon XDPE12254 Prefix: 'xdpe12254'
@@ -20,9 +24,9 @@ Authors: Description ----------- -This driver implements support for Infineon Multi-phase XDPE122 family -dual loop voltage regulators. -The family includes XDPE12284 and XDPE12254 devices. +This driver implements support for Infineon Multi-phase XDPE112 and XDPE122 +family dual loop voltage regulators. +These families include XDPE11280, XDPE12284 and XDPE12254 devices. The devices from this family complaint with: - Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC
drivers/hwmon/pmbus/xdpe12284.c +16 -1
@@ -27,6 +27,9 @@ static int xdpe122_read_word_data(struct i2c_client *client, int page,s32 mantissa;int ret; +if (info->format[PSC_VOLTAGE_OUT ] == linear) +return -ENODATA ; +switch (reg) {case PMBUS_VOUT_OV_FAULT_LIMIT :case PMBUS_VOUT_UV_FAULT_LIMIT :
@@ -75,9 +78,19 @@ static int xdpe122_read_word_data(struct i2c_client *client, int page,static int xdpe122_identify (struct i2c_client *client,struct pmbus_driver_info *info) { -u8 vout_params; +u8 vout_mode, vout_params;int i, ret; + ret =pmbus_read_byte_data (client,0 ,PMBUS_VOUT_MODE ); +if (ret <0 ) +return ret; + + vout_mode = ret >>5 ; +if (vout_mode ==0 ) { + info->format[PSC_VOLTAGE_OUT ] = linear; +return 0 ; + } +for (i =0 ; i <XDPE122_PAGE_NUM ; i++) {/* Read the register with VOUT scaling value.*/ ret =pmbus_read_byte_data (client, i,PMBUS_VOUT_MODE );
@@ -140,6 +153,7 @@ static int xdpe122_probe(struct i2c_client *client) }static const struct i2c_device_id xdpe122_id[] = { + {"xdpe11280" ,0 }, {"xdpe12254" ,0 }, {"xdpe12284" ,0 }, {}
@@ -148,6 +162,7 @@ static const struct i2c_device_id xdpe122_id[] = {MODULE_DEVICE_TABLE (i2c, xdpe122_id);static const struct of_device_id __maybe_unused xdpe122_of_match[] = { + {.compatible ="infineon,xdpe11280" }, {.compatible ="infineon,xdpe12254" }, {.compatible ="infineon,xdpe12284" }, {}
Signature · 1 line
2.34.1
PATCH 3/3 hwmon (xdpe12284): Add regulator support
In reply to Marcello Sylvester BauerAdd simple on/off regulator support for xdpe12284 and other pmbus parts supported by the xdpe12284 driver.
--- drivers/hwmon/pmbus/Kconfig | 6 ++++++ drivers/hwmon/pmbus/xdpe12284.c | 11 +++++++++++ 2 files changed, 17 insertions(+)
drivers/hwmon/pmbus/Kconfig +6 -0
@@ -394,6 +394,12 @@ config SENSORS_XDPE122 This driver can also be built as a module. If so, the module will be called xdpe12284. +config SENSORS_XDPE122_REGULATOR + bool "Regulator support for XDPE122 and compatibles" + depends on SENSORS_XDPE122 && REGULATOR + help + Uses the xdpe12284 or compatible as regulator. + config SENSORS_ZL6100 tristate "Intersil ZL6100 and compatibles" help
drivers/hwmon/pmbus/xdpe12284.c +11 -0
@@ -10,6 +10,8 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/regulator/driver.h> +#include "pmbus.h" #define XDPE122_PROT_VR12_5MV 0x01/* VR12.0 mode, 5-mV DAC */
@@ -120,6 +122,11 @@ static int xdpe122_identify(struct i2c_client *client,return 0 ; } +static const struct regulator_desc xdpe122_reg_desc[] = { +PMBUS_REGULATOR ("vout" ,0 ), +PMBUS_REGULATOR ("vout" ,1 ), +}; +static struct pmbus_driver_info xdpe122_info = { .pages =XDPE122_PAGE_NUM , .format[PSC_VOLTAGE_IN ] = linear,
@@ -138,6 +145,10 @@ static struct pmbus_driver_info xdpe122_info = { PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT, .identify = xdpe122_identify, .read_word_data = xdpe122_read_word_data, +#if IS_ENABLED(CONFIG_SENSORS_XDPE122_REGULATOR) + .num_regulators =2 , + .reg_desc = xdpe122_reg_desc, +#endif };static int xdpe122_probe (struct i2c_client *client)
Signature · 1 line
2.34.1
kernel test robot
build botRe: [PATCH v1 3/3] hwmon (xdpe12284): Add regulator support
Thank you for the patch! Perhaps something to improve:
Hi Marcello,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on robh/for-next linux/master linus/master v5.17-rc4 next-20220217] [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/Marcello-Sylvester-Bauer/Support-XDPE112/20220217-172831 base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next config: s390-randconfig-r044-20220217 (https://download.01.org/0day-ci/archive/20220217/202202172254.TL5ZxxMO-lkp(a)intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/0day-ci/linux/commit/7d607e48fd68499470da6630cff4d23f43f29aa9
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marcello-Sylvester-Bauer/Support-XDPE112/20220217-172831
git checkout 7d607e48fd68499470da6630cff4d23f43f29aa9
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/hwmon/pmbus/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/hwmon/pmbus/xdpe12284.c:125:36: warning: unused variable 'xdpe122_reg_desc' [-Wunused-const-variable]
static const struct regulator_desc xdpe122_reg_desc[] = {
^1 warning generated.
vim +/xdpe122_reg_desc +125 drivers/hwmon/pmbus/xdpe12284.c
124
> 125 static const struct regulator_desc xdpe122_reg_desc[] = { 126 PMBUS_REGULATOR("vout", 0),
127 PMBUS_REGULATOR("vout", 1),
128 };
129
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org