Support for more slave select (i.e. chip select/CS) channels on SPI
mcbridejc opened this issue · 1 comments
I'd like to extend the SPI driver to support more slave select options. The default device tree only defines 2 chip select pins, but this can be extended with a device overlay to use any number of GPIOs as chip selects.
I will create a PR, but I'd like to get the maintainer(s) feedback on preferred approach.
Approach 1: Use an integer for slave_select argument. Since the only place slave select is used is in generating the /dev/spidevX.Y
string, this seems reasonable to me, but it breaks backwards compatibility.
Approach 2: Extend to SlaveSelect
enum to a sufficiently large number (perhaps up to Ss16) to cover all reasonable cases.
Approach 3: We could consider using typenum instead of SlaveSelect
for the parameter, but since it's only used at run-time, I'm not sure I see any advantage to this over option 1.
Any advice?
For reference, here is gist showing how to extend the SPI devices with more chip select using a DT overlay: https://gist.github.com/mcbridejc/d060602e892f6879e7bc8b93aa3f85be