svn commit: r277980 - head/sys/dev/gpio
Luiz Otavio O Souza
loos at FreeBSD.org
Sat Jan 31 15:50:20 UTC 2015
Author: loos
Date: Sat Jan 31 15:50:19 2015
New Revision: 277980
URL: https://svnweb.freebsd.org/changeset/base/277980
Log:
Implement a new method to retrieve the gpiobus reference from a GPIO
controller.
The gpiobus is responsible to keep track of the used pins and serialize
the access to pins.
Some of these features are important to devices that do not descend
directly from gpiobus and as such cannot make use of its features (one
classic example is gpioc that is attached to the GPIO controller and could
not, until now, make use of the gpiobus locking).
Modified:
head/sys/dev/gpio/gpio_if.m
Modified: head/sys/dev/gpio/gpio_if.m
==============================================================================
--- head/sys/dev/gpio/gpio_if.m Sat Jan 31 15:41:01 2015 (r277979)
+++ head/sys/dev/gpio/gpio_if.m Sat Jan 31 15:50:19 2015 (r277980)
@@ -32,6 +32,13 @@
INTERFACE gpio;
CODE {
+ static device_t
+ gpio_default_get_bus(void)
+ {
+
+ return (NULL);
+ }
+
static int
gpio_default_map_gpios(device_t bus, phandle_t dev,
phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin,
@@ -56,6 +63,13 @@ HEADER {
};
#
+# Return the gpiobus device reference
+#
+METHOD device_t get_bus {
+ device_t dev;
+} DEFAULT gpio_default_get_bus;
+
+#
# Get maximum pin number
#
METHOD int pin_max {
More information about the svn-src-head
mailing list