All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] drivers: hwmon: add driver for max42500
@ 2024-12-22 23:15 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2024-12-22 23:15 UTC (permalink / raw)
  Cc: oe-kbuild-all, llvm

In-Reply-To: <20241220012003.9568-3-Kent.Libetario@analog.com>
References: <20241220012003.9568-3-Kent.Libetario@analog.com>
TO: Kent Libetario <Kent.Libetario@analog.com>
TO: linux-hwmon@vger.kernel.org
TO: devicetree@vger.kernel.org
TO: linux-kernel@vger.kernel.org
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Rob Herring <robh@kernel.org>
CC: Krzysztof Kozlowski <krzk@kernel.org>
CC: Conor Dooley <conor+dt@kernel.org>

Hi Kent,

kernel test robot noticed the following build warnings:

[auto build test WARNING on de076198d1e4934c5fc17aa52d5f1884f469ce1a]

url:    https://github.com/intel-lab-lkp/linux/commits/Kent-Libetario/dt-bindings-hwmon-add-adi-max42500-yaml/20241220-092728
base:   de076198d1e4934c5fc17aa52d5f1884f469ce1a
patch link:    https://lore.kernel.org/r/20241220012003.9568-3-Kent.Libetario%40analog.com
patch subject: [PATCH 2/2] drivers: hwmon: add driver for max42500
config: x86_64-randconfig-003-20241223 (https://download.01.org/0day-ci/archive/20241223/202412230626.JsC2Jzh5-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241223/202412230626.JsC2Jzh5-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/202412230626.JsC2Jzh5-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/hwmon/max42500.c:18:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/hwmon/max42500.c:201:33: warning: arithmetic between different enumeration types ('enum max42500_vm_input' and 'enum max42500_comp_stat') [-Wenum-enum-conversion]
     201 |         u8 comp_status[MAX42500_VM_MAX * MAX42500_COMP_STAT_MAX];
         |                        ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
   2 warnings generated.


vim +201 drivers/hwmon/max42500.c

   189	
   190	struct max42500_state {
   191		struct i2c_client *client;
   192		struct regmap *regmap;
   193		struct max42500_config *config;
   194		long pwrup_stamp[MAX42500_VM_MAX];
   195		long pwrdn_stamp[MAX42500_VM_MAX];
   196		u8 ov_thresh1[MAX42500_VM_MAX - 2];
   197		u8 ov_thresh2[MAX42500_VM_MAX - 5];
   198		u8 uv_thresh1[MAX42500_VM_MAX - 2];
   199		u8 uv_thresh2[MAX42500_VM_MAX - 5];
   200		u8 nominal_volt[MAX42500_VM_MAX - 2];
 > 201		u8 comp_status[MAX42500_VM_MAX * MAX42500_COMP_STAT_MAX];
   202	};
   203	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] drivers: hwmon: add driver for max42500
@ 2024-12-21 22:16 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2024-12-21 22:16 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20241220012003.9568-3-Kent.Libetario@analog.com>
References: <20241220012003.9568-3-Kent.Libetario@analog.com>
TO: Kent Libetario <Kent.Libetario@analog.com>
TO: linux-hwmon@vger.kernel.org
TO: devicetree@vger.kernel.org
TO: linux-kernel@vger.kernel.org
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Rob Herring <robh@kernel.org>
CC: Krzysztof Kozlowski <krzk@kernel.org>
CC: Conor Dooley <conor+dt@kernel.org>

Hi Kent,

kernel test robot noticed the following build warnings:

[auto build test WARNING on de076198d1e4934c5fc17aa52d5f1884f469ce1a]

url:    https://github.com/intel-lab-lkp/linux/commits/Kent-Libetario/dt-bindings-hwmon-add-adi-max42500-yaml/20241220-092728
base:   de076198d1e4934c5fc17aa52d5f1884f469ce1a
patch link:    https://lore.kernel.org/r/20241220012003.9568-3-Kent.Libetario%40analog.com
patch subject: [PATCH 2/2] drivers: hwmon: add driver for max42500
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-r071-20241221 (https://download.01.org/0day-ci/archive/20241222/202412220556.U9kI8Oix-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202412220556.U9kI8Oix-lkp@intel.com/

New smatch warnings:
drivers/hwmon/max42500.c:312 max42500_set_nominal_voltage() warn: impossible condition '(voltage > 255) => (0-255 > 255)'
drivers/hwmon/max42500.c:427 max42500_set_ov_thresh2() warn: impossible condition '(thresh > 255) => (0-255 > 255)'
drivers/hwmon/max42500.c:482 max42500_set_uv_thresh2() warn: impossible condition '(thresh > 255) => (0-255 > 255)'

Old smatch warnings:
drivers/hwmon/max42500.c:318 max42500_set_nominal_voltage() warn: impossible condition '(voltage > 255) => (0-255 > 255)'

vim +312 drivers/hwmon/max42500.c

38dfb309423437 Kent Libetario 2024-12-20  296  
38dfb309423437 Kent Libetario 2024-12-20  297  /**
38dfb309423437 Kent Libetario 2024-12-20  298   * @brief Set nominal voltage for VM1 to VM5.
38dfb309423437 Kent Libetario 2024-12-20  299   * @return 0 in case of success, negative error code otherwise.
38dfb309423437 Kent Libetario 2024-12-20  300   */
38dfb309423437 Kent Libetario 2024-12-20  301  static int max42500_set_nominal_voltage(struct max42500_state *st,
38dfb309423437 Kent Libetario 2024-12-20  302  	enum max42500_vm_input vm_in, u8 voltage)
38dfb309423437 Kent Libetario 2024-12-20  303  {
38dfb309423437 Kent Libetario 2024-12-20  304  	u8 reg_addr;
38dfb309423437 Kent Libetario 2024-12-20  305  
38dfb309423437 Kent Libetario 2024-12-20  306  	switch (vm_in) {
38dfb309423437 Kent Libetario 2024-12-20  307  	case MAX42500_VM1:
38dfb309423437 Kent Libetario 2024-12-20  308  	case MAX42500_VM2:
38dfb309423437 Kent Libetario 2024-12-20  309  	case MAX42500_VM3:
38dfb309423437 Kent Libetario 2024-12-20  310  	case MAX42500_VM4:
38dfb309423437 Kent Libetario 2024-12-20  311  		if (voltage < MAX42500_MIN_VNOM ||
38dfb309423437 Kent Libetario 2024-12-20 @312  			voltage > MAX42500_VNOM_MAX_VM1_VM4)
38dfb309423437 Kent Libetario 2024-12-20  313  			return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  314  		reg_addr = MAX42500_REG_VIN1 + vm_in;
38dfb309423437 Kent Libetario 2024-12-20  315  		break;
38dfb309423437 Kent Libetario 2024-12-20  316  	case MAX42500_VM5:
38dfb309423437 Kent Libetario 2024-12-20  317  		if (voltage < MAX42500_MIN_VNOM ||
38dfb309423437 Kent Libetario 2024-12-20  318  			voltage > MAX42500_VNOM_MAX_VM5)
38dfb309423437 Kent Libetario 2024-12-20  319  			return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  320  		reg_addr = MAX42500_REG_VIN5;
38dfb309423437 Kent Libetario 2024-12-20  321  		break;
38dfb309423437 Kent Libetario 2024-12-20  322  	default:
38dfb309423437 Kent Libetario 2024-12-20  323  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  324  	}
38dfb309423437 Kent Libetario 2024-12-20  325  
38dfb309423437 Kent Libetario 2024-12-20  326  	st->nominal_volt[vm_in] = voltage;
38dfb309423437 Kent Libetario 2024-12-20  327  	return max42500_reg_write(st, reg_addr, voltage);
38dfb309423437 Kent Libetario 2024-12-20  328  }
38dfb309423437 Kent Libetario 2024-12-20  329  
38dfb309423437 Kent Libetario 2024-12-20  330  /**
38dfb309423437 Kent Libetario 2024-12-20  331   * @brief Get the status of the voltage monitor input.
38dfb309423437 Kent Libetario 2024-12-20  332   * @return 0 in case of success, negative error code otherwise.
38dfb309423437 Kent Libetario 2024-12-20  333   */
38dfb309423437 Kent Libetario 2024-12-20  334  static int max42500_get_comp_status(struct max42500_state *st,
38dfb309423437 Kent Libetario 2024-12-20  335  									u8 vm_in, u8 *status)
38dfb309423437 Kent Libetario 2024-12-20  336  {
38dfb309423437 Kent Libetario 2024-12-20  337  	int ret;
38dfb309423437 Kent Libetario 2024-12-20  338  	u8 reg_addr;
38dfb309423437 Kent Libetario 2024-12-20  339  	u8 vm_in_status;
38dfb309423437 Kent Libetario 2024-12-20  340  
38dfb309423437 Kent Libetario 2024-12-20  341  	switch (vm_in % MAX42500_COMP_STAT_MAX) {
38dfb309423437 Kent Libetario 2024-12-20  342  	case MAX42500_COMP_STAT_OFF:
38dfb309423437 Kent Libetario 2024-12-20  343  		reg_addr = MAX42500_REG_STATOFF;
38dfb309423437 Kent Libetario 2024-12-20  344  		break;
38dfb309423437 Kent Libetario 2024-12-20  345  	case MAX42500_COMP_STAT_UV:
38dfb309423437 Kent Libetario 2024-12-20  346  		reg_addr = MAX42500_REG_STATUV;
38dfb309423437 Kent Libetario 2024-12-20  347  		break;
38dfb309423437 Kent Libetario 2024-12-20  348  	case MAX42500_COMP_STAT_OV:
38dfb309423437 Kent Libetario 2024-12-20  349  		reg_addr = MAX42500_REG_STATOV;
38dfb309423437 Kent Libetario 2024-12-20  350  		break;
38dfb309423437 Kent Libetario 2024-12-20  351  	default:
38dfb309423437 Kent Libetario 2024-12-20  352  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  353  	}
38dfb309423437 Kent Libetario 2024-12-20  354  
38dfb309423437 Kent Libetario 2024-12-20  355  	ret = max42500_reg_read(st, reg_addr, &vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  356  	if (ret)
38dfb309423437 Kent Libetario 2024-12-20  357  		return ret;
38dfb309423437 Kent Libetario 2024-12-20  358  
38dfb309423437 Kent Libetario 2024-12-20  359  	switch (vm_in % MAX42500_VM_MAX) {
38dfb309423437 Kent Libetario 2024-12-20  360  	case MAX42500_VM1:
38dfb309423437 Kent Libetario 2024-12-20  361  		*status = (u8)FIELD_GET(BIT(MAX42500_VM1), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  362  		break;
38dfb309423437 Kent Libetario 2024-12-20  363  	case MAX42500_VM2:
38dfb309423437 Kent Libetario 2024-12-20  364  		*status = (u8)FIELD_GET(BIT(MAX42500_VM2), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  365  		break;
38dfb309423437 Kent Libetario 2024-12-20  366  	case MAX42500_VM3:
38dfb309423437 Kent Libetario 2024-12-20  367  		*status = (u8)FIELD_GET(BIT(MAX42500_VM3), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  368  		break;
38dfb309423437 Kent Libetario 2024-12-20  369  	case MAX42500_VM4:
38dfb309423437 Kent Libetario 2024-12-20  370  		*status = (u8)FIELD_GET(BIT(MAX42500_VM4), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  371  		break;
38dfb309423437 Kent Libetario 2024-12-20  372  	case MAX42500_VM5:
38dfb309423437 Kent Libetario 2024-12-20  373  		*status = (u8)FIELD_GET(BIT(MAX42500_VM5), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  374  		break;
38dfb309423437 Kent Libetario 2024-12-20  375  	case MAX42500_VM6:
38dfb309423437 Kent Libetario 2024-12-20  376  		*status = (u8)FIELD_GET(BIT(MAX42500_VM6), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  377  		break;
38dfb309423437 Kent Libetario 2024-12-20  378  	case MAX42500_VM7:
38dfb309423437 Kent Libetario 2024-12-20  379  		*status = (u8)FIELD_GET(BIT(MAX42500_VM7), vm_in_status);
38dfb309423437 Kent Libetario 2024-12-20  380  		break;
38dfb309423437 Kent Libetario 2024-12-20  381  	default:
38dfb309423437 Kent Libetario 2024-12-20  382  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  383  	}
38dfb309423437 Kent Libetario 2024-12-20  384  	st->comp_status[vm_in] = *status;
38dfb309423437 Kent Libetario 2024-12-20  385  
38dfb309423437 Kent Libetario 2024-12-20  386  	return 0;
38dfb309423437 Kent Libetario 2024-12-20  387  }
38dfb309423437 Kent Libetario 2024-12-20  388  
38dfb309423437 Kent Libetario 2024-12-20  389  /**
38dfb309423437 Kent Libetario 2024-12-20  390   * @brief Set the overvoltage threshold of VM1 to VM5.
38dfb309423437 Kent Libetario 2024-12-20  391   * @return 0 in case of success, negative error code otherwise.
38dfb309423437 Kent Libetario 2024-12-20  392   */
38dfb309423437 Kent Libetario 2024-12-20  393  static int max42500_set_ov_thresh1(struct max42500_state *st,
38dfb309423437 Kent Libetario 2024-12-20  394  	enum max42500_vm_input vm_in, u8 thresh)
38dfb309423437 Kent Libetario 2024-12-20  395  {
38dfb309423437 Kent Libetario 2024-12-20  396  	if (thresh < MAX42500_MIN_THRESH_VM1_VM5 ||
38dfb309423437 Kent Libetario 2024-12-20  397  		thresh > MAX42500_MAX_THRESH_VM1_VM5)
38dfb309423437 Kent Libetario 2024-12-20  398  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  399  
38dfb309423437 Kent Libetario 2024-12-20  400  	switch (vm_in) {
38dfb309423437 Kent Libetario 2024-12-20  401  	case MAX42500_VM1:
38dfb309423437 Kent Libetario 2024-12-20  402  	case MAX42500_VM2:
38dfb309423437 Kent Libetario 2024-12-20  403  	case MAX42500_VM3:
38dfb309423437 Kent Libetario 2024-12-20  404  	case MAX42500_VM4:
38dfb309423437 Kent Libetario 2024-12-20  405  	case MAX42500_VM5:
38dfb309423437 Kent Libetario 2024-12-20  406  		st->ov_thresh1[vm_in] = thresh;
38dfb309423437 Kent Libetario 2024-12-20  407  		return max42500_reg_update(st,
38dfb309423437 Kent Libetario 2024-12-20  408  								MAX42500_REG_OVUV1 + vm_in,
38dfb309423437 Kent Libetario 2024-12-20  409  								GENMASK(7, 4),
38dfb309423437 Kent Libetario 2024-12-20  410  								FIELD_PREP(GENMASK(7, 4),
38dfb309423437 Kent Libetario 2024-12-20  411  								thresh));
38dfb309423437 Kent Libetario 2024-12-20  412  	default:
38dfb309423437 Kent Libetario 2024-12-20  413  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  414  	}
38dfb309423437 Kent Libetario 2024-12-20  415  }
38dfb309423437 Kent Libetario 2024-12-20  416  
38dfb309423437 Kent Libetario 2024-12-20  417  /**
38dfb309423437 Kent Libetario 2024-12-20  418   * @brief Set the overvoltage threshold of VM6 and VM7.
38dfb309423437 Kent Libetario 2024-12-20  419   * @return 0 in case of success, negative error code otherwise.
38dfb309423437 Kent Libetario 2024-12-20  420   */
38dfb309423437 Kent Libetario 2024-12-20  421  static int max42500_set_ov_thresh2(struct max42500_state *st,
38dfb309423437 Kent Libetario 2024-12-20  422  	enum max42500_vm_input vm_in, u8 thresh)
38dfb309423437 Kent Libetario 2024-12-20  423  {
38dfb309423437 Kent Libetario 2024-12-20  424  	u8 reg_addr;
38dfb309423437 Kent Libetario 2024-12-20  425  
38dfb309423437 Kent Libetario 2024-12-20  426  	if (thresh < MAX42500_MIN_THRESH_VM6_V7 ||
38dfb309423437 Kent Libetario 2024-12-20 @427  		thresh > MAX42500_MAX_THRESH_VM6_V7)
38dfb309423437 Kent Libetario 2024-12-20  428  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  429  
38dfb309423437 Kent Libetario 2024-12-20  430  	switch (vm_in) {
38dfb309423437 Kent Libetario 2024-12-20  431  	case MAX42500_VM6:
38dfb309423437 Kent Libetario 2024-12-20  432  		reg_addr = MAX42500_REG_VINO6;
38dfb309423437 Kent Libetario 2024-12-20  433  		break;
38dfb309423437 Kent Libetario 2024-12-20  434  	case MAX42500_VM7:
38dfb309423437 Kent Libetario 2024-12-20  435  		reg_addr = MAX42500_REG_VINO7;
38dfb309423437 Kent Libetario 2024-12-20  436  		break;
38dfb309423437 Kent Libetario 2024-12-20  437  	default:
38dfb309423437 Kent Libetario 2024-12-20  438  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  439  	}
38dfb309423437 Kent Libetario 2024-12-20  440  
38dfb309423437 Kent Libetario 2024-12-20  441  	st->ov_thresh2[vm_in] = thresh;
38dfb309423437 Kent Libetario 2024-12-20  442  	return max42500_reg_write(st, reg_addr, thresh);
38dfb309423437 Kent Libetario 2024-12-20  443  }
38dfb309423437 Kent Libetario 2024-12-20  444  
38dfb309423437 Kent Libetario 2024-12-20  445  /**
38dfb309423437 Kent Libetario 2024-12-20  446   * @brief Set the undervoltage threshold of VM1 to VM5.
38dfb309423437 Kent Libetario 2024-12-20  447   * @return 0 in case of success, negative error code otherwise.
38dfb309423437 Kent Libetario 2024-12-20  448   */
38dfb309423437 Kent Libetario 2024-12-20  449  static int max42500_set_uv_thresh1(struct max42500_state *st,
38dfb309423437 Kent Libetario 2024-12-20  450  	enum max42500_vm_input vm_in, u8 thresh)
38dfb309423437 Kent Libetario 2024-12-20  451  {
38dfb309423437 Kent Libetario 2024-12-20  452  	if (thresh < MAX42500_MIN_THRESH_VM1_VM5 ||
38dfb309423437 Kent Libetario 2024-12-20  453  		thresh > MAX42500_MAX_THRESH_VM1_VM5)
38dfb309423437 Kent Libetario 2024-12-20  454  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  455  
38dfb309423437 Kent Libetario 2024-12-20  456  	switch (vm_in) {
38dfb309423437 Kent Libetario 2024-12-20  457  	case MAX42500_VM1:
38dfb309423437 Kent Libetario 2024-12-20  458  	case MAX42500_VM2:
38dfb309423437 Kent Libetario 2024-12-20  459  	case MAX42500_VM3:
38dfb309423437 Kent Libetario 2024-12-20  460  	case MAX42500_VM4:
38dfb309423437 Kent Libetario 2024-12-20  461  	case MAX42500_VM5:
38dfb309423437 Kent Libetario 2024-12-20  462  		st->uv_thresh1[vm_in] = thresh;
38dfb309423437 Kent Libetario 2024-12-20  463  		return max42500_reg_update(st,
38dfb309423437 Kent Libetario 2024-12-20  464  					MAX42500_REG_OVUV1 + vm_in,
38dfb309423437 Kent Libetario 2024-12-20  465  					GENMASK(3, 0),
38dfb309423437 Kent Libetario 2024-12-20  466  					thresh);
38dfb309423437 Kent Libetario 2024-12-20  467  	default:
38dfb309423437 Kent Libetario 2024-12-20  468  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  469  	}
38dfb309423437 Kent Libetario 2024-12-20  470  }
38dfb309423437 Kent Libetario 2024-12-20  471  
38dfb309423437 Kent Libetario 2024-12-20  472  /**
38dfb309423437 Kent Libetario 2024-12-20  473   * @brief Set the undervoltage threshold of VM6 and VM7.
38dfb309423437 Kent Libetario 2024-12-20  474   * @return 0 in case of success, negative error code otherwise.
38dfb309423437 Kent Libetario 2024-12-20  475   */
38dfb309423437 Kent Libetario 2024-12-20  476  static int max42500_set_uv_thresh2(struct max42500_state *st,
38dfb309423437 Kent Libetario 2024-12-20  477  	enum max42500_vm_input vm_in, u8 thresh)
38dfb309423437 Kent Libetario 2024-12-20  478  {
38dfb309423437 Kent Libetario 2024-12-20  479  	u8 reg_addr;
38dfb309423437 Kent Libetario 2024-12-20  480  
38dfb309423437 Kent Libetario 2024-12-20  481  	if (thresh < MAX42500_MIN_THRESH_VM6_V7 ||
38dfb309423437 Kent Libetario 2024-12-20 @482  		thresh > MAX42500_MAX_THRESH_VM6_V7)
38dfb309423437 Kent Libetario 2024-12-20  483  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  484  
38dfb309423437 Kent Libetario 2024-12-20  485  	switch (vm_in) {
38dfb309423437 Kent Libetario 2024-12-20  486  	case MAX42500_VM6:
38dfb309423437 Kent Libetario 2024-12-20  487  		reg_addr = MAX42500_REG_VINU6;
38dfb309423437 Kent Libetario 2024-12-20  488  		break;
38dfb309423437 Kent Libetario 2024-12-20  489  	case MAX42500_VM7:
38dfb309423437 Kent Libetario 2024-12-20  490  		reg_addr = MAX42500_REG_VINU7;
38dfb309423437 Kent Libetario 2024-12-20  491  		break;
38dfb309423437 Kent Libetario 2024-12-20  492  	default:
38dfb309423437 Kent Libetario 2024-12-20  493  		return -EINVAL;
38dfb309423437 Kent Libetario 2024-12-20  494  	}
38dfb309423437 Kent Libetario 2024-12-20  495  
38dfb309423437 Kent Libetario 2024-12-20  496  	st->uv_thresh2[vm_in] = thresh;
38dfb309423437 Kent Libetario 2024-12-20  497  	return max42500_reg_write(st, reg_addr, thresh);
38dfb309423437 Kent Libetario 2024-12-20  498  }
38dfb309423437 Kent Libetario 2024-12-20  499  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 0/2] Add driver for MAX42500
@ 2024-12-20  1:20 Kent Libetario
  2024-12-20  1:20 ` [PATCH 2/2] drivers: hwmon: add driver for max42500 Kent Libetario
  0 siblings, 1 reply; 6+ messages in thread
From: Kent Libetario @ 2024-12-20  1:20 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-kernel
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley

This patch series introduces a new hardware monitoring (hwmon) driver for
the MAX42500 hardware. The driver is a SoC power-system monitor with up to
seven voltage monitor inputs. Each input has programmable OV/UV thresholds
over the full temperature range and support DVS through the I2C interface.

The MAX42500 contains a programmable flexible power sequence recorder
(FPSR) and a programmable challenge/response watchdog with a configurable
RESET output. These are also accessible through the I2C interface.

The patches are organized as follows:
1. Patch 1/2: Add documentation for devicetree bindings of MAX42500 driver.
2. Patch 2/2: Add the core implementation of the MAX42500 hwmon driver.

The driver has been tested on the raspberry pi-4 platform.

Kent Libetario (2):
  dt-bindings: hwmon: add adi,max42500.yaml
  drivers: hwmon: add driver for max42500

 .../bindings/hwmon/adi,max42500.yaml          |   42 +
 MAINTAINERS                                   |    7 +
 drivers/hwmon/Kconfig                         |   13 +
 drivers/hwmon/Makefile                        |    1 +
 drivers/hwmon/max42500.c                      | 1049 +++++++++++++++++
 5 files changed, 1112 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adi,max42500.yaml
 create mode 100644 drivers/hwmon/max42500.c


base-commit: de076198d1e4934c5fc17aa52d5f1884f469ce1a
-- 
2.25.1


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

end of thread, other threads:[~2025-03-10  9:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-22 23:15 [PATCH 2/2] drivers: hwmon: add driver for max42500 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-12-21 22:16 kernel test robot
2024-12-20  1:20 [PATCH 0/2] Add driver for MAX42500 Kent Libetario
2024-12-20  1:20 ` [PATCH 2/2] drivers: hwmon: add driver for max42500 Kent Libetario
2024-12-21  5:01   ` kernel test robot
2024-12-21 18:08   ` Guenter Roeck
2025-03-10  9:05     ` Libetario, Kent

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.