overlays: i2c-fan: add compatible for upstream compatibility#7483
Conversation
The way upstream deals with compatibles is to add emc2305 and then deal with the variations in the driver as it's detectable so add emc2305 to the compat so we work with the upstream driver. Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
FYI: the upstream driver looks in a better state recently. |
|
Tailoring the Device Tree to match the Linux driver implementation seems to go against the upstream DT rules. |
It's as required by the bindings It's using emc2305 as the fallback that the driver picks up. LGTM. |
|
I should have been more explicit: I think the upstream driver is breaking the principles of OS-neutral DT files. |
I completely agree, I tried to send the compatibles upstream and I got this response. With this change it works with the upstream and I didn't have the strength to argue. I was considering also reverting the fork you have downstream (which appears to be while upstream worked out what to do) and pull back the upstream changes but I thought I would start with this. |
I know the feeling. It probably shouldn't be the case, but if you'd included some of this in your PR I would probably have merged it sooner. |
Isn't that everyone's response to trying to do anything device tree related, especially bindings!
Yes it was an earlier patch set. The CM4IO board uses EMC2301 and no one had checked there was a driver at that point when deciding to use the chip. The DT docs do say to use fallback compatibles "when devices are the same as or a superset of prior implementations", but emc2305 didn't exist before emc2301, so why did it get precedence? A wildcard of emc230x would have made more sense for the fallback. It sounds like we need to review the mainline emc2305 driver again to see what state it's in. I'd hope we'll have it cleaned up before the next LTS release. Seeing as we always ship kernel and DT files together, we don't care as much about ABI in DT. |
It was still pretty quick ;-) and I sort of did both in parallel and wasn't fully up on threads |
No idea, and all the upstream examples are the 2301 so ¯_(ツ)_/¯ I think to some degree the HW can be queries for the exact variant so essentially the DT should be generic or something.
Yes, so it has the cooling devices pieces, which you then link to a thermal zone, you can see an example here. I think that should have all the bits needed to be able to set that up.
When I get a moment I'm happy to do a PR to clean stuff up, let me know what branch you'd like to do it against. |
|
It looks like the earlier versions of the driver had extra DT parameters that got dropped ( There's also code left over from a non-DT option which is redundant. I think the only fragment we probably do still want is to do what it says. It you did want to look, then it's easiest from our side to take the latest released branch (currently rpi-7.1.y), revert anything patches you don't want (ie currently 8ee1366), and then create clean patches for the bits we do want to keep. That means that when rebasing the next branch we can drop the unwanted patches and their reverts, and just have the desired bits. |
See: raspberrypi/linux#7500 kernel: staging: vchiq_arm: use one DMA device to map and unmap bulk pagelists See: raspberrypi/linux#7494 kernel: drm/vc4: hdmi: Remove duplicate hotplug helper call See: raspberrypi/linux#7489 kernel: ASoC: hifiberry_studio: change driver name and add support for new soundcards See: raspberrypi/linux#7487 kernel: mmc: Fix MMC request issuing race condition to prevent stall See: raspberrypi/linux#7486 kernel: dmaengine: dw-axi-dmac: Wait for runtime resume before using a channel See: raspberrypi/linux#7484 kernel: overlays: i2c-fan: add compatible for upstream compatibility See: raspberrypi/linux#7483
See: raspberrypi/linux#7500 kernel: staging: vchiq_arm: use one DMA device to map and unmap bulk pagelists See: raspberrypi/linux#7494 kernel: drm/vc4: hdmi: Remove duplicate hotplug helper call See: raspberrypi/linux#7489 kernel: ASoC: hifiberry_studio: change driver name and add support for new soundcards See: raspberrypi/linux#7487 kernel: mmc: Fix MMC request issuing race condition to prevent stall See: raspberrypi/linux#7486 kernel: dmaengine: dw-axi-dmac: Wait for runtime resume before using a channel See: raspberrypi/linux#7484 kernel: overlays: i2c-fan: add compatible for upstream compatibility See: raspberrypi/linux#7483
|
I happen to have half an hour spare now, so I'm looking at the driver cleanups. |
|
awesome, thx 👍 |
The way upstream deals with compatibles is to add emc2305 and then deal with the variations in the driver as it's detectable so add emc2305 to the compat so we work with the upstream driver.