Lines Matching full:scu
2 * Pinctrl driver for NXP LPC18xx/LPC43xx System Control Unit (SCU)
24 /* LPC18XX SCU analog function registers */
30 /* LPC18XX SCU pin register definitions */
52 /* LPC18XX SCU pin interrupt select registers */
762 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_get_gpio_pin_int() local
777 ret = lpc18xx_get_pintsel(scu->base + LPC18XX_SCU_PINTSEL0, val, arg); in lpc18xx_pconf_get_gpio_pin_int()
781 return lpc18xx_get_pintsel(scu->base + LPC18XX_SCU_PINTSEL1, val, arg); in lpc18xx_pconf_get_gpio_pin_int()
875 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_get() local
885 reg = readl(scu->base + pin_cap->offset); in lpc18xx_pconf_get()
984 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_set_gpio_pin_int() local
999 reg_val = readl(scu->base + reg_offset); in lpc18xx_pconf_set_gpio_pin_int()
1002 writel(reg_val, scu->base + reg_offset); in lpc18xx_pconf_set_gpio_pin_int()
1088 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pconf_set() local
1100 reg = readl(scu->base + pin_cap->offset); in lpc18xx_pconf_set()
1117 writel(reg, scu->base + pin_cap->offset); in lpc18xx_pconf_set()
1144 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pmx_get_func_groups() local
1146 *groups = scu->func[function].groups; in lpc18xx_pmx_get_func_groups()
1147 *num_groups = scu->func[function].ngroups; in lpc18xx_pmx_get_func_groups()
1155 struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); in lpc18xx_pmx_set() local
1178 writel(LPC18XX_SCU_ANALOG_PIN_CFG, scu->base + pin->offset); in lpc18xx_pmx_set()
1185 reg = readl(scu->base + offset); in lpc18xx_pmx_set()
1187 writel(reg, scu->base + offset); in lpc18xx_pmx_set()
1193 writel(LPC18XX_SCU_ANALOG_PIN_CFG, scu->base + pin->offset); in lpc18xx_pmx_set()
1195 reg = readl(scu->base + LPC18XX_SCU_REG_ENAIO2); in lpc18xx_pmx_set()
1197 writel(reg, scu->base + LPC18XX_SCU_REG_ENAIO2); in lpc18xx_pmx_set()
1210 reg = readl(scu->base + pin->offset); in lpc18xx_pmx_set()
1212 writel(reg | func, scu->base + pin->offset); in lpc18xx_pmx_set()
1259 .name = "lpc18xx/43xx-scu",
1299 struct lpc18xx_scu_data *scu) in lpc18xx_create_group_func_map() argument
1310 scu->func[func].ngroups = ngroups; in lpc18xx_create_group_func_map()
1311 scu->func[func].groups = devm_kcalloc(dev, in lpc18xx_create_group_func_map()
1314 if (!scu->func[func].groups) in lpc18xx_create_group_func_map()
1318 scu->func[func].groups[i] = lpc18xx_pins[pins[i]].name; in lpc18xx_create_group_func_map()
1326 struct lpc18xx_scu_data *scu; in lpc18xx_scu_probe() local
1329 scu = devm_kzalloc(&pdev->dev, sizeof(*scu), GFP_KERNEL); in lpc18xx_scu_probe()
1330 if (!scu) in lpc18xx_scu_probe()
1333 scu->base = devm_platform_ioremap_resource(pdev, 0); in lpc18xx_scu_probe()
1334 if (IS_ERR(scu->base)) in lpc18xx_scu_probe()
1335 return PTR_ERR(scu->base); in lpc18xx_scu_probe()
1337 scu->clk = devm_clk_get(&pdev->dev, NULL); in lpc18xx_scu_probe()
1338 if (IS_ERR(scu->clk)) { in lpc18xx_scu_probe()
1340 return PTR_ERR(scu->clk); in lpc18xx_scu_probe()
1343 ret = lpc18xx_create_group_func_map(&pdev->dev, scu); in lpc18xx_scu_probe()
1349 ret = clk_prepare_enable(scu->clk); in lpc18xx_scu_probe()
1355 platform_set_drvdata(pdev, scu); in lpc18xx_scu_probe()
1357 scu->pctl = devm_pinctrl_register(&pdev->dev, &lpc18xx_scu_desc, scu); in lpc18xx_scu_probe()
1358 if (IS_ERR(scu->pctl)) { in lpc18xx_scu_probe()
1360 clk_disable_unprepare(scu->clk); in lpc18xx_scu_probe()
1361 return PTR_ERR(scu->pctl); in lpc18xx_scu_probe()
1368 { .compatible = "nxp,lpc1850-scu" },
1375 .name = "lpc18xx-scu",