Lines Matching +full:ls2k +full:- +full:gpio
1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright (C) 2022-2023 Loongson Technology Corporation Limited
13 #include <linux/pinctrl/pinconf-generic.h>
20 #include "pinctrl-utils.h"
63 #define LOONGSON2_PIN(x) PINCTRL_PIN(x, "gpio"#x)
108 PMX_GROUP(gpio, 0x0, 64),
150 FUNCTION(gpio),
189 seq_printf(s, " %s", dev_name(pcdev->dev)); in loongson2_pin_dbg_show()
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()
254 struct device *dev = &pdev->dev; in loongson2_pinctrl_probe()
259 return -ENOMEM; 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()
285 .compatible = "loongson,ls2k-pinctrl",
294 .name = "loongson2-pinctrl",