Skip to content

overlays: sc16is75x: Fix spi1 cs-gpios #6964

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

Closed

Conversation

nbuchwitz
Copy link
Contributor

Native cs is somewhat broken on spi1 (see [1]), so re-add the explicit cs-gpios definition, as was done before in sc16is752-spi1-overlay.

Fixes #6962

[1] torvalds/linux@519f2c2

@nbuchwitz
Copy link
Contributor Author

This is a potential fix for #6962

@pelwell
Copy link
Contributor

pelwell commented Jul 19, 2025

That's not going to work - you can either build up the cs-gpios property one cell at a time, or add a dormant fragment that is enabled by this override (which feels a bit cleaner).

@nbuchwitz nbuchwitz force-pushed the devel/fix-sc1675x-spi1 branch from 7329e83 to f98f4f0 Compare July 22, 2025 08:05
@nbuchwitz nbuchwitz marked this pull request as ready for review July 22, 2025 08:07
@nbuchwitz
Copy link
Contributor Author

I've updated the PR with a different approach and tested it successfully with the bespoke waveshare board

@nbuchwitz
Copy link
Contributor Author

@pelwell can you please re-trigger the builds, so the reporter can verify this too? Thanks.

@nbuchwitz
Copy link
Contributor Author

nbuchwitz commented Jul 22, 2025

Another thought: Do we want to have this fixup in each and every overlay targeting spi1 or would it make more sense to leave it to the spi1-[123]cs overlays? mcp251xfd-overlay.dts for example assumes that spi is correctly configured by the spi overlays.

In case of the sc1675x on spi1:

dtoverlay=spi1-1cs,cs0_spidev=off
dtoverlay=sc16is75x-spi,sc16is752,spi1-0,int_pin=24

(the cs0_spidev=off is probably something which can be done in the downstream overlays though)

Native cs is somewhat broken on spi1 (see [1]), so re-add the explicit
cs-gpios definition, as was done before in sc16is752-spi1-overlay.

Fixes raspberrypi#6962

[1] torvalds/linux@519f2c2

Signed-off-by: Nicolai Buchwitz <[email protected]>
@nbuchwitz nbuchwitz force-pushed the devel/fix-sc1675x-spi1 branch from f98f4f0 to f1c00a6 Compare July 22, 2025 09:24
@pelwell
Copy link
Contributor

pelwell commented Jul 23, 2025

What about 1.1, 1.2, 2.0, etc.?

@nbuchwitz
Copy link
Contributor Author

What about 1.1, 1.2, 2.0, etc.?

Guess they are broken as before ("backwards compatibility")? I mean they could be added to the overlay, but imho the split between the spi overlays and device overlay would be a cleaner and more maintenance friendly approach? I was also thinking about a dtsi shared between different spi device overlays, but still lots of boilerplate code in each ...

@pelwell
Copy link
Contributor

pelwell commented Aug 12, 2025

Having had a proper chance to look at this, I'm not convinced this patch is enough to solve the problem.

As well as enabling CS GPIOs, the old sc16is752-spi1 overlay, like the spi1-<n>cs overlays, enables the SPI1 controller node and selects the correct ALT function on GPIOs 19-21. It also enables the AUX resets block (needed for SPI1 and SPI2).

In an ideal world we would have always required the use of spi1-1cs as well as sc16is752-spi1, but it's too late for that now. I considered generating a new sc16is752-spi1 by combining spi1-1cs and sc16is75x-spi (using ovmerge via the // redo a comment), but that would break the int_pin and xtal parameters.

#6996 is an alternate approach that adds just enough to allow sc16is75x-spi to emulate sc16is752-spi1.

@nbuchwitz
Copy link
Contributor Author

#6996 looks sane. I will close this one in favor

@nbuchwitz nbuchwitz closed this Aug 12, 2025
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.

6.12.34 breaks Waveshare RS232 HAT
2 participants