Lines Matching full:pctrl
65 * @pctrl: Pin control device
76 struct pinctrl_dev *pctrl; member
99 struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); in zynqmp_pctrl_get_groups_count() local
101 return pctrl->ngroups + zynqmp_desc.npins; in zynqmp_pctrl_get_groups_count()
107 struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); in zynqmp_pctrl_get_group_name() local
109 if (selector < pctrl->ngroups) in zynqmp_pctrl_get_group_name()
110 return pctrl->groups[selector].name; in zynqmp_pctrl_get_group_name()
112 return zynqmp_desc.pins[selector - pctrl->ngroups].name; in zynqmp_pctrl_get_group_name()
120 struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); in zynqmp_pctrl_get_group_pins() local
122 if (selector < pctrl->ngroups) { in zynqmp_pctrl_get_group_pins()
123 *pins = pctrl->groups[selector].pins; in zynqmp_pctrl_get_group_pins()
124 *npins = pctrl->groups[selector].npins; in zynqmp_pctrl_get_group_pins()
126 *pins = &zynqmp_desc.pins[selector - pctrl->ngroups].number; in zynqmp_pctrl_get_group_pins()
157 struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); in zynqmp_pmux_get_functions_count() local
159 return pctrl->nfuncs; in zynqmp_pmux_get_functions_count()
165 struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); in zynqmp_pmux_get_function_name() local
167 return pctrl->funcs[selector].name; in zynqmp_pmux_get_function_name()
186 struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); in zynqmp_pmux_get_function_groups() local
188 *groups = pctrl->funcs[selector].groups; in zynqmp_pmux_get_function_groups()
189 *num_groups = pctrl->funcs[selector].ngroups; in zynqmp_pmux_get_function_groups()
757 * @pctrl: Pin control driver data.
772 struct zynqmp_pinctrl *pctrl) in zynqmp_pinctrl_prepare_function_info() argument
778 ret = zynqmp_pinctrl_get_num_functions(&pctrl->nfuncs); in zynqmp_pinctrl_prepare_function_info()
782 funcs = devm_kcalloc(dev, pctrl->nfuncs, sizeof(*funcs), GFP_KERNEL); in zynqmp_pinctrl_prepare_function_info()
786 for (i = 0; i < pctrl->nfuncs; i++) { in zynqmp_pinctrl_prepare_function_info()
793 pctrl->ngroups += funcs[i].ngroups; in zynqmp_pinctrl_prepare_function_info()
796 groups = devm_kcalloc(dev, pctrl->ngroups, sizeof(*groups), GFP_KERNEL); in zynqmp_pinctrl_prepare_function_info()
800 ret = zynqmp_pinctrl_prepare_group_pins(dev, groups, pctrl->ngroups); in zynqmp_pinctrl_prepare_function_info()
804 for (i = 0; i < pctrl->nfuncs; i++) { in zynqmp_pinctrl_prepare_function_info()
811 pctrl->funcs = funcs; in zynqmp_pinctrl_prepare_function_info()
812 pctrl->groups = groups; in zynqmp_pinctrl_prepare_function_info()
878 struct zynqmp_pinctrl *pctrl; in zynqmp_pinctrl_probe() local
881 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); in zynqmp_pinctrl_probe()
882 if (!pctrl) in zynqmp_pinctrl_probe()
893 ret = zynqmp_pinctrl_prepare_function_info(&pdev->dev, pctrl); in zynqmp_pinctrl_probe()
899 pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &zynqmp_desc, pctrl); in zynqmp_pinctrl_probe()
900 if (IS_ERR(pctrl->pctrl)) in zynqmp_pinctrl_probe()
901 return PTR_ERR(pctrl->pctrl); in zynqmp_pinctrl_probe()
903 platform_set_drvdata(pdev, pctrl); in zynqmp_pinctrl_probe()