*/ret = of_parse_phandle_with_args(np, propname,"#gpio-cells", index, &gpiospec);/* 根据gpiospec,遍历 gpio_devices,找到匹配的gpiochip */chip = of_find_gpiochip_by_xlate(&gpiospec);/* 根据dt中,"xx-gpios"属性提供的引脚号,找到对应引脚的gpio_desc */desc = of_xlate_and_get_gpio...
gpiod_get gpiod_get_array gpiod_get_array_optiona gpiod_get_direction gpiod_get_index gpiod_get_index_optiona gpiod_get_optional gpiod_get_raw_value gpiod_get_raw_value_can gpiod_get_value gpiod_get_value_canslee gpiod_is_active_low gpiod_put gpiod_put_array gpiod_set_array_...
fwnode_get_named_gpiod gpio_to_desc gpiod_cansleep gpiod_count gpiod_direction_input gpiod_direction_output gpiod_direction_output_ gpiod_export gpiod_export_link gpiod_get gpiod_get_array gpiod_get_array_optiona gpiod_get_direction gpiod_get_index gpiod_get_index_optiona gpiod_get_o...
struct gpio_desc *gpiod_get(struct device *dev, const char *con_id,enum gpiod_flags flags)struct gpio_desc *gpiod_get_index(struct device *dev,const char *con_id, unsigned int idx,enum gpiod_flags flags) 或者也可以使用如下两个函数获取可用设备: struct gpio_desc *gpiod_get_optional(st...
转自:https://blog.csdn.net/kris_fei/article/details/78932904 调用流程: 在看显示模块的代码时看到一个函数devm_gpiod_get_optional(), 之前没接触过,它的调用如下: 可以看到devm_gpiod_get_optional
blue = gpiod_get_index(dev, "led", 2, GPIOD_OUT_HIGH); power = gpiod_get(dev, "power", GPIOD_OUT_HIGH); 1. 2. 3. 4. 5. 1.3.2 旧的gpio函数举例 如果需要使用gpio_函数,需要知道引脚号,引脚号的计算: 每个注册的GPIO Controller会确定它的"base number",那么这个控制器里的第n号引脚...
5、gpiod_direction_output_gpiod_exportgpiod_export_linkgpiod_getgpiod_get_arraygpiod_get_array_optionagpiod_get_directiongpiod_get_indexgpiod_get_index_optionagpiod_get_optionalgpiod_get_raw_valuegpiod_get_raw_value_cangpiod_get_valuegpiod_get_value_cansleegpiod_is_active_lowgpiod_put...
gpiod_get_array gpiod_get_array_optiona gpiod_get_direction gpiod_get_index gpiod_get_index_optiona gpiod_get_optional gpiod_get_raw_value gpiod_get_raw_value_can gpiod_get_value gpiod_get_value_canslee gpiod_is_active_low gpiod_put gpiod_put_array gpiod_set_array_value gpiod_...
我的问题出现在获取GPIO描述符阶段;文档说要使用gpiod_get_index(),该函数调用的是struct device而不是struct acpi_device。我试图通过传递struct acpi_device::dev成员来实现这一点,但是尽管这样做后我没有收到任何错误消息,但是当我将GPIO引脚设置为活动时,似乎什么也没有发生,所以我认为它不起作用。
unsigned int index mnumep'iio-d_flse£flags) 使用如下函数同时获取多个设备: struct g3io_ds5us geiod_g«t_a「「av(st「Mct device"dev, c0list char *cDr_idj enum gpiod」lags fl$eG 该函数返回一个 struct gniO-dwscy{unsigned int ndescs;struct gpio—desc*clest[ ...