enum of_gpio_flags *flags这个定义在哪个linux源码文件
时间: 2024-03-05 20:47:34 浏览: 168
enum of_gpio_flags *flags
是一个函数参数的声明,它并不是一个定义。在 Linux 源码中,很多设备驱动程序会使用 enum of_gpio_flags
枚举类型来表示 GPIO 的配置标志,并通过指针类型的函数参数来传递这些标志。因此,可以在多个源码文件中找到类似的函数参数声明。例如,在设备树 GPIO 控制器驱动程序 drivers/gpio/gpiolib-of.c
文件中,就有以下函数定义:
static int of_gpiochip_add(struct of_phandle_args *gpiospec,
struct gpio_chip *gpiochip)
{
...
enum of_gpio_flags flags;
...
if (of_get_gpio_flags(gpiospec, &flags) == 0) {
if (flags & GPIO_ACTIVE_LOW)
gpiochip->invert = true;
if (flags & GPIO_PULL_UP)
gpiochip->pull_updown = true;
...
}
...
}
可以看到,在这个函数中,enum of_gpio_flags *flags
参数被用于接收 of_get_gpio_flags()
函数返回的 GPIO 配置标志。
相关推荐


















