•函数原型:int of_get_named_gpio_flags(struct device_nodenp, const charlist_name, int index, enum of_gpio_flags *flags) •作用:通过名称从 dts 解析 gpio 属性并返回 gpio 编号。 •参数: •np: 指向使用 gpio 的设备结点。 •propname:dts 中属性的名称。 •index:dts 中属...
linux of_get_named_gpio gpio 编号linux of_get_named_gpio gpio编号 -下面给出一个使用`of_get_named_gpio`函数获取Linux GPIO编号的示例代码: ```c #include <linux/gpio/consumer.h> int get_gpio_number(struct device_node *node, const char *propname) { int ret; struct gpio_desc *desc; ...
det-gpios = <&gpio3 RK_PA6 IRQ_TYPE_EDGE_BOTH>; 驱动文件调用 gc5025->det_pin = of_get_named_gpio_flags(node, "det-gpios", 0, &det_flags); camera_det_irq = gpio_to_irq(gc5025->det_pin); gc5025->det_value = gpio_get_value(gc5025->det_pin); /*判断注册终端*/ if(came...
gc5025->det_pin = of_get_named_gpio_flags(node, "det-gpios", 0, &det_flags); camera_det_irq = gpio_to_irq(gc5025->det_pin); gc5025->det_value = gpio_get_value(gc5025->det_pin); /*判断注册终端*/ if(camera_det_irq){ if (gpio_request(gc5025->det_pin, "camera-irq-gpio...
4.2.8 of_get_named_gpio_flags •函数原型:int of_get_named_gpio_flags(struct device_node *np, const char *list_name, int index, enum of_gpio_flags *flags) •作用:通过名称从 dts 解析 gpio 属性并返回 gpio 编号。 •参数:
这里需要看一下of_gpio_simple_xlate的实现,这个在下面的分析中会被回调 1intof_gpio_simple_xlate(structgpio_chip *gc,2conststructof_phandle_args *gpiospec, u32 *flags)3{4.. ...5if(flags)//第二个参数表示的是flag6*flags = gpiospec->args[1];7//第一个参数表示的是gpio号8returngpiospec...
#旧的 GPIO 使用实例 DTS 文件 det-gpios = <&gpio3 RK_PA6 IRQ_TYPE_EDGE_BOTH>; 驱动文件调用 gc5025->det_pin = of_get_named_gpio_flags(node, "det-gpios", 0, &det_flags);camera_det_irq = gpio_to_irq(gc5025->det_pin);gc5025->det_value = gpio_get_value(gc5025->det_pin);...
4.2.8 of_get_named_gpio_flags • 函数原型:int of_get_named_gpio_flags(struct device_node *np, const char *list_name, int index, enum of_gpio_flags *flags) • 作用:通过名称从 dts 解析 gpio 属性并返回 gpio 编号。 • 参数: ...
* @gpio: the GPIO number * @flags: GPIO configuration as specified by GPIOF_* * @label: a literal description string of this GPIO*/structgpio { unsigned gpio; unsignedlongflags;constchar*label; }; 结构体struct gpio用来描述一个需要配置的GPIO。
of_get_named_gpio_flags() of_get_gpio_flags() 注册i2c_board_info,指定IRQ等板级信息。 形如 [objc]view plaincopy static struct i2c_board_info __initdata afeb9260_i2c_devices[] = { { I2C_BOARD_INFO(“tlv320aic23”, 0x1a),