of_get_gpio说明

/**

  • of_get_gpio() - Get a GPIO number to use with GPIO API
  • @np: device node to get GPIO from
  • @index: index of the GPIO
  • Returns GPIO number to use with Linux generic GPIO API, or one of the errno
  • value on the error condition.
    /
    static inline int of_get_gpio(const struct device_node
    np, int index)
    {
    return of_get_gpio_flags(np, index, NULL);
    }

    这个index 表示gpios节点的索引位置,gpios支持多个节点,每个节点由<gpio_chip gpio_num default_level>
    eg:
    gpios = <&ap_gpio 145 0 &ap_gpio 144 0>;

发表回复

您的电子邮箱地址不会被公开。