Lines Matching full:pctrl
204 struct loongson2_pinctrl *pctrl = pinctrl_dev_get_drvdata(pcdev); in loongson2_pmx_set_mux() local
205 void __iomem *reg = pctrl->reg_base + in loongson2_pmx_set_mux()
211 spin_lock_irqsave(&pctrl->lock, flags); in loongson2_pmx_set_mux()
218 spin_unlock_irqrestore(&pctrl->lock, flags); in loongson2_pmx_set_mux()
255 struct loongson2_pinctrl *pctrl; in loongson2_pinctrl_probe() local
257 pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); in loongson2_pinctrl_probe()
258 if (!pctrl) in loongson2_pinctrl_probe()
261 pctrl->reg_base = devm_platform_ioremap_resource(pdev, 0); in loongson2_pinctrl_probe()
262 if (IS_ERR(pctrl->reg_base)) in loongson2_pinctrl_probe()
263 return PTR_ERR(pctrl->reg_base); in loongson2_pinctrl_probe()
265 spin_lock_init(&pctrl->lock); in loongson2_pinctrl_probe()
267 pctrl->dev = dev; in loongson2_pinctrl_probe()
268 pctrl->desc.name = "pinctrl-loongson2"; in loongson2_pinctrl_probe()
269 pctrl->desc.owner = THIS_MODULE; in loongson2_pinctrl_probe()
270 pctrl->desc.pctlops = &loongson2_pctrl_ops; in loongson2_pinctrl_probe()
271 pctrl->desc.pmxops = &loongson2_pmx_ops; in loongson2_pinctrl_probe()
272 pctrl->desc.pins = loongson2_pctrl_pins; in loongson2_pinctrl_probe()
273 pctrl->desc.npins = ARRAY_SIZE(loongson2_pctrl_pins); in loongson2_pinctrl_probe()
275 pctrl->pcdev = devm_pinctrl_register(pctrl->dev, &pctrl->desc, pctrl); in loongson2_pinctrl_probe()
276 if (IS_ERR(pctrl->pcdev)) in loongson2_pinctrl_probe()
277 return dev_err_probe(pctrl->dev, PTR_ERR(pctrl->pcdev), in loongson2_pinctrl_probe()