All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>,
	linux-iio@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>
Subject: Re: [PATCH 2/2] iio: temperature: add ADI MAX30210 driver
Date: Fri, 27 Feb 2026 05:26:25 +0800	[thread overview]
Message-ID: <202602270554.gpbYaUtd-lkp@intel.com> (raw)
In-Reply-To: <20260226163041.169786-3-johnerasmusmari.geronimo@analog.com>

Hi John,

kernel test robot noticed the following build errors:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on linus/master v7.0-rc1 next-20260226]
[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/John-Erasmus-Mari-Geronimo/dt-bindings-iio-temperature-add-ADI-MAX30210/20260227-013306
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20260226163041.169786-3-johnerasmusmari.geronimo%40analog.com
patch subject: [PATCH 2/2] iio: temperature: add ADI MAX30210 driver
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20260227/202602270554.gpbYaUtd-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260227/202602270554.gpbYaUtd-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/202602270554.gpbYaUtd-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/iio/temperature/max30210.c: In function 'max30210_read_raw':
>> drivers/iio/temperature/max30210.c:412:23: error: implicit declaration of function 'iio_device_claim_direct_mode'; did you mean 'iio_device_claim_direct'? [-Werror=implicit-function-declaration]
     412 |                 ret = iio_device_claim_direct_mode(indio_dev);
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                       iio_device_claim_direct
>> drivers/iio/temperature/max30210.c:426:17: error: implicit declaration of function 'iio_device_release_direct_mode'; did you mean 'iio_device_release_direct'? [-Werror=implicit-function-declaration]
     426 |                 iio_device_release_direct_mode(indio_dev);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                 iio_device_release_direct
   drivers/iio/temperature/max30210.c: At top level:
>> drivers/iio/temperature/max30210.c:604:31: error: initialization of 'int (*)(struct iio_dev *, const struct iio_chan_spec *, enum iio_event_type,  enum iio_event_direction,  bool)' {aka 'int (*)(struct iio_dev *, const struct iio_chan_spec *, enum iio_event_type,  enum iio_event_direction,  _Bool)'} from incompatible pointer type 'int (*)(struct iio_dev *, const struct iio_chan_spec *, enum iio_event_type,  enum iio_event_direction,  int)' [-Werror=incompatible-pointer-types]
     604 |         .write_event_config = max30210_write_event_config,
         |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/temperature/max30210.c:604:31: note: (near initialization for 'max30210_info.write_event_config')
   cc1: some warnings being treated as errors


vim +412 drivers/iio/temperature/max30210.c

   381	
   382	static int max30210_read_raw(struct iio_dev *indio_dev,
   383				     struct iio_chan_spec const *chan, int *val,
   384				     int *val2, long mask)
   385	{
   386		struct max30210_state *st = iio_priv(indio_dev);
   387		unsigned int uval;
   388		int ret;
   389	
   390		switch (mask) {
   391		case IIO_CHAN_INFO_SCALE:
   392			*val = 5;
   393	
   394			return IIO_VAL_INT;
   395		case IIO_CHAN_INFO_SAMP_FREQ:
   396			ret = regmap_read(st->regmap, MAX30210_TEMP_CONF_2_REG, &uval);
   397			if (ret)
   398				return ret;
   399	
   400			uval = FIELD_GET(MAX30210_TEMP_PERIOD_MASK, uval);
   401	
   402			*val = 8;
   403	
   404			/**
   405			 * register values 0x9 or above have the same sample
   406			 * rate of 8Hz
   407			 */
   408			*val2 = uval >= 0x9 ? 1 : BIT(0x9 - uval);
   409	
   410			return IIO_VAL_FRACTIONAL;
   411		case IIO_CHAN_INFO_RAW:
 > 412			ret = iio_device_claim_direct_mode(indio_dev);
   413			if (ret)
   414				return ret;
   415	
   416			ret = regmap_write(st->regmap, MAX30210_TEMP_CONV_REG,
   417					   MAX30210_CONV_T_MASK);
   418			if (ret)
   419				goto release_dmode;
   420	
   421			fsleep(8000);
   422	
   423			ret = max30210_read_temp(st->regmap, MAX30210_TEMP_DATA_REG, val);
   424	
   425	release_dmode:
 > 426			iio_device_release_direct_mode(indio_dev);
   427			return ret;
   428		default:
   429			return -EINVAL;
   430		}
   431	}
   432	
   433	static int max30210_read_avail(struct iio_dev *indio_dev,
   434				       struct iio_chan_spec const *chan,
   435				       const int **vals, int *type, int *length,
   436				       long mask)
   437	{
   438		switch (mask) {
   439		case IIO_CHAN_INFO_SAMP_FREQ:
   440			*vals = samp_freq_avail;
   441			*type = IIO_VAL_INT_PLUS_MICRO;
   442			*length = ARRAY_SIZE(samp_freq_avail);
   443	
   444			return IIO_AVAIL_LIST;
   445		default:
   446			return -EINVAL;
   447		}
   448	}
   449	
   450	static int max30210_write_raw(struct iio_dev *indio_dev,
   451				      struct iio_chan_spec const *chan, int val,
   452				      int val2, long mask)
   453	{
   454		struct max30210_state *st = iio_priv(indio_dev);
   455		u64 data;
   456		int ret;
   457	
   458		switch (mask) {
   459		case IIO_CHAN_INFO_SAMP_FREQ:
   460			ret = iio_device_claim_direct_mode(indio_dev);
   461			if (ret)
   462				return ret;
   463	
   464			/**
   465			 * micro_value = val * 1000000 + val2
   466			 * reg_value = ((micro_value * 64) / 1000000) - 1
   467			 */
   468			data = (val * MICRO + val2) << 6;
   469			do_div(data, MICRO);
   470	
   471			data = fls_long(data - 1);
   472			data = FIELD_PREP(MAX30210_TEMP_PERIOD_MASK, data);
   473	
   474			ret = regmap_update_bits(st->regmap, MAX30210_TEMP_CONF_2_REG,
   475						 MAX30210_TEMP_PERIOD_MASK,
   476						 (unsigned int)data);
   477	
   478			iio_device_release_direct_mode(indio_dev);
   479			return ret;
   480		default:
   481			return -EINVAL;
   482		}
   483	}
   484	
   485	static int max30210_write_raw_get_fmt(struct iio_dev *indio_dev,
   486					      struct iio_chan_spec const *chan,
   487					      long mask)
   488	{
   489		switch (mask) {
   490		case IIO_CHAN_INFO_SAMP_FREQ:
   491			return IIO_VAL_INT_PLUS_MICRO;
   492		default:
   493			return -EINVAL;
   494		}
   495	}
   496	
   497	static const struct iio_trigger_ops max30210_trigger_ops = {
   498		.validate_device = &iio_trigger_validate_own_device,
   499	};
   500	
   501	static int max30210_set_watermark(struct iio_dev *indio_dev, unsigned int val)
   502	{
   503		struct max30210_state *st = iio_priv(indio_dev);
   504		unsigned int reg;
   505		int ret;
   506	
   507		if (val < 1 || val > MAX30210_FIFO_SIZE)
   508			return -EINVAL;
   509	
   510		reg = MAX30210_FIFO_SIZE - val;
   511	
   512		ret = regmap_write(st->regmap, MAX30210_FIFO_CONF_1_REG, reg);
   513		if (ret)
   514			return ret;
   515	
   516		st->watermark = val;
   517	
   518		return 0;
   519	}
   520	
   521	static ssize_t hwfifo_watermark_show(struct device *dev,
   522					     struct device_attribute *devattr,
   523					     char *buf)
   524	{
   525		struct max30210_state *st = iio_priv(dev_to_iio_dev(dev));
   526	
   527		return sysfs_emit(buf, "%d\n", st->watermark);
   528	}
   529	
   530	IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1");
   531	IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max,
   532				     __stringify(MAX30210_FIFO_SIZE));
   533	static IIO_DEVICE_ATTR_RO(hwfifo_watermark, 0);
   534	
   535	static const struct iio_dev_attr *max30210_fifo_attributes[] = {
   536		&iio_dev_attr_hwfifo_watermark_min,
   537		&iio_dev_attr_hwfifo_watermark_max,
   538		&iio_dev_attr_hwfifo_watermark,
   539		NULL,
   540	};
   541	
   542	static int max30210_buffer_preenable(struct iio_dev *indio_dev)
   543	{
   544		struct max30210_state *st = iio_priv(indio_dev);
   545		int ret;
   546	
   547		ret = regmap_update_bits(st->regmap, MAX30210_INT_EN_REG,
   548					 MAX30210_A_FULL_MASK, MAX30210_A_FULL_MASK);
   549		if (ret)
   550			return ret;
   551	
   552		ret = regmap_update_bits(st->regmap, MAX30210_FIFO_CONF_2_REG,
   553					 MAX30210_FLUSH_FIFO_MASK,
   554					 MAX30210_FLUSH_FIFO_MASK);
   555		if (ret)
   556			return ret;
   557	
   558		ret = regmap_write(st->regmap, MAX30210_TEMP_CONV_REG,
   559				   MAX30210_AUTO_MASK | MAX30210_CONV_T_MASK);
   560		if (ret)
   561			return ret;
   562	
   563		return 0;
   564	}
   565	
   566	static int max30210_buffer_postdisable(struct iio_dev *indio_dev)
   567	{
   568		struct max30210_state *st = iio_priv(indio_dev);
   569		int ret;
   570	
   571		ret = regmap_update_bits(st->regmap, MAX30210_INT_EN_REG,
   572					 MAX30210_A_FULL_MASK, 0x0);
   573		if (ret)
   574			return ret;
   575	
   576		ret = regmap_update_bits(st->regmap, MAX30210_FIFO_CONF_2_REG,
   577					 MAX30210_FLUSH_FIFO_MASK,
   578					 MAX30210_FLUSH_FIFO_MASK);
   579		if (ret)
   580			return ret;
   581	
   582		ret = regmap_write(st->regmap, MAX30210_TEMP_CONV_REG, 0x0);
   583		if (ret)
   584			return ret;
   585	
   586		return 0;
   587	}
   588	
   589	static const struct iio_buffer_setup_ops max30210_buffer_ops = {
   590		.preenable = max30210_buffer_preenable,
   591		.postdisable = max30210_buffer_postdisable,
   592	};
   593	
   594	static const struct iio_info max30210_info = {
   595		.read_raw = max30210_read_raw,
   596		.read_avail = max30210_read_avail,
   597		.write_raw = max30210_write_raw,
   598		.write_raw_get_fmt = max30210_write_raw_get_fmt,
   599		.hwfifo_set_watermark = max30210_set_watermark,
   600		.debugfs_reg_access = &max30210_reg_access,
   601		.validate_trigger = &max30210_validate_trigger,
   602		.read_event_value = max30210_read_event,
   603		.write_event_value = max30210_write_event,
 > 604		.write_event_config = max30210_write_event_config,
   605		.read_event_config = max30210_read_event_config,
   606	};
   607	

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

  parent reply	other threads:[~2026-02-26 21:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 16:30 [PATCH 0/2] iio: temperature: add ADI MAX30210 SPI temperature sensor John Erasmus Mari Geronimo
2026-02-26 16:30 ` [PATCH 1/2] dt-bindings: iio: temperature: add ADI MAX30210 John Erasmus Mari Geronimo
2026-02-26 18:33   ` David Lechner
2026-02-28 12:18     ` Jonathan Cameron
2026-02-27 10:48   ` Krzysztof Kozlowski
2026-02-26 16:30 ` [PATCH 2/2] iio: temperature: add ADI MAX30210 driver John Erasmus Mari Geronimo
2026-02-26 17:48   ` Andy Shevchenko
2026-02-26 20:08   ` David Lechner
2026-02-26 21:26   ` kernel test robot [this message]
2026-02-26 22:29   ` kernel test robot
2026-02-28 13:05   ` Jonathan Cameron

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=202602270554.gpbYaUtd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andy@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=johnerasmusmari.geronimo@analog.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.