All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Clark Wang <xiaoning.wang@nxp.com>
Cc: conor.culhane@silvaco.com, alexandre.belloni@bootlin.com,
	vitor.soares@synopsys.com, boris.brezillon@bootlin.com,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] i3c: master: svc: set ODSTOP to let I2C device see the STOP signal
Date: Fri, 16 Jul 2021 00:57:37 +0200	[thread overview]
Message-ID: <20210716005737.49760d66@xps13> (raw)
In-Reply-To: <20210715082413.3042149-5-xiaoning.wang@nxp.com>

Hi Clark,

Clark Wang <xiaoning.wang@nxp.com> wrote on Thu, 15 Jul 2021 16:24:13
+0800:

> If using I2C/I3C mixed mode, need to set ODSTOP. Otherwise, the I2C
> devices cannot see the stop signal. It may cause message sending errors.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

> 
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> ---
>  drivers/i3c/master/svc-i3c-master.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index 892e57fec4b0..b05cc7f521e6 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -449,7 +449,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  	struct i3c_device_info info = {};
>  	unsigned long fclk_rate, fclk_period_ns;
>  	unsigned int high_period_ns, od_low_period_ns;
> -	u32 ppbaud, pplow, odhpp, odbaud, i2cbaud, reg;
> +	u32 ppbaud, pplow, odhpp, odbaud, odstop, i2cbaud, reg;
>  	int ret;
>  
>  	/* Timings derivation */
> @@ -479,6 +479,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  	switch (bus->mode) {
>  	case I3C_BUS_MODE_PURE:
>  		i2cbaud = 0;
> +		odstop = 0;
>  		break;
>  	case I3C_BUS_MODE_MIXED_FAST:
>  	case I3C_BUS_MODE_MIXED_LIMITED:
> @@ -487,6 +488,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  		 * between the high and low period does not really matter.
>  		 */
>  		i2cbaud = DIV_ROUND_UP(1000, od_low_period_ns) - 2;
> +		odstop = 1;
>  		break;
>  	case I3C_BUS_MODE_MIXED_SLOW:
>  		/*
> @@ -494,6 +496,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  		 * constraints as the FM+ mode.
>  		 */
>  		i2cbaud = DIV_ROUND_UP(2500, od_low_period_ns) - 2;
> +		odstop = 1;
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -502,7 +505,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  	reg = SVC_I3C_MCONFIG_MASTER_EN |
>  	      SVC_I3C_MCONFIG_DISTO(0) |
>  	      SVC_I3C_MCONFIG_HKEEP(0) |
> -	      SVC_I3C_MCONFIG_ODSTOP(0) |
> +	      SVC_I3C_MCONFIG_ODSTOP(odstop) |
>  	      SVC_I3C_MCONFIG_PPBAUD(ppbaud) |
>  	      SVC_I3C_MCONFIG_PPLOW(pplow) |
>  	      SVC_I3C_MCONFIG_ODBAUD(odbaud) |




Thanks,
Miquèl

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Clark Wang <xiaoning.wang@nxp.com>
Cc: conor.culhane@silvaco.com, alexandre.belloni@bootlin.com,
	vitor.soares@synopsys.com, boris.brezillon@bootlin.com,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] i3c: master: svc: set ODSTOP to let I2C device see the STOP signal
Date: Fri, 16 Jul 2021 00:57:37 +0200	[thread overview]
Message-ID: <20210716005737.49760d66@xps13> (raw)
In-Reply-To: <20210715082413.3042149-5-xiaoning.wang@nxp.com>

Hi Clark,

Clark Wang <xiaoning.wang@nxp.com> wrote on Thu, 15 Jul 2021 16:24:13
+0800:

> If using I2C/I3C mixed mode, need to set ODSTOP. Otherwise, the I2C
> devices cannot see the stop signal. It may cause message sending errors.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

> 
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> ---
>  drivers/i3c/master/svc-i3c-master.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index 892e57fec4b0..b05cc7f521e6 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -449,7 +449,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  	struct i3c_device_info info = {};
>  	unsigned long fclk_rate, fclk_period_ns;
>  	unsigned int high_period_ns, od_low_period_ns;
> -	u32 ppbaud, pplow, odhpp, odbaud, i2cbaud, reg;
> +	u32 ppbaud, pplow, odhpp, odbaud, odstop, i2cbaud, reg;
>  	int ret;
>  
>  	/* Timings derivation */
> @@ -479,6 +479,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  	switch (bus->mode) {
>  	case I3C_BUS_MODE_PURE:
>  		i2cbaud = 0;
> +		odstop = 0;
>  		break;
>  	case I3C_BUS_MODE_MIXED_FAST:
>  	case I3C_BUS_MODE_MIXED_LIMITED:
> @@ -487,6 +488,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  		 * between the high and low period does not really matter.
>  		 */
>  		i2cbaud = DIV_ROUND_UP(1000, od_low_period_ns) - 2;
> +		odstop = 1;
>  		break;
>  	case I3C_BUS_MODE_MIXED_SLOW:
>  		/*
> @@ -494,6 +496,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  		 * constraints as the FM+ mode.
>  		 */
>  		i2cbaud = DIV_ROUND_UP(2500, od_low_period_ns) - 2;
> +		odstop = 1;
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -502,7 +505,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m)
>  	reg = SVC_I3C_MCONFIG_MASTER_EN |
>  	      SVC_I3C_MCONFIG_DISTO(0) |
>  	      SVC_I3C_MCONFIG_HKEEP(0) |
> -	      SVC_I3C_MCONFIG_ODSTOP(0) |
> +	      SVC_I3C_MCONFIG_ODSTOP(odstop) |
>  	      SVC_I3C_MCONFIG_PPBAUD(ppbaud) |
>  	      SVC_I3C_MCONFIG_PPLOW(pplow) |
>  	      SVC_I3C_MCONFIG_ODBAUD(odbaud) |




Thanks,
Miquèl

  reply	other threads:[~2021-07-15 22:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  8:24 [PATCH 0/4] i3c: master: svc: some bug fixes Clark Wang
2021-07-15  8:24 ` Clark Wang
2021-07-15  8:24 ` [PATCH 1/4] i3c: master: svc: move module reset behind clk enable Clark Wang
2021-07-15  8:24   ` Clark Wang
2021-07-15 22:51   ` Miquel Raynal
2021-07-15 22:51     ` Miquel Raynal
2021-07-15  8:24 ` [PATCH 2/4] i3c: master: svc: fix atomic issue Clark Wang
2021-07-15  8:24   ` Clark Wang
2021-07-15 22:52   ` Miquel Raynal
2021-07-15 22:52     ` Miquel Raynal
2021-07-16  1:58     ` Clark Wang
2021-07-16  1:58       ` Clark Wang
2021-07-15  8:24 ` [PATCH 3/4] i3c: master: svc: add support for slave to stop returning data Clark Wang
2021-07-15  8:24   ` Clark Wang
2021-07-15 22:55   ` Miquel Raynal
2021-07-15 22:55     ` Miquel Raynal
2021-07-16  1:53     ` Clark Wang
2021-07-16  1:53       ` Clark Wang
2021-07-15  8:24 ` [PATCH 4/4] i3c: master: svc: set ODSTOP to let I2C device see the STOP signal Clark Wang
2021-07-15  8:24   ` Clark Wang
2021-07-15 22:57   ` Miquel Raynal [this message]
2021-07-15 22:57     ` Miquel Raynal
2021-07-16  7:51 ` [PATCH 0/4] i3c: master: svc: some bug fixes Miquel Raynal
2021-07-16  7:51   ` Miquel Raynal
2021-07-16  8:07   ` Clark Wang
2021-07-16  8:07     ` Clark Wang

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=20210716005737.49760d66@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=conor.culhane@silvaco.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vitor.soares@synopsys.com \
    --cc=xiaoning.wang@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.