summaryrefslogtreecommitdiff
path: root/sys/dev/gpio
Commit message (Collapse)AuthorAgeFilesLines
* Provide userland notification of gpio pin changes ("userland gpio interrupts").Ian Lepore2020-12-122-74/+917
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an import of the Google Summer of Code 2018 project completed by Christian Kramer (and, sadly, ignored by us for two years now). The goals stated for that project were: FreeBSD already has support for interrupts implemented in the GPIO controller drivers of several SoCs, but there are no interfaces to take advantage of them out of user space yet. The goal of this work is to implement such an interface by providing descriptors which integrate with the common I/O system calls and multiplexing mechanisms. The initial imported code supports the following functionality: - A kernel driver that provides an interface to the user space; the existing gpioc(4) driver was enhanced with this functionality. - Implement support for the most common I/O system calls / multiplexing mechanisms: - read() Places the pin number on which the interrupt occurred in the buffer. Blocking and non-blocking behaviour supported. - poll()/select() - kqueue() - signal driven I/O. Posting SIGIO when the O_ASYNC was set. - Many-to-many relationship between pins and file descriptors. - A file descriptor can monitor several GPIO pins. - A GPIO pin can be monitored by multiple file descriptors. - Integration with gpioctl and libgpio. I added some fixes (mostly to locking) and feature enhancements on top of the original gsoc code. The feature ehancements allow the user to choose between detailed and summary event reporting. Detailed reporting provides a record describing each pin change event. Summary reporting provides the time of the first and last change of each pin, and a count of how many times it changed state since the last read(2) call. Another enhancement allows the recording of multiple state change events on multiple pins between each call to read(2) (the original code would track only a single event at a time). The phabricator review for these changes timed out without approval, but I cite it below anyway, because the review contains a series of diffs that show how I evolved the code from its original state in Christian's github repo for the gsoc project to what is being commited here. (In effect, the phab review extends the VC history back to the original code.) Submitted by: Christian Kramer Obtained from: https://github.com/ckraemer/freebsd/tree/gsoc2018 Differential Revision: https://reviews.freebsd.org/D27398 Notes: svn path=/head/; revision=368585
* Allow for interrupts on pl061 childrenAndrew Turner2020-09-141-0/+5
| | | | | | | | | | | | | | Add enough infrastructure for interrupts on children of the pl061 GPIO controller. As gpiobus already provided these the pl061 driver also needs to pass requests up the newbus hierarchy. Currently there are no children that expect to configure interrupts, however this is expected to change to support the ACPI Event Information interface. Sponsored by: Innovate UK Notes: svn path=/head/; revision=365709
* Move the pl061 acpi attachment earlierAndrew Turner2020-09-101-2/+3
| | | | | | | | | | | | | As the pl061 driver can be an interrupt controller attach it earlier in the boot so other drivers can use it. Use a new GPIO xref to not conflict with the existing root interrupt controller. Sponsored by: Innovate UK Notes: svn path=/head/; revision=365579
* Switch the name of the pl061 driver to gpioAndrew Turner2020-09-102-2/+2
| | | | | | | | | We need it to be named gpio for gpiobus to work. Sponsored by: Innovate UK Notes: svn path=/head/; revision=365559
* Only manage ofw gpio providers on ofw systemsAndrew Turner2020-09-101-2/+4
| | | | | | | | | | | On arm64 we may boot via ACPI. In this case we will still try to manage the gpio providers as if we are using FDT. Fix this by checking if the FDT node is valid before registering a cross reference. Sponsored by: Innovate UK Notes: svn path=/head/; revision=365558
* Use the correct variable to check which interrupt mode to useAndrew Turner2020-09-101-5/+5
| | | | | | | | | | In the PL061 driver we incorrectly used the mask rather than mode to find how to configure the interrupt. Sponsored by: Innovate UK Notes: svn path=/head/; revision=365557
* Add a GPIO driver for the Arm pl061 controllerAndrew Turner2020-09-084-0/+839
| | | | | | | | | | | | | A PL061 is a simple 8 pin GPIO controller. This GPIO device is used to signal an internal request for shutdown on some virtual machines including Arm-based Amazon EC2 instances. Submitted by: Ali Saidi <alisaidi_amazon.com> (previouss version) Reviewed by: Ali Saidi, manu Differential Revision: https://reviews.freebsd.org/D24065 Notes: svn path=/head/; revision=365450
* gpiokeys: add evdev supportAndriy Gapon2020-08-121-25/+69
| | | | | | | | | | | | Only linux,code is supported as it maps 1:1 to evdev key codes. No reverse mapping for freebsd,code yet. Reviewed by: wulf MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25940 Notes: svn path=/head/; revision=364145
* gpioiic: never drive lines active highAndriy Gapon2020-07-211-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | I2C communication is done by a combination of driving a line low or letting it float, so that it is either pulled up or driven low by another party. r355276 besides the stated goal of the change -- using the new GPIO API -- also changed the logic, so that active state is signaled by actively driving a line. That worked with iicbb prior to r362042, but stopped working after that commit on at least some hardware. My guess that the breakage was related to getting an ACK bit. A device expected to be able to drive SDA actively low, but controller was actively driving it high for some time. Anyway, this change seems to fix the problem. Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor. Reported by: Nick Kostirya <nikolay.kostirya@i11.co> Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25684 Notes: svn path=/head/; revision=363382
* gpiobus_release_pin: remove incorrect prefix from error messagesAndriy Gapon2020-06-221-2/+2
| | | | | | | | | | | | It's interesting that similar messages from gpiobus_acquire_pin never had any prefix while gpiobus_release_pin messages were prefixed with "gpiobus_acquire_pin". Anyway, the prefix is not that useful and can be deduced from context. MFC after: 2 weeks Notes: svn path=/head/; revision=362492
* gpioiic_attach: fix a NULL pointer crash on hints-based systemsAndriy Gapon2020-05-071-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The attach method uses GPIO_GET_BUS() to get a "newbus" device that provides a pin. But on hints-based systems a GPIO controller driver might not be fully initialized yet and it does not know gpiobus hanging off it. Thus, GPIO_GET_BUS() cannot be called yet. The reason is that controller drivers typically create a child gpiobus using gpiobus_attach_bus() and that leads to the following call chain: gpiobus_attach_bus() -> gpiobus_attach() -> bus_generic_attach(gpiobus) -> gpioiic_attach(). So, gpioiic_attach() is called before gpiobus_attach_bus() returns. I observed this bug with nctgpio driver on amd64. I think that the problem was introduced in r355276. The fix is to avoid calling GPIO_GET_BUS() from the attach method. Instead, we know that on hints-based systems only the parent gpiobus can provide the pins. Nothing is changed for FDT-based systems. MFC after: 1 week Notes: svn path=/head/; revision=360779
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* [gpioths] Fix GPIOTHS_DEBUGBrad Davis2019-12-271-2/+2
| | | | | | | | | | | Chase the removal of dev from gpioths_dht_readbytes() in r355540. Reviewed by: ian Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D22926 Notes: svn path=/head/; revision=356115
* Revert r355806: kbd drivers: don't double register keyboard driversKyle Evans2019-12-261-3/+0
| | | | | | | | | | | r356087 made it rather innocuous to double-register built-in keyboard drivers; we now set a flag to indicate that it's been registered and only act once on a registration anyways. There is no misleading here, as the follow-up kbd_delete_driver will actually remove the driver as needed now that the linker set isn't also consulted after kbdinit. Notes: svn path=/head/; revision=356091
* kbd drivers: don't double register keyboard driversKyle Evans2019-12-161-0/+3
| | | | | | | | | | | | | | | | | | Keyboard drivers are generally registered via linker set. In these cases, they're also available as kmods which use KPI for registering/unregistering keyboard drivers outside of the linker set. For built-in modules, we still fire off MOD_LOAD and maybe even MOD_UNLOAD if an error occurs, leading to registration via linker set and at MOD_LOAD time. This is a minor optimization at best, but it keeps the internal kbd driver tidy as a future change will merge the linker set driver list into its internal keyboard_drivers list via SYSINIT and simplify driver lookup by removing the need to consult the linker set. Notes: svn path=/head/; revision=355806
* kbd: provide default implementations of get_fkeystr/diagKyle Evans2019-12-161-2/+0
| | | | | | | | | Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set and make genkbd_get_fkeystr/genkbd_diag private. Notes: svn path=/head/; revision=355796
* kbd drivers: use kbdd_* indirection for diag invocationKyle Evans2019-12-161-1/+1
| | | | | | | | | | | These invocations were directly calling enkbd_diag(), rather than indirection back through kbdd_diag/kbdsw. While they're functionally equivent, invoking kbdd_diag where feasible (i.e. not in a diag implementation) makes it easier to visually identify locking needs in these other drivers. Notes: svn path=/head/; revision=355793
* Switch gpioths(4) from using a callout to a taskqueue for periodic pollingIan Lepore2019-12-091-10/+17
| | | | | | | | | | | of the sensor hardware. Part of the polling process involves signalling the chip then waiting 20 milliseconds. This was being done with DELAY(), which is a pretty rude thing to do in a callout. Now a taskqueue_thread task is scheduled to do the polling, and because sleeping is allowed in the task context, pause_sbt() replaces DELAY() for the 20ms wait. Notes: svn path=/head/; revision=355565
* Paste things correctly so that I'm added to the *end* of the copyright list.Ian Lepore2019-12-091-1/+1
| | | | Notes: svn path=/head/; revision=355550
* Add myself to the copyright list. Also add an SPDX tag. And finally, fixIan Lepore2019-12-091-3/+5
| | | | | | | a missing word and a spelling error in a comment. Notes: svn path=/head/; revision=355549
* Add FDT support to the gpioths driver. It now uses the newer gpio_pin_*()Ian Lepore2019-12-091-104/+131
| | | | | | | API and can attach based on either hints or fdt data. Notes: svn path=/head/; revision=355540
* Add a MODULE_DEPEND() for the gpioths driver. Also, note that the prior commitIan Lepore2019-12-081-2/+3
| | | | | | | | | | changed the sysctl format for the temperature from "I" to "IK", and correspondingly changed the units from integer degrees C to decikelvin. For access via sysctl(8) the output will be the same except that now decimal fractions will be shown when available. Notes: svn path=/head/; revision=355535
* Add support for more chips to the gpioths driver.Ian Lepore2019-12-081-6/+49
| | | | | | | | | | | | | | | | Previously the driver supported the DHT11 sensor. Now it supports DHT11, DHT12, DHT21, DHT22, AM3201, AM3202. All these chips are similar, differing primarily in supported temperature and humidity ranges and accuracy (and, presumably, cost). There are two basic data formats reported by the various chips, and it is possible to figure out at runtime which format to use for decoding the data based on the range of values in a single byte of the humidity measurement. (which is detailed in a comment block, so I won't recapitulate it here). Notes: svn path=/head/; revision=355533
* Simplify sysctl stuff in the gpioths driver. There is no need to use localIan Lepore2019-12-081-87/+8
| | | | | | | | | | | | functions to handle the sysctls, they all just access simple readonly integer variables. There's no need to track the oids of the ones we add, since the teardown is done by newbus code, not the driver itself. Also remove the DDB code, because it just provides access to the same data that the sysctls already provide. Notes: svn path=/head/; revision=355532
* Several small fixes for the gpioths (temp/humidity sensor) driver.Ian Lepore2019-12-081-4/+15
| | | | | | | | | | | | | | | | | | | At the end of a read cycle, set the gpio pin to INPUT rather than OUTPUT. The state of the single-wire "bus" when idle should be high; setting the pin to input allows the external pullup to pull the line high. Setting it to output (and leaving it driving low) was leading a good read cycle followed by one that would fail, and it just continued like that forever, effectively reading the sensor once every 10 seconds instead of 5. In the attach function, do an initial read from the device before registering the sysctls for accessing the last-read values, to prevent reading spurious values for the first 5 seconds after the driver attaches. Do a callout_drain() in the detach function to prevent crashes after unloading the module. Notes: svn path=/head/; revision=355531
* Implement bus_rescan for gpiobus(4). This allows on-the-fly reconfigurationIan Lepore2019-12-061-0/+20
| | | | | | | | | | | | of gpio devices by using kenv to add hints for a new device and then do 'devctl rescan gpiobus4' to make the new device(s) attach. It's not particularly easy to detect whether the 'at' hint has been deleted for a child device that's currently attached, so this doesn't handle that. But the user can use devctl commands to manually detach an existing device. Notes: svn path=/head/; revision=355467
* Add a GPIO based MDIO bit-banging bus driver.Luiz Otavio O Souza2019-12-061-0/+243
| | | | | | | | | | | | | Uses two GPIO pins as MDC (clock) and MDIO (bidirectional I/O), relies on mii_bitbang. Tested on SG-3200 where the PHY for one of the ports is wired independently of the SoC MDIO bus. Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=355462
* Remove "all rights reserved" from copyright for the file that Jared McNeillEmmanuel Vadot2019-12-031-1/+0
| | | | | | | own. He gave me permission to do this. Notes: svn path=/head/; revision=355358
* Do not initialize the flags field in struct gpiobus_pin from the flags inIan Lepore2019-12-021-2/+12
| | | | | | | | | | | | | | struct gpio_pin. It turns out these two sets of flags are completely unrelated to each other. Also, update the comment for GPIO_ACTIVE_LOW to reflect the fact that it does get set, somewhat unobviously, by code that parses FDT data. The bits from the FDT cell containing flags are just copied to gpiobus_pin.flags, so there's never any obvious reference to the symbol GPIO_ACTIVE_LOW being stored into the flags field. Notes: svn path=/head/; revision=355298
* Remove "all rights reserved" from copyright after getting a response fromIan Lepore2019-12-021-1/+1
| | | | | | | | Luiz that he also was not intentionally asserting that right, it was already there when he added his name. Notes: svn path=/head/; revision=355295
* Fix leading whitespace (spaces->tabs) in comments; no functional change.Ian Lepore2019-12-021-2/+2
| | | | Notes: svn path=/head/; revision=355277
* Rewrite gpioiic(4) to use the gpio_pin_* API, and to conform to the modernIan Lepore2019-12-011-143/+219
| | | | | | | | | | | | | | | | | FDT bindings document for gpio-i2c devices. Using the gpio_pin_* functions to acquire/release/manipulate gpio pins removes the constraint that both gpio pins must belong to the same gpio controller/bank, and that the gpioiic instance must be a child of gpiobus. Removing those constraints allows the driver to be fully compatible with the modern dts bindings for a gpio bitbanged i2c bus. For hinted attachment, the two gpio pins still must be on the same gpiobus, and the device instance must be a child of that bus. This preserves compatibility for existing installations that have use gpioiic(4) with hints. Notes: svn path=/head/; revision=355276
* Move most of the gpio_pin_* functions from ofw_gpiobus.c to gpiobus.c soIan Lepore2019-12-013-84/+127
| | | | | | | | | | | | | | | | | | | | | | | that they can be used by drivers on non-FDT-configured systems. Only the functions related to acquiring pins by parsing FDT data remain in ofw_gpiobus. Also, add two new functions for acquiring gpio pins based on child device_t and index, or on the bus device_t and pin number. And finally, defer reserving pins for gpiobus children until they acquire the pin, rather than reserving them as soon as the child is added (before it's even known whether the child will attach). This will allow drivers configured with hints (or any other mechanism) to use the same code as drivers configured via FDT data. Until now, a hinted driver and an FDT driver had to be two completely different sets of code, because hinted drivers could only use gpiobus calls to manipulate pins, while fdt-configured drivers could not use that API (due to not always being children of the bus that owns the pins) and had to use the newer gpio_pin_xxxx() functions. Now drivers can be written in the more traditional form, where most of the code is shared and only the resource acquisition code at attachment time changes. Notes: svn path=/head/; revision=355274
* Remove more needless <sys/tty.h> includesKyle Evans2019-12-011-1/+0
| | | | | | | | | As part of my journey to make it easy to determine what's relying on tty bits, remove a couple more. Some of these just outright didn't need it, while others did rely on <sys/tty.h> pollution for mutex headers. Notes: svn path=/head/; revision=355271
* Ignore "gpio-hog" nodes when instantiating ofw_gpiobus children. Also,Ian Lepore2019-11-291-1/+3
| | | | | | | | | | | | | | | | | | | | in ofw_gpiobus_probe() return BUS_PROBE_DEFAULT rather than 0; we are not the only possible driver to handle this device, we're just slightly better than the base gpiobus (which probes at BUS_PROBE_GENERIC). In the time since this code was first written, the gpio controller bindings aquired the concept of a "hog" node which could be used to preset one or more gpio pins as input or output at a specified level. This change doesn't fully implement the hogging concept, it just filters out hog nodes when instantiating child devices by scanning for child nodes in the fdt data. The whole concept of having child nodes under the controller node is not supported by the standard bindings, and appears to be a freebsd extension, probably left over from the days when we had no support for cross-tree phandle references in the fdt data. Notes: svn path=/head/; revision=355214
* gpioiic: set output after switching to output mode if presetting it failedAndriy Gapon2019-10-251-25/+33
| | | | | | | | | | | | | | | | | | | | | Some controllers cannot preset future output value while the pin is in input mode. This adds a fallback for those controllers. The new code assumes that a controller reports an error in that case. For example, all hardware supported by nctgpio behaves in that way. This is a temporary measure. In the future we will use GPIO_PIN_PRESET_LOW / GPIO_PIN_PRESET_HIGH to preset the output either in hardware, if supported, or in software (e.g., in gpiobus_pin_setflags). While here, I extracted common functionality of gpioiic_set{sda,scl} and gpioiic_get{sda,scl} to gpioiic_setpin and gpioiic_getpin respectively. MFC after: 2 weeks Notes: svn path=/head/; revision=354065
* gpioiic: add the detach methodAndriy Gapon2019-10-181-1/+10
| | | | | | | | | | bus_generic_detach was not enough, we also need to clean up the iicbus child device. MFC after: 1 week Notes: svn path=/head/; revision=353727
* o Add support for multi-port instances of Synopsys DesignWare APB GPIORuslan Bukin2019-09-043-0/+643
| | | | | | | | | | Controller. o Rename the driver to dwgpio. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=351817
* Add PNP_INFO to the gpiopps driver.Ian Lepore2019-08-131-0/+1
| | | | Notes: svn path=/head/; revision=350988
* Follow r349460 to complete removing "flags" in struct gpiobus_ivarLi-Wen Hsu2019-06-271-3/+1
| | | | | | | | MFC with: r349460 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=349472
* gpiobus: provide a new hint, pin_listAndriy Gapon2019-06-272-26/+173
| | | | | | | | | | | | | | | | | | | | | | | | | "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 Notes: svn path=/head/; revision=349460
* Zero the GPIO regulator pins memory.Luiz Otavio O Souza2019-06-061-1/+1
| | | | | | | | | | This fixes a panic in Espressobin when gpioregulator fails to allocate the GPIO pin (the GPIO controller is not there). Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=348759
* gpioled: add a new hint for initial stateAndriy Gapon2019-05-231-0/+3
| | | | | | | | | | | | | | | hint.gpioled.%d.state determines the initial state of the LED when the driver takes control over it: 0 - the LED is off 1 - the LED is on -1 - the LED is kept as it was While here, add a module version declaration. MFC after: 2 weks Notes: svn path=/head/; revision=348153
* Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins toIan Lepore2019-04-251-1/+1
| | | | | | | | | | change, not the variable used to return the original pin state. PR: 237378 Reported by: Mori Hiroki <yamori813@yahoo.co.jp> Notes: svn path=/head/; revision=346713
* Distinguish _CID match and _HID match and make lower priority probeTakanori Watanabe2018-10-262-11/+14
| | | | | | | | | | when _CID match. Reviewed by: jhb, imp Differential Revision:https://reviews.freebsd.org/D16468 Notes: svn path=/head/; revision=339754
* Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_allocOleksandr Tymoshenko2018-04-092-2/+2
| | | | | | | | | | | | | | | | | | | | | Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size. Notes: svn path=/head/; revision=332341
* Clean up OF_getprop_alloc APIOleksandr Tymoshenko2018-04-082-5/+5
| | | | | | | | | | | | | | | | | | | | OF_getprop_alloc takes element size argument and returns number of elements in the property. There are valid use cases for such behavior but mostly API consumers pass 1 as element size to get string properties. What API users would expect from OF_getprop_alloc is to be a combination of malloc + OF_getprop with the same semantic of return value. This patch modifies API signature to match these expectations. For the valid use cases with element size != 1 and to reduce modification scope new OF_getprop_alloc_multi function has been introduced that behaves the same way OF_getprop_alloc behaved prior to this patch. Reviewed by: ian, manu Differential Revision: https://reviews.freebsd.org/D14850 Notes: svn path=/head/; revision=332310
* Add SPDX tags for chvgpio driver sourcesOleksandr Tymoshenko2018-02-242-1/+5
| | | | | | | | | Also move $FreeBSD$ keyword in header to BSD license MFC after: 2 weeks Notes: svn path=/head/; revision=329926
* [chvgpio] add GPIO driver for Intel Z8xxx SoC familyOleksandr Tymoshenko2018-02-222-0/+858
| | | | | | | | | | | | | | | Add chvgpio(4) driver for Intel Z8xxx SoC family. This product was formerly known as Cherry Trail but Linux and OpenBSD drivers refer to it as Cherry View. This driver is derived from OpenBSD one so the name is kept for alignment with another BSD system. Submitted by: Tom Jones <tj@enoti.me> Reviewed by: gonzo, wblock(man page) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13086 Notes: svn path=/head/; revision=329832
* Provide a public function to acquire a gpio pin by giving the property nameIan Lepore2018-02-182-4/+6
| | | | | | | | | | | | | | | | and index. A private function to do exactly that already existed, so this renames gpio_pin_get_by_ofw_impl() to gpio_pin_get_by_ofw_propidx() and provides a declaration for it in a public header. Previously there were functions to get a pin by property name (assuming there would only be one pin defined for the name), or by index (asuming the property has the standard name "gpios"). It turns out there are devicetree bindings that describe properties with names other than "gpios" which can describe multiple pins. Hence the need to retrieve the Nth item from a named property. Notes: svn path=/head/; revision=329537