]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
gpiobus: provide a new hint, pin_list
authoravg <avg@FreeBSD.org>
Thu, 27 Jun 2019 15:46:06 +0000 (15:46 +0000)
committeravg <avg@FreeBSD.org>
Thu, 27 Jun 2019 15:46:06 +0000 (15:46 +0000)
commitade6eac179b2765f7269905f9d44287590ff0773
tree96ce228dbec78f04096903f17451d2ba006d1fa6
parenta626b8bc1290af02f88b8e570afc7048e620c56e
gpiobus: provide a new hint, pin_list

"pin_list" allows to specify child pins as a list of pin numbers.
Existing hint "pins" serves the same purpose but with a 32-bit wide bit
mask.  One problem with that is that a controller can have more than 32
pins.  One example is amdgpio.  Also, a list of numbers is a little bit
more human friendly than a matching bit mask.  As a side note, it seems
that in FDT pins are typically specified by their numbers as well.

This commit also adds accessors for instance variables (IVARs) that
define the child pins.  My primary goal is to allow a child to be
configured programmatically rather than via hints (assuming that FDT is
not supported on a platform).  Also, while a child should not care about
specific pin numbers that are allocated to it, it could be interested in
how many were actually assigned to it.

While there, I removed "flags" instance variable.  It was unused.

Reviewed by: mizhka
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20459
share/man/man4/gpio.4
sys/dev/gpio/gpiobus.c
sys/dev/gpio/gpiobusvar.h