October 2017
Intermediate to advanced
586 pages
14h 8m
English
GPIO descriptor mappings are defined in the consumer device's node. The property that contains a GPIO descriptor mapping must be named <name>-gpios or <name>-gpio, where <name> is meaningful enough to describe the function for which those GPIOs will be used.
You should always suffix the property name with either -gpio or -gpios because every descriptor-based interface function relies on the gpio_suffixes[] variable, defined in drivers/gpio/gpiolib.h and shown as follows:
/* gpio suffixes used for ACPI and device tree lookup */
static const char * const gpio_suffixes[] = { "gpios", "gpio" };
Let's see how to do this by having a look at the function used to look for GPIO descriptor mappings in devices ...