Skip to content
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

6 chip selects on SPI0 #6635

Draft
wants to merge 3 commits into
base: rpi-6.6.y
Choose a base branch
from
Draft

Conversation

jsarrett
Copy link
Contributor

I need 6 chip selects on a custom board of mine, and I'm sure someone else out there might also need more than 2, but I'm not at all sure if this is the right way to implement this. It's kinda ugly that we have to have a separate dts for every possible number of CS# lines. Looking for feedback/ideas.

This patch adds the shtc3 device tree parameters to the i2c-sensors
overlay.  The shtc3 driver needs no other configuration parameters, as the
i2c address is permanently baked in to the silicon.
@jsarrett jsarrett marked this pull request as draft January 27, 2025 07:25
@jsarrett jsarrett force-pushed the spi_cs branch 3 times, most recently from 92597c4 to 6e0024f Compare January 27, 2025 09:05
@pelwell
Copy link
Contributor

pelwell commented Jan 28, 2025

I'm not keen on the way you've changed the GPIO for CS1 to suit your application - that could cause some confusion.

Whether there's a cleaner way to implement this is an interesting question. It would be pretty easy to write an overlay that adds a single spidev at position n, but patching up the cs-gpios is harder to do piecewise like this because I can't see how to patch at the property at varying offsets derived from the assigned value, and it's not possible to just append to an existing property.

Perhaps the cleanest way to do this would be to have one underlying implementation .dtsi that can conditionally add any of the spidevs controlled by macros, then make each spi0-ncs overlay include the implementation with different macro flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants