Commit 8c5013d
i2c: rcar: fix NACK handling when being a target
[ Upstream commit 093f70c ]
When this controller is a target, the NACK handling had two issues.
First, the return value from the backend was not checked on the initial
WRITE_REQUESTED. So, the driver missed to send a NACK in this case.
Also, the NACK always arrives one byte late on the bus, even in the
WRITE_RECEIVED case. This seems to be a HW issue. We should then not
rely on the backend to correctly NACK the superfluous byte as well. Fix
both issues by introducing a flag which gets set whenever the backend
requests a NACK and keep sending it until we get a STOP condition.
Fixes: de20d18 ("i2c: rcar: add slave support")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 6152c2c)1 parent 964174c commit 8c5013d
1 file changed
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
597 | 600 | | |
598 | 601 | | |
599 | 602 | | |
| 603 | + | |
600 | 604 | | |
601 | 605 | | |
602 | 606 | | |
| |||
612 | 616 | | |
613 | 617 | | |
614 | 618 | | |
615 | | - | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
616 | 623 | | |
617 | 624 | | |
618 | 625 | | |
| |||
625 | 632 | | |
626 | 633 | | |
627 | 634 | | |
| 635 | + | |
628 | 636 | | |
629 | 637 | | |
630 | 638 | | |
631 | 639 | | |
632 | 640 | | |
633 | 641 | | |
634 | | - | |
635 | | - | |
636 | 642 | | |
637 | 643 | | |
638 | | - | |
639 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
640 | 650 | | |
641 | 651 | | |
642 | 652 | | |
| |||
0 commit comments