在看显示模块的代码时看到一个函数devm_gpiod_get_optional(), 之前没接触过,它的调用如下: devm_gpiod_get_optional ->devm_gpiod_get_index_optional->//index为0devm_gpiod_get_index ->gpiod_get_index 可以看到devm_gpiod_get_optional只是对gpiod_get_index的包装而已,并且index为0。index参数后面会...
*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...
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 gpio_set_value 释放GPIO...
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); msleep(CS35L34_START_DELAY); ret = regmap_read(cs35l34->regmap, C...
gpio-controller; #gpio-cells = <0x2>; interrupt-controller; #interrupt-cells = <0x2>; linux,phandle = <0xc>; phandle = <0xc>; }; …… } 其实S3C2416 pin controller定义了gpa到gpm共计11个sub node,每个sub node是描述S3C2416 GPIO controller的各个bank信息。S3C2416有138个I/O 端口(或者叫做...
sclk = devm_kzalloc(dev,sizeof(*sclk), GFP_KERNEL);if(!sclk)return-ENOMEM;if(of_property_read_string_index(np,"clock-output-names", idx, &name)) { dev_err(dev,"invalid clock name @ %s\n", np->name);return-EINVAL; }if(of_property_read_u32_index(np,"clock-indices", ...
4.x内核文档 Linux-4.9.88...\Documentation\gpio Linux-4.9.88\Documentation\devicetree\bindings\gpio\gpio.txt Linux-4.9.88\drivers...devm_gpiod_get_index devm_gpiod_get_array 设置方向 gpiod_direction_input gpio_direction_input gpiod_direction_output...devm_gpiod_put_array 1.3 GPIOLIB向下...
可以看到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); ...
可以看到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); ...
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 gpio_set_value 释放GPIO...