Lines Matching full:scu
2 * Pinctrl driver for NXP LPC18xx/LPC43xx System Control Unit (SCU)
26 /* LPC18XX SCU analog function registers */
32 /* LPC18XX SCU pin register definitions */
54 /* LPC18XX SCU pin interrupt select registers */
764 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_get_gpio_pin_int() local
779 ret = lpc18xx_get_pintsel(scu->base + LPC18XX_SCU_PINTSEL0, val, arg); in lpc18xx_pconf_get_gpio_pin_int()
783 return lpc18xx_get_pintsel(scu->base + LPC18XX_SCU_PINTSEL1, val, arg); in lpc18xx_pconf_get_gpio_pin_int()
877 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_get() local
887 reg = readl(scu->base + pin_cap->offset); in lpc18xx_pconf_get()
986 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_set_gpio_pin_int() local
1001 reg_val = readl(scu->base + reg_offset); in lpc18xx_pconf_set_gpio_pin_int()
1004 writel(reg_val, scu->base + reg_offset); in lpc18xx_pconf_set_gpio_pin_int()
1090 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_set() local
1102 reg = readl(scu->base + pin_cap->offset); in lpc18xx_pconf_set()
1119 writel(reg, scu->base + pin_cap->offset); in lpc18xx_pconf_set()
1146 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pmx_get_func_groups() local
1148 *groups = scu->func[function].groups; in lpc18xx_pmx_get_func_groups()
1149 *num_groups = scu->func[function].ngroups; in lpc18xx_pmx_get_func_groups()
1157 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pmx_set() local
1180 writel(LPC18XX_SCU_ANALOG_PIN_CFG, scu->base + pin->offset); in lpc18xx_pmx_set()
1187 reg = readl(scu->base + offset); in lpc18xx_pmx_set()
1189 writel(reg, scu->base + offset); in lpc18xx_pmx_set()
1195 writel(LPC18XX_SCU_ANALOG_PIN_CFG, scu->base + pin->offset); in lpc18xx_pmx_set()
1197 reg = readl(scu->base + LPC18XX_SCU_REG_ENAIO2); in lpc18xx_pmx_set()
1199 writel(reg, scu->base + LPC18XX_SCU_REG_ENAIO2); in lpc18xx_pmx_set()
1212 reg = readl(scu->base + pin->offset); in lpc18xx_pmx_set()
1214 writel(reg | func, scu->base + pin->offset); in lpc18xx_pmx_set()
1261 .name = "lpc18xx/43xx-scu",
1301 struct lpc18xx_scu_data *scu) in lpc18xx_create_group_func_map() argument
1312 scu->func[func].ngroups = ngroups; in lpc18xx_create_group_func_map()
1313 scu->func[func].groups = devm_kcalloc(dev, in lpc18xx_create_group_func_map()
1316 if (!scu->func[func].groups) in lpc18xx_create_group_func_map()
1320 scu->func[func].groups[i] = lpc18xx_pins[pins[i]].name; in lpc18xx_create_group_func_map()
1328 struct lpc18xx_scu_data *scu; in lpc18xx_scu_probe() local
1331 scu = devm_kzalloc(&pdev->dev, sizeof(*scu), GFP_KERNEL); in lpc18xx_scu_probe()
1332 if (!scu) in lpc18xx_scu_probe()
1335 scu->base = devm_platform_ioremap_resource(pdev, 0); in lpc18xx_scu_probe()
1336 if (IS_ERR(scu->base)) in lpc18xx_scu_probe()
1337 return PTR_ERR(scu->base); in lpc18xx_scu_probe()
1339 scu->clk = devm_clk_get(&pdev->dev, NULL); in lpc18xx_scu_probe()
1340 if (IS_ERR(scu->clk)) { in lpc18xx_scu_probe()
1342 return PTR_ERR(scu->clk); in lpc18xx_scu_probe()
1345 ret = lpc18xx_create_group_func_map(&pdev->dev, scu); in lpc18xx_scu_probe()
1351 ret = clk_prepare_enable(scu->clk); in lpc18xx_scu_probe()
1357 platform_set_drvdata(pdev, scu); in lpc18xx_scu_probe()
1359 scu->pctl = devm_pinctrl_register(&pdev->dev, &lpc18xx_scu_desc, scu); in lpc18xx_scu_probe()
1360 if (IS_ERR(scu->pctl)) { in lpc18xx_scu_probe()
1362 clk_disable_unprepare(scu->clk); in lpc18xx_scu_probe()
1363 return PTR_ERR(scu->pctl); in lpc18xx_scu_probe()
1370 { .compatible = "nxp,lpc1850-scu" },
1377 .name = "lpc18xx-scu",