All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ricard Wanderlof <ricardw@axis.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: alsa-devel <alsa-devel@alsa-project.org>, kbuild-all@lists.01.org
Subject: Re: [PATCH v4 2/2] ASoC: codec: tlv320adc3xxx: New codec driver
Date: Mon, 15 Nov 2021 22:55:00 +0800	[thread overview]
Message-ID: <202111152254.YGJRjIjK-lkp@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2111091654290.24937@lnxricardw1.se.axis.com>

[-- Attachment #1: Type: text/plain, Size: 3893 bytes --]

Hi Ricard,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on v5.16-rc1 next-20211115]
[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]

url:    https://github.com/0day-ci/linux/commits/Ricard-Wanderlof/Codec-driver-for-TLV320ADC3001-and-3101/20211109-235832
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: nios2-randconfig-m031-20211115 (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0

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

smatch warnings:
sound/soc/codecs/tlv320adc3xxx.c:1002 adc3xxx_i2c_probe() warn: unsigned 'adc3xxx->rst_pin' is never less than zero.

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

   956	
   957	static int adc3xxx_i2c_probe(struct i2c_client *i2c,
   958				     const struct i2c_device_id *id)
   959	{
   960		struct device *dev = &i2c->dev;
   961		struct device_node *np = dev->of_node;
   962		struct adc3xxx *adc3xxx = NULL;
   963		enum of_gpio_flags flags;
   964		int ret;
   965	
   966		adc3xxx = devm_kzalloc(dev, sizeof(struct adc3xxx), GFP_KERNEL);
   967		if (!adc3xxx)
   968			return -ENOMEM;
   969		adc3xxx->dev = dev;
   970	
   971		adc3xxx->mclk = devm_clk_get(dev, NULL);
   972		if (IS_ERR(adc3xxx->mclk)) {
   973			/*
   974			 * The chip itself supports running off the BCLK either
   975			 * directly or via the PLL, but the driver does not (yet), so
   976			 * having a specified mclk is required. Otherwise, we could
   977			 * use the lack of a clocks property to indicate when BCLK is
   978			 * intended as the clock source.
   979			 */
   980			return PTR_ERR(adc3xxx->mclk);
   981		} else if (adc3xxx->mclk) {
   982			ret = clk_prepare_enable(adc3xxx->mclk);
   983			if (ret < 0)
   984				return ret;
   985			dev_dbg(dev, "Enabled MCLK, freq %lu Hz\n", clk_get_rate(adc3xxx->mclk));
   986		}
   987	
   988		adc3xxx_parse_dt_gpio(adc3xxx, "ti,dmdin-gpio1", &adc3xxx->gpio_cfg[0]);
   989		adc3xxx_parse_dt_gpio(adc3xxx, "ti,dmclk-gpio2", &adc3xxx->gpio_cfg[1]);
   990		adc3xxx_parse_dt_micbias(adc3xxx, "ti,micbias1-vg", &adc3xxx->micbias_vg[0]);
   991		adc3xxx_parse_dt_micbias(adc3xxx, "ti,micbias2-vg", &adc3xxx->micbias_vg[1]);
   992	
   993		adc3xxx->regmap = devm_regmap_init_i2c(i2c, &adc3xxx_regmap);
   994		if (IS_ERR(adc3xxx->regmap)) {
   995			ret = PTR_ERR(adc3xxx->regmap);
   996			return ret;
   997		}
   998	
   999		i2c_set_clientdata(i2c, adc3xxx);
  1000	
  1001		adc3xxx->rst_pin = of_get_named_gpio_flags(np, "reset-gpios", 0, &flags);
> 1002		if (adc3xxx->rst_pin < 0 || !gpio_is_valid(adc3xxx->rst_pin))
  1003			return -ENXIO;
  1004	
  1005		adc3xxx->rst_active = !(flags & OF_GPIO_ACTIVE_LOW);
  1006		adc3xxx->type = id->driver_data;
  1007	
  1008		ret = devm_gpio_request(dev, adc3xxx->rst_pin, "adc3xxx reset");
  1009		if (ret < 0) {
  1010			dev_err(dev, "Failed to request rst_pin: %d\n", ret);
  1011			return ret;
  1012		}
  1013	
  1014		/* Reset codec chip */
  1015		gpio_direction_output(adc3xxx->rst_pin, adc3xxx->rst_active);
  1016		usleep_range(2000, 100000); /* Requirement: > 10 ns (datasheet p13) */
  1017		gpio_direction_output(adc3xxx->rst_pin, !adc3xxx->rst_active);
  1018	
  1019		/* Potentially set up pins used as GPIOs */
  1020		adc3xxx_init_gpio(adc3xxx);
  1021	
  1022		ret = snd_soc_register_component(dev,
  1023				&soc_component_dev_adc3xxx, &adc3xxx_dai, 1);
  1024		if (ret < 0)
  1025			dev_err(dev, "Failed to register codec: %d\n", ret);
  1026	
  1027		return ret;
  1028	}
  1029	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35813 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v4 2/2] ASoC: codec: tlv320adc3xxx: New codec driver
Date: Mon, 15 Nov 2021 22:55:00 +0800	[thread overview]
Message-ID: <202111152254.YGJRjIjK-lkp@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2111091654290.24937@lnxricardw1.se.axis.com>

[-- Attachment #1: Type: text/plain, Size: 3994 bytes --]

Hi Ricard,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on v5.16-rc1 next-20211115]
[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]

url:    https://github.com/0day-ci/linux/commits/Ricard-Wanderlof/Codec-driver-for-TLV320ADC3001-and-3101/20211109-235832
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: nios2-randconfig-m031-20211115 (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0

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

smatch warnings:
sound/soc/codecs/tlv320adc3xxx.c:1002 adc3xxx_i2c_probe() warn: unsigned 'adc3xxx->rst_pin' is never less than zero.

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

   956	
   957	static int adc3xxx_i2c_probe(struct i2c_client *i2c,
   958				     const struct i2c_device_id *id)
   959	{
   960		struct device *dev = &i2c->dev;
   961		struct device_node *np = dev->of_node;
   962		struct adc3xxx *adc3xxx = NULL;
   963		enum of_gpio_flags flags;
   964		int ret;
   965	
   966		adc3xxx = devm_kzalloc(dev, sizeof(struct adc3xxx), GFP_KERNEL);
   967		if (!adc3xxx)
   968			return -ENOMEM;
   969		adc3xxx->dev = dev;
   970	
   971		adc3xxx->mclk = devm_clk_get(dev, NULL);
   972		if (IS_ERR(adc3xxx->mclk)) {
   973			/*
   974			 * The chip itself supports running off the BCLK either
   975			 * directly or via the PLL, but the driver does not (yet), so
   976			 * having a specified mclk is required. Otherwise, we could
   977			 * use the lack of a clocks property to indicate when BCLK is
   978			 * intended as the clock source.
   979			 */
   980			return PTR_ERR(adc3xxx->mclk);
   981		} else if (adc3xxx->mclk) {
   982			ret = clk_prepare_enable(adc3xxx->mclk);
   983			if (ret < 0)
   984				return ret;
   985			dev_dbg(dev, "Enabled MCLK, freq %lu Hz\n", clk_get_rate(adc3xxx->mclk));
   986		}
   987	
   988		adc3xxx_parse_dt_gpio(adc3xxx, "ti,dmdin-gpio1", &adc3xxx->gpio_cfg[0]);
   989		adc3xxx_parse_dt_gpio(adc3xxx, "ti,dmclk-gpio2", &adc3xxx->gpio_cfg[1]);
   990		adc3xxx_parse_dt_micbias(adc3xxx, "ti,micbias1-vg", &adc3xxx->micbias_vg[0]);
   991		adc3xxx_parse_dt_micbias(adc3xxx, "ti,micbias2-vg", &adc3xxx->micbias_vg[1]);
   992	
   993		adc3xxx->regmap = devm_regmap_init_i2c(i2c, &adc3xxx_regmap);
   994		if (IS_ERR(adc3xxx->regmap)) {
   995			ret = PTR_ERR(adc3xxx->regmap);
   996			return ret;
   997		}
   998	
   999		i2c_set_clientdata(i2c, adc3xxx);
  1000	
  1001		adc3xxx->rst_pin = of_get_named_gpio_flags(np, "reset-gpios", 0, &flags);
> 1002		if (adc3xxx->rst_pin < 0 || !gpio_is_valid(adc3xxx->rst_pin))
  1003			return -ENXIO;
  1004	
  1005		adc3xxx->rst_active = !(flags & OF_GPIO_ACTIVE_LOW);
  1006		adc3xxx->type = id->driver_data;
  1007	
  1008		ret = devm_gpio_request(dev, adc3xxx->rst_pin, "adc3xxx reset");
  1009		if (ret < 0) {
  1010			dev_err(dev, "Failed to request rst_pin: %d\n", ret);
  1011			return ret;
  1012		}
  1013	
  1014		/* Reset codec chip */
  1015		gpio_direction_output(adc3xxx->rst_pin, adc3xxx->rst_active);
  1016		usleep_range(2000, 100000); /* Requirement: > 10 ns (datasheet p13) */
  1017		gpio_direction_output(adc3xxx->rst_pin, !adc3xxx->rst_active);
  1018	
  1019		/* Potentially set up pins used as GPIOs */
  1020		adc3xxx_init_gpio(adc3xxx);
  1021	
  1022		ret = snd_soc_register_component(dev,
  1023				&soc_component_dev_adc3xxx, &adc3xxx_dai, 1);
  1024		if (ret < 0)
  1025			dev_err(dev, "Failed to register codec: %d\n", ret);
  1026	
  1027		return ret;
  1028	}
  1029	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35813 bytes --]

  reply	other threads:[~2021-11-15 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 15:55 [PATCH v4 2/2] ASoC: codec: tlv320adc3xxx: New codec driver Ricard Wanderlof
2021-11-15 14:55 ` kernel test robot [this message]
2021-11-15 14:55   ` kernel test robot

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=202111152254.YGJRjIjK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=lgirdwood@gmail.com \
    --cc=ricardw@axis.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.