-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overlays: Factor out the common i2c bus selection #6636
Conversation
FYI I'm most interested in feedback for the first commit, since that makes real changes to the resulting configuration. I'm happy to bear the burden for verifying the changes made by the second, but confirmation that the overall scheme looks okay would be nice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One rogue space, but otherwise looks fine.
(The edt-ft5x06 include had my head hurting for a bit)
I think the patch order will mean that some of the overlays will be functionally broken for bisection purposes if using i2c0 or 10 - they appear to drop enabling i2c0mux and i2c0if, which gets added back in with the second patch. Otherwise those cleanups all look reasonable. |
When using i2c0, some overlays enabled i2c0mux and i2c0if while others didn't. It looks I've chosen the wrong option (kind of obvious now looking at some of the dts files). I'll rework it the other way - not a big change. |
A few small improvements, with a view to making the updated overlays behave the same before and after the big conversion. Signed-off-by: Phil Elwell <[email protected]>
Create an i2c-buses.dtsi to hold all of the common I2C bus selection logic, and refactor existing overlays to use it. This patch should have no functional change overall except to increase the range of options for some overlays. There is a slightly ugly mechanism for overriding the default bus, where the mux nodes may or may not need to be enabled. Signed-off-by: Phil Elwell <[email protected]>
Updated to address the feedback. With a fixed (not nobbled) ovmerge, a test script that compares the results of applying all the old parameters to each updated overlay before and after the second commit finds zero differences. Therefore I think that if you're happy with the new first commit then its safe to merge. |
Looks good to me. I wonder if the original i2c0 support predated the mux, hence some i2c0 options didn't worry about it. |
For some reason, that's what I was expecting it to do. |
This PR reduces some of the duplication in I2C overlays, factoring out the bus selection parameters into a .dtsi file. To allow for easier comparison and to improve the codebase, the first commit fixes a few minor problems with the old versions of the overlays. The second commit rewrites them to use the dtsi file, a step which is essentially cosmetic.
The README is also updated, moving the common parameters into a pseudo-overlay called
i2c-bus
. Overlays that use these common parameters are shown as supporting the parameteri2c-bus
, whose documentation refers the user to the common documentation.