[PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137

Jeff Lin posted 1 patch 5 days, 20 hours ago
drivers/hwmon/pmbus/Kconfig      | 10 +++++
drivers/hwmon/pmbus/isl68137.c   | 65 ++++++++++++++++++++++++++++++++
drivers/hwmon/pmbus/pmbus.h      | 11 ++++++
drivers/hwmon/pmbus/pmbus_core.c | 20 ++++++++++
4 files changed, 106 insertions(+)
[PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
Posted by Jeff Lin 5 days, 20 hours ago
In chip RAA229141 there exist ISYS pin which can report the current data
for the device connected to this chip through this pin by routed by Direct
Memory Access(DMA) command. To read the data in ISYS pin, we have to set
the DMA address to 0xC5 and then read the DMA data from 0xC7. And then use
the Direct read format with 10mA per LSB to transfer the data in 0xC7.
And for ISYS input pin, the DMA address is 0xE0D3 and for ISYS output pin,
the DMA address is 0xEE42.

Signed-off-by: Jeff Lin <jefflin994697@gmail.com>
---
 drivers/hwmon/pmbus/Kconfig      | 10 +++++
 drivers/hwmon/pmbus/isl68137.c   | 65 ++++++++++++++++++++++++++++++++
 drivers/hwmon/pmbus/pmbus.h      | 11 ++++++
 drivers/hwmon/pmbus/pmbus_core.c | 20 ++++++++++
 4 files changed, 106 insertions(+)

diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index 55e492452ce8..a14393d41412 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -211,6 +211,16 @@ config SENSORS_ISL68137
 	  This driver can also be built as a module. If so, the module will
 	  be called isl68137.
 
+config SENSORS_RAA229141
+	bool "Renesas RAA229141 Supply"
+	default n
+	help
+	  If you say yes here you get the support for Renesas RAA229140 and
+	  RAA229141.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called raa229141.
+
 config SENSORS_LM25066
 	tristate "National Semiconductor LM25066 and compatibles"
 	help
diff --git a/drivers/hwmon/pmbus/isl68137.c b/drivers/hwmon/pmbus/isl68137.c
index c52c55d2e7f4..04a582ba9416 100644
--- a/drivers/hwmon/pmbus/isl68137.c
+++ b/drivers/hwmon/pmbus/isl68137.c
@@ -63,6 +63,9 @@ enum chips {
 	raa228228,
 	raa229001,
 	raa229004,
++#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
++	raa229141,
++#endif /* CONFIG_SENSORS_RAA229141 */
 	raa229621,
 };
 
@@ -71,6 +74,9 @@ enum variants {
 	raa_dmpvr2_1rail,
 	raa_dmpvr2_2rail,
 	raa_dmpvr2_2rail_nontc,
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	raa_dmpvr2_2rail_isys,
+#endif /* CONFIG_SENSORS_RAA229141 */
 	raa_dmpvr2_3rail,
 	raa_dmpvr2_hv,
 };
@@ -174,6 +180,34 @@ static const struct attribute_group *isl68137_attribute_groups[] = {
 	NULL,
 };
 
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+#define RAA_READ_DMA_DATA	0xc5
+#define RAA_WRITE_DMA_ADDRESS 0xc7
+
+/* DMA address for input and output */
+static const unsigned char dma_address_in[] = { 0xD3, 0xE0 };
+static const unsigned char dma_address_out[] = { 0x42, 0xEE };
+int read_isys_route_dma(struct i2c_client *client, const char *addr)
+{
+	int ret;
+
+	ret = i2c_smbus_write_i2c_block_data(client, RAA_WRITE_DMA_ADDRESS, 2, addr);
+	if (ret < 0) {
+		dev_err(&client->dev, "Set DMA address failed for address 0x%02x 0x%02x\n",
+			addr[0], addr[1]);
+		return ret;
+	}
+	// DIRECT ISYS format 10mA/LSB
+	u8 buf[2];
+
+	ret = i2c_smbus_read_i2c_block_data(client, RAA_READ_DMA_DATA, 2, buf);
+	if (ret < 0)
+		return ret;
+	u16 value = ((u16)buf[1]<<8) | buf[0];
+	return value;
+};
+#endif /* CONFIG_SENSORS_RAA229141 */
+
 static int raa_dmpvr2_read_word_data(struct i2c_client *client, int page,
 				     int phase, int reg)
 {
@@ -183,6 +217,14 @@ static int raa_dmpvr2_read_word_data(struct i2c_client *client, int page,
 	u64 temp;
 
 	switch (reg) {
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	case PMBUS_VIRT_READ_ISYSIN:
+		ret = read_isys_route_dma(client, dma_address_in);
+		break;
+	case PMBUS_VIRT_READ_ISYSOUT:
+		ret = read_isys_route_dma(client, dma_address_out);
+		break;
+#endif /* CONFIG_SENSORS_RAA229141 */
 	case PMBUS_VIRT_READ_VMON:
 		ret = pmbus_read_word_data(client, page, phase,
 					   RAA_DMPVR2_READ_VMON);
@@ -253,6 +295,12 @@ static struct pmbus_driver_info raa_dmpvr_info = {
 	.format[PSC_CURRENT_OUT] = direct,
 	.format[PSC_POWER] = direct,
 	.format[PSC_TEMPERATURE] = direct,
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	.format[PSC_ISYS] = direct,
+	.m[PSC_ISYS] = 1,
+	.b[PSC_ISYS] = 0,
+	.R[PSC_ISYS] = 2,
+#endif /* CONFIG_SENSORS_RAA229141 */
 	.m[PSC_VOLTAGE_IN] = 1,
 	.b[PSC_VOLTAGE_IN] = 0,
 	.R[PSC_VOLTAGE_IN] = 2,
@@ -398,6 +446,20 @@ static int isl68137_probe(struct i2c_client *client)
 		info->read_word_data = raa_dmpvr2_read_word_data;
 		info->write_word_data = raa_dmpvr2_write_word_data;
 		break;
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	case raa_dmpvr2_2rail_isys:
+		info->format[PSC_VOLTAGE_IN] = linear,
+		info->format[PSC_VOLTAGE_OUT] = linear,
+		info->format[PSC_CURRENT_IN] = linear;
+		info->format[PSC_CURRENT_OUT] = linear;
+		info->format[PSC_POWER] = linear;
+		info->format[PSC_TEMPERATURE] = linear;
+		info->func[0] |= PMBUS_HAVE_ISYSIN;
+		info->func[0] |= PMBUS_HAVE_ISYSOUT;
+		info->pages = 2;
+		info->read_word_data = raa_dmpvr2_read_word_data;
+		break;
+#endif /* CONFIG_SENSORS_RAA229141 */
 	case raa_dmpvr2_3rail:
 		info->read_word_data = raa_dmpvr2_read_word_data;
 		info->write_word_data = raa_dmpvr2_write_word_data;
@@ -466,6 +528,9 @@ static const struct i2c_device_id raa_dmpvr_id[] = {
 	{"raa228228", raa_dmpvr2_2rail_nontc},
 	{"raa229001", raa_dmpvr2_2rail},
 	{"raa229004", raa_dmpvr2_2rail},
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	{"raa229141", raa_dmpvr2_2rail_isys},
+#endif /* CONFIG_SENSORS_RAA229141 */
 	{"raa229621", raa_dmpvr2_2rail},
 	{}
 };
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index d2e9bfb5320f..ec5a4b9286cc 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -236,6 +236,10 @@ enum pmbus_regs {
 	PMBUS_VIRT_CURR_SAMPLES,
 	PMBUS_VIRT_POWER_SAMPLES,
 	PMBUS_VIRT_TEMP_SAMPLES,
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	PMBUS_VIRT_READ_ISYSIN,
+	PMBUS_VIRT_READ_ISYSOUT,
+#endif /* CONFIG_SENSORS_RAA229141 */
 };
 
 /*
@@ -381,6 +385,9 @@ enum pmbus_sensor_classes {
 	PSC_TEMPERATURE,
 	PSC_FAN,
 	PSC_PWM,
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	PSC_ISYS,
+#endif /* CONFIG_SENSORS_RAA229141 */
 	PSC_NUM_CLASSES		/* Number of power sensor classes */
 };
 
@@ -411,6 +418,10 @@ enum pmbus_sensor_classes {
 #define PMBUS_HAVE_PWM12	BIT(20)
 #define PMBUS_HAVE_PWM34	BIT(21)
 #define PMBUS_HAVE_SAMPLES	BIT(22)
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+#define PMBUS_HAVE_ISYSIN	BIT(23)
+#define PMBUS_HAVE_ISYSOUT	BIT(24)
+#endif /* CONFIG_SENSORS_RAA229141 */
 
 #define PMBUS_PHASE_VIRTUAL	BIT(30)	/* Phases on this page are virtual */
 #define PMBUS_PAGE_VIRTUAL	BIT(31)	/* Page is virtual */
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index be6d05def115..88344c088f6d 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -1929,6 +1929,20 @@ static const struct pmbus_sensor_attr current_attributes[] = {
 		.gbit = PB_STATUS_IOUT_OC,
 		.limit = iout_limit_attrs,
 		.nlimit = ARRAY_SIZE(iout_limit_attrs),
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	}, {
+		.reg = PMBUS_VIRT_READ_ISYSIN,
+		.class = PSC_ISYS,
+		.label = "isysin",
+		.paged = true,
+		.func = PMBUS_HAVE_ISYSIN,
+	}, {
+		.reg = PMBUS_VIRT_READ_ISYSOUT,
+		.class = PSC_ISYS,
+		.label = "isysout",
+		.paged = true,
+		.func = PMBUS_HAVE_ISYSOUT,
+#endif /* CONFIG_SENSORS_RAA229141 */
 	}
 };
 
@@ -2501,6 +2515,12 @@ static const struct pmbus_class_attr_map class_attr_map[] = {
 		.class = PSC_TEMPERATURE,
 		.attr = temp_attributes,
 		.nattr = ARRAY_SIZE(temp_attributes),
+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
+	}, {
+		.class = PSC_ISYS,
+		.attr = current_attributes,
+		.nattr = ARRAY_SIZE(current_attributes),
+#endif /* CONFIG_SENSORS_RAA229141 */
 	}
 };
 
-- 
2.34.1
Re: [PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
Posted by kernel test robot 5 days, 8 hours ago
Hi Jeff,

kernel test robot noticed the following build warnings:

[auto build test WARNING on v6.17-rc7]
[also build test WARNING on linus/master next-20250925]
[cannot apply to groeck-staging/hwmon-next]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jeff-Lin/drivers-hwmon-pmbus-Add-support-for-raa229141-in-isl68137/20250926-094703
base:   v6.17-rc7
patch link:    https://lore.kernel.org/r/20250926014552.1625950-1-jefflin994697%40gmail.com
patch subject: [PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20250926/202509262212.QaMSQytw-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250926/202509262212.QaMSQytw-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509262212.QaMSQytw-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/hwmon/pmbus/isl68137.c:66:1: error: expected identifier
      66 | +#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
         | ^
   drivers/hwmon/pmbus/isl68137.c:68:1: error: expected identifier
      68 | +#endif /* CONFIG_SENSORS_RAA229141 */
         | ^
>> drivers/hwmon/pmbus/isl68137.c:190:5: warning: no previous prototype for function 'read_isys_route_dma' [-Wmissing-prototypes]
     190 | int read_isys_route_dma(struct i2c_client *client, const char *addr)
         |     ^
   drivers/hwmon/pmbus/isl68137.c:190:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     190 | int read_isys_route_dma(struct i2c_client *client, const char *addr)
         | ^
         | static 
   1 warning and 2 errors generated.


vim +/read_isys_route_dma +190 drivers/hwmon/pmbus/isl68137.c

    25	
    26	enum chips {
    27		isl68137,
    28		isl68220,
    29		isl68221,
    30		isl68222,
    31		isl68223,
    32		isl68224,
    33		isl68225,
    34		isl68226,
    35		isl68227,
    36		isl68229,
    37		isl68233,
    38		isl68239,
    39		isl69222,
    40		isl69223,
    41		isl69224,
    42		isl69225,
    43		isl69227,
    44		isl69228,
    45		isl69234,
    46		isl69236,
    47		isl69239,
    48		isl69242,
    49		isl69243,
    50		isl69247,
    51		isl69248,
    52		isl69254,
    53		isl69255,
    54		isl69256,
    55		isl69259,
    56		isl69260,
    57		isl69268,
    58		isl69269,
    59		isl69298,
    60		raa228000,
    61		raa228004,
    62		raa228006,
    63		raa228228,
    64		raa229001,
    65		raa229004,
  > 66	+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
    67	+	raa229141,
    68	+#endif /* CONFIG_SENSORS_RAA229141 */
    69		raa229621,
    70	};
    71	
    72	enum variants {
    73		raa_dmpvr1_2rail,
    74		raa_dmpvr2_1rail,
    75		raa_dmpvr2_2rail,
    76		raa_dmpvr2_2rail_nontc,
    77	#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
    78		raa_dmpvr2_2rail_isys,
    79	#endif /* CONFIG_SENSORS_RAA229141 */
    80		raa_dmpvr2_3rail,
    81		raa_dmpvr2_hv,
    82	};
    83	
    84	struct isl68137_channel {
    85		u32 vout_voltage_divider[2];
    86	};
    87	
    88	struct isl68137_data {
    89		struct pmbus_driver_info info;
    90		struct isl68137_channel channel[MAX_CHANNELS];
    91	};
    92	
    93	#define to_isl68137_data(x)	container_of(x, struct isl68137_data, info)
    94	
    95	static const struct i2c_device_id raa_dmpvr_id[];
    96	
    97	static ssize_t isl68137_avs_enable_show_page(struct i2c_client *client,
    98						     int page,
    99						     char *buf)
   100	{
   101		int val = pmbus_read_byte_data(client, page, PMBUS_OPERATION);
   102	
   103		return sprintf(buf, "%d\n",
   104			       (val & ISL68137_VOUT_AVS) == ISL68137_VOUT_AVS ? 1 : 0);
   105	}
   106	
   107	static ssize_t isl68137_avs_enable_store_page(struct i2c_client *client,
   108						      int page,
   109						      const char *buf, size_t count)
   110	{
   111		int rc, op_val;
   112		bool result;
   113	
   114		rc = kstrtobool(buf, &result);
   115		if (rc)
   116			return rc;
   117	
   118		op_val = result ? ISL68137_VOUT_AVS : 0;
   119	
   120		/*
   121		 * Writes to VOUT setpoint over AVSBus will persist after the VRM is
   122		 * switched to PMBus control. Switching back to AVSBus control
   123		 * restores this persisted setpoint rather than re-initializing to
   124		 * PMBus VOUT_COMMAND. Writing VOUT_COMMAND first over PMBus before
   125		 * enabling AVS control is the workaround.
   126		 */
   127		if (op_val == ISL68137_VOUT_AVS) {
   128			rc = pmbus_read_word_data(client, page, 0xff,
   129						  PMBUS_VOUT_COMMAND);
   130			if (rc < 0)
   131				return rc;
   132	
   133			rc = pmbus_write_word_data(client, page, PMBUS_VOUT_COMMAND,
   134						   rc);
   135			if (rc < 0)
   136				return rc;
   137		}
   138	
   139		rc = pmbus_update_byte_data(client, page, PMBUS_OPERATION,
   140					    ISL68137_VOUT_AVS, op_val);
   141	
   142		return (rc < 0) ? rc : count;
   143	}
   144	
   145	static ssize_t isl68137_avs_enable_show(struct device *dev,
   146						struct device_attribute *devattr,
   147						char *buf)
   148	{
   149		struct i2c_client *client = to_i2c_client(dev->parent);
   150		struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
   151	
   152		return isl68137_avs_enable_show_page(client, attr->index, buf);
   153	}
   154	
   155	static ssize_t isl68137_avs_enable_store(struct device *dev,
   156					struct device_attribute *devattr,
   157					const char *buf, size_t count)
   158	{
   159		struct i2c_client *client = to_i2c_client(dev->parent);
   160		struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
   161	
   162		return isl68137_avs_enable_store_page(client, attr->index, buf, count);
   163	}
   164	
   165	static SENSOR_DEVICE_ATTR_RW(avs0_enable, isl68137_avs_enable, 0);
   166	static SENSOR_DEVICE_ATTR_RW(avs1_enable, isl68137_avs_enable, 1);
   167	
   168	static struct attribute *enable_attrs[] = {
   169		&sensor_dev_attr_avs0_enable.dev_attr.attr,
   170		&sensor_dev_attr_avs1_enable.dev_attr.attr,
   171		NULL,
   172	};
   173	
   174	static const struct attribute_group enable_group = {
   175		.attrs = enable_attrs,
   176	};
   177	
   178	static const struct attribute_group *isl68137_attribute_groups[] = {
   179		&enable_group,
   180		NULL,
   181	};
   182	
   183	#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
   184	#define RAA_READ_DMA_DATA	0xc5
   185	#define RAA_WRITE_DMA_ADDRESS 0xc7
   186	
   187	/* DMA address for input and output */
   188	static const unsigned char dma_address_in[] = { 0xD3, 0xE0 };
   189	static const unsigned char dma_address_out[] = { 0x42, 0xEE };
 > 190	int read_isys_route_dma(struct i2c_client *client, const char *addr)
   191	{
   192		int ret;
   193	
   194		ret = i2c_smbus_write_i2c_block_data(client, RAA_WRITE_DMA_ADDRESS, 2, addr);
   195		if (ret < 0) {
   196			dev_err(&client->dev, "Set DMA address failed for address 0x%02x 0x%02x\n",
   197				addr[0], addr[1]);
   198			return ret;
   199		}
   200		// DIRECT ISYS format 10mA/LSB
   201		u8 buf[2];
   202	
   203		ret = i2c_smbus_read_i2c_block_data(client, RAA_READ_DMA_DATA, 2, buf);
   204		if (ret < 0)
   205			return ret;
   206		u16 value = ((u16)buf[1]<<8) | buf[0];
   207		return value;
   208	};
   209	#endif /* CONFIG_SENSORS_RAA229141 */
   210	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
Posted by Guenter Roeck 5 days, 9 hours ago
On 9/25/25 18:45, Jeff Lin wrote:
> In chip RAA229141 there exist ISYS pin which can report the current data
> for the device connected to this chip through this pin by routed by Direct
> Memory Access(DMA) command. To read the data in ISYS pin, we have to set
> the DMA address to 0xC5 and then read the DMA data from 0xC7. And then use
> the Direct read format with 10mA per LSB to transfer the data in 0xC7.
> And for ISYS input pin, the DMA address is 0xE0D3 and for ISYS output pin,
> the DMA address is 0xEE42.
> 
> Signed-off-by: Jeff Lin <jefflin994697@gmail.com>
> ---
...
> diff --git a/drivers/hwmon/pmbus/isl68137.c b/drivers/hwmon/pmbus/isl68137.c
> index c52c55d2e7f4..04a582ba9416 100644
> --- a/drivers/hwmon/pmbus/isl68137.c
> +++ b/drivers/hwmon/pmbus/isl68137.c
> @@ -63,6 +63,9 @@ enum chips {
>   	raa228228,
>   	raa229001,
>   	raa229004,
> ++#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
> ++	raa229141,
> ++#endif /* CONFIG_SENSORS_RAA229141 */

I just realized (as did 0-day): This code doesn't even build.

Obviously that means that I can't trust that the code coming from you actually
works, even if it does build. Please keep that in mind if/when submitting
subsequent versions. I will want to see very detailed and verifiable
information about this chip and its supposed functionality.

Guenter
Re: [PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
Posted by kernel test robot 5 days, 9 hours ago
Hi Jeff,

kernel test robot noticed the following build errors:

[auto build test ERROR on v6.17-rc7]
[also build test ERROR on linus/master next-20250925]
[cannot apply to groeck-staging/hwmon-next]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jeff-Lin/drivers-hwmon-pmbus-Add-support-for-raa229141-in-isl68137/20250926-094703
base:   v6.17-rc7
patch link:    https://lore.kernel.org/r/20250926014552.1625950-1-jefflin994697%40gmail.com
patch subject: [PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
config: i386-buildonly-randconfig-002-20250926 (https://download.01.org/0day-ci/archive/20250926/202509262044.Scx8WTbC-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250926/202509262044.Scx8WTbC-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509262044.Scx8WTbC-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/hwmon/pmbus/isl68137.c:66:1: error: expected identifier
      66 | +#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
         | ^
   drivers/hwmon/pmbus/isl68137.c:68:1: error: expected identifier
      68 | +#endif /* CONFIG_SENSORS_RAA229141 */
         | ^
   2 errors generated.


vim +66 drivers/hwmon/pmbus/isl68137.c

    25	
    26	enum chips {
    27		isl68137,
    28		isl68220,
    29		isl68221,
    30		isl68222,
    31		isl68223,
    32		isl68224,
    33		isl68225,
    34		isl68226,
    35		isl68227,
    36		isl68229,
    37		isl68233,
    38		isl68239,
    39		isl69222,
    40		isl69223,
    41		isl69224,
    42		isl69225,
    43		isl69227,
    44		isl69228,
    45		isl69234,
    46		isl69236,
    47		isl69239,
    48		isl69242,
    49		isl69243,
    50		isl69247,
    51		isl69248,
    52		isl69254,
    53		isl69255,
    54		isl69256,
    55		isl69259,
    56		isl69260,
    57		isl69268,
    58		isl69269,
    59		isl69298,
    60		raa228000,
    61		raa228004,
    62		raa228006,
    63		raa228228,
    64		raa229001,
    65		raa229004,
  > 66	+#if IS_ENABLED(CONFIG_SENSORS_RAA229141)
    67	+	raa229141,
    68	+#endif /* CONFIG_SENSORS_RAA229141 */
    69		raa229621,
    70	};
    71	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] drivers/hwmon/pmbus: Add support for raa229141 in isl68137
Posted by Guenter Roeck 5 days, 13 hours ago
On 9/25/25 18:45, Jeff Lin wrote:
> In chip RAA229141 there exist ISYS pin which can report the current data
> for the device connected to this chip through this pin by routed by Direct
> Memory Access(DMA) command. To read the data in ISYS pin, we have to set
> the DMA address to 0xC5 and then read the DMA data from 0xC7. And then use
> the Direct read format with 10mA per LSB to transfer the data in 0xC7.
> And for ISYS input pin, the DMA address is 0xE0D3 and for ISYS output pin,
> the DMA address is 0xEE42.
> 
> Signed-off-by: Jeff Lin <jefflin994697@gmail.com>

As submitted this is a no-go, for several reasons.

The description should describe what is done and why (i.e., here, describe
the added chip), not implementation details. Those are useful as comments
in the code, not as patch description.

Introducing a new sensor class is unacceptable. This is a current (I think),
treat it as such.

Changes in the core together with other changes are unacceptable.

A new virtual command (or commands) would have to be discussed and be generic.

A new Kconfig symbol when adding support for a new chip to an existing driver
is unacceptable. Besides, the new Kconfig symbol would have no effect if
the driver supporting the chip is not enabled, so this is not only unacceptable
but wrong.

Regarding the code itself: Stick with existing coding style. Do not use C++ comments,
declare variables at the beginning of code blocks.

I would suggest to add support for RAA229141 in one patch, then we can discuss
what ISYS_{IN,OUT} actually measures, how it differs from IIN/IOUT, if it indeed
requires new virtual commands and how those command might look like, or if it
can be handled by mapping a existing commands.

The datasheet for RAA229141 is not public, so be prepared to provide a detailed
description.

Guenter