[PATCH] i2c: imx: fix emulated smbus block read
Carlos Song
carlos.song at nxp.com
Tue May 27 18:50:51 PDT 2025
> -----Original Message-----
> From: KUCHARCZYK Lukasz <lukasz.kucharczyk at leica-geosystems.com>
> Sent: Tuesday, May 27, 2025 8:03 PM
> To: Carlos Song <carlos.song at nxp.com>; Oleksij Rempel
> <o.rempel at pengutronix.de>; stefan.eichenberger at toradex.com; Pengutronix
> Kernel Team <kernel at pengutronix.de>; Andi Shyti <andi.shyti at kernel.org>;
> Shawn Guo <shawnguo at kernel.org>; Sascha Hauer <s.hauer at pengutronix.de>;
> Fabio Estevam <festevam at gmail.com>
> Cc: open list:FREESCALE IMX I2C DRIVER <linux-i2c at vger.kernel.org>; open
> list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE <imx at lists.linux.dev>;
> moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
> <linux-arm-kernel at lists.infradead.org>; open list
> <linux-kernel at vger.kernel.org>; GEO-CHHER-bsp-development
> <bsp-development.geo at leica-geosystems.com>;
> customers.leicageo at pengutronix.de
> Subject: [EXT] RE: [PATCH] i2c: imx: fix emulated smbus block read
>
> [You don't often get email from lukasz.kucharczyk at leica-geosystems.com.
> Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> > -----Original Message-----
> > From: Carlos Song <carlos.song at nxp.com>
> > Sent: 27 May 2025 12:46
> > Subject: RE: [PATCH] i2c: imx: fix emulated smbus block read
> >
> > I2C SMBUS block read need first read one byte from data length offset
> > then I2C will know how many bytes need to continue read. For this
> > issue you can meet " Error: Read failed " when using i2cget -f -y bus address
> offset s to test.
> >
> > So you apply this change to make i2c-imx controller can behavior like this:
> >
> > S Addr Wr [A] Comm [A] Sr Addr Rd [A] [Count] A [Data] A [Data] A ...
> > A [Data] NA P
> >
> > Do I understand this right?
>
> hi Carlos; thanks for the message! Yes, exactly, that's correct.
>
> I run into this issue while trying to integrate a smart battery into a IMX8-based
> system. Fetching of properties that rely on data block read operation (i.e.,
> ManufacturerName, DeviceName, DeviceChemistry and
> ManufacturerData) was failing.
>
> With the fix the block read looks just like you described.
>
>
> Without the fix, the transaction on the bus looked somehow like:
> S Addr Wr [A] Comm [A] Sr Addr Rd [A] [Count] NA [0xff] NA [0xff] NA ... [0xff]
> NA P
>
> (i.e., the Count is not acknowledged and SDA remains high afterwards).
>
Good, thank you for your work!
Reviewed-by: Carlos Song <carlos.song at nxp.com>
> Lukasz
More information about the linux-arm-kernel
mailing list