Re: [PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-30 Thread Wolfram Sang
On Thu, Aug 22, 2019 at 05:45:17PM +0800, Hsin-Yi Wang wrote: > When doing i2cdetect quick write mode, we would get transfer > error ENOMEM, and i2cdetect shows there's no device at the address. > Quoting from mt8183 datasheet, the number of transfers to be > transferred in one transaction should b

Re: [PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-23 Thread Qii Wang
On Fri, 2019-08-23 at 16:13 +0800, Hsin-Yi Wang wrote: > On Fri, Aug 23, 2019 at 4:09 PM Qii Wang wrote: > > > > > > > static u32 mtk_i2c_functionality(struct i2c_adapter *adap) > > > { > > > - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; > > > + if (adap->quirks->flags & I2C_AQ_NO_ZERO_L

Re: [PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-23 Thread Hsin-Yi Wang
On Fri, Aug 23, 2019 at 4:09 PM Qii Wang wrote: > > > > static u32 mtk_i2c_functionality(struct i2c_adapter *adap) > > { > > - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; > > + if (adap->quirks->flags & I2C_AQ_NO_ZERO_LEN) > > + return I2C_FUNC_I2C | > > +

Re: [PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-23 Thread Qii Wang
On Thu, 2019-08-22 at 17:45 +0800, Hsin-Yi Wang wrote: > When doing i2cdetect quick write mode, we would get transfer > error ENOMEM, and i2cdetect shows there's no device at the address. > Quoting from mt8183 datasheet, the number of transfers to be > transferred in one transaction should be set t

[PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-22 Thread Hsin-Yi Wang
When doing i2cdetect quick write mode, we would get transfer error ENOMEM, and i2cdetect shows there's no device at the address. Quoting from mt8183 datasheet, the number of transfers to be transferred in one transaction should be set to bigger than 1, so we should forbid zero-length transfer and u