Open pdp7 opened 6 years ago
For example:
/sys/devices/platform/ocp/48030000.spi/spi_master/spi1/spi1.0/
who do I get to the actual character device file that I would open?
@RobertCNelson wrote:
spi1.0 -> /dev/spidev1.0
/sys/devices/platform/ocp/*.spi/spi_master/spiX/spiX.Y/ = /dev/spidevX.Y
For reference, here is a commit to add the /dev/spi/X.Y properties to device tree: SPIDEV: use symlink label to help udev https://github.com/beagleboard/bb.org-overlays/commit/d21b116ebee9e581428acf2558ebf7a56b37de6c
And udev script that create the corresponding symlinks: https://github.com/mvduin/py-uio/blob/master/etc/udev/rules.d/10-of-symlink.rules
FYI - this will solve issues like this one: SPI No such file or directory
I also ran into this problem, which got me a bit by surprise.
However, it does seem the new names make more sense: Now it uses spidev0 and spidev1, which match the labels on the pinout and the overlays (e.g. BB-SPIDEV0-00A0.dtbo
). However, it does seem that the /dev/spidev.x.x
is rather arbitrary (e.g. like ethx labels used to be), so the new symlinks are probably the best way to target specific spi devices.
FYI - a solution will need to be decided upon for libraries like Adafruit_BBIO
cc @RobertCNelson