Hi Biwen,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v5.9]
[cannot apply to wsa/i2c/for-next next-20201016]
[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/Biwen-Li/i2c-imx-support-slave-m...
base: bbf5c979011a099af5dc76498918ed7df445635b
config: arm-randconfig-r004-20201019 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
094e9f4779eb9b5c6a49014f2f80b8cbb833572f)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
#
https://github.com/0day-ci/linux/commit/afe1305a21d6e88b2c015cf62f84893cd...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Biwen-Li/i2c-imx-support-slave-mode-for-imx-I2C-driver/20201016-163639
git checkout afe1305a21d6e88b2c015cf62f84893cd9c462d5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> drivers/i2c/busses/i2c-imx.c:667:4: error: implicit declaration
of function 'i2c_slave_event' [-Werror,-Wimplicit-function-declaration]
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_REQUESTED,
&value);
^
> drivers/i2c/busses/i2c-imx.c:667:36: error: use of undeclared
identifier 'I2C_SLAVE_READ_REQUESTED'
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_REQUESTED, &value);
^
drivers/i2c/busses/i2c-imx.c:677:4: error: implicit declaration of function
'i2c_slave_event' [-Werror,-Wimplicit-function-declaration]
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_REQUESTED,
&value);
^
> drivers/i2c/busses/i2c-imx.c:677:36: error: use of undeclared
identifier 'I2C_SLAVE_WRITE_REQUESTED'
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_REQUESTED, &value);
^
drivers/i2c/busses/i2c-imx.c:688:4: error: implicit declaration of function
'i2c_slave_event' [-Werror,-Wimplicit-function-declaration]
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_RECEIVED,
&value);
^
> drivers/i2c/busses/i2c-imx.c:688:36: error: use of undeclared
identifier 'I2C_SLAVE_WRITE_RECEIVED'
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_RECEIVED, &value);
^
drivers/i2c/busses/i2c-imx.c:692:4: error: implicit declaration of function
'i2c_slave_event' [-Werror,-Wimplicit-function-declaration]
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_STOP,
&value);
^
> drivers/i2c/busses/i2c-imx.c:692:36: error: use of undeclared
identifier 'I2C_SLAVE_STOP'
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_STOP, &value);
^
drivers/i2c/busses/i2c-imx.c:698:3: error: implicit declaration of function
'i2c_slave_event' [-Werror,-Wimplicit-function-declaration]
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_PROCESSED,
&value);
^
> drivers/i2c/busses/i2c-imx.c:698:35: error: use of undeclared
identifier 'I2C_SLAVE_READ_PROCESSED'
i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_PROCESSED, &value);
^
> drivers/i2c/busses/i2c-imx.c:1301:3: error: field designator
'reg_slave' does not refer to any field in type 'const struct
i2c_algorithm'
.reg_slave = i2c_imx_reg_slave,
^
> drivers/i2c/busses/i2c-imx.c:1302:3: error: field designator
'unreg_slave' does not refer to any field in type 'const struct
i2c_algorithm'
.unreg_slave = i2c_imx_unreg_slave,
^
12 errors generated.
vim +/i2c_slave_event +667 drivers/i2c/busses/i2c-imx.c
656
657 static irqreturn_t i2c_imx_slave_isr(struct imx_i2c_struct *i2c_imx,
658 unsigned int status, unsigned int ctl)
659 {
660 u8 value;
661
662 if (status & I2SR_IAL) { /* Arbitration lost */
663 i2c_imx_clr_al_bit(status | I2SR_IIF, i2c_imx);
664 } else if (status & I2SR_IAAS) { /* Addressed as a slave */
665 if (status & I2SR_SRW) { /* Master wants to read from us*/
666 dev_dbg(&i2c_imx->adapter.dev, "read requested");
667 i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_REQUESTED,
&value);
668
669 /* Slave transmit */
670 ctl |= I2CR_MTX;
671 imx_i2c_write_reg(ctl, i2c_imx, IMX_I2C_I2CR);
672
673 /* Send data */
674 imx_i2c_write_reg(value, i2c_imx, IMX_I2C_I2DR);
675 } else { /* Master wants to write to us */
676 dev_dbg(&i2c_imx->adapter.dev, "write requested");
677 i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_REQUESTED,
&value);
678
679 /* Slave receive */
680 ctl &= ~I2CR_MTX;
681 imx_i2c_write_reg(ctl, i2c_imx, IMX_I2C_I2CR);
682 /* Dummy read */
683 imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
684 }
685 } else if (!(ctl & I2CR_MTX)) { /* Receive mode */
686 if (status & I2SR_IBB) { /* No STOP signal detected */
687 value = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
688 i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_RECEIVED,
&value);
689 } else { /* STOP signal is detected */
690 dev_dbg(&i2c_imx->adapter.dev,
691 "STOP signal detected");
692 i2c_slave_event(i2c_imx->slave, I2C_SLAVE_STOP,
&value);
693 }
694 } else if (!(status & I2SR_RXAK)) { /* Transmit mode received ACK */
695 ctl |= I2CR_MTX;
696 imx_i2c_write_reg(ctl, i2c_imx, IMX_I2C_I2CR);
697
698 i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_PROCESSED,
&value);
699
700 imx_i2c_write_reg(value, i2c_imx, IMX_I2C_I2DR);
701 } else { /* Transmit mode received NAK */
702 ctl &= ~I2CR_MTX;
703 imx_i2c_write_reg(ctl, i2c_imx, IMX_I2C_I2CR);
704 imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
705 }
706
707 return IRQ_HANDLED;
708 }
709
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org