Lines Matching +full:nand +full:- +full:related

1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/drivers/pinctrl/pinmux-xway.c
4 * based on linux/drivers/pinctrl/pinmux-pxa910.c
21 #include "pinctrl-lantiq.h"
110 /* --------- DEPRECATED: xr9 related code --------- */
111 /* ---------- use xrx100/xrx200 instead ---------- */
249 GRP_MUX("nand ale", EBU, pins_nand_ale),
250 GRP_MUX("nand cs1", EBU, pins_nand_cs1),
251 GRP_MUX("nand cle", EBU, pins_nand_cle),
277 GRP_MUX("nand rdy", EBU, pins_nand_rdy),
278 GRP_MUX("nand rd", EBU, pins_nand_rd),
305 "nand ale", "nand cs1",
306 "nand cle"};
322 "nand ale", "nand cs1",
323 "nand cle", "nand rdy",
324 "nand rd"};
347 /* --------- ase related code --------- */
475 /* --------- danube related code --------- */
578 GRP_MUX("nand ale", EBU, danube_pins_nand_ale),
579 GRP_MUX("nand cs1", EBU, danube_pins_nand_cs1),
580 GRP_MUX("nand cle", EBU, danube_pins_nand_cle),
626 "nand ale", "nand cs1",
627 "nand cle"};
650 /* --------- xrx100 related code --------- */
785 GRP_MUX("nand ale", EBU, xrx100_pins_nand_ale),
786 GRP_MUX("nand cs1", EBU, xrx100_pins_nand_cs1),
787 GRP_MUX("nand cle", EBU, xrx100_pins_nand_cle),
788 GRP_MUX("nand rdy", EBU, xrx100_pins_nand_rdy),
789 GRP_MUX("nand rd", EBU, xrx100_pins_nand_rd),
837 "nand ale", "nand cs1",
838 "nand cle", "nand rdy",
839 "nand rd"};
863 /* --------- xrx200 related code --------- */
1013 GRP_MUX("nand ale", EBU, xrx200_pins_nand_ale),
1014 GRP_MUX("nand cs1", EBU, xrx200_pins_nand_cs1),
1015 GRP_MUX("nand cle", EBU, xrx200_pins_nand_cle),
1016 GRP_MUX("nand rdy", EBU, xrx200_pins_nand_rdy),
1017 GRP_MUX("nand rd", EBU, xrx200_pins_nand_rd),
1083 "nand ale", "nand cs1",
1084 "nand cle", "nand rdy",
1085 "nand rd"};
1119 /* --------- xrx300 related code --------- */
1256 GRP_MUX("nand ale", EBU, xrx300_pins_nand_ale),
1257 GRP_MUX("nand cs1", EBU, xrx300_pins_nand_cs1),
1258 GRP_MUX("nand cle", EBU, xrx300_pins_nand_cle),
1259 GRP_MUX("nand rdy", EBU, xrx300_pins_nand_rdy),
1260 GRP_MUX("nand rd", EBU, xrx300_pins_nand_rd),
1261 GRP_MUX("nand d1", EBU, xrx300_pins_nand_d1),
1262 GRP_MUX("nand d0", EBU, xrx300_pins_nand_d0),
1263 GRP_MUX("nand d2", EBU, xrx300_pins_nand_d2),
1264 GRP_MUX("nand d7", EBU, xrx300_pins_nand_d7),
1265 GRP_MUX("nand d6", EBU, xrx300_pins_nand_d6),
1266 GRP_MUX("nand d5", EBU, xrx300_pins_nand_d5),
1267 GRP_MUX("nand d4", EBU, xrx300_pins_nand_d4),
1268 GRP_MUX("nand d3", EBU, xrx300_pins_nand_d3),
1269 GRP_MUX("nand cs0", EBU, xrx300_pins_nand_cs0),
1270 GRP_MUX("nand wr", EBU, xrx300_pins_nand_wr),
1271 GRP_MUX("nand wp", EBU, xrx300_pins_nand_wp),
1272 GRP_MUX("nand se", EBU, xrx300_pins_nand_se),
1300 static const char * const xrx300_ebu_grps[] = {"nand ale", "nand cs1",
1301 "nand cle", "nand rdy",
1302 "nand rd", "nand d1",
1303 "nand d0", "nand d2",
1304 "nand d7", "nand d6",
1305 "nand d5", "nand d4",
1306 "nand d3", "nand cs0",
1307 "nand wr", "nand wp",
1308 "nand se"};
1332 /* --------- pinconf related code --------- */
1349 !gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); in xway_pinconf_get()
1357 if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) { in xway_pinconf_get()
1366 if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) in xway_pinconf_get()
1375 gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); in xway_pinconf_get()
1378 dev_err(pctldev->dev, "Invalid config param %04x\n", param); in xway_pinconf_get()
1379 return -ENOTSUPP; in xway_pinconf_get()
1407 gpio_setbit(info->membase[0], in xway_pinconf_set()
1411 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1422 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1427 gpio_setbit(info->membase[0], reg, PORT_PIN(pin)); in xway_pinconf_set()
1434 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1438 gpio_setbit(info->membase[0], in xway_pinconf_set()
1442 dev_err(pctldev->dev, in xway_pinconf_set()
1449 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1453 gpio_setbit(info->membase[0], in xway_pinconf_set()
1459 dev_err(pctldev->dev, in xway_pinconf_set()
1461 return -ENOTSUPP; in xway_pinconf_set()
1476 for (i = 0; i < info->grps[selector].npins && !ret; i++) in xway_pinconf_group_set()
1478 info->grps[selector].pins[i], in xway_pinconf_group_set()
1507 gpio_setbit(info->membase[0], GPIO_ALT0(pin), PORT_PIN(pin)); in xway_mux_apply()
1509 gpio_clearbit(info->membase[0], GPIO_ALT0(pin), PORT_PIN(pin)); in xway_mux_apply()
1512 gpio_setbit(info->membase[0], alt1_reg, PORT_PIN(pin)); in xway_mux_apply()
1514 gpio_clearbit(info->membase[0], alt1_reg, PORT_PIN(pin)); in xway_mux_apply()
1521 {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN},
1532 /* --------- gpio_chip related code --------- */
1535 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_set()
1538 gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); in xway_gpio_set()
1540 gpio_clearbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); in xway_gpio_set()
1545 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_get()
1547 return !!gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin)); in xway_gpio_get()
1552 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_dir_in()
1554 gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); in xway_gpio_dir_in()
1561 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_dir_out()
1564 gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin)); in xway_gpio_dir_out()
1566 gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin)); in xway_gpio_dir_out()
1567 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); in xway_gpio_dir_out()
1579 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_to_irq()
1582 for (i = 0; i < info->num_exin; i++) in xway_gpio_to_irq()
1583 if (info->exin[i] == offset) in xway_gpio_to_irq()
1586 return -1; in xway_gpio_to_irq()
1590 .label = "gpio-xway",
1598 .base = -1,
1602 /* --------- register the pinctrl layer --------- */
1692 { .compatible = "lantiq,pinctrl-xway", .data = &danube_pinctrl}, /*DEPRECATED*/
1693 { .compatible = "lantiq,pinctrl-xr9", .data = &xr9_pinctrl}, /*DEPRECATED*/
1694 { .compatible = "lantiq,pinctrl-ase", .data = &ase_pinctrl}, /*DEPRECATED*/
1695 { .compatible = "lantiq,ase-pinctrl", .data = &ase_pinctrl},
1696 { .compatible = "lantiq,danube-pinctrl", .data = &danube_pinctrl},
1697 { .compatible = "lantiq,xrx100-pinctrl", .data = &xrx100_pinctrl},
1698 { .compatible = "lantiq,xrx200-pinctrl", .data = &xrx200_pinctrl},
1699 { .compatible = "lantiq,xrx300-pinctrl", .data = &xrx300_pinctrl},
1715 match = of_match_device(xway_match, &pdev->dev); in pinmux_xway_probe()
1717 xway_soc = (const struct pinctrl_xway_soc *) match->data; in pinmux_xway_probe()
1722 xway_chip.ngpio = xway_soc->pin_count; in pinmux_xway_probe()
1725 xway_info.pads = devm_kcalloc(&pdev->dev, in pinmux_xway_probe()
1729 return -ENOMEM; in pinmux_xway_probe()
1732 char *name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "io%d", i); in pinmux_xway_probe()
1735 return -ENOMEM; in pinmux_xway_probe()
1743 xway_pctrl_desc.name = dev_name(&pdev->dev); in pinmux_xway_probe()
1748 xway_info.mfp = xway_soc->mfp; in pinmux_xway_probe()
1749 xway_info.grps = xway_soc->grps; in pinmux_xway_probe()
1750 xway_info.num_grps = xway_soc->num_grps; in pinmux_xway_probe()
1751 xway_info.funcs = xway_soc->funcs; in pinmux_xway_probe()
1752 xway_info.num_funcs = xway_soc->num_funcs; in pinmux_xway_probe()
1753 xway_info.exin = xway_soc->exin; in pinmux_xway_probe()
1754 xway_info.num_exin = xway_soc->num_exin; in pinmux_xway_probe()
1759 dev_err(&pdev->dev, "Failed to register pinctrl driver\n"); in pinmux_xway_probe()
1764 xway_chip.parent = &pdev->dev; in pinmux_xway_probe()
1766 ret = devm_gpiochip_add_data(&pdev->dev, &xway_chip, NULL); in pinmux_xway_probe()
1768 dev_err(&pdev->dev, "Failed to register gpio chip\n"); in pinmux_xway_probe()
1773 * For DeviceTree-supported systems, the gpio core checks the in pinmux_xway_probe()
1774 * pinctrl's device node for the "gpio-ranges" property. in pinmux_xway_probe()
1779 * files which don't set the "gpio-ranges" property or systems that in pinmux_xway_probe()
1782 if (!of_property_read_bool(pdev->dev.of_node, "gpio-ranges")) { in pinmux_xway_probe()
1789 dev_info(&pdev->dev, "Init done\n"); in pinmux_xway_probe()
1796 .name = "pinctrl-xway",