Jump to content

spidev on a spi-gpio device


Recommended Posts

I'm currently working on the meson64 family (C2, K2, Le Potato) as a family, and am trying to more or less make their GPIO behaviors similar and matching (as best I can) to the RPi they are form factor clones of.  An issue I'm having right now has to do with the spidev driver, these boards don't have hardware spi where the Pi/Tinker does does, so I'm defining spi-gpio devices in the device tree.  That part is fine.  Where it gets interesting is setting up a spidev node under it.

 

- Calling out a compatible = "spidev" works, enumerates, etc, but throws the typical ugly error during boot that it is wrong to do it that way.

- Adding a compatible string to the driver (as seen in Tinker and recommended in the documentation) results in no device enumeration.

 

Has anyone come across this?  I'm not going to put much more time into it and just deal with the error if there's not some obvious reason for it not working.

 

[edit] Yes, I have made sure the compatible string added to the driver and the one in the dts match.  :lol:)

 

Link to comment
Share on other sites

It is a warning with a stack trace, it was intentionally put into the spidev driver to make people create compatible strings. It doesn't actually do anything, but it looks/acts like a real bug in the dmesg output, I'm assuming it's only a matter of time before we get questions about why the kernel is complaining on boot.

Sent from my Pixel using Tapatalk

Link to comment
Share on other sites

10 minutes ago, TonyMac32 said:

it was intentionally put into the spidev driver

Is it this famous one ?

"buggy DT: spidev listed directly in DT\n"

I remember discussing about it with @mripard 2 years ago , but I don't recall why I've faced it and how it got fixed ...

Link to comment
Share on other sites

Yes, that one. Basically it is a simple check that just looks to see if compatible = "spidev". It's a technicality that someone decided was worth a lot of noise, the device tree is for hardware description, spidev is a driver, so you "shouldn't say the driver is compatible with itself". So it is desirable for the board/distro maintainers to define a "hardware" at least in name (I was arbitrarily choosing "armbian,soft_spi"), then applying the driver to that.

The concern for me is that compatible = "spidev" loads properly, but after adding a compatible string and using it, it doesn't load. The only functional difference between the working Tinker board implementation of spidev and my try on Amlogic is the fact that I have a bit-banged software SPI device, not a hardware one.

Sent from my Pixel using Tapatalk

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines