From: kernel test robot <lkp@intel.com>
To: "Esteban Blanc" <eblanc@baylibre.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>
Cc: oe-kbuild-all@lists.linux.dev, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, Esteban Blanc <eblanc@baylibre.com>
Subject: Re: [PATCH v2 2/6] iio: adc: ad4030: add driver for ad4030-24
Date: Sat, 21 Dec 2024 00:39:06 +0800 [thread overview]
Message-ID: <202412210010.ddQlStza-lkp@intel.com> (raw)
In-Reply-To: <20241219-eblanc-ad4630_v1-v2-2-f36e55907bf5@baylibre.com>
Hi Esteban,
kernel test robot noticed the following build errors:
[auto build test ERROR on 40384c840ea1944d7c5a392e8975ed088ecf0b37]
url: https://github.com/intel-lab-lkp/linux/commits/Esteban-Blanc/dt-bindings-iio-adc-add-ADI-ad4030-ad4630-and-ad4632/20241220-001408
base: 40384c840ea1944d7c5a392e8975ed088ecf0b37
patch link: https://lore.kernel.org/r/20241219-eblanc-ad4630_v1-v2-2-f36e55907bf5%40baylibre.com
patch subject: [PATCH v2 2/6] iio: adc: ad4030: add driver for ad4030-24
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20241221/202412210010.ddQlStza-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241221/202412210010.ddQlStza-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/202412210010.ddQlStza-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/iio/adc/ad4030.c: In function 'ad4030_get_chan_calibscale':
>> drivers/iio/adc/ad4030.c:346:16: error: implicit declaration of function 'get_unaligned_be16' [-Wimplicit-function-declaration]
346 | gain = get_unaligned_be16(st->rx_data.raw);
| ^~~~~~~~~~~~~~~~~~
drivers/iio/adc/ad4030.c: In function 'ad4030_get_chan_calibbias':
>> drivers/iio/adc/ad4030.c:375:38: error: implicit declaration of function 'get_unaligned_be24' [-Wimplicit-function-declaration]
375 | *val = sign_extend32(get_unaligned_be24(st->rx_data.raw), 23);
| ^~~~~~~~~~~~~~~~~~
drivers/iio/adc/ad4030.c: In function 'ad4030_set_chan_calibscale':
>> drivers/iio/adc/ad4030.c:399:9: error: implicit declaration of function 'put_unaligned_be16' [-Wimplicit-function-declaration]
399 | put_unaligned_be16(DIV_ROUND_CLOSEST_ULL(gain * 0x8000, MICRO),
| ^~~~~~~~~~~~~~~~~~
drivers/iio/adc/ad4030.c: In function 'ad4030_set_chan_calibbias':
>> drivers/iio/adc/ad4030.c:424:17: error: implicit declaration of function 'put_unaligned_be24' [-Wimplicit-function-declaration]
424 | put_unaligned_be24(offset, st->tx_data);
| ^~~~~~~~~~~~~~~~~~
vim +/get_unaligned_be16 +346 drivers/iio/adc/ad4030.c
331
332 static int ad4030_get_chan_calibscale(struct iio_dev *indio_dev,
333 struct iio_chan_spec const *chan,
334 int *val,
335 int *val2)
336 {
337 struct ad4030_state *st = iio_priv(indio_dev);
338 u16 gain;
339 int ret;
340
341 ret = regmap_bulk_read(st->regmap, AD4030_REG_GAIN_CHAN(chan->address),
342 st->rx_data.raw, AD4030_REG_GAIN_BYTES_NB);
343 if (ret)
344 return ret;
345
> 346 gain = get_unaligned_be16(st->rx_data.raw);
347
348 /* From datasheet: multiplied output = input × gain word/0x8000 */
349 *val = gain / 0x8000;
350 *val2 = mul_u64_u32_div(gain % 0x8000, NANO, 0x8000);
351
352 return IIO_VAL_INT_PLUS_NANO;
353 }
354
355 /* Returns the offset where 1 LSB = (VREF/2^precision_bits - 1)/gain */
356 static int ad4030_get_chan_calibbias(struct iio_dev *indio_dev,
357 struct iio_chan_spec const *chan,
358 int *val)
359 {
360 struct ad4030_state *st = iio_priv(indio_dev);
361 int ret;
362
363 ret = regmap_bulk_read(st->regmap,
364 AD4030_REG_OFFSET_CHAN(chan->address),
365 st->rx_data.raw, AD4030_REG_OFFSET_BYTES_NB);
366 if (ret)
367 return ret;
368
369 switch (st->chip->precision_bits) {
370 case 16:
371 *val = sign_extend32(get_unaligned_be16(st->rx_data.raw), 15);
372 return IIO_VAL_INT;
373
374 case 24:
> 375 *val = sign_extend32(get_unaligned_be24(st->rx_data.raw), 23);
376 return IIO_VAL_INT;
377
378 default:
379 return -EINVAL;
380 }
381 }
382
383 static int ad4030_set_chan_calibscale(struct iio_dev *indio_dev,
384 struct iio_chan_spec const *chan,
385 int gain_int,
386 int gain_frac)
387 {
388 struct ad4030_state *st = iio_priv(indio_dev);
389 u64 gain;
390
391 if (gain_int < 0 || gain_frac < 0)
392 return -EINVAL;
393
394 gain = mul_u32_u32(gain_int, MICRO) + gain_frac;
395
396 if (gain > AD4030_REG_GAIN_MAX_GAIN)
397 return -EINVAL;
398
> 399 put_unaligned_be16(DIV_ROUND_CLOSEST_ULL(gain * 0x8000, MICRO),
400 st->tx_data);
401
402 return regmap_bulk_write(st->regmap,
403 AD4030_REG_GAIN_CHAN(chan->address),
404 st->tx_data, AD4030_REG_GAIN_BYTES_NB);
405 }
406
407 static int ad4030_set_chan_calibbias(struct iio_dev *indio_dev,
408 struct iio_chan_spec const *chan,
409 int offset)
410 {
411 struct ad4030_state *st = iio_priv(indio_dev);
412
413 if (offset < st->offset_avail[0] || offset > st->offset_avail[2])
414 return -EINVAL;
415
416 st->tx_data[2] = 0;
417
418 switch (st->chip->precision_bits) {
419 case 16:
420 put_unaligned_be16(offset, st->tx_data);
421 break;
422
423 case 24:
> 424 put_unaligned_be24(offset, st->tx_data);
425 break;
426
427 default:
428 return -EINVAL;
429 }
430
431 return regmap_bulk_write(st->regmap,
432 AD4030_REG_OFFSET_CHAN(chan->address),
433 st->tx_data, AD4030_REG_OFFSET_BYTES_NB);
434 }
435
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-12-20 16:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 16:10 [PATCH v2 0/6] iio: adc: ad4030: new driver for AD4030 and similar ADCs Esteban Blanc
2024-12-19 16:10 ` [PATCH v2 1/6] dt-bindings: iio: adc: add ADI ad4030, ad4630 and ad4632 Esteban Blanc
2024-12-19 16:10 ` [PATCH v2 2/6] iio: adc: ad4030: add driver for ad4030-24 Esteban Blanc
2024-12-20 16:39 ` kernel test robot [this message]
2024-12-21 7:14 ` kernel test robot
2024-12-22 5:57 ` Marcelo Schmitt
2024-12-23 12:04 ` Jonathan Cameron
2025-01-10 14:39 ` Esteban Blanc
2025-01-16 9:56 ` Esteban Blanc
2024-12-23 12:15 ` Jonathan Cameron
2024-12-19 16:10 ` [PATCH v2 3/6] iio: adc: ad4030: add averaging support Esteban Blanc
2024-12-19 16:10 ` [PATCH v2 4/6] iio: adc: ad4030: add support for ad4630-24 and ad4630-16 Esteban Blanc
2024-12-19 16:10 ` [PATCH v2 5/6] iio: adc: ad4030: add support for ad4632-16 and ad4632-24 Esteban Blanc
2024-12-19 16:10 ` [PATCH v2 6/6] docs: iio: ad4030: add documentation Esteban Blanc
2024-12-23 12:23 ` 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=202412210010.ddQlStza-lkp@intel.com \
--to=lkp@intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=eblanc@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox