From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org, cerg2010cerg2010@mail.ru
Cc: linux-renesas-soc@vger.kernel.org,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
dri-devel@lists.freedesktop.org
Subject: [RFT] i2c: algos: bit: prepare/unprepare before sending initial STOP
Date: Fri, 15 Jun 2018 14:17:23 +0900 [thread overview]
Message-ID: <20180615051723.7193-1-wsa+renesas@sang-engineering.com> (raw)
Some adapters need to be prepared/unprepared before bitbanging the bus.
Do this for the initial STOP, too.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Ok, another idea to fix the regression. I'm not 100% sure if the placement is
perfect, but it should serve well enough as a proof of concept to see if this
is the actual issue. It looks promising, though.
drivers/i2c/algos/i2c-algo-bit.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 4a34f311e1ff..fab4437ecbb5 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -648,10 +648,19 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap,
adap->quirks = &i2c_bit_quirk_no_clk_stretch;
/* Bring bus to a known state. Looks like STOP if bus is not free yet */
+ if (bit_adap->pre_xfer) {
+ ret = bit_adap->pre_xfer(adap);
+ if (ret < 0)
+ return ret;
+ }
+
setscl(bit_adap, 1);
udelay(bit_adap->udelay);
setsda(bit_adap, 1);
+ if (bit_adap->post_xfer)
+ bit_adap->post_xfer(adap);
+
ret = add_adapter(adap);
if (ret < 0)
return ret;
--
2.11.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2018-06-15 5:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 5:17 Wolfram Sang [this message]
2018-06-15 8:25 ` [RFT] i2c: algos: bit: prepare/unprepare before sending initial STOP Sergei Shtylyov
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=20180615051723.7193-1-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=cerg2010cerg2010@mail.ru \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
/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).