Re: [PATCH v1 2/3] iio: adc: Initial support for AD4134

kernel test robot
2025-11-14T06:48:08Z

Hi Marcelo,

kernel test robot noticed the following build errors:

[auto build test ERROR on c5411c8b9ed1caf53604bb1a5be3f487988efc98]

url: https://github.com/intel-lab-lkp/linux/commits/Marcelo-Schmitt/dt-bindings-iio-adc-Add-AD4134/20251110-204756
base: c5411c8b9ed1caf53604bb1a5be3f487988efc98
patch link: https://lore.kernel.org/r/86f532ae3a9b3f122b9d5dbada9c131a0c048ca7.1762777931.git.marcelo.schmitt%40analog.com
patch subject: [PATCH v1 2/3] iio: adc: Initial support for AD4134
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20251114/202511141221.nUo0NmMn-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251114/202511141221.nUo0NmMn-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/202511141221.nUo0NmMn-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/iio/adc/ad4134-common.c:178:6: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
178 | FIELD_PREP(AD4134_DATA_PACKET_CONFIG_FRAME_MASK,
| ^
1 error generated.

vim +/FIELD_PREP +178 drivers/iio/adc/ad4134-common.c

87
88 int ad4134_probe(struct device *dev, const struct ad4134_bus_info *bus_info)
89 {
90 bool use_internal_ldo_retulator;
91 struct gpio_desc *reset_gpio;
92 struct iio_dev *indio_dev;
93 struct ad4134_state *st;
94 int ret;
95
96 indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
97 if (!indio_dev)
98 return -ENOMEM;
99
100 st = iio_priv(indio_dev);
101 st->dev = dev;
102
103 indio_dev->name = bus_info->chip_info->name;
104
105 /* Required regulators */
106 ret = devm_regulator_bulk_get_enable(dev, 3, ad4143_regulator_names);
107 if (ret)
108 return dev_err_probe(dev, ret, "failed to enable power supplies\n");
109
110 /* Required regulator that we need to read the voltage */
111 ret = devm_regulator_get_enable_read_voltage(dev, "refin");
112 if (ret < 0)
113 return dev_err_probe(dev, ret, "failed to get REFIN voltage.\n");
114
115 st->refin_mv = ret / MILLI;
116
117 /*
118 * If ldoin is not provided, then avdd1v8, dvdd1v8, and clkvdd are
119 * required.
120 */
121 ret = devm_regulator_get_enable_optional(dev, "ldoin");
122 if (ret < 0 && ret != -ENODEV)
123 return dev_err_probe(dev, ret, "failed to enable ldoin supply\n");
124
125 use_internal_ldo_retulator = ret == 0;
126
127 if (!use_internal_ldo_retulator) {
128 ret = devm_regulator_get_enable(dev, "avdd1v8");
129 if (ret < 0)
130 return dev_err_probe(dev, ret,
131 "failed to enable avdd1v8 supply\n");
132
133 ret = devm_regulator_get_enable(dev, "dvdd1v8");
134 if (ret < 0)
135 return dev_err_probe(dev, ret,
136 "failed to enable dvdd1v8 supply\n");
137
138 ret = devm_regulator_get_enable(dev, "clkvdd");
139 if (ret < 0)
140 return dev_err_probe(dev, ret,
141 "failed to enable clkvdd supply\n");
142 }
143
144 ret = ad4134_clock_select(st);
145 if (ret)
146 return ret;
147
148 crc8_populate_msb(ad4134_spi_crc_table, AD4134_SPI_CRC_POLYNOM);
149
150 reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
151 if (IS_ERR(reset_gpio))
152 return dev_err_probe(dev, PTR_ERR(reset_gpio),
153 "failed to find reset GPIO\n");
154
155 if (reset_gpio) {
156 fsleep(AD4134_RESET_TIME_US);
157 gpiod_set_value_cansleep(reset_gpio, 0);
158 }
159
160 ret = bus_info->bops->config_iio_dev(indio_dev);
161 if (ret)
162 return dev_err_probe(dev, ret, "failed to config IIO device\n");
163
164 st->regmap = bus_info->bops->init_regmap(st);
165 if (IS_ERR(st->regmap))
166 return dev_err_probe(st->dev, PTR_ERR(st->regmap),
167 "failed to initialize regmap");
168
169 /* wiring/configuration specific setup */
170 ret = bus_info->bops->setup(st);
171 if (ret)
172 return dev_err_probe(dev, ret, "failed to setup bus\n");
173
174 /* Bump precision to 24-bit */
175 st->current_scan_type = AD4134_DATA_PACKET_24BIT_FRAME;
176 ret = regmap_update_bits(st->regmap, AD4134_DATA_PACKET_CONFIG_REG,
177 AD4134_DATA_PACKET_CONFIG_FRAME_MASK,
> 178 FIELD_PREP(AD4134_DATA_PACKET_CONFIG_FRAME_MASK,
179 st->current_scan_type));
180 if (ret)
181 return ret;
182
183 /* Set high performance power mode */
184 ret = regmap_update_bits(st->regmap, AD4134_DEVICE_CONFIG_REG,
185 AD4134_DEVICE_CONFIG_POWER_MODE_MASK,
186 FIELD_PREP(AD4134_DEVICE_CONFIG_POWER_MODE_MASK,
187 AD4134_POWER_MODE_HIGH_PERF));
188 if (ret)
189 return ret;
190
191 return devm_iio_device_register(dev, indio_dev);
192 }
193 EXPORT_SYMBOL_NS_GPL(ad4134_probe, "IIO_AD4134");
194

--
0-DAY CI Kernel Test Service