linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFT 0/6] i2c: recovery: fix GPIO usage for recovery
@ 2018-07-13 21:09 Wolfram Sang
  2018-07-13 21:09 ` [PATCH/RFT 4/6] i2c: davinci: set SDA as output " Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2018-07-13 21:09 UTC (permalink / raw)
  To: linux-arm-kernel

I have sent the last patch of this series before, but then I realized I need to
convert all users of GPIO recovery before. I needed to make sure they all set
the SDA GPIO to output, this is what patches 3-5 are doing. Which is also good
for them because then they can send STOP at apropriate places when doing
recovery.

Then, I noticed that two drivers were not using the open drain mode for SCL
which seems like a bug to me. So, patches 1+2 address that. I'd think those two
are stable material.

Due to no hardware, I could only build test these patches. I'd be really
looking forward to comments or tests of these patches.

A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/recovery-sda-output

Thanks,

   Wolfram


Wolfram Sang (6):
  i2c: designware: use open drain for recovery GPIO
  i2c: imx: use open drain for recovery GPIO
  i2c: designware: set SDA as output for recovery
  i2c: davinci: set SDA as output for recovery
  i2c: imx: set SDA as output for recovery
  i2c: recovery: remove bogus check if SDA GPIO is set to output

 drivers/i2c/busses/i2c-davinci.c           | 3 ++-
 drivers/i2c/busses/i2c-designware-master.c | 4 ++--
 drivers/i2c/busses/i2c-imx.c               | 4 ++--
 drivers/i2c/i2c-core-base.c                | 4 +---
 4 files changed, 7 insertions(+), 8 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH/RFT 4/6] i2c: davinci: set SDA as output for recovery
  2018-07-13 21:09 [PATCH/RFT 0/6] i2c: recovery: fix GPIO usage for recovery Wolfram Sang
@ 2018-07-13 21:09 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2018-07-13 21:09 UTC (permalink / raw)
  To: linux-arm-kernel

This allows for sending STOP when generating pulses which is much more
robust because it will bring clients into a default state.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-davinci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index d945a2654c2f..478acf0870aa 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -874,7 +874,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
 			r = PTR_ERR(rinfo->scl_gpiod);
 			goto err_unuse_clocks;
 		}
-		rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
+		rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda",
+						  GPIOD_OUT_HIGH_OPEN_DRAIN);
 		if (IS_ERR(rinfo->sda_gpiod)) {
 			r = PTR_ERR(rinfo->sda_gpiod);
 			goto err_unuse_clocks;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-13 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13 21:09 [PATCH/RFT 0/6] i2c: recovery: fix GPIO usage for recovery Wolfram Sang
2018-07-13 21:09 ` [PATCH/RFT 4/6] i2c: davinci: set SDA as output " Wolfram Sang

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).