[linux-next:master 3876/11953] sound/soc/codecs/tlv320adc3xxx.c:1209:28: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'?

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

 



Hi Mark,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   71941773e143369a73c9c4a3b62fbb60736a1182
commit: 44bd27c42a1c9a00f1fbcb58301a7f3e6f5cdd0f [3876/11953] ASoC: simple-amplifier: Remove spurious gpiolib select
config: ia64-randconfig-r024-20220312 (https://download.01.org/0day-ci/archive/20220312/202203121929.ewdptOte-lkp@xxxxxxxxx/config)
compiler: ia64-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=44bd27c42a1c9a00f1fbcb58301a7f3e6f5cdd0f
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 44bd27c42a1c9a00f1fbcb58301a7f3e6f5cdd0f
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash sound/soc/codecs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   sound/soc/codecs/tlv320adc3xxx.c: In function 'adc3xxx_i2c_probe':
>> sound/soc/codecs/tlv320adc3xxx.c:1209:28: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration]
    1209 |         adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
         |                            ^~~~~~~~~~~~~~
         |                            devm_gpio_free
>> sound/soc/codecs/tlv320adc3xxx.c:1209:57: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
    1209 |         adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
         |                                                         ^~~~~~~~~~~~~
         |                                                         GPIOF_INIT_LOW
   sound/soc/codecs/tlv320adc3xxx.c:1209:57: note: each undeclared identifier is reported only once for each function it appears in
>> sound/soc/codecs/tlv320adc3xxx.c:1257:9: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration]
    1257 |         gpiod_set_value_cansleep(adc3xxx->rst_pin, 1);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
         |         gpio_set_value_cansleep
   cc1: some warnings being treated as errors


vim +1209 sound/soc/codecs/tlv320adc3xxx.c

e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1196  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1197  static int adc3xxx_i2c_probe(struct i2c_client *i2c,
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1198  			     const struct i2c_device_id *id)
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1199  {
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1200  	struct device *dev = &i2c->dev;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1201  	struct adc3xxx *adc3xxx = NULL;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1202  	int ret;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1203  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1204  	adc3xxx = devm_kzalloc(dev, sizeof(struct adc3xxx), GFP_KERNEL);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1205  	if (!adc3xxx)
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1206  		return -ENOMEM;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1207  	adc3xxx->dev = dev;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1208  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15 @1209  	adc3xxx->rst_pin = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1210  	if (IS_ERR(adc3xxx->rst_pin)) {
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1211  		return dev_err_probe(dev, PTR_ERR(adc3xxx->rst_pin),
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1212  				     "Failed to request rst_pin\n");
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1213  	}
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1214  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1215  	adc3xxx->mclk = devm_clk_get(dev, NULL);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1216  	if (IS_ERR(adc3xxx->mclk)) {
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1217  		/*
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1218  		 * The chip itself supports running off the BCLK either
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1219  		 * directly or via the PLL, but the driver does not (yet), so
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1220  		 * having a specified mclk is required. Otherwise, we could
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1221  		 * use the lack of a clocks property to indicate when BCLK is
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1222  		 * intended as the clock source.
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1223  		 */
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1224  		return dev_err_probe(dev, PTR_ERR(adc3xxx->mclk),
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1225  				     "Failed to acquire MCLK\n");
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1226  	} else if (adc3xxx->mclk) {
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1227  		ret = clk_prepare_enable(adc3xxx->mclk);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1228  		if (ret < 0)
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1229  			return ret;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1230  		dev_dbg(dev, "Enabled MCLK, freq %lu Hz\n", clk_get_rate(adc3xxx->mclk));
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1231  	}
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1232  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1233  	ret = adc3xxx_parse_dt_gpio(adc3xxx, "ti,dmdin-gpio1", &adc3xxx->gpio_cfg[0]);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1234  	if (ret < 0)
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1235  		goto err_unprepare_mclk;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1236  	ret = adc3xxx_parse_dt_gpio(adc3xxx, "ti,dmclk-gpio2", &adc3xxx->gpio_cfg[1]);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1237  	if (ret < 0)
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1238  		goto err_unprepare_mclk;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1239  	ret = adc3xxx_parse_dt_micbias(adc3xxx, "ti,micbias1-vg", &adc3xxx->micbias_vg[0]);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1240  	if (ret < 0)
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1241  		goto err_unprepare_mclk;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1242  	ret = adc3xxx_parse_dt_micbias(adc3xxx, "ti,micbias2-vg", &adc3xxx->micbias_vg[1]);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1243  	if (ret < 0)
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1244  		goto err_unprepare_mclk;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1245  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1246  	adc3xxx->regmap = devm_regmap_init_i2c(i2c, &adc3xxx_regmap);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1247  	if (IS_ERR(adc3xxx->regmap)) {
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1248  		ret = PTR_ERR(adc3xxx->regmap);
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1249  		goto err_unprepare_mclk;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1250  	}
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1251  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1252  	i2c_set_clientdata(i2c, adc3xxx);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1253  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1254  	adc3xxx->type = id->driver_data;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1255  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1256  	/* Reset codec chip */
e9a3b57efd28fe Ricard Wanderlof 2021-12-15 @1257  	gpiod_set_value_cansleep(adc3xxx->rst_pin, 1);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1258  	usleep_range(2000, 100000); /* Requirement: > 10 ns (datasheet p13) */
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1259  	gpiod_set_value_cansleep(adc3xxx->rst_pin, 0);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1260  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1261  	/* Potentially set up pins used as GPIOs */
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1262  	adc3xxx_init_gpio(adc3xxx);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1263  
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1264  	ret = snd_soc_register_component(dev,
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1265  			&soc_component_dev_adc3xxx, &adc3xxx_dai, 1);
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1266  	if (ret < 0) {
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1267  		dev_err(dev, "Failed to register codec: %d\n", ret);
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1268  		goto err_unprepare_mclk;
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1269  	}
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1270  
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1271  	return 0;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1272  
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1273  err_unprepare_mclk:
8a2d8e4fed6d58 Yang Yingliang   2021-12-23  1274  	clk_disable_unprepare(adc3xxx->mclk);
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1275  	return ret;
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1276  }
e9a3b57efd28fe Ricard Wanderlof 2021-12-15  1277  

:::::: The code at line 1209 was first introduced by commit
:::::: e9a3b57efd28fe889a98171bdc1e9e0dd7eb9a50 ASoC: codec: tlv320adc3xxx: New codec driver

:::::: TO: Ricard Wanderlof <ricardw@xxxxxxxx>
:::::: CC: Mark Brown <broonie@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux