HomeFreeBSD

MFC r331868, r332046, r332194-r332196, r332198, r332219, r332231, r332233…

Description

MFC r331868, r332046, r332194-r332196, r332198, r332219, r332231, r332233, r332240, r332258-r332259, r332261, r332292

r331868:
Add opt_platform.h for several modules that have #ifdef FDT in the source.

Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>

r332046:
Add a missing MODULE_DEPEND().

r332194:
Add support for writing/changing spi device ivars. The SPI mode (polarity
and phase) and the maximum bus speed can be changed. The chip select
number cannot be changed, because the device instances which are children
of spibus are inherently associated with the chip select number they were
instantiated for.

r332195:
A couple minor improvements to spibus.c...

  • Change the description string to "SPI bus" (was "spibus bus").
  • This is the default driver for a SPI bus, not a generic implementation, so return the probe value that indicates such.
  • Use device_delete_children() at detach time, instead of a local loop to enumerate the children and detach each one individually.

r332196:
Return BUS_PROBE_DEFAULT, not zero, because this is not the one driver
implementation that must be used, it's just the base system default driver.

Also add a comment noting that we're being more liberal about the bus
frequency property than the dts binding documents require.

r332198:
Arrange the list of generated sources as 1-per-line alphbetical, and add
the files required when building for FDT-based systems.

r332219:
Remove the existing identify() hack to force-add a spigen device on
FDT-based systems, and instead add proper FDT probe code. Because this
driver is freebsd-specific and just provides generic userland access to run
spibus transactions, there is no bindings document to mandate a compatible
string, so just arbitrarily use "freebsd,spigen".

r332231:
Generate a spibus_set_[ivarname]() convenience function for each ivar,
now that they can be set.

r332233:
Add an ioctl to get/set the SPI transfer mode. Also, make the bus clock
frequency ioctl actually set the corresponding ivar instead of just storing
the value locally in the softc (and then not using it for anything). Also,
return the correct error code if the ioctl cmd is not recognized.

r332240:
Add the ioctl definitions for spigen get/set spi mode. Should have been
part of r332233.

r332258:
Don't check for impossible NULL return from malloc(..., M_WAITOK).

r332259:
Cast the data pointer to the correct type for the data being accessed (as
opposed to one that accidentally worked on the one arch I test-compiled for
on my first try).

Reported by: np@, O. Hartmann <ohartmann@walstatt.org>
Pointy hat: ian@

r332261:
Add a manpage for spigen(4).

r332292:
Allow hinted attachment on FDT-based systems. Instead of returning ENXIO
when the FDT data doesn't enable the device instance, return
BUS_PROBE_NOWILDCARD, the same as for non-FDT systems.

Details

Provenance
ianAuthored on
Parents
rS332941: Fix wl(4) after r332288, using the same fix applied in r332331. This
Branches
Unknown
Tags
Unknown