Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271082 > unrolled thread

sound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of function 'i2c_master_send'

Started bykbuild test robot <fengguang.wu@intel.com>
First post2015-11-17 12:10 +0100
Last post2015-11-17 17:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  sound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of  function 'i2c_master_send' kbuild test robot <fengguang.wu@intel.com> - 2015-11-17 12:10 +0100
    Re: sound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of  function 'i2c_master_send' Vinod Koul <vinod.koul@intel.com> - 2015-11-17 17:50 +0100

#1271082 — sound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of function 'i2c_master_send'

Fromkbuild test robot <fengguang.wu@intel.com>
Date2015-11-17 12:10 +0100
Subjectsound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of function 'i2c_master_send'
Message-ID<qvMj7-4ds-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8005c49d9aea74d382f474ce11afbbc7d7130bec
commit: 624729fd51871bfbddb647764f180126789a29ee ASoC: Intel: Skylake - Add Skylake RT286 I2S machine driver
date:   4 weeks ago
config: x86_64-randconfig-s5-11171804 (attached as .config)
reproduce:
        git checkout 624729fd51871bfbddb647764f180126789a29ee
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   sound/soc/codecs/rl6347a.c: In function 'rl6347a_hw_write':
>> sound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of function 'i2c_master_send' [-Werror=implicit-function-declaration]
     ret = i2c_master_send(client, data, 4);
           ^
   sound/soc/codecs/rl6347a.c: In function 'rl6347a_hw_read':
>> sound/soc/codecs/rl6347a.c:114:8: error: implicit declaration of function 'i2c_transfer' [-Werror=implicit-function-declaration]
     ret = i2c_transfer(client->adapter, xfer, 2);
           ^
   cc1: some warnings being treated as errors
--
>> sound/soc/codecs/rt286.c:1269:1: warning: data definition has no type or storage class
    module_i2c_driver(rt286_i2c_driver);
    ^
>> sound/soc/codecs/rt286.c:1269:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]
>> sound/soc/codecs/rt286.c:1269:1: warning: parameter names (without types) in function declaration
>> sound/soc/codecs/rt286.c:1259:26: warning: 'rt286_i2c_driver' defined but not used [-Wunused-variable]
    static struct i2c_driver rt286_i2c_driver = {
                             ^
   cc1: some warnings being treated as errors

vim +/i2c_master_send +66 sound/soc/codecs/rl6347a.c

bc08f96b Oder Chiou 2015-06-12   60  	 * 12 bit VID: value should be 0
bc08f96b Oder Chiou 2015-06-12   61  	 * So we use an OR operator to handle it rather than use if condition.
bc08f96b Oder Chiou 2015-06-12   62  	 */
bc08f96b Oder Chiou 2015-06-12   63  	data[2] = ((reg >> 8) & 0xff) | ((value >> 8) & 0xff);
bc08f96b Oder Chiou 2015-06-12   64  	data[3] = value & 0xff;
bc08f96b Oder Chiou 2015-06-12   65  
bc08f96b Oder Chiou 2015-06-12  @66  	ret = i2c_master_send(client, data, 4);
bc08f96b Oder Chiou 2015-06-12   67  
bc08f96b Oder Chiou 2015-06-12   68  	if (ret == 4)
bc08f96b Oder Chiou 2015-06-12   69  		return 0;
bc08f96b Oder Chiou 2015-06-12   70  	else
bc08f96b Oder Chiou 2015-06-12   71  		pr_err("ret=%d\n", ret);
bc08f96b Oder Chiou 2015-06-12   72  	if (ret < 0)
bc08f96b Oder Chiou 2015-06-12   73  		return ret;
bc08f96b Oder Chiou 2015-06-12   74  	else
bc08f96b Oder Chiou 2015-06-12   75  		return -EIO;
bc08f96b Oder Chiou 2015-06-12   76  }
bc08f96b Oder Chiou 2015-06-12   77  EXPORT_SYMBOL_GPL(rl6347a_hw_write);
bc08f96b Oder Chiou 2015-06-12   78  
bc08f96b Oder Chiou 2015-06-12   79  int rl6347a_hw_read(void *context, unsigned int reg, unsigned int *value)
bc08f96b Oder Chiou 2015-06-12   80  {
bc08f96b Oder Chiou 2015-06-12   81  	struct i2c_client *client = context;
bc08f96b Oder Chiou 2015-06-12   82  	struct i2c_msg xfer[2];
bc08f96b Oder Chiou 2015-06-12   83  	int ret;
bc08f96b Oder Chiou 2015-06-12   84  	__be32 be_reg;
bc08f96b Oder Chiou 2015-06-12   85  	unsigned int index, vid, buf = 0x0;
bc08f96b Oder Chiou 2015-06-12   86  
bc08f96b Oder Chiou 2015-06-12   87  	/* handle index registers */
bc08f96b Oder Chiou 2015-06-12   88  	if (reg <= 0xff) {
bc08f96b Oder Chiou 2015-06-12   89  		rl6347a_hw_write(client, RL6347A_COEF_INDEX, reg);
bc08f96b Oder Chiou 2015-06-12   90  		reg = RL6347A_PROC_COEF;
bc08f96b Oder Chiou 2015-06-12   91  	}
bc08f96b Oder Chiou 2015-06-12   92  
bc08f96b Oder Chiou 2015-06-12   93  	reg = reg | 0x80000;
bc08f96b Oder Chiou 2015-06-12   94  	vid = (reg >> 8) & 0xfff;
bc08f96b Oder Chiou 2015-06-12   95  
bc08f96b Oder Chiou 2015-06-12   96  	if (AC_VERB_GET_AMP_GAIN_MUTE == (vid & 0xf00)) {
bc08f96b Oder Chiou 2015-06-12   97  		index = (reg >> 8) & 0xf;
bc08f96b Oder Chiou 2015-06-12   98  		reg = (reg & ~0xf0f) | index;
bc08f96b Oder Chiou 2015-06-12   99  	}
bc08f96b Oder Chiou 2015-06-12  100  	be_reg = cpu_to_be32(reg);
bc08f96b Oder Chiou 2015-06-12  101  
bc08f96b Oder Chiou 2015-06-12  102  	/* Write register */
bc08f96b Oder Chiou 2015-06-12  103  	xfer[0].addr = client->addr;
bc08f96b Oder Chiou 2015-06-12  104  	xfer[0].flags = 0;
bc08f96b Oder Chiou 2015-06-12  105  	xfer[0].len = 4;
bc08f96b Oder Chiou 2015-06-12  106  	xfer[0].buf = (u8 *)&be_reg;
bc08f96b Oder Chiou 2015-06-12  107  
bc08f96b Oder Chiou 2015-06-12  108  	/* Read data */
bc08f96b Oder Chiou 2015-06-12  109  	xfer[1].addr = client->addr;
bc08f96b Oder Chiou 2015-06-12  110  	xfer[1].flags = I2C_M_RD;
bc08f96b Oder Chiou 2015-06-12  111  	xfer[1].len = 4;
bc08f96b Oder Chiou 2015-06-12  112  	xfer[1].buf = (u8 *)&buf;
bc08f96b Oder Chiou 2015-06-12  113  
bc08f96b Oder Chiou 2015-06-12 @114  	ret = i2c_transfer(client->adapter, xfer, 2);
bc08f96b Oder Chiou 2015-06-12  115  	if (ret < 0)
bc08f96b Oder Chiou 2015-06-12  116  		return ret;
bc08f96b Oder Chiou 2015-06-12  117  	else if (ret != 2)

:::::: The code at line 66 was first introduced by commit
:::::: bc08f96b5fa783132c278d7a48a1c18feca5813f ASoC: rt286: Add RL6347A class device shared support for RT286

:::::: TO: Oder Chiou <oder_chiou@realtek.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [next] | [standalone]


#1271411

FromVinod Koul <vinod.koul@intel.com>
Date2015-11-17 17:50 +0100
Message-ID<qvRC9-7wq-7@gated-at.bofh.it>
In reply to#1271082
On Tue, Nov 17, 2015 at 07:07:28PM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   8005c49d9aea74d382f474ce11afbbc7d7130bec
> commit: 624729fd51871bfbddb647764f180126789a29ee ASoC: Intel: Skylake - Add Skylake RT286 I2S machine driver
> date:   4 weeks ago
> config: x86_64-randconfig-s5-11171804 (attached as .config)
> reproduce:
>         git checkout 624729fd51871bfbddb647764f180126789a29ee
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All error/warnings (new ones prefixed by >>):
> 
>    sound/soc/codecs/rl6347a.c: In function 'rl6347a_hw_write':
> >> sound/soc/codecs/rl6347a.c:66:8: error: implicit declaration of function 'i2c_master_send' [-Werror=implicit-function-declaration]
>      ret = i2c_master_send(client, data, 4);
>            ^
>    sound/soc/codecs/rl6347a.c: In function 'rl6347a_hw_read':
> >> sound/soc/codecs/rl6347a.c:114:8: error: implicit declaration of function 'i2c_transfer' [-Werror=implicit-function-declaration]
>      ret = i2c_transfer(client->adapter, xfer, 2);
>            ^
>    cc1: some warnings being treated as errors
> --
> >> sound/soc/codecs/rt286.c:1269:1: warning: data definition has no type or storage class
>     module_i2c_driver(rt286_i2c_driver);
>     ^
> >> sound/soc/codecs/rt286.c:1269:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]
> >> sound/soc/codecs/rt286.c:1269:1: warning: parameter names (without types) in function declaration
> >> sound/soc/codecs/rt286.c:1259:26: warning: 'rt286_i2c_driver' defined but not used [-Wunused-variable]
>     static struct i2c_driver rt286_i2c_driver = {
>                              ^
>    cc1: some warnings being treated as errors

Thanks for reporting this, I was able to verify and looks like the config
does not have I2C selected, so the driver does not find this symbol.

Also I noticed, i2c core defines i2c_master_send() APIs as extern, so not
having I2C causes failure.

I did try adding depends on I2C on rl6347a but that does not help as rt286
starts not compiling which incidently depends on I2C but was selected by SKL
machine

So finalled added depends on SKL machine, will send that out

Thanks
-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web