From: kernel test robot <lkp@intel.com>
To: Mike Looijmans <mike.looijmans@topic.nl>,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
Mike Looijmans <mike.looijmans@topic.nl>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Caleb Connolly <caleb.connolly@linaro.org>,
ChiYuan Huang <cy_huang@richtek.com>,
ChiaEn Wu <chiaen_wu@richtek.com>,
Cosmin Tanislav <demonsingur@gmail.com>,
Ibrahim Tilki <Ibrahim.Tilki@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Ramona Bolboaca <ramona.bolboaca@analog.com>,
William Breathitt Gray <william.gray@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: Add TI ADS1100 and ADS1000
Date: Mon, 27 Feb 2023 23:47:08 +0800 [thread overview]
Message-ID: <202302272311.tpyMXtCV-lkp@intel.com> (raw)
In-Reply-To: <20230227133255.32301-2-mike.looijmans@topic.nl>
Hi Mike,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v6.2]
[cannot apply to jic23-iio/togreg linus/master next-20230227]
[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/Mike-Looijmans/iio-adc-Add-TI-ADS1100-and-ADS1000/20230227-213529
patch link: https://lore.kernel.org/r/20230227133255.32301-2-mike.looijmans%40topic.nl
patch subject: [PATCH v2 2/2] iio: adc: Add TI ADS1100 and ADS1000
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20230227/202302272311.tpyMXtCV-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/8bc0b6e697641a7c6274a492bf210faccdeb55bf
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Mike-Looijmans/iio-adc-Add-TI-ADS1100-and-ADS1000/20230227-213529
git checkout 8bc0b6e697641a7c6274a492bf210faccdeb55bf
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/iio/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202302272311.tpyMXtCV-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/iio/adc/ti-ads1100.c: In function 'ads1100_data_bits':
>> drivers/iio/adc/ti-ads1100.c:87:39: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
87 | return ads1100_data_rate_bits[FIELD_GET(ADS1100_DR_MASK, data->config)];
| ^~~~~~~~~
| FOLL_GET
drivers/iio/adc/ti-ads1100.c: In function 'ads1100_set_data_rate':
>> drivers/iio/adc/ti-ads1100.c:156:41: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
156 | FIELD_PREP(ADS1100_DR_MASK, i));
| ^~~~~~~~~~
cc1: some warnings being treated as errors
vim +87 drivers/iio/adc/ti-ads1100.c
84
85 static int ads1100_data_bits(struct ads1100_data *data)
86 {
> 87 return ads1100_data_rate_bits[FIELD_GET(ADS1100_DR_MASK, data->config)];
88 }
89
90 static int ads1100_get_adc_result(struct ads1100_data *data, int chan, int *val)
91 {
92 int ret;
93 __be16 buffer;
94 s16 value;
95
96 if (chan != 0)
97 return -EINVAL;
98
99 ret = pm_runtime_resume_and_get(&data->client->dev);
100 if (ret < 0)
101 return ret;
102
103 ret = i2c_master_recv(data->client, (char *)&buffer, sizeof(buffer));
104
105 pm_runtime_mark_last_busy(&data->client->dev);
106 pm_runtime_put_autosuspend(&data->client->dev);
107
108 if (ret < 0) {
109 dev_err(&data->client->dev, "I2C read fail: %d\n", ret);
110 return ret;
111 }
112
113 /* Value is always 16-bit 2's complement */
114 value = be16_to_cpu(buffer);
115 /* Shift result to compensate for bit resolution vs. sample rate */
116 value <<= 16 - ads1100_data_bits(data);
117 *val = sign_extend32(value, 15);
118
119 return 0;
120 }
121
122 static int ads1100_set_scale(struct ads1100_data *data, int val, int val2)
123 {
124 int microvolts;
125 int gain;
126 int i;
127
128 /* With Vdd between 2.7 and 5V, the scale is always below 1 */
129 if (val)
130 return -EINVAL;
131
132 microvolts = regulator_get_voltage(data->reg_vdd);
133 /* Calculate: gain = ((microvolts / 1000) / (val2 / 1000000)) >> 15 */
134 gain = ((microvolts + BIT(14)) >> 15) * 1000 / val2;
135
136 for (i = 0; i < 4; i++) {
137 if (BIT(i) == gain) {
138 ads1100_set_config_bits(data, ADS1100_PGA_MASK, i);
139 return 0;
140 }
141 }
142
143 return -EINVAL;
144 }
145
146 static int ads1100_set_data_rate(struct ads1100_data *data, int chan, int rate)
147 {
148 unsigned int i;
149 unsigned int size;
150
151 size = data->supports_data_rate ? ARRAY_SIZE(ads1100_data_rate) : 1;
152 for (i = 0; i < size; ++i) {
153 if (ads1100_data_rate[i] == rate) {
154 return ads1100_set_config_bits(
155 data, ADS1100_DR_MASK,
> 156 FIELD_PREP(ADS1100_DR_MASK, i));
157 }
158 }
159
160 return -EINVAL;
161 }
162
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-02-27 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 13:32 [PATCH v2 1/2] dt-bindings: iio: adc: Add TI ADS1100 and ADS1000 Mike Looijmans
2023-02-27 13:32 ` [PATCH v2 2/2] " Mike Looijmans
2023-02-27 15:47 ` kernel test robot [this message]
2023-02-27 22:47 ` Andy Shevchenko
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=202302272311.tpyMXtCV-lkp@intel.com \
--to=lkp@intel.com \
--cc=Ibrahim.Tilki@analog.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=caleb.connolly@linaro.org \
--cc=chiaen_wu@richtek.com \
--cc=cy_huang@richtek.com \
--cc=demonsingur@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.looijmans@topic.nl \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=ramona.bolboaca@analog.com \
--cc=william.gray@linaro.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;
as well as URLs for NNTP newsgroup(s).