From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org,
Chris Paterson <Chris.Paterson2@renesas.com>,
Biju Das <biju.das@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
stable@vger.kernel.org,
Ben Hutchings <ben.hutchings@codethink.co.uk>
Subject: [PATCH 1/3] i2c: rcar: don't issue stop when HW does it automatically
Date: Wed, 30 May 2018 11:07:11 +0100 [thread overview]
Message-ID: <1527674833-13122-2-git-send-email-fabrizio.castro@bp.renesas.com> (raw)
In-Reply-To: <1527674833-13122-1-git-send-email-fabrizio.castro@bp.renesas.com>
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit d89667b14f9d13b684287f6189ca209af5feee43 upstream.
The manual says (55.4.8.6) that HW does automatically send STOP after
NACK was received. My measuerments confirm that.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
[fabrizio: cherry-pick to 4.4]
Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
---
drivers/i2c/busses/i2c-rcar.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 44662e2..6f23b97 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -455,8 +455,8 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
/* Nack */
if (msr & MNR) {
- /* go to stop phase */
- rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
+ /* HW automatically sends STOP after received NACK */
+ rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_DATA);
rcar_i2c_write(priv, ICMIER, RCAR_IRQ_STOP);
rcar_i2c_flags_set(priv, ID_NACK);
goto out;
--
2.7.4
next prev parent reply other threads:[~2018-05-30 10:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 10:07 [PATCH 0/3] Fix double address byte issue Fabrizio Castro
2018-05-30 10:07 ` Fabrizio Castro [this message]
2018-05-30 10:07 ` [PATCH 2/3] i2c: rcar: check master irqs before slave irqs Fabrizio Castro
2018-05-30 10:07 ` [PATCH 3/3] i2c: rcar: revoke START request early Fabrizio Castro
2018-06-02 13:17 ` [PATCH 0/3] Fix double address byte issue Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1527674833-13122-2-git-send-email-fabrizio.castro@bp.renesas.com \
--to=fabrizio.castro@bp.renesas.com \
--cc=Chris.Paterson2@renesas.com \
--cc=ben.hutchings@codethink.co.uk \
--cc=biju.das@bp.renesas.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-i2c@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).