public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: jacopo mondi <jacopo@jmondi.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH RFT] i2c: sh_mobile: make sure to not accidently trigger STOP
Date: Fri, 17 Nov 2017 11:05:10 +0100	[thread overview]
Message-ID: <20171117100510.GF4668@w540> (raw)
In-Reply-To: <20171115143221.30618-1-wsa+renesas@sang-engineering.com>

Hi Wolfram,

On Wed, Nov 15, 2017 at 03:32:21PM +0100, Wolfram Sang wrote:
> 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>
> ---
>
> Jacopo: another to test, please. On top of all the other patches. Thank you!

and for this one as well, on Migo-R no visible regressions. I2c sensor
probes properly, and I can capture images.

Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Thanks
  j

>
>  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 9012d5f8fb38b8..c2841a4f5807c0 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.11.0
>

  reply	other threads:[~2017-11-17 10:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 14:32 [PATCH RFT] i2c: sh_mobile: make sure to not accidently trigger STOP Wolfram Sang
2017-11-17 10:05 ` jacopo mondi [this message]
2017-11-27 17:57 ` Wolfram Sang

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=20171117100510.GF4668@w540 \
    --to=jacopo@jmondi.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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