From: Peter Korsgaard <peter@korsgaard.com>
To: Grygorii Tertychnyi <grembeter@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Thomas Gleixner <tglx@linutronix.de>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
bsp-development.geo@leica-geosystems.com,
Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com>
Subject: Re: [PATCH] i2c: ocores: set IACK bit after core is enabled
Date: Sat, 18 May 2024 20:46:12 +0200 [thread overview]
Message-ID: <87wmnrnekr.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20240517191000.11390-1-grygorii.tertychnyi@leica-geosystems.com> (Grygorii Tertychnyi's message of "Fri, 17 May 2024 21:10:00 +0200")
>>>>> "Grygorii" == Grygorii Tertychnyi <grembeter@gmail.com> writes:
> Setting IACK bit when core is disabled does not clear the "Interrupt Flag"
> bit in the status register, and the interrupt remains pending.
> Sometimes it causes failure for the very first message transfer, that is
> usually a device probe.
> Hence, set IACK bit after core is enabled to clear pending interrupt.
> Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com>
I no longer have access to a device with i2c-ocores, but it sounds
sensible so:
Acked-by: Peter Korsgaard <peter@korsgaard.com>
> ---
> drivers/i2c/busses/i2c-ocores.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
> index a0af027db04c..a52f8fd4e2fe 100644
> --- a/drivers/i2c/busses/i2c-ocores.c
> +++ b/drivers/i2c/busses/i2c-ocores.c
> @@ -439,8 +439,8 @@ static int ocores_init(struct device *dev, struct ocores_i2c *i2c)
> oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8);
> /* Init the device */
> - oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
> oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN);
> + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
> return 0;
> }
> --
> 2.43.0
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2024-05-18 18:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 19:10 [PATCH] i2c: ocores: set IACK bit after core is enabled Grygorii Tertychnyi
2024-05-18 18:46 ` Peter Korsgaard [this message]
2024-05-19 5:25 ` Markus Elfring
2024-05-20 13:30 ` grygorii tertychnyi
2024-05-20 13:41 ` Andrew Lunn
2024-05-20 15:01 ` grygorii tertychnyi
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=87wmnrnekr.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=andrew@lunn.ch \
--cc=bsp-development.geo@leica-geosystems.com \
--cc=grembeter@gmail.com \
--cc=grygorii.tertychnyi@leica-geosystems.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.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