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-imx_v6_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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://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=gcc-9.3.0 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 error/warnings (new ones prefixed by >>):
drivers/i2c/busses/i2c-imx.c: In function 'i2c_imx_slave_isr':
> drivers/i2c/busses/i2c-imx.c:667:4: error: implicit declaration
of function 'i2c_slave_event' [-Werror=implicit-function-declaration]
667 | i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_REQUESTED, &value);
| ^~~~~~~~~~~~~~~
> drivers/i2c/busses/i2c-imx.c:667:36: error:
'I2C_SLAVE_READ_REQUESTED' undeclared (first use in this function)
667
| i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_REQUESTED, &value);
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-imx.c:667:36: note: each undeclared identifier is reported only
once for each function it appears in
> drivers/i2c/busses/i2c-imx.c:677:36: error:
'I2C_SLAVE_WRITE_REQUESTED' undeclared (first use in this function)
677
| i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_REQUESTED, &value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/i2c/busses/i2c-imx.c:688:36: error:
'I2C_SLAVE_WRITE_RECEIVED' undeclared (first use in this function)
688
| i2c_slave_event(i2c_imx->slave, I2C_SLAVE_WRITE_RECEIVED, &value);
| ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/i2c/busses/i2c-imx.c:692:36: error:
'I2C_SLAVE_STOP' undeclared (first use in this function); did you mean
'I2C_M_STOP'?
692 | i2c_slave_event(i2c_imx->slave,
I2C_SLAVE_STOP, &value);
| ^~~~~~~~~~~~~~
| I2C_M_STOP
> drivers/i2c/busses/i2c-imx.c:698:35: error:
'I2C_SLAVE_READ_PROCESSED' undeclared (first use in this function)
698
| i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_PROCESSED, &value);
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-imx.c: At top level:
> drivers/i2c/busses/i2c-imx.c:1301:3: error: 'const struct
i2c_algorithm' has no member named 'reg_slave'
1301 | .reg_slave =
i2c_imx_reg_slave,
| ^~~~~~~~~
> drivers/i2c/busses/i2c-imx.c:1301:15: warning: excess elements in
struct initializer
1301 | .reg_slave = i2c_imx_reg_slave,
| ^~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-imx.c:1301:15: note: (near initialization for
'i2c_imx_algo')
> drivers/i2c/busses/i2c-imx.c:1302:3: error: 'const struct
i2c_algorithm' has no member named 'unreg_slave'
1302 |
.unreg_slave = i2c_imx_unreg_slave,
| ^~~~~~~~~~~
drivers/i2c/busses/i2c-imx.c:1302:17: warning: excess elements in struct initializer
1302 | .unreg_slave = i2c_imx_unreg_slave,
| ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-imx.c:1302:17: note: (near initialization for
'i2c_imx_algo')
cc1: some warnings being treated as errors
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