[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <VI1PR0401MB244647A8A121D6EF974A35B58F150@VI1PR0401MB2446.eurprd04.prod.outlook.com>
Date: Fri, 30 Oct 2020 11:17:25 +0000
From: "Biwen Li (OSS)" <biwen.li@....nxp.com>
To: "Biwen Li (OSS)" <biwen.li@....nxp.com>,
Oleksij Rempel <o.rempel@...gutronix.de>
CC: Leo Li <leoyang.li@....com>,
"linux@...pel-privat.de" <linux@...pel-privat.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"wsa@...-dreams.de" <wsa@...-dreams.de>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
Aisheng Dong <aisheng.dong@....com>,
Clark Wang <xiaoning.wang@....com>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jiafei Pan <jiafei.pan@....com>,
Xiaobo Xie <xiaobo.xie@....com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: RE: [v8] i2c: imx: support slave mode for imx I2C driver
> > > +/*
> > > + * Enable bus idle interrupts
> > > + * Note: IBIC register will be cleared after disabled i2c module.
> > > + */
> > > +static void i2c_imx_enable_bus_idle(struct imx_i2c_struct *i2c_imx) {
> > > + unsigned int temp;
> > > +
> > > + temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_IBIC);
> > > + temp |= IBIC_BIIE;
> > > + imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_IBIC); }
> > > +
> > > +static void i2c_imx_clr_if_bit(unsigned int status, struct
> > > +imx_i2c_struct *i2c_imx) {
> > > + status &= ~I2SR_IIF;
> > > + status |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IIF);
> > > + imx_i2c_write_reg(status, i2c_imx, IMX_I2C_I2SR); }
> > > +
> > > +/* Clear arbitration lost bit */
> > > +static void i2c_imx_clr_al_bit(unsigned int status, struct
> > > +imx_i2c_struct *i2c_imx) {
> > > + status &= ~I2SR_IAL;
> > > + status |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IAL);
> > > + imx_i2c_write_reg(status, i2c_imx, IMX_I2C_I2SR); }
> > > +
> > > +#if IS_ENABLED(CONFIG_I2C_SLAVE)
> >
> > Last year (to be more precise Date: Fri, 6 Dec 2019 08:38:20 +0100),
> > Sascha asked you to make I2C_SLAVE support not optional.
> > In the V7 of this patch you even tried to do so...
> > Please, patch drivers/i2c/busses/Kconfig and add "select I2C_SLAVE" to
> > the I2C_IMX node.
> Sure, np. Will add it in v4.
Correct it, it's v9.
> >
> > > +static irqreturn_t i2c_imx_slave_isr(struct imx_i2c_struct *i2c_imx,
> > > + unsigned int status, unsigned int ctl) {
> > > + u8 value;
> > > +
> > > + if (status & I2SR_IAL) { /* Arbitration lost */
> > > + i2c_imx_clr_al_bit(status | I2SR_IIF, i2c_imx);
> > > + } else if (status & I2SR_IAAS) { /* Addressed as a slave */
> > > + if (status & I2SR_SRW) { /* Master wants to read from us*/
> > > + dev_dbg(&i2c_imx->adapter.dev, "read requested");
> > > + i2c_slave_event(i2c_imx->slave, I2C_SLAVE_READ_REQUESTED,
> > &value);
> > > +
Powered by blists - more mailing lists