blob: d9b005f194e7e06a5e185b4dea2f5d59cc8fb2e7 [file] [log] [blame]
From c26b8bd9db771ff232f11b9f16f01d79f2c678d5 Mon Sep 17 00:00:00 2001
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: Wed, 15 Nov 2017 15:32:21 +0100
Subject: [PATCH 0426/1795] i2c: sh_mobile: make sure to not accidently trigger
STOP
The datasheet was a bit vague, but after consultation with HW designers,
we came to the conclusion that we should set the SCP bit always when
dealing only with the ICE bit. A set SCP bit is ignored, and thus fine,
a cleared one may trigger STOP on the bus.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 4ed152c4daf32d2cd4a5285f3aaca3a4c89a31fb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/i2c/busses/i2c-sh_mobile.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index c904be631db3..bc1605a31534 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -604,10 +604,10 @@ static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg,
if (do_init) {
/* Initialize channel registers */
- iic_wr(pd, ICCR, 0);
+ iic_wr(pd, ICCR, ICCR_SCP);
/* Enable channel and configure rx ack */
- iic_wr(pd, ICCR, ICCR_ICE);
+ iic_wr(pd, ICCR, ICCR_ICE | ICCR_SCP);
/* Set the clock */
iic_wr(pd, ICCL, pd->iccl & 0xff);
@@ -723,7 +723,7 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
}
/* Disable channel */
- iic_wr(pd, ICCR, 0);
+ iic_wr(pd, ICCR, ICCR_SCP);
/* Disable clock and mark device as idle */
pm_runtime_put_sync(pd->dev);
--
2.19.0