All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chris Morgan <macroalpha82@gmail.com>, linux-pm@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	heiko@sntech.de, conor+dt@kernel.org, krzk+dt@kernel.org,
	robh@kernel.org, sre@kernel.org, t.schramm@manjaro.org,
	Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217
Date: Thu, 29 Oct 2026 14:24:14 +0800	[thread overview]
Message-ID: <202610291456.pByroJTe-lkp@intel.com> (raw)
In-Reply-To: <20261027131751.1724448-3-macroalpha82@gmail.com>

Hi Chris,

kernel test robot noticed the following build errors:

[auto build test ERROR on sre-power-supply/for-next]
[also build test ERROR on rockchip/for-next amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.3 next-20261028]
[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/Chris-Morgan/dt-bindings-power-cw2015-add-cw2215-cw2217-and-cw2218/20261027-081749
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link:    https://lore.kernel.org/r/20261027131751.1724448-3-macroalpha82%40gmail.com
patch subject: [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20261029/202610291456.pByroJTe-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 1da436a23e613c425fc9b868fc8deb979ede47a4)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261029/202610291456.pByroJTe-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/202610291456.pByroJTe-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/power/supply/cw2217_battery.c:261:11: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     261 |         fw_ver = FIELD_GET(CW2217_ID_MASK, cw_bat->fw_version);
         |                  ^
   drivers/power/supply/cw2217_battery.c:465:12: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     465 |                                        FIELD_GET(CW2217_IC_READY_MASK, reg) == CW2217_IC_READY,
         |                                        ^
   drivers/power/supply/cw2217_battery.c:491:6: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     491 |         if (FIELD_GET(CW2217_CONFIG_ACT_MSK, reg)) {
         |             ^
   3 errors generated.


vim +/FIELD_GET +261 drivers/power/supply/cw2217_battery.c

   231	
   232	/*
   233	 * Current is a signed 16bit register (0x0E 0x0F) that reports current A/D
   234	 * converter result of the voltage across the current sense resistor,
   235	 * 10mohm typical. The register value should be divided by the sense
   236	 * resistance to convert to amperes. The value of the sense resistor
   237	 * determines the resolution and the full-scale range of the current readings.
   238	 * The LSB of 0x0F is (52.4/32768)uV for CW2215 and CW2217. The LSB of 0x0F is
   239	 * (125/32768)uV for CW2218.
   240	 */
   241	static int cw2217_get_current(struct cw2217_battery *cw_bat)
   242	{
   243		s32 cw_current;
   244		__be16 reg;
   245		u8 fw_ver;
   246		int ret;
   247	
   248		if (cw_bat->fw_version == 0) {
   249			cw_bat->cw_current = 0;
   250			dev_err(cw_bat->dev, "Error! CW2217 firmware read error!\n");
   251			return -EIO;
   252		}
   253	
   254		ret = regmap_bulk_read(cw_bat->regmap, CW2217_CURRENT_H,
   255				       &reg, sizeof(reg));
   256		if (ret)
   257			return ret;
   258	
   259		cw_current = (s16)be16_to_cpu(reg);
   260	
 > 261		fw_ver = FIELD_GET(CW2217_ID_MASK, cw_bat->fw_version);
   262		switch (fw_ver) {
   263		case CW2215_ID:
   264		case CW2217_ID:
   265			cw_current = (cw_current * 1600) / (cw_bat->user_rsense / 1000);
   266			cw_bat->cw_current = cw_current * 1000;
   267			break;
   268		case CW2218_ID:
   269			cw_current = (cw_current * 3815) / (cw_bat->user_rsense / 1000);
   270			cw_bat->cw_current = cw_current * 1000;
   271			break;
   272		default:
   273			cw_bat->cw_current = 0;
   274			dev_err(cw_bat->dev, "Error! CW2217 firmware read error!\n");
   275			return -EIO;
   276		}
   277	
   278		return 0;
   279	}
   280	

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Chris Morgan <macroalpha82@gmail.com>, linux-pm@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	heiko@sntech.de, conor+dt@kernel.org, krzk+dt@kernel.org,
	robh@kernel.org, sre@kernel.org, t.schramm@manjaro.org,
	Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217
Date: Thu, 29 Oct 2026 14:24:14 +0800	[thread overview]
Message-ID: <202610291456.pByroJTe-lkp@intel.com> (raw)
In-Reply-To: <20261027131751.1724448-3-macroalpha82@gmail.com>

Hi Chris,

kernel test robot noticed the following build errors:

[auto build test ERROR on sre-power-supply/for-next]
[also build test ERROR on rockchip/for-next amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.3 next-20261028]
[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/Chris-Morgan/dt-bindings-power-cw2015-add-cw2215-cw2217-and-cw2218/20261027-081749
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link:    https://lore.kernel.org/r/20261027131751.1724448-3-macroalpha82%40gmail.com
patch subject: [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20261029/202610291456.pByroJTe-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 1da436a23e613c425fc9b868fc8deb979ede47a4)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261029/202610291456.pByroJTe-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/202610291456.pByroJTe-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/power/supply/cw2217_battery.c:261:11: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     261 |         fw_ver = FIELD_GET(CW2217_ID_MASK, cw_bat->fw_version);
         |                  ^
   drivers/power/supply/cw2217_battery.c:465:12: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     465 |                                        FIELD_GET(CW2217_IC_READY_MASK, reg) == CW2217_IC_READY,
         |                                        ^
   drivers/power/supply/cw2217_battery.c:491:6: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     491 |         if (FIELD_GET(CW2217_CONFIG_ACT_MSK, reg)) {
         |             ^
   3 errors generated.


vim +/FIELD_GET +261 drivers/power/supply/cw2217_battery.c

   231	
   232	/*
   233	 * Current is a signed 16bit register (0x0E 0x0F) that reports current A/D
   234	 * converter result of the voltage across the current sense resistor,
   235	 * 10mohm typical. The register value should be divided by the sense
   236	 * resistance to convert to amperes. The value of the sense resistor
   237	 * determines the resolution and the full-scale range of the current readings.
   238	 * The LSB of 0x0F is (52.4/32768)uV for CW2215 and CW2217. The LSB of 0x0F is
   239	 * (125/32768)uV for CW2218.
   240	 */
   241	static int cw2217_get_current(struct cw2217_battery *cw_bat)
   242	{
   243		s32 cw_current;
   244		__be16 reg;
   245		u8 fw_ver;
   246		int ret;
   247	
   248		if (cw_bat->fw_version == 0) {
   249			cw_bat->cw_current = 0;
   250			dev_err(cw_bat->dev, "Error! CW2217 firmware read error!\n");
   251			return -EIO;
   252		}
   253	
   254		ret = regmap_bulk_read(cw_bat->regmap, CW2217_CURRENT_H,
   255				       &reg, sizeof(reg));
   256		if (ret)
   257			return ret;
   258	
   259		cw_current = (s16)be16_to_cpu(reg);
   260	
 > 261		fw_ver = FIELD_GET(CW2217_ID_MASK, cw_bat->fw_version);
   262		switch (fw_ver) {
   263		case CW2215_ID:
   264		case CW2217_ID:
   265			cw_current = (cw_current * 1600) / (cw_bat->user_rsense / 1000);
   266			cw_bat->cw_current = cw_current * 1000;
   267			break;
   268		case CW2218_ID:
   269			cw_current = (cw_current * 3815) / (cw_bat->user_rsense / 1000);
   270			cw_bat->cw_current = cw_current * 1000;
   271			break;
   272		default:
   273			cw_bat->cw_current = 0;
   274			dev_err(cw_bat->dev, "Error! CW2217 firmware read error!\n");
   275			return -EIO;
   276		}
   277	
   278		return 0;
   279	}
   280	

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  parent reply	other threads:[~2026-10-29  6:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 13:17 [PATCH 0/3] Add Cellwise CW2217 Chris Morgan
2026-10-27 13:17 ` Chris Morgan
2026-10-27 13:17 ` [PATCH 1/3] dt-bindings: power: cw2015: add cw2215, cw2217, and cw2218 Chris Morgan
2026-10-27 13:17   ` Chris Morgan
2026-10-27 13:22   ` sashiko-bot
2026-10-27 15:57   ` Krzysztof Kozlowski
2026-10-27 15:57     ` Krzysztof Kozlowski
2026-10-27 13:17 ` [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217 Chris Morgan
2026-10-27 13:17   ` Chris Morgan
2026-10-27 13:31   ` sashiko-bot
2026-10-27 13:34   ` Shawn Lin
2026-10-27 13:34     ` Shawn Lin
2026-10-27 15:46     ` Chris Morgan
2026-10-27 15:46       ` Chris Morgan
2026-10-29  6:24   ` kernel test robot [this message]
2026-10-29  6:24     ` kernel test robot
2026-10-27 13:17 ` [PATCH 3/3] arm64: dts: rockchip: Add Battery Gauge to Anbernic Vita-Pro Chris Morgan
2026-10-27 13:17   ` Chris Morgan
2026-10-27 13:32   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202610291456.pByroJTe-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=macroalpha82@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=t.schramm@manjaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.