Linux 内核设备驱动之GPIO驱动之GPIO 控制器设备描述

 

/**  * struct gpio_device - internal state container for GPIO devices  * @id: numerical ID number for the GPIO chip  * @dev: the GPIO device struct  * @chrdev: character device for the GPIO device  * @mockdev: class device used by the deprecated sysfs interface (may be  * NULL)  * @owner: helps prevent removal of modules exporting active GPIOs  * @chip: pointer to the corresponding gpiochip, holding static  * data for this device  * @descs: array of ngpio descriptors.  * @ngpio: the number of GPIO lines on this GPIO device, equal to the size  * of the @descs array.  * @base: GPIO base in the DEPRECATED global Linux GPIO numberspace, assigned  * at device creation time.  * @label: a descriptive name for the GPIO device, such as the part number  * or name of the IP component in a System on Chip.  * @data: per-instance data assigned by the driver  * @list: links gpio_device:s together for traversal  *  * This state container holds most of the runtime variable data  * for a GPIO device and can hold references and live on after the  * GPIO chip has been removed, if it is still being used from  * userspace.  */ struct gpio_device {  int   id;  struct device  dev;  struct cdev  chrdev;  struct device  *mockdev;  struct module  *owner;  struct gpio_chip *chip;  struct gpio_desc *descs;  int   base;  u16   ngpio;  char   *label;  void   *data;  struct list_head        list;

#ifdef CONFIG_PINCTRL  /*   * If CONFIG_PINCTRL is enabled, then gpio controllers can optionally   * describe the actual pin range which they serve in an SoC. This   * information would be used by pinctrl subsystem to configure   * corresponding pins for gpio usage.   */  struct list_head pin_ranges; #endif };

 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值