Date: Sat, 31 Jan 2015 15:50:19 +0000 (UTC) From: Luiz Otavio O Souza <loos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277980 - head/sys/dev/gpio Message-ID: <201501311550.t0VFoJMb041177@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501311550.t0VFoJMb041177>