Accessing existing SPI device from another driver?

37 views
Skip to first unread message

Don Porges

unread,
Oct 18, 2016, 3:36:13 PM10/18/16
to BeagleBoard
[Reposted to add better categories.  Will delete original.]

I'm trying to write a kernel driver that accesses an existing spi device -- in particular, I already have /dev/spidev1.0 active and working, and I'd like to be able to use kernel spi_write(), etc, calls on that device.  I'm using linux 3.8.13-bone70.

I can get at the spi master with spi_busnum_to_master(), but it seems to me that I should be able to get the existing spi_device from some api interaction with the master, but I don't see any such thing.  I also can't use spi_new_device() to create a "new" device (if that is the correct way to do it) because there's a chipselect conflict -- this seems to be almost an FAQ for spi users, and I've looked a that some and would rather not try to go that that path -- at a minimum it would require rewiring our custom cape.

I imagine I could do most of what I want simply in user code, with /dev/spidev1.0, but I expect a latency issue and I'd rather try to do it the best way, from that point of view, which is to be in a kernel driver.

Thanks for any advice.
Reply all
Reply to author
Forward
0 new messages