Re: [PATCH] i2c: designware: return proper fault codes
From: Mika Westerberg
Date: Thu Nov 05 2026 - 00:48:06 EST
On Tue, Nov 03, 2026 at 06:12:16PM +0200, Dmitry Guzman wrote:
> I2C documentation Documentation/i2c/fault-codes.rst defines fault codes
> for different negative results in I2C transmittion. Previously,
> i2c-designware driver didn't implement them properly - it returned
> EREMOTEIO on NACK either on address or data phase instead of ENXIO and
> EIO respectively, and EINVAL instead of EOPNOTSUPP if a message cannot be
> sent due to controller hardware limitations.
>
> To comply with the documentation, return the proper fault codes for
> different conditions, namely:
>
> - EOPNOTSUPP if the controller cannot transfer the message sequence
> requested (for example, target address change without STOP condition)
> - ENXIO if target address is not acknowledged
> - EIO on other faults detected by controller (for example, NACK on data)
>
> Signed-off-by: Dmitry Guzman <Dmitry.Guzman@xxxxxxxxxxxx>
Acked-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>