Lines Matching full:pctrl

37 	struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev);  in berlin_pinctrl_get_group_count()  local
39 return pctrl->desc->ngroups; in berlin_pinctrl_get_group_count()
45 struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev); in berlin_pinctrl_get_group_name() local
47 return pctrl->desc->groups[group].name; in berlin_pinctrl_get_group_name()
55 struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev); in berlin_pinctrl_dt_node_to_map() local
66 dev_err(pctrl->dev, in berlin_pinctrl_dt_node_to_map()
73 dev_err(pctrl->dev, in berlin_pinctrl_dt_node_to_map()
81 dev_err(pctrl->dev, "can't reserve map: %d\n", ret); in berlin_pinctrl_dt_node_to_map()
90 dev_err(pctrl->dev, "can't add map: %d\n", ret); in berlin_pinctrl_dt_node_to_map()
107 struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev); in berlin_pinmux_get_functions_count() local
109 return pctrl->nfunctions; in berlin_pinmux_get_functions_count()
115 struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev); in berlin_pinmux_get_function_name() local
117 return pctrl->functions[function].name; in berlin_pinmux_get_function_name()
125 struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev); in berlin_pinmux_get_function_groups() local
127 *groups = pctrl->functions[function].groups; in berlin_pinmux_get_function_groups()
128 *ngroups = pctrl->functions[function].ngroups; in berlin_pinmux_get_function_groups()
134 berlin_pinctrl_find_function_by_name(struct berlin_pinctrl *pctrl, in berlin_pinctrl_find_function_by_name() argument
154 struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev); in berlin_pinmux_set() local
155 const struct berlin_desc_group *group_desc = pctrl->desc->groups + group; in berlin_pinmux_set()
156 struct pinfunction *func = pctrl->functions + function; in berlin_pinmux_set()
158 berlin_pinctrl_find_function_by_name(pctrl, group_desc, in berlin_pinmux_set()
168 regmap_update_bits(pctrl->regmap, group_desc->offset, mask, val); in berlin_pinmux_set()
180 static int berlin_pinctrl_add_function(struct berlin_pinctrl *pctrl, in berlin_pinctrl_add_function() argument
183 struct pinfunction *function = pctrl->functions; in berlin_pinctrl_add_function()
196 pctrl->nfunctions++; in berlin_pinctrl_add_function()
203 struct berlin_pinctrl *pctrl = platform_get_drvdata(pdev); in berlin_pinctrl_build_state() local
208 pctrl->nfunctions = 0; in berlin_pinctrl_build_state()
210 for (i = 0; i < pctrl->desc->ngroups; i++) { in berlin_pinctrl_build_state()
211 desc_group = pctrl->desc->groups + i; in berlin_pinctrl_build_state()
217 pctrl->functions = kcalloc(max_functions, sizeof(*pctrl->functions), GFP_KERNEL); in berlin_pinctrl_build_state()
218 if (!pctrl->functions) in berlin_pinctrl_build_state()
222 for (i = 0; i < pctrl->desc->ngroups; i++) { in berlin_pinctrl_build_state()
223 desc_group = pctrl->desc->groups + i; in berlin_pinctrl_build_state()
227 berlin_pinctrl_add_function(pctrl, desc_function->name); in berlin_pinctrl_build_state()
232 pctrl->functions = krealloc(pctrl->functions, in berlin_pinctrl_build_state()
233 pctrl->nfunctions * sizeof(*pctrl->functions), in berlin_pinctrl_build_state()
235 if (!pctrl->functions) in berlin_pinctrl_build_state()
239 for (i = 0; i < pctrl->desc->ngroups; i++) { in berlin_pinctrl_build_state()
240 desc_group = pctrl->desc->groups + i; in berlin_pinctrl_build_state()
244 struct pinfunction *function = pctrl->functions; in berlin_pinctrl_build_state()
257 kfree(pctrl->functions); in berlin_pinctrl_build_state()
268 kfree(pctrl->functions); in berlin_pinctrl_build_state()
298 struct berlin_pinctrl *pctrl; in berlin_pinctrl_probe_regmap() local
301 pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); in berlin_pinctrl_probe_regmap()
302 if (!pctrl) in berlin_pinctrl_probe_regmap()
305 platform_set_drvdata(pdev, pctrl); in berlin_pinctrl_probe_regmap()
307 pctrl->regmap = regmap; in berlin_pinctrl_probe_regmap()
308 pctrl->dev = &pdev->dev; in berlin_pinctrl_probe_regmap()
309 pctrl->desc = desc; in berlin_pinctrl_probe_regmap()
317 pctrl->pctrl_dev = devm_pinctrl_register(dev, &berlin_pctrl_desc, in berlin_pinctrl_probe_regmap()
318 pctrl); in berlin_pinctrl_probe_regmap()
319 if (IS_ERR(pctrl->pctrl_dev)) { in berlin_pinctrl_probe_regmap()
321 return PTR_ERR(pctrl->pctrl_dev); in berlin_pinctrl_probe_regmap()