答:gpiod_get_index()本质上和gpio_request()是一个功能,是申请gpio的,只是它是从device tree去查找, 因此看到第二个参数”con_id”是字符串类型,也就是gpio的名字。 例如在显示驱动看到的去查找名字为”enable”的gpio panel-simple.c: panel->enable_gpio = devm_gpiod_get_optional(dev,"enable",0); ...
priv->ulpi_reset = devm_gpiod_get_optional(dev->parent, "reset", GPIOD_ACTIVE_LOW); /* property is optional, don't return error! */ if (priv->ulpi_reset) { /* Toggle ulpi to reset the phy. */ rc = dm_gpio_set_value(priv->ulpi_reset, 1); ...
*devm_fwnode_get_index_gpiod_from_child(struct device *dev, return desc; } -EXPORT_SYMBOL(devm_fwnode_get_index_gpiod_from_child); +EXPORT_SYMBOL(devm_fwnode_gpiod_get_index); /** * devm_gpiod_get_index_optional - Resource-managed gpiod_get_index_optional() diff --git a/include/l...
dev_err(&i2c_client->dev,"Failed to request IRQ: %d\n", ret); cs35l34->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,"reset-gpios", GPIOD_OUT_LOW);if(IS_ERR(cs35l34->reset_gpio))returnPTR_ERR(cs35l34->reset_gpio); gpiod_set_value_cansleep(cs35l34->reset_gpio,1);...
2——GPIO子系统重要概念 descriptor-based legacy 说明 获得GPIO gpiod_get gpio_request gpiod_get_index gpiod_get_array gpio_request_array devm_gpiod_get...devm_gpiod_get_index devm_gpiod_get_array 设置方向 gpiod_direction_input gpio_direction_input gpiod_direction_output...gpiod_set_value...
dev_err(&spi->dev,"Unable to get Vdd regulator: %d\n", ret);returnret; } ak4104->regmap = devm_regmap_init_spi(spi, &ak4104_regmap);if(IS_ERR(ak4104->regmap)) { ret = PTR_ERR(ak4104->regmap);returnret; }if(np) {enumof_gpio_flags flags;intgpio = of_get_named_gpio_flags...
可以看到devm_gpiod_get_optional只是对gpiod_get_index的包装而已,并且index为0。index参数后面会提。 函数参数: structgpio_desc *__must_check devm_gpiod_get_index(structdevice *dev,constchar*con_id, unsignedintidx,enumgpiod_flags flags); ...
get请求 2019-12-20 19:43 −1.get请求在二级目录下的views.py文件中写入 声明全局变量 c = "pp" d = "123" def indexa(request): if request.method == "GET": name = request.GET.get("name") pwd =... 后羿的百宝箱 0 312 STM32 GPIO口的配置和应用 ...
2——GPIO子系统重要概念 descriptor-based legacy 说明 获得GPIO gpiod_get gpio_request gpiod_get_index gpiod_get_array gpio_request_array devm_gpiod_get...devm_gpiod_get_index devm_gpiod_get_array 设置方向 gpiod_direction_input gpio_direction_input gpiod_direction_output...gpiod_set_value...
dev_err(dev,"failed to get memory for instance %d\n", id); ret = -ENODEV;gotoerr0; } res->parent =NULL; resources[0] = *res;/* first resource is for usbss, so start index from 1 */res = platform_get_resource(pdev, IORESOURCE_IRQ, id +1);if(!res) { ...