Lines Matching refs:pmx
51 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_get_groups_count() local
53 return pmx->pfc->info->nr_groups; in sh_pfc_get_groups_count()
59 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_get_group_name() local
61 return pmx->pfc->info->groups[selector].name; in sh_pfc_get_group_name()
67 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_get_group_pins() local
69 *pins = pmx->pfc->info->groups[selector].pins; in sh_pfc_get_group_pins()
70 *num_pins = pmx->pfc->info->groups[selector].nr_pins; in sh_pfc_get_group_pins()
108 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_dt_subnode_to_map() local
109 struct device *dev = pmx->pfc->dev; in sh_pfc_dt_subnode_to_map()
127 if (!pmx->func_prop_name) { in sh_pfc_dt_subnode_to_map()
130 pmx->func_prop_name = "function"; in sh_pfc_dt_subnode_to_map()
131 pmx->groups_prop_name = "groups"; in sh_pfc_dt_subnode_to_map()
132 pmx->pins_prop_name = "pins"; in sh_pfc_dt_subnode_to_map()
134 pmx->func_prop_name = "renesas,function"; in sh_pfc_dt_subnode_to_map()
135 pmx->groups_prop_name = "renesas,groups"; in sh_pfc_dt_subnode_to_map()
136 pmx->pins_prop_name = "renesas,pins"; in sh_pfc_dt_subnode_to_map()
143 ret = of_property_read_string(np, pmx->func_prop_name, &function); in sh_pfc_dt_subnode_to_map()
161 ret = of_property_count_strings(np, pmx->pins_prop_name); in sh_pfc_dt_subnode_to_map()
171 ret = of_property_count_strings(np, pmx->groups_prop_name); in sh_pfc_dt_subnode_to_map()
202 of_property_for_each_string(np, pmx->groups_prop_name, prop, group) { in sh_pfc_dt_subnode_to_map()
226 of_property_for_each_string(np, pmx->pins_prop_name, prop, pin) { in sh_pfc_dt_subnode_to_map()
263 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_dt_node_to_map() local
264 struct device *dev = pmx->pfc->dev; in sh_pfc_dt_node_to_map()
315 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_get_functions_count() local
317 return pmx->pfc->info->nr_functions; in sh_pfc_get_functions_count()
323 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_get_function_name() local
325 return pmx->pfc->info->functions[selector].name; in sh_pfc_get_function_name()
333 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_get_function_groups() local
335 *groups = pmx->pfc->info->functions[selector].groups; in sh_pfc_get_function_groups()
336 *num_groups = pmx->pfc->info->functions[selector].nr_groups; in sh_pfc_get_function_groups()
344 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_func_set_mux() local
345 struct sh_pfc *pfc = pmx->pfc; in sh_pfc_func_set_mux()
355 struct sh_pfc_pin_config *cfg = &pmx->configs[idx]; in sh_pfc_func_set_mux()
378 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_gpio_request_enable() local
379 struct sh_pfc *pfc = pmx->pfc; in sh_pfc_gpio_request_enable()
381 struct sh_pfc_pin_config *cfg = &pmx->configs[idx]; in sh_pfc_gpio_request_enable()
420 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_gpio_disable_free() local
421 struct sh_pfc *pfc = pmx->pfc; in sh_pfc_gpio_disable_free()
423 struct sh_pfc_pin_config *cfg = &pmx->configs[idx]; in sh_pfc_gpio_disable_free()
435 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_gpio_set_direction() local
436 struct sh_pfc *pfc = pmx->pfc; in sh_pfc_gpio_set_direction()
440 struct sh_pfc_pin_config *cfg = &pmx->configs[idx]; in sh_pfc_gpio_set_direction()
505 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_pinconf_get() local
506 struct sh_pfc *pfc = pmx->pfc; in sh_pfc_pinconf_get()
560 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_pinconf_set() local
561 struct sh_pfc *pfc = pmx->pfc; in sh_pfc_pinconf_set()
615 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); in sh_pfc_pinconf_group_set() local
620 pins = pmx->pfc->info->groups[group].pins; in sh_pfc_pinconf_group_set()
621 num_pins = pmx->pfc->info->groups[group].nr_pins; in sh_pfc_pinconf_group_set()
638 static int sh_pfc_map_pins(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx) in sh_pfc_map_pins() argument
643 pmx->pins = devm_kzalloc(pfc->dev, in sh_pfc_map_pins()
644 sizeof(*pmx->pins) * pfc->info->nr_pins, in sh_pfc_map_pins()
646 if (unlikely(!pmx->pins)) in sh_pfc_map_pins()
649 pmx->configs = devm_kzalloc(pfc->dev, in sh_pfc_map_pins()
650 sizeof(*pmx->configs) * pfc->info->nr_pins, in sh_pfc_map_pins()
652 if (unlikely(!pmx->configs)) in sh_pfc_map_pins()
657 struct sh_pfc_pin_config *cfg = &pmx->configs[i]; in sh_pfc_map_pins()
658 struct pinctrl_pin_desc *pin = &pmx->pins[i]; in sh_pfc_map_pins()
671 struct sh_pfc_pinctrl *pmx; in sh_pfc_register_pinctrl() local
674 pmx = devm_kzalloc(pfc->dev, sizeof(*pmx), GFP_KERNEL); in sh_pfc_register_pinctrl()
675 if (unlikely(!pmx)) in sh_pfc_register_pinctrl()
678 pmx->pfc = pfc; in sh_pfc_register_pinctrl()
679 pfc->pinctrl = pmx; in sh_pfc_register_pinctrl()
681 ret = sh_pfc_map_pins(pfc, pmx); in sh_pfc_register_pinctrl()
685 pmx->pctl_desc.name = DRV_NAME; in sh_pfc_register_pinctrl()
686 pmx->pctl_desc.owner = THIS_MODULE; in sh_pfc_register_pinctrl()
687 pmx->pctl_desc.pctlops = &sh_pfc_pinctrl_ops; in sh_pfc_register_pinctrl()
688 pmx->pctl_desc.pmxops = &sh_pfc_pinmux_ops; in sh_pfc_register_pinctrl()
689 pmx->pctl_desc.confops = &sh_pfc_pinconf_ops; in sh_pfc_register_pinctrl()
690 pmx->pctl_desc.pins = pmx->pins; in sh_pfc_register_pinctrl()
691 pmx->pctl_desc.npins = pfc->info->nr_pins; in sh_pfc_register_pinctrl()
693 pmx->pctl = pinctrl_register(&pmx->pctl_desc, pfc->dev, pmx); in sh_pfc_register_pinctrl()
694 if (IS_ERR(pmx->pctl)) in sh_pfc_register_pinctrl()
695 return PTR_ERR(pmx->pctl); in sh_pfc_register_pinctrl()
702 struct sh_pfc_pinctrl *pmx = pfc->pinctrl; in sh_pfc_unregister_pinctrl() local
704 pinctrl_unregister(pmx->pctl); in sh_pfc_unregister_pinctrl()