diff options
| author | Hans Hu <hanshu-oc@zhaoxin.com> | 2024-04-08 10:54:46 +0800 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@kernel.org> | 2024-05-06 00:56:45 +0200 |
| commit | 2e829ccc2779d4ea47050a2f41e7531a247a46e5 (patch) | |
| tree | 38f8ed857121ac93dd10bf0dfa78324f85569600 /drivers/i2c/busses/i2c-viai2c-common.h | |
| parent | 013fa161a4b584e416b98a31c6fda67753e9d7b8 (diff) | |
| download | linux-2e829ccc2779d4ea47050a2f41e7531a247a46e5.tar.gz linux-2e829ccc2779d4ea47050a2f41e7531a247a46e5.tar.bz2 linux-2e829ccc2779d4ea47050a2f41e7531a247a46e5.zip | |
i2c: wmt: fix a bug when thread blocked
During each byte access, the host performs clock stretching.
To reduce the host performs clock stretching, move most of
the per-msg processing to the interrupt context.
Suggested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Hu <hanshu-oc@zhaoxin.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-viai2c-common.h')
| -rw-r--r-- | drivers/i2c/busses/i2c-viai2c-common.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-viai2c-common.h b/drivers/i2c/busses/i2c-viai2c-common.h index 28799e7e97f0..c92e054ac7e7 100644 --- a/drivers/i2c/busses/i2c-viai2c-common.h +++ b/drivers/i2c/busses/i2c-viai2c-common.h @@ -58,11 +58,13 @@ struct viai2c { struct clk *clk; u16 tcr; int irq; - u16 cmd_status; + u16 xfered_len; + struct i2c_msg *msg; + int ret; + bool last; }; int viai2c_wait_bus_not_busy(struct viai2c *i2c); -int viai2c_check_status(struct viai2c *i2c); int viai2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num); int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c); |
