Skip to content

overlays: sc16is75x: Add generic SPI overlay#6865

Merged
pelwell merged 2 commits into
raspberrypi:rpi-6.12.yfrom
nbuchwitz:sc16is75x-spi
May 26, 2025
Merged

overlays: sc16is75x: Add generic SPI overlay#6865
pelwell merged 2 commits into
raspberrypi:rpi-6.12.yfrom
nbuchwitz:sc16is75x-spi

Conversation

@nbuchwitz

Copy link
Copy Markdown
Contributor

Currently four nearly identical overlays (sc16is750-spi0 / -spi1 and sc16is752-spi0 / -spi1) are provided. Besides the redundant configuration all of them lack support for other SPI interfaces than spi0 and spi1.

Thus refactor the common definitions into a generic sc16is75x-spi overlay which provides support for all known spi / cs combinations. Also choose the chip type via dtparam rather than different overlay.

In order to keep existing setups keep the old overlays, but add a deprecation message via overlay map.

Currently four nearly identical overlays (sc16is750-spi0 / -spi1
and sc16is752-spi0 / -spi1) are provided. Besides the redundant configuration
all of them lack support for other SPI interfaces than spi0 and spi1.

Thus refactor the common definitions into a generic sc16is75x-spi overlay which
provides support for all known spi / cs combinations. Also choose the chip type
via dtparam rather than different overlay.

In order to keep existing setups keep the old overlays, but add a deprecation
message via overlay map.

Signed-off-by: Nicolai Buchwitz <n.buchwitz@kunbus.com>
@nbuchwitz

Copy link
Copy Markdown
Contributor Author

As talked about yesterday, I will think about some generic solution in order to avoid duplication of the boilerplate spi cs tuples. But this is stuff for another PR (once I found something which will work for most of the overlays)

@pelwell

pelwell commented May 21, 2025

Copy link
Copy Markdown
Contributor

I'm looking at this now. The deprecation breaking the overlay check is unfortunate, but I think it would be fixed by actually deleting the original overlays. A more serious problem is the reference to labels that don't exist in the older Pis' dtbs, eg. spi3. This can be avoided by replacing the target property with target-path=spi3 etc., making use of the fact that paths that don't start with a / are assumed to begin with the name of an alias, which is then resolved.

If you don't mind sticking to the old naming scheme - int_pin and xtal - we should be able to replace the deprecated error messages with e.g.:

	sc16is750-spi0 {
		rename = "sc16is75x,sc16is750,spi0-0";
	};

I'm currently getting an error about overlay 'sc16is750-spi0' not being supported on the bcm2835 platform, but I should be able to fix (or at least understand) that.

@pelwell

pelwell commented May 21, 2025

Copy link
Copy Markdown
Contributor

Doh, it's obvious - the correct syntax is:

	sc16is750-spi0 {
		renamed = "sc16is75x,sc16is750,spi0-0";
	};

Note the d on renamed.

@nbuchwitz

Copy link
Copy Markdown
Contributor Author

Thanks, the changes sound resonable. I will update the branch

@pelwell

pelwell commented May 21, 2025

Copy link
Copy Markdown
Contributor

I'd hang on until I've got it all working, especially the automated checks. When I've done that I'll push a patch with my changes.

As discussed, here are a few minor improvements to the original PR:
1. Use target-path with aliases to allow the overlay to be loaded on
older devices that lack the higher numbered SPI interfacs.
2. Change the "deprecated" errors to "renamed", so that the old names
continue to work without requiring a config.txt change.
3. Use the same parameter names as the old overlays, partly so that
existing installations continue to work even though they are now using
the new overlay, and partly to match the -i2c variants.
4. Actually delete the old overlays.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell

pelwell commented May 22, 2025

Copy link
Copy Markdown
Contributor

Assuming the other tests pass, we can fix up the over-long commit message when we "Squash and merge".

@nbuchwitz

Copy link
Copy Markdown
Contributor Author

Looks good so far. Will do some tests with real hardware and then this should be ready

@nbuchwitz

Copy link
Copy Markdown
Contributor Author

Tests look good so far. From my side this is ready to be squashed and merged

@pelwell pelwell merged commit ce20a8f into raspberrypi:rpi-6.12.y May 26, 2025
11 of 12 checks passed
@nbuchwitz nbuchwitz deleted the sc16is75x-spi branch May 26, 2025 15:02
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jun 3, 2025
kernel: overlays: sc16is75x: Add generic SPI overlay
See: raspberrypi/linux#6865

kernel: add mira220 image sensor
See: raspberrypi/linux#6717

kernel: defconfigs: Enable WATCHDOG_SYSFS
See: raspberrypi/linux#6875

kernel: drivers: pci: hailo: Better lock handling when calling find_vdma()
See: raspberrypi/linux#6868

kernel: drivers: media: imx500: Enable sensor temperature monitoring
See: raspberrypi/linux#6877

kernel: firmware: rp1: Rename to rp1-fw to avoid module name collision
See: raspberrypi/linux#6879

kernel: Candidate fixes for camera sync issues
See: raspberrypi/linux#6863
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jun 3, 2025
kernel: overlays: sc16is75x: Add generic SPI overlay
See: raspberrypi/linux#6865

kernel: add mira220 image sensor
See: raspberrypi/linux#6717

kernel: defconfigs: Enable WATCHDOG_SYSFS
See: raspberrypi/linux#6875

kernel: drivers: pci: hailo: Better lock handling when calling find_vdma()
See: raspberrypi/linux#6868

kernel: drivers: media: imx500: Enable sensor temperature monitoring
See: raspberrypi/linux#6877

kernel: firmware: rp1: Rename to rp1-fw to avoid module name collision
See: raspberrypi/linux#6879

kernel: Candidate fixes for camera sync issues
See: raspberrypi/linux#6863
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