Clarify on SPI chipselects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I’m a bit confused how to interpret the CS section of spi/spi-bus.txt:

Optional properties (master mode only):
- cs-gpios	  - gpios chip select.
- num-cs	  - total number of chipselects.

If cs-gpios is used the number of chip selects will be increased automatically
with max(cs-gpios > hw cs).

So if for example the controller has 2 CS lines, and the cs-gpios
property looks like this:

cs-gpios = <&gpio1 0 0>, <0>, <&gpio1 1 0>, <&gpio1 2 0>;

Then it should be configured so that num_chipselect = 4 with the
following mapping:

cs0 : &gpio1 0 0
cs1 : native
cs2 : &gpio1 1 0
cs3 : &gpio1 2 0


—— cut —-

My confusion lays around how things work with a mix of “hardware” CS and GPIO CS.

1. Is num-cs the total number of CS (Hardware CS + GPIO CS)?
2. Should the size of cs-gpios be num-cs? (Regardless of # of Hardware CS or GPIO CS)

Some area’s of confusion
* What does “increased automatically” mean?
* Is max(cs-gpios > hw cs) suppose to be max(cs-gpios, hw cs)?
* The example used talks about 2 CS lines, but only utilizes one.  Is that on purpose?

Thanks

- k



[Index of Archives]     [Device Tree]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]

  Powered by Linux