qualcomm GPIO 框架
2022-08-01 17:42:10 0 举报
qualcomm GPIO 框架
作者其他创作
大纲/内容
PMI gpio chip
.
0
PMIC gpio chip
devtree(platform dev):pinctrl@1000000 { compatible = \
TLMM gpio num
统一编址原则,除GPIO chip从0 开始编址外,其他的chip按注册时的先后顺序,从大到小注册。
IRQ_CHIP:
framework层统一编址(gpiolib)
GPIO_DESC
qcom具体平台相关数据(msm8953/msm8952..etc)
msm_function
\tconst char *name;\tconst char * const *groups;\tunsigned ngroups;
PMI_gpio_num
各chip独立编址
pinX
Namepctrl_dev
pin1
ARCH_NR_GPIOS - PMIC_gpio_num-PMI_gpio_num
pinctrl_select_state api所调用的最终接口
pinctrl_pin_desc
\tunsigned number;\tconst char *name;\tvoid *drv_data;
chip独立编址基本是连续的,因为这个编址决定了寄存器的offset
qcom平台相关数据
pinctrl_dev(core_dev与平台无关)
\tstruct list_head node;\tstruct pinctrl_desc *desc;\tstruct radix_tree_root pin_desc_tree;\tstruct list_head gpio_ranges;\tstruct device *dev;\tstruct module *owner;\tvoid *driver_data;\tstruct pinctrl *p;\tstruct pinctrl_state *hog_default;\tstruct pinctrl_state *hog_sleep;\tstruct mutex mutex;#ifdef CONFIG_DEBUG_FS\tstruct dentry *device_root;#endif
gpio_desc 0
struct gpio_chip\t*chip;\tunsigned long\t\tflags;\tconst char\t\t*label;
pinctrl_dev(另一个chip,如pmic)
msm_pinctrl_soc_data
\tconst struct pinctrl_pin_desc *pins;//all pin\tunsigned npins;\tconst struct msm_function *functions; //all func\tunsigned nfunctions;\tconst struct msm_pingroup *groups; //all gpio\tunsigned ngroups;\tunsigned ngpios;
msm_pinctrl
TLMM gpio chip
gpio_chip
pin0
ARCH_NR_GPIOS - PMIC_gpio_num
msm_pingroup
\tconst char *name;\tconst unsigned *pins;\tunsigned npins;\tunsigned *funcs;\tunsigned nfuncs;\tu32 ctl_reg;\tu32 io_reg;\tu32 intr_cfg_reg;\tu32 intr_status_reg;\tu32 intr_target_reg;\tunsigned mux_bit:5;\tunsigned pull_bit:5;\tunsigned drv_bit:5;\tunsigned oe_bit:5;\tunsigned in_bit:5;\tunsigned out_bit:5;\tunsigned intr_enable_bit:5;\tunsigned intr_status_bit:5;\tunsigned intr_ack_high:1;\tunsigned intr_target_bit:5;\tunsigned intr_target_kpss_val:5;\tunsigned intr_raw_status_bit:5;\tunsigned intr_polarity_bit:5;\tunsigned intr_detection_bit:5;\tunsigned intr_detection_width:5;
PMIC_gpio_num
pinctrl_desc
\tconst char *name;\tstruct pinctrl_pin_desc const *pins;\tunsigned int npins;\tconst struct pinctrl_ops *pctlops; //for gpio desc\tconst struct pinmux_ops *pmxops; // for gpio alternate\tconst struct pinconf_ops *confops; // fpr gpio config\tstruct module *owner;
ARCH_NR_GPIOS
0 条评论
下一页