]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Incorporate bus and chip select numbers into spigen(4) cdev names. Rather
authorian <ian@FreeBSD.org>
Thu, 21 Jun 2018 21:16:26 +0000 (21:16 +0000)
committerian <ian@FreeBSD.org>
Thu, 21 Jun 2018 21:16:26 +0000 (21:16 +0000)
commit5d7866c4732482941cf028fef99e2329e2e739e9
treed184ab398a53716aceacbcbbb98f9591de56a23d
parent8880abe5ff7c958f1a7b20bae3f881fa0b961640
Incorporate bus and chip select numbers into spigen(4) cdev names.  Rather
than assigning spigen device names in order of creation, this uses a device
name that corresponds to the owning spibus and chip-select index.

Example: /dev/spigen0.1 would be a child of spibus0, and use cs = 1

The intent is for systems like Raspberry Pi to have a consistent way of
using an SPI interface with a specific cs value from a user application.
Otherwise, there is no consistent way of knowing which cs pin will be
assigned to a particular spigen device. The alternative is to specify
everything in "the right order" in an overlay file, which is less than
ideal. Additionally, this duplicates (to some extent) the way Linux handles
a similar situation with their 'spidev' device, so it would be somewhat
familiar to those who also use Linux.

A new kernel config option, SPIGEN_LEGACY_CDEVNAME, causes the driver to
also create /dev/spigenN device name aliases, with N incrementing in the
order of device instantiation.  This is provided to ease the transition
for existing systems using the original naming convention (particularly
when these changes are MFC'd to stable branches).

Differential Revision: https://reviews.freebsd.org/D15301
sys/conf/NOTES
sys/conf/options
sys/dev/spibus/spibus.c
sys/dev/spibus/spigen.c