freebsd-skq/sys/dev/spibus
Ian Lepore 1fcf4de055 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
2018-06-21 21:16:26 +00:00
..
ofw_spibus.c Return BUS_PROBE_DEFAULT, not zero, because this is not the one driver 2018-04-07 18:58:58 +00:00
spi.h spi: Add SPIBUS_PNP_INFO macro 2018-06-14 17:20:47 +00:00
spibus_if.m
spibus.c Incorporate bus and chip select numbers into spigen(4) cdev names. Rather 2018-06-21 21:16:26 +00:00
spibusvar.h Generate a spibus_set_[ivarname]() convenience function for each ivar, 2018-04-07 20:34:57 +00:00
spigen.c Incorporate bus and chip select numbers into spigen(4) cdev names. Rather 2018-06-21 21:16:26 +00:00