Re: [PATCH v2 2/2] iio: dac: support the ad8460 Waveform DAC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mariel,

kernel test robot noticed the following build errors:

[auto build test ERROR on 9900e7a54764998ba3a22f06ec629f7b5fe0b422]

url:    https://github.com/intel-lab-lkp/linux/commits/Mariel-Tinaco/dt-bindings-iio-dac-add-docs-for-ad8460/20240730-112724
base:   9900e7a54764998ba3a22f06ec629f7b5fe0b422
patch link:    https://lore.kernel.org/r/20240730030509.57834-3-Mariel.Tinaco%40analog.com
patch subject: [PATCH v2 2/2] iio: dac: support the ad8460 Waveform DAC
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20240802/202408021737.KMIdEjmt-lkp@xxxxxxxxx/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240802/202408021737.KMIdEjmt-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408021737.KMIdEjmt-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   drivers/iio/dac/ad8460.c: In function 'ad8460_dac_input_read':
>> drivers/iio/dac/ad8460.c:159:15: error: implicit declaration of function 'ad8460_get_hvdac_word' [-Werror=implicit-function-declaration]
     159 |         ret = ad8460_get_hvdac_word(state, private, &reg);
         |               ^~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c:163:35: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat=]
     163 |         return sysfs_emit(buf, "%ld\n", reg);
         |                                 ~~^     ~~~
         |                                   |     |
         |                                   |     unsigned int
         |                                   long int
         |                                 %d
   drivers/iio/dac/ad8460.c: In function 'ad8460_dac_input_write':
   drivers/iio/dac/ad8460.c:176:30: warning: passing argument 2 of 'kstrtou32' makes integer from pointer without a cast [-Wint-conversion]
     176 |         ret = kstrtou32(buf, &reg);
         |                              ^~~~
         |                              |
         |                              unsigned int *
   In file included from include/linux/kernel.h:25,
                    from include/linux/clk.h:13,
                    from drivers/iio/dac/ad8460.c:10:
   include/linux/kstrtox.h:84:70: note: expected 'unsigned int' but argument is of type 'unsigned int *'
      84 | static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
         |                                                         ~~~~~~~~~~~~~^~~~
>> drivers/iio/dac/ad8460.c:176:15: error: too few arguments to function 'kstrtou32'
     176 |         ret = kstrtou32(buf, &reg);
         |               ^~~~~~~~~
   include/linux/kstrtox.h:84:32: note: declared here
      84 | static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
         |                                ^~~~~~~~~
>> drivers/iio/dac/ad8460.c:182:16: error: implicit declaration of function 'ad8460_set_hvdac_word' [-Werror=implicit-function-declaration]
     182 |         return ad8460_set_hvdac_word(state, private, reg);
         |                ^~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c: In function 'ad8460_write_symbol':
   drivers/iio/dac/ad8460.c:211:30: warning: passing argument 2 of 'kstrtou16' makes integer from pointer without a cast [-Wint-conversion]
     211 |         ret = kstrtou16(buf, &sym);
         |                              ^~~~
         |                              |
         |                              bool * {aka _Bool *}
   include/linux/kstrtox.h:94:56: note: expected 'unsigned int' but argument is of type 'bool *' {aka '_Bool *'}
      94 | int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
         |                                           ~~~~~~~~~~~~~^~~~
>> drivers/iio/dac/ad8460.c:211:15: error: too few arguments to function 'kstrtou16'
     211 |         ret = kstrtou16(buf, &sym);
         |               ^~~~~~~~~
   include/linux/kstrtox.h:94:18: note: declared here
      94 | int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
         |                  ^~~~~~~~~
   drivers/iio/dac/ad8460.c: In function 'ad8460_write_toggle_en':
   drivers/iio/dac/ad8460.c:249:30: warning: passing argument 2 of 'kstrtou16' makes integer from pointer without a cast [-Wint-conversion]
     249 |         ret = kstrtou16(buf, &toggle_en);
         |                              ^~~~~~~~~~
         |                              |
         |                              bool * {aka _Bool *}
   include/linux/kstrtox.h:94:56: note: expected 'unsigned int' but argument is of type 'bool *' {aka '_Bool *'}
      94 | int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
         |                                           ~~~~~~~~~~~~~^~~~
   drivers/iio/dac/ad8460.c:249:15: error: too few arguments to function 'kstrtou16'
     249 |         ret = kstrtou16(buf, &toggle_en);
         |               ^~~~~~~~~
   include/linux/kstrtox.h:94:18: note: declared here
      94 | int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
         |                  ^~~~~~~~~
   drivers/iio/dac/ad8460.c: At top level:
>> drivers/iio/dac/ad8460.c:335:12: error: static declaration of 'ad8460_get_hvdac_word' follows non-static declaration
     335 | static int ad8460_get_hvdac_word(struct ad8460_state *state,
         |            ^~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c:159:15: note: previous implicit declaration of 'ad8460_get_hvdac_word' with type 'int()'
     159 |         ret = ad8460_get_hvdac_word(state, private, &reg);
         |               ^~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c: In function 'ad8460_get_hvdac_word':
>> drivers/iio/dac/ad8460.c:346:16: error: implicit declaration of function 'get_unaligned_le16' [-Werror=implicit-function-declaration]
     346 |         *val = get_unaligned_le16(state->spi_tx_buf);
         |                ^~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c: At top level:
>> drivers/iio/dac/ad8460.c:351:12: error: static declaration of 'ad8460_set_hvdac_word' follows non-static declaration
     351 | static int ad8460_set_hvdac_word(struct ad8460_state *state,
         |            ^~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c:182:16: note: previous implicit declaration of 'ad8460_set_hvdac_word' with type 'int()'
     182 |         return ad8460_set_hvdac_word(state, private, reg);
         |                ^~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c: In function 'ad8460_set_hvdac_word':
>> drivers/iio/dac/ad8460.c:355:9: error: implicit declaration of function 'put_unaligned_le16' [-Werror=implicit-function-declaration]
     355 |         put_unaligned_le16(val & 0x3FFF, &state->spi_tx_buf);
         |         ^~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad8460.c: In function 'ad8460_probe':
>> drivers/iio/dac/ad8460.c:855:15: error: implicit declaration of function 'devm_regulator_get_enable_read_voltage'; did you mean 'devm_regulator_get_enable_optional'? [-Werror=implicit-function-declaration]
     855 |         ret = devm_regulator_get_enable_read_voltage(&spi->dev, "refio_1p2v");
         |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |               devm_regulator_get_enable_optional
>> drivers/iio/dac/ad8460.c:859:57: error: 'vrefio' undeclared (first use in this function)
     859 |                 return dev_err_probe(&spi->dev, PTR_ERR(vrefio),
         |                                                         ^~~~~~
   drivers/iio/dac/ad8460.c:859:57: note: each undeclared identifier is reported only once for each function it appears in
   drivers/iio/dac/ad8460.c:819:27: warning: unused variable 'refio_1p2v' [-Wunused-variable]
     819 |         struct regulator *refio_1p2v;
         |                           ^~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/ad8460_get_hvdac_word +159 drivers/iio/dac/ad8460.c

   149	
   150	static ssize_t ad8460_dac_input_read(struct iio_dev *indio_dev,
   151					     uintptr_t private,
   152					     const struct iio_chan_spec *chan,
   153					     char *buf)
   154	{
   155		struct ad8460_state *state = iio_priv(indio_dev);
   156		unsigned int reg;
   157		int ret;
   158	
 > 159		ret = ad8460_get_hvdac_word(state, private, &reg);
   160		if (ret)
   161			return ret;
   162	
   163		return sysfs_emit(buf, "%ld\n", reg);
   164	}
   165	
   166	static ssize_t ad8460_dac_input_write(struct iio_dev *indio_dev,
   167					      uintptr_t private,
   168					      const struct iio_chan_spec *chan,
   169					      const char *buf,
   170					      size_t len)
   171	{
   172		struct ad8460_state *state = iio_priv(indio_dev);
   173		unsigned int reg;
   174		int ret;
   175	
 > 176		ret = kstrtou32(buf, &reg);
   177		if (ret)
   178			return ret;
   179	
   180		guard(mutex)(&state->lock);
   181	
 > 182		return ad8460_set_hvdac_word(state, private, reg);
   183	}
   184	
   185	static ssize_t ad8460_read_symbol(struct iio_dev *indio_dev,
   186					  uintptr_t private,
   187					  const struct iio_chan_spec *chan,
   188					  char *buf)
   189	{
   190		struct ad8460_state *state = iio_priv(indio_dev);
   191		unsigned int reg;
   192		int ret;
   193	
   194		ret = regmap_read(state->regmap, AD8460_CTRL_REG(0x02), &reg);
   195		if (ret)
   196			return ret;
   197	
   198		return sysfs_emit(buf, "%ld\n", FIELD_GET(AD8460_PATTERN_DEPTH_MSK, reg));
   199	}
   200	
   201	static ssize_t ad8460_write_symbol(struct iio_dev *indio_dev,
   202					   uintptr_t private,
   203					   const struct iio_chan_spec *chan,
   204					   const char *buf,
   205					   size_t len)
   206	{
   207		struct ad8460_state *state = iio_priv(indio_dev);
   208		bool sym;
   209		int ret;
   210	
 > 211		ret = kstrtou16(buf, &sym);
   212		if (ret)
   213			return ret;
   214	
   215		guard(mutex)(&state->lock);
   216	
   217		return regmap_update_bits(state->regmap,
   218					  AD8460_CTRL_REG(0x02),
   219					  AD8460_PATTERN_DEPTH_MSK,
   220					  FIELD_PREP(AD8460_PATTERN_DEPTH_MSK, sym));
   221	}
   222	
   223	static ssize_t ad8460_read_toggle_en(struct iio_dev *indio_dev,
   224					     uintptr_t private,
   225					     const struct iio_chan_spec *chan,
   226					     char *buf)
   227	{
   228		struct ad8460_state *state = iio_priv(indio_dev);
   229		unsigned int reg;
   230		int ret;
   231	
   232		ret = regmap_read(state->regmap, AD8460_CTRL_REG(0x02), &reg);
   233		if (ret)
   234			return ret;
   235	
   236		return sysfs_emit(buf, "%ld\n", FIELD_GET(AD8460_APG_MODE_ENABLE_MSK, reg));
   237	}
   238	
   239	static ssize_t ad8460_write_toggle_en(struct iio_dev *indio_dev,
   240					      uintptr_t private,
   241					      const struct iio_chan_spec *chan,
   242					      const char *buf,
   243					      size_t len)
   244	{
   245		struct ad8460_state *state = iio_priv(indio_dev);
   246		bool toggle_en;
   247		int ret;
   248	
   249		ret = kstrtou16(buf, &toggle_en);
   250		if (ret)
   251			return ret;
   252	
   253		iio_device_claim_direct_scoped(return -EBUSY, indio_dev)
   254			return ad8460_enable_apg_mode(state, toggle_en);
   255		unreachable();
   256	}
   257	
   258	static ssize_t ad8460_read_powerdown(struct iio_dev *indio_dev,
   259					     uintptr_t private,
   260					     const struct iio_chan_spec *chan,
   261					     char *buf)
   262	{
   263		struct ad8460_state *state = iio_priv(indio_dev);
   264		unsigned int reg;
   265		int ret;
   266	
   267		ret = regmap_read(state->regmap, AD8460_CTRL_REG(0x01), &reg);
   268		if (ret)
   269			return ret;
   270	
   271		return sysfs_emit(buf, "%ld\n", FIELD_GET(AD8460_HVDAC_SLEEP_MSK, reg));
   272	}
   273	
   274	static ssize_t ad8460_write_powerdown(struct iio_dev *indio_dev,
   275					      uintptr_t private,
   276					      const struct iio_chan_spec *chan,
   277					      const char *buf,
   278					      size_t len)
   279	{
   280		struct ad8460_state *state = iio_priv(indio_dev);
   281		bool pwr_down;
   282		u64 sdn_flag;
   283		int ret;
   284	
   285		ret = kstrtobool(buf, &pwr_down);
   286		if (ret)
   287			return ret;
   288	
   289		guard(mutex)(&state->lock);
   290	
   291		ret = regmap_update_bits(state->regmap, AD8460_CTRL_REG(0x01),
   292					 AD8460_HVDAC_SLEEP_MSK,
   293					 FIELD_PREP(AD8460_HVDAC_SLEEP_MSK, pwr_down));
   294		if (ret)
   295			return ret;
   296	
   297		if (!pwr_down) {
   298			ret = ad8460_read_shutdown_flag(state, &sdn_flag);
   299			if (ret)
   300				return ret;
   301	
   302			if (sdn_flag) {
   303				ret = ad8460_hv_reset(state);
   304				if (ret)
   305					return ret;
   306			}
   307		}
   308	
   309		ret = regmap_update_bits(state->regmap, AD8460_CTRL_REG(0x00),
   310					 AD8460_HV_SLEEP_MSK,
   311					 FIELD_PREP(AD8460_HV_SLEEP_MSK, !pwr_down));
   312		if (ret)
   313			return ret;
   314	
   315		return len;
   316	}
   317	
   318	static const char * const ad8460_powerdown_modes[] = {
   319		"three_state",
   320	};
   321	
   322	static int ad8460_get_powerdown_mode(struct iio_dev *indio_dev,
   323					     const struct iio_chan_spec *chan)
   324	{
   325		return 0;
   326	}
   327	
   328	static int ad8460_set_powerdown_mode(struct iio_dev *indio_dev,
   329					     const struct iio_chan_spec *chan,
   330					     unsigned int type)
   331	{
   332		return 0;
   333	}
   334	
 > 335	static int ad8460_get_hvdac_word(struct ad8460_state *state,
   336					 int index,
   337					 int *val)
   338	{
   339		int ret;
   340	
   341		ret = regmap_bulk_read(state->regmap, AD8460_HVDAC_DATA_WORD_LOW(index),
   342				       &state->spi_tx_buf, AD8460_DATA_BYTE_WORD_LENGTH);
   343		if (ret)
   344			return ret;
   345	
 > 346		*val = get_unaligned_le16(state->spi_tx_buf);
   347	
   348		return ret;
   349	}
   350	
 > 351	static int ad8460_set_hvdac_word(struct ad8460_state *state,
   352					 int index,
   353					 int val)
   354	{
 > 355		put_unaligned_le16(val & 0x3FFF, &state->spi_tx_buf);
   356	
   357		return regmap_bulk_write(state->regmap, AD8460_HVDAC_DATA_WORD_LOW(index),
   358					 state->spi_tx_buf, AD8460_DATA_BYTE_WORD_LENGTH);
   359	}
   360	

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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux