Lines Matching refs:sprd_pctl

161 static int sprd_pinctrl_get_id_by_name(struct sprd_pinctrl *sprd_pctl,  in sprd_pinctrl_get_id_by_name()  argument
164 struct sprd_pinctrl_soc_info *info = sprd_pctl->info; in sprd_pinctrl_get_id_by_name()
176 sprd_pinctrl_get_pin_by_id(struct sprd_pinctrl *sprd_pctl, unsigned int id) in sprd_pinctrl_get_pin_by_id() argument
178 struct sprd_pinctrl_soc_info *info = sprd_pctl->info; in sprd_pinctrl_get_pin_by_id()
193 sprd_pinctrl_find_group_by_name(struct sprd_pinctrl *sprd_pctl, in sprd_pinctrl_find_group_by_name() argument
196 struct sprd_pinctrl_soc_info *info = sprd_pctl->info; in sprd_pinctrl_find_group_by_name()
883 struct sprd_pinctrl *sprd_pctl, in sprd_pinctrl_parse_groups() argument
896 grp->pins = devm_kcalloc(sprd_pctl->dev, in sprd_pinctrl_parse_groups()
903 ret = sprd_pinctrl_get_id_by_name(sprd_pctl, pin_name); in sprd_pinctrl_parse_groups()
909 dev_dbg(sprd_pctl->dev, in sprd_pinctrl_parse_groups()
933 static int sprd_pinctrl_parse_dt(struct sprd_pinctrl *sprd_pctl) in sprd_pinctrl_parse_dt() argument
935 struct sprd_pinctrl_soc_info *info = sprd_pctl->info; in sprd_pinctrl_parse_dt()
936 struct device_node *np = sprd_pctl->dev->of_node; in sprd_pinctrl_parse_dt()
948 info->groups = devm_kcalloc(sprd_pctl->dev, in sprd_pinctrl_parse_dt()
955 info->grp_names = devm_kcalloc(sprd_pctl->dev, in sprd_pinctrl_parse_dt()
965 ret = sprd_pinctrl_parse_groups(child, sprd_pctl, grp); in sprd_pinctrl_parse_dt()
975 sprd_pctl, grp); in sprd_pinctrl_parse_dt()
988 static int sprd_pinctrl_add_pins(struct sprd_pinctrl *sprd_pctl, in sprd_pinctrl_add_pins() argument
992 struct sprd_pinctrl_soc_info *info = sprd_pctl->info; in sprd_pinctrl_add_pins()
998 info->pins = devm_kcalloc(sprd_pctl->dev, in sprd_pinctrl_add_pins()
1012 pin->reg = (unsigned long)sprd_pctl->base + in sprd_pinctrl_add_pins()
1018 pin->reg = (unsigned long)sprd_pctl->base + in sprd_pinctrl_add_pins()
1023 pin->reg = (unsigned long)sprd_pctl->base + in sprd_pinctrl_add_pins()
1030 dev_dbg(sprd_pctl->dev, "pin name[%s-%d], type = %d, " in sprd_pinctrl_add_pins()
1043 struct sprd_pinctrl *sprd_pctl; in sprd_pinctrl_core_probe() local
1048 sprd_pctl = devm_kzalloc(&pdev->dev, sizeof(struct sprd_pinctrl), in sprd_pinctrl_core_probe()
1050 if (!sprd_pctl) in sprd_pinctrl_core_probe()
1053 sprd_pctl->base = devm_platform_ioremap_resource(pdev, 0); in sprd_pinctrl_core_probe()
1054 if (IS_ERR(sprd_pctl->base)) in sprd_pinctrl_core_probe()
1055 return PTR_ERR(sprd_pctl->base); in sprd_pinctrl_core_probe()
1063 sprd_pctl->info = pinctrl_info; in sprd_pinctrl_core_probe()
1064 sprd_pctl->dev = &pdev->dev; in sprd_pinctrl_core_probe()
1065 platform_set_drvdata(pdev, sprd_pctl); in sprd_pinctrl_core_probe()
1067 ret = sprd_pinctrl_add_pins(sprd_pctl, sprd_soc_pin_info, pins_cnt); in sprd_pinctrl_core_probe()
1073 ret = sprd_pinctrl_parse_dt(sprd_pctl); in sprd_pinctrl_core_probe()
1096 sprd_pctl->pctl = pinctrl_register(&sprd_pinctrl_desc, in sprd_pinctrl_core_probe()
1097 &pdev->dev, (void *)sprd_pctl); in sprd_pinctrl_core_probe()
1098 if (IS_ERR(sprd_pctl->pctl)) { in sprd_pinctrl_core_probe()
1100 return PTR_ERR(sprd_pctl->pctl); in sprd_pinctrl_core_probe()
1109 struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev); in sprd_pinctrl_remove() local
1111 pinctrl_unregister(sprd_pctl->pctl); in sprd_pinctrl_remove()