Skip to content

i2c: rockchip: De-initialize the bus after start bit failure#194

Merged
samueldr merged 1 commit intoTow-Boot:developmentfrom
antoniprzybylik:i2cfix
Nov 8, 2022
Merged

i2c: rockchip: De-initialize the bus after start bit failure#194
samueldr merged 1 commit intoTow-Boot:developmentfrom
antoniprzybylik:i2cfix

Conversation

@antoniprzybylik
Copy link
Contributor

Failure can happen when i2c is used without initializing pinctrl properly, which U-Boot happily allows. Without this fix, further I2C access would fail, even after proper pinctrl initialization.

This is based on megi's u-boot (see
https://xff.cz/git/u-boot/commit/?h=ppp&id=ccb804db1753958a33e7a6e55c52b3b04e4754e9)

It compiles, but I did not test it on real hardware yet.

Antoni Przybylik

@antoniprzybylik
Copy link
Contributor Author

antoniprzybylik commented Sep 22, 2022

I've just tested it, it works.

@ghost
Copy link

ghost commented Oct 29, 2022

Hi there, just wondering how this was tested? I'm just curious haha

@antoniprzybylik
Copy link
Contributor Author

I booted up the phone and it did not crash -- that's the test.

@ghost
Copy link

ghost commented Oct 30, 2022

How did you test that this patch does anything at all? Booting the device is one thing but testing if that actual patch does anything is another. I'm just curious.

@antoniprzybylik
Copy link
Contributor Author

It's not my patch. It's taken from megi's u-boot -- https://xff.cz/git/u-boot/commit/?h=ppp&id=ccb804db1753958a33e7a6e55c52b3b04e4754e9 .

I wrote to megi about proximity sensor not working, he directed me to the patch on his u-boot branch which fixes this issue. I thought I would also want to have this in tow-boot so I ported this patch to tow-boot -- #195 . But megi mentioned he has more bugs fixed in his u-boot branch so I ported also some other patches from his u-boot to tow-boot.

I didn't do any elaborate tests -- I just made sure that tow-boot doesn't crash. Except for this proximity sensor -- it was better tested -- it actually starts to work after my patch.

@ghost
Copy link

ghost commented Oct 31, 2022

Awesome cool ty :)

@samueldr samueldr changed the base branch from released to development November 1, 2022 02:21
@samueldr
Copy link
Contributor

samueldr commented Nov 1, 2022

Hi, will look in the coming days/weeks. Just changed the target branch to development.

Don't worry about the odd commits showing up from that, it'll all be fine in due time.

@samueldr samueldr added this to the 2022.07-006 milestone Nov 3, 2022
@samueldr samueldr changed the base branch from development to released November 4, 2022 02:26
@samueldr samueldr changed the base branch from released to development November 4, 2022 02:26
@samueldr
Copy link
Contributor

samueldr commented Nov 4, 2022

github was being silly and wouldn't update the commit listing without forcing some event on the PR...

@samueldr
Copy link
Contributor

samueldr commented Nov 8, 2022

Hi! Merging this soon, fixing the other batch of changes and will re-test combined.

I force-pushed these changes:

  • synced to latest development
  • dropped the vendored patch and use fetchpatch since it applies
  • rephrased the commit name

BTW, some of it is on me: there's no contributor guide, no way for you to know how to name your commits :).

Failure can happen when i2c is used without initializing pinctrl properly,
which U-Boot happily allows. Without this fix, further I2C access would
fail, even after proper pinctrl initialization.

Signed-off-by: Antoni Przybylik <antoni.przybylik@wp.pl>
Co-authored-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
@samueldr samueldr merged commit d842c78 into Tow-Boot:development Nov 8, 2022
@samueldr
Copy link
Contributor

samueldr commented Nov 8, 2022

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants