[PATCH] spi/spi-altera: Allow to explicitely override bus number via dts

Frederic LAMBERT frdrc66 at gmail.com
Thu Feb 2 01:53:00 EST 2012


>
> > Good question. I have a nvSRAM that I access using the AT25 driver, and I
> > don't know how access it without its /sys/bus/ name. If there is another
> > way, it is worse to consider it.
>
> For this I'd expect the application to be able to enumerate all the SPI
> devices and offer the user a selection of those with the appropriate
> driver bound (though I can see that simple scripts might not have
> bothered).
>

???
I wrote a piece of code that uses this nvSRAM as a persistent storage.
This runs in a softcore embedded in an FPGA, in an equipment.
The PC version of this application uses a simple file to emulate this
behavior.
The simulated version, using an x86 port embedded in a VirtualBox uses a
piece of virtual disk with /dev/sdb.

To sumarize, I have a same code that works for the 3 architecture, the
single difference being in the device name:
/sys/proc/spi/drivers/at25/spi0.0/eeprom for Nios2
dataBase.dat on Linux
/dev/sdb on the Virtual Machine

Why should I have to break that, which work nice, to use a bus enumeration
which would be specific to the real hardware version, because I'm using a
new tools, DTS, which is supposed to simplify my life.
Sorry to insist, but this incapacity to set the bus number is a *real*
regression (for me).

I know I could use the name chosen by the kernel (it mus be something like
/sys/.../spi253.0/...), but I have no control on it. If tomorrow someone
changes something in the spi bus number definition, a kernel upgrade will
have an impact on the user stuff...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20120201/67b9070d/attachment-0001.html>


More information about the devicetree-discuss mailing list