Re: [RFC] GPIO lines [was: GPIO User I/O]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 9, 2020 at 4:11 PM Rodolfo Giometti <giometti@xxxxxxxxxxxx> wrote:

>         gpio_lines {
>                 compatible = "gpio-line";
>
>                 bypass0 {
>                         gpios = <&gpionb 10 GPIO_ACTIVE_HIGH>;
>                         mode = "out-low";
>                 };
>
>                 bypass1 {
>                         gpios = <&gpiosb 11 GPIO_ACTIVE_HIGH>;
>                         mode = "out-low";
>                 };
>
>                 key {
>                         gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
>                         mode = "input";
>                 };
>
>                 motor {
>                         gpios = <&gpionb 8 GPIO_ACTIVE_HIGH>;
>                         mode = "out-high-open-drain";
>                 };

These mode = ... strings are really just a big confusion for me since
they reinvent several of the flags you can already give to the gpios,
see include/dt-bindings/gpio/gpio.h:

/* Bit 0 express polarity */
#define GPIO_ACTIVE_HIGH 0
#define GPIO_ACTIVE_LOW 1

/* Bit 1 express single-endedness */
#define GPIO_PUSH_PULL 0
#define GPIO_SINGLE_ENDED 2

/* Bit 2 express Open drain or open source */
#define GPIO_LINE_OPEN_SOURCE 0
#define GPIO_LINE_OPEN_DRAIN 4

/*
 * Open Drain/Collector is the combination of single-ended open drain interface.
 * Open Source/Emitter is the combination of single-ended open source interface.
 */
#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN)
#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE)

Yours,
Linus Walleij



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux