Lines Matching +full:uart11 +full:- +full:pins
1 // SPDX-License-Identifier: GPL-2.0+
14 #include <linux/pinctrl/pinconf-generic.h>
20 #include "pinctrl-utils.h"
25 * struct bm1880_pinctrl - driver data
45 * struct bm1880_pctrl_group - pinctrl group
47 * @pins: Array of pins belonging to this group
48 * @npins: Number of @pins
52 const unsigned int *pins; member
57 * struct bm1880_pinmux_function - a pinmux function
75 * struct bm1880_pinconf_data - pinconf data
366 .pins = nm ## _pins, \
430 BM1880_PINCTRL_GRP(uart11),
718 BM1880_PINMUX_FUNCTION(uart11, 1),
923 return pctrl->ngroups; in bm1880_pctrl_get_groups_count()
931 return pctrl->groups[selector].name; in bm1880_pctrl_get_group_name()
936 const unsigned int **pins, in bm1880_pctrl_get_group_pins() argument
941 *pins = pctrl->groups[selector].pins; in bm1880_pctrl_get_group_pins()
942 *num_pins = pctrl->groups[selector].npins; in bm1880_pctrl_get_group_pins()
960 return pctrl->nfuncs; in bm1880_pmux_get_functions_count()
968 return pctrl->funcs[selector].name; in bm1880_pmux_get_function_name()
978 *groups = pctrl->funcs[selector].groups; in bm1880_pmux_get_function_groups()
979 *num_groups = pctrl->funcs[selector].ngroups; in bm1880_pmux_get_function_groups()
988 const struct bm1880_pctrl_group *pgrp = &pctrl->groups[group]; in bm1880_pinmux_set_mux()
989 const struct bm1880_pinmux_function *func = &pctrl->funcs[function]; in bm1880_pinmux_set_mux()
992 for (i = 0; i < pgrp->npins; i++) { in bm1880_pinmux_set_mux()
993 unsigned int pin = pgrp->pins[i]; in bm1880_pinmux_set_mux()
996 u32 regval = readl_relaxed(pctrl->base + BM1880_REG_MUX + in bm1880_pinmux_set_mux()
1000 regval |= func->mux_val << mux_offset; in bm1880_pinmux_set_mux()
1002 writel_relaxed(regval, pctrl->base + BM1880_REG_MUX + offset); in bm1880_pinmux_set_mux()
1062 return -EINVAL; in bm1880_pinconf_drv_set()
1083 return -EINVAL; in bm1880_pinconf_drv_set()
1094 int ret = -ENOTSUPP; in bm1880_pinconf_drv_get()
1162 regval = readl_relaxed(pctrl->base + BM1880_REG_MUX + offset); in bm1880_pinconf_cfg_get()
1187 ret = bm1880_pinconf_drv_get(pctrl->pinconf[pin].drv_bits, in bm1880_pinconf_cfg_get()
1195 return -ENOTSUPP; in bm1880_pinconf_cfg_get()
1213 regval = readl_relaxed(pctrl->base + BM1880_REG_MUX + offset); in bm1880_pinconf_cfg_set()
1249 pctrl->pinconf[pin].drv_bits, in bm1880_pinconf_cfg_set()
1256 dev_warn(pctldev->dev, in bm1880_pinconf_cfg_set()
1262 writel_relaxed(regval, pctrl->base + BM1880_REG_MUX + offset); in bm1880_pinconf_cfg_set()
1275 const struct bm1880_pctrl_group *pgrp = &pctrl->groups[selector]; in bm1880_pinconf_group_set()
1277 for (i = 0; i < pgrp->npins; i++) { in bm1880_pinconf_group_set()
1278 ret = bm1880_pinconf_cfg_set(pctldev, pgrp->pins[i], configs, in bm1880_pinconf_group_set()
1303 .pins = bm1880_pins,
1316 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); in bm1880_pinctrl_probe()
1318 return -ENOMEM; in bm1880_pinctrl_probe()
1320 pctrl->base = devm_platform_ioremap_resource(pdev, 0); in bm1880_pinctrl_probe()
1321 if (IS_ERR(pctrl->base)) in bm1880_pinctrl_probe()
1322 return PTR_ERR(pctrl->base); in bm1880_pinctrl_probe()
1324 pctrl->groups = bm1880_pctrl_groups; in bm1880_pinctrl_probe()
1325 pctrl->ngroups = ARRAY_SIZE(bm1880_pctrl_groups); in bm1880_pinctrl_probe()
1326 pctrl->funcs = bm1880_pmux_functions; in bm1880_pinctrl_probe()
1327 pctrl->nfuncs = ARRAY_SIZE(bm1880_pmux_functions); in bm1880_pinctrl_probe()
1328 pctrl->pinconf = bm1880_pinconf; in bm1880_pinctrl_probe()
1330 pctrl->pctrldev = devm_pinctrl_register(&pdev->dev, &bm1880_desc, in bm1880_pinctrl_probe()
1332 if (IS_ERR(pctrl->pctrldev)) in bm1880_pinctrl_probe()
1333 return PTR_ERR(pctrl->pctrldev); in bm1880_pinctrl_probe()
1337 dev_info(&pdev->dev, "BM1880 pinctrl driver initialized\n"); in bm1880_pinctrl_probe()
1343 { .compatible = "bitmain,bm1880-pinctrl" },
1349 .name = "pinctrl-bm1880",