freebsd-dev/sys/dev
Ian Lepore e1275c6805 Add gpio methods to read/write/configure up to 32 pins simultaneously.
Sometimes it is necessary to combine several gpio pins into an ad-hoc bus
and manipulate the pins as a group. In such cases manipulating the pins
individualy is not an option, because the value on the "bus" assumes
potentially-invalid intermediate values as each pin is changed in turn. Note
that the "bus" may be something as simple as a bi-color LED where changing
colors requires changing both gpio pins at once, or something as complex as
a bitbanged multiplexed address/data bus connected to a microcontroller.

In addition to the absolute requirement of simultaneously changing the
output values of driven pins, a desirable feature of these new methods is to
provide a higher-performance mechanism for reading and writing multiple
pins, especially from userland where pin-at-a-time access incurs a noticible
syscall time penalty.

These new interfaces are NOT intended to abstract away all the ugly details
of how gpio is implemented on any given platform. In fact, to use these
properly you absolutely must know something about how the gpio hardware is
organized. Typically there are "banks" of gpio pins controlled by registers
which group several pins together. A bank may be as small as 2 pins or as
big as "all the pins on the device, hundreds of them." In the latter case, a
driver might support this interface by allowing access to any 32 adjacent
pins within the overall collection. Or, more likely, any 32 adjacent pins
starting at any multiple of 32. Whatever the hardware restrictions may be,
you would need to understand them to use this interface.

In additional to defining the interfaces, two example implementations are
included here, for imx5/6, and allwinner. These represent the two primary
types of gpio hardware drivers. imx6 has multiple gpio devices, each
implementing a single bank of 32 pins. Allwinner implements a single large
gpio number space from 1-n pins, and the driver internally translates that
linear number space to a bank+pin scheme based on how the pins are grouped
into control registers. The allwinner implementation imposes the restriction
that the first_pin argument to the new functions must always be pin 0 of a
bank.

Differential Revision:	https://reviews.freebsd.org/D11810
2017-09-10 18:08:25 +00:00
..
aac Move the intrhook release to later in the function so that GEOM knows to wait longer 2017-09-08 16:52:59 +00:00
aacraid
acpi_support
acpica Merge ACPICA 20170831. 2017-08-31 22:47:04 +00:00
adb
adlink
advansys
ae
age
agp
aha
ahci Add support for AHCI in Armada 3700 2017-09-09 11:01:44 +00:00
aic
aic7xxx
al_eth
alc
ale
alpm
altera
amd_ecc_inject
amdpm
amdsbwd
amdsmb
amdsmn amdsmn(4): Do not probe not matching hostbridges 2017-09-05 21:00:33 +00:00
amdtemp amdtemp(4): Do not probe not matching hostbridges 2017-09-05 20:35:25 +00:00
amr As with r323317, hold off on releasing the intrhook during boot until 2017-09-08 17:40:29 +00:00
an
arcmsr
asmc
ata
ath
atkbdc
auxio
axgbe
bce
beri
bfe
bge
bhnd bhnd: Remove unsupported USB core IDs from the bhnd_usb device table. 2017-09-06 23:43:20 +00:00
bktr
bm
bnxt Added support for displaying HW port stats using sysctl. 2017-09-08 18:03:34 +00:00
buslogic
bvm
bwi
bwn
bxe
cadence
cardbus
cas
ce
cesa
cfe
cfi
chromebook_platform
ciss
cm
cmx
coretemp
cp
cpuctl
cpufreq
cs
ctau
cx
cxgb
cxgbe cxgbe(4): Fix a couple of problems in the sge_wrq data path. 2017-09-09 05:12:14 +00:00
cy
cyapa
dc
dcons
de
dme
dpaa
dpms
dpt
drm
drm2
dwc
e1000 Fix malloc() uses in em_get_regs(). 2017-09-08 14:54:07 +00:00
ed
efidev
ena
ep
esp
et
etherswitch
evdev
ex
exca
extres
fb
fdc
fdt
fe
ffec
filemon
firewire
flash
fxp
gem
glxiic
glxsb
gpio Add gpio methods to read/write/configure up to 32 pins simultaneously. 2017-09-10 18:08:25 +00:00
gxemul
hdmi
hifn
hme
hpt27xx
hptiop
hptmv
hptnr
hptrr
hwpmc Skylake server core PMC support for hwpmc(4). 2017-09-06 17:19:48 +00:00
hyperv hyperv/hn: Log RSS capabilities mask. 2017-09-05 06:20:02 +00:00
ic
ichiic
ichsmb
ichwd Fix typo, TC0->TCO. 2017-09-10 13:21:54 +00:00
ida
if_ndis
iicbus
iir
intel
intpm
io
ioat
ipmi
ips
ipw
isci
iscsi
iscsi_initiator
iser
isl
ismt
isp
ispfw
iwi
iwm
iwn
ixgb
ixgbe Only make the if_ix module depend on netmap when netmap is configured. 2017-08-30 18:19:25 +00:00
ixl
jedec_ts
jme
joy
kbd
kbdmux
ksyms
le
led
lge
lmc
malo
mbox
mc146818
md Add ability to label md(4) devices. 2017-08-28 15:54:07 +00:00
mdio
mem
mfi Fix intrhook release in MFI as well 2017-09-08 17:51:19 +00:00
mge
mii
mk48txx
mlx
mlx4
mlx5
mly
mmc
mmcnull
mn
mpr Fix intrhook release in MPR and MPS for EARLY_AP_STARTUP. 2017-09-10 07:10:40 +00:00
mps Fix intrhook release in MPR and MPS for EARLY_AP_STARTUP. 2017-09-10 07:10:40 +00:00
mpt
mrsas
mse
msk
mvs
mwl
mxge
my
nand
ncr
nctgpio
ncv
neta Add support for Armada 3700 in the NETA driver 2017-09-09 11:54:04 +00:00
netfpga10g/nf10bmac
netmap
nfe
nfsmb
nge
nmdm
nsp
ntb Increase negotiation polling period from 10ms to 100ms. 2017-09-02 13:28:45 +00:00
null
nvd
nvme The nvme module should explicitly declare dependency on the cam. 2017-08-31 14:21:32 +00:00
nvram
nvram2env
nxge
oce
ofw
otus
ow
pbio
pccard
pccbb
pcf
pci
pcn
pdq
pms
powermac_nvram
ppbus
ppc
proto
psci
pst
pty
puc
qlnx/qlnxe
qlxgb
qlxgbe
qlxge
quicc
ral
random
rc
rccgpio
re
rl
rndtest
rp
rt
rtwn rtwn(4): some initial preparations for (basic) VHT support. 2017-08-28 22:14:16 +00:00
safe
sbni
scc
sdhci
sec
sf
sfxge
sge
siba
siis
sio
sis
sk
smbus
smc
sn
snp
sound
speaker
spibus
ste
stg
stge
sym
syscons
tdfx
terasic
ti
tl
tpm
trm
tsec
twa
twe
tws
tx
txp
uart Introduce UART driver module for Armada 3700 2017-09-09 11:42:32 +00:00
ubsec
usb Add support for Armada 3700 EHCI 2017-09-09 11:06:58 +00:00
vge
viapm
viawd
videomode
virtio
vkbd
vmware/vmxnet3
vnic
vr
vt
vte
vx
vxge vxge: plug void casts from memcpy/memzero calls 2017-09-06 21:38:07 +00:00
watchdog
wb
wbwd
wi
wpi
wtap
xdma
xe
xen
xilinx
xl