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 *num_groups = 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 berlin_pinctrl_function *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 berlin_pinctrl_function *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, in berlin_pinctrl_build_state()
218 sizeof(*pctrl->functions), GFP_KERNEL); in berlin_pinctrl_build_state()
219 if (!pctrl->functions) in berlin_pinctrl_build_state()
223 for (i = 0; i < pctrl->desc->ngroups; i++) { in berlin_pinctrl_build_state()
224 desc_group = pctrl->desc->groups + i; in berlin_pinctrl_build_state()
228 berlin_pinctrl_add_function(pctrl, desc_function->name); in berlin_pinctrl_build_state()
233 pctrl->functions = krealloc(pctrl->functions, in berlin_pinctrl_build_state()
234 pctrl->nfunctions * sizeof(*pctrl->functions), in berlin_pinctrl_build_state()
236 if (!pctrl->functions) in berlin_pinctrl_build_state()
240 for (i = 0; i < pctrl->desc->ngroups; i++) { in berlin_pinctrl_build_state()
241 desc_group = pctrl->desc->groups + i; in berlin_pinctrl_build_state()
246 *function = pctrl->functions; in berlin_pinctrl_build_state()
259 kfree(pctrl->functions); in berlin_pinctrl_build_state()
271 kfree(pctrl->functions); in berlin_pinctrl_build_state()
301 struct berlin_pinctrl *pctrl; in berlin_pinctrl_probe_regmap() local
304 pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); in berlin_pinctrl_probe_regmap()
305 if (!pctrl) in berlin_pinctrl_probe_regmap()
308 platform_set_drvdata(pdev, pctrl); in berlin_pinctrl_probe_regmap()
310 pctrl->regmap = regmap; in berlin_pinctrl_probe_regmap()
311 pctrl->dev = &pdev->dev; in berlin_pinctrl_probe_regmap()
312 pctrl->desc = desc; in berlin_pinctrl_probe_regmap()
320 pctrl->pctrl_dev = devm_pinctrl_register(dev, &berlin_pctrl_desc, in berlin_pinctrl_probe_regmap()
321 pctrl); in berlin_pinctrl_probe_regmap()
322 if (IS_ERR(pctrl->pctrl_dev)) { in berlin_pinctrl_probe_regmap()
324 return PTR_ERR(pctrl->pctrl_dev); in berlin_pinctrl_probe_regmap()