Lines Matching +full:nand +full:- +full:has +full:- +full:wp
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"
36 * each bank has this offset apart from the 4th bank that is mixed into the
110 /* --------- ase related code --------- */
238 /* --------- danube related code --------- */
341 GRP_MUX("nand ale", EBU, danube_pins_nand_ale),
342 GRP_MUX("nand cs1", EBU, danube_pins_nand_cs1),
343 GRP_MUX("nand cle", EBU, danube_pins_nand_cle),
389 "nand ale", "nand cs1",
390 "nand cle"};
413 /* --------- xrx100 related code --------- */
548 GRP_MUX("nand ale", EBU, xrx100_pins_nand_ale),
549 GRP_MUX("nand cs1", EBU, xrx100_pins_nand_cs1),
550 GRP_MUX("nand cle", EBU, xrx100_pins_nand_cle),
551 GRP_MUX("nand rdy", EBU, xrx100_pins_nand_rdy),
552 GRP_MUX("nand rd", EBU, xrx100_pins_nand_rd),
600 "nand ale", "nand cs1",
601 "nand cle", "nand rdy",
602 "nand rd"};
626 /* --------- xrx200 related code --------- */
776 GRP_MUX("nand ale", EBU, xrx200_pins_nand_ale),
777 GRP_MUX("nand cs1", EBU, xrx200_pins_nand_cs1),
778 GRP_MUX("nand cle", EBU, xrx200_pins_nand_cle),
779 GRP_MUX("nand rdy", EBU, xrx200_pins_nand_rdy),
780 GRP_MUX("nand rd", EBU, xrx200_pins_nand_rd),
846 "nand ale", "nand cs1",
847 "nand cle", "nand rdy",
848 "nand rd"};
882 /* --------- xrx300 related code --------- */
1019 GRP_MUX("nand ale", EBU, xrx300_pins_nand_ale),
1020 GRP_MUX("nand cs1", EBU, xrx300_pins_nand_cs1),
1021 GRP_MUX("nand cle", EBU, xrx300_pins_nand_cle),
1022 GRP_MUX("nand rdy", EBU, xrx300_pins_nand_rdy),
1023 GRP_MUX("nand rd", EBU, xrx300_pins_nand_rd),
1024 GRP_MUX("nand d1", EBU, xrx300_pins_nand_d1),
1025 GRP_MUX("nand d0", EBU, xrx300_pins_nand_d0),
1026 GRP_MUX("nand d2", EBU, xrx300_pins_nand_d2),
1027 GRP_MUX("nand d7", EBU, xrx300_pins_nand_d7),
1028 GRP_MUX("nand d6", EBU, xrx300_pins_nand_d6),
1029 GRP_MUX("nand d5", EBU, xrx300_pins_nand_d5),
1030 GRP_MUX("nand d4", EBU, xrx300_pins_nand_d4),
1031 GRP_MUX("nand d3", EBU, xrx300_pins_nand_d3),
1032 GRP_MUX("nand cs0", EBU, xrx300_pins_nand_cs0),
1033 GRP_MUX("nand wr", EBU, xrx300_pins_nand_wr),
1034 GRP_MUX("nand wp", EBU, xrx300_pins_nand_wp),
1035 GRP_MUX("nand se", EBU, xrx300_pins_nand_se),
1063 static const char * const xrx300_ebu_grps[] = {"nand ale", "nand cs1",
1064 "nand cle", "nand rdy",
1065 "nand rd", "nand d1",
1066 "nand d0", "nand d2",
1067 "nand d7", "nand d6",
1068 "nand d5", "nand d4",
1069 "nand d3", "nand cs0",
1070 "nand wr", "nand wp",
1071 "nand se"};
1095 /* --------- pinconf related code --------- */
1112 !gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); in xway_pinconf_get()
1120 if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) { in xway_pinconf_get()
1129 if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) in xway_pinconf_get()
1138 gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); in xway_pinconf_get()
1141 dev_err(pctldev->dev, "Invalid config param %04x\n", param); in xway_pinconf_get()
1142 return -ENOTSUPP; in xway_pinconf_get()
1170 gpio_setbit(info->membase[0], in xway_pinconf_set()
1174 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1185 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1190 gpio_setbit(info->membase[0], reg, PORT_PIN(pin)); in xway_pinconf_set()
1197 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1201 gpio_setbit(info->membase[0], in xway_pinconf_set()
1205 dev_err(pctldev->dev, in xway_pinconf_set()
1212 gpio_clearbit(info->membase[0], in xway_pinconf_set()
1216 gpio_setbit(info->membase[0], in xway_pinconf_set()
1222 dev_err(pctldev->dev, in xway_pinconf_set()
1224 return -ENOTSUPP; in xway_pinconf_set()
1239 for (i = 0; i < info->grps[selector].npins && !ret; i++) in xway_pinconf_group_set()
1241 info->grps[selector].pins[i], in xway_pinconf_group_set()
1270 gpio_setbit(info->membase[0], GPIO_ALT0(pin), PORT_PIN(pin)); in xway_mux_apply()
1272 gpio_clearbit(info->membase[0], GPIO_ALT0(pin), PORT_PIN(pin)); in xway_mux_apply()
1275 gpio_setbit(info->membase[0], alt1_reg, PORT_PIN(pin)); in xway_mux_apply()
1277 gpio_clearbit(info->membase[0], alt1_reg, PORT_PIN(pin)); in xway_mux_apply()
1284 {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN},
1295 /* --------- gpio_chip related code --------- */
1298 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_set()
1301 gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); in xway_gpio_set()
1303 gpio_clearbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); in xway_gpio_set()
1308 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_get()
1310 return !!gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin)); in xway_gpio_get()
1315 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_dir_in()
1317 gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); in xway_gpio_dir_in()
1324 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_dir_out()
1327 gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin)); in xway_gpio_dir_out()
1329 gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin)); in xway_gpio_dir_out()
1330 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); in xway_gpio_dir_out()
1342 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); in xway_gpio_to_irq()
1345 for (i = 0; i < info->num_exin; i++) in xway_gpio_to_irq()
1346 if (info->exin[i] == offset) in xway_gpio_to_irq()
1349 return -1; in xway_gpio_to_irq()
1353 .label = "gpio-xway",
1361 .base = -1,
1365 /* --------- register the pinctrl layer --------- */
1443 { .compatible = "lantiq,ase-pinctrl", .data = &ase_pinctrl},
1444 { .compatible = "lantiq,danube-pinctrl", .data = &danube_pinctrl},
1445 { .compatible = "lantiq,xrx100-pinctrl", .data = &xrx100_pinctrl},
1446 { .compatible = "lantiq,xrx200-pinctrl", .data = &xrx200_pinctrl},
1447 { .compatible = "lantiq,xrx300-pinctrl", .data = &xrx300_pinctrl},
1462 xway_soc = device_get_match_data(&pdev->dev); in pinmux_xway_probe()
1467 xway_chip.ngpio = xway_soc->pin_count; in pinmux_xway_probe()
1470 xway_info.pads = devm_kcalloc(&pdev->dev, in pinmux_xway_probe()
1474 return -ENOMEM; in pinmux_xway_probe()
1477 char *name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "io%d", i); in pinmux_xway_probe()
1480 return -ENOMEM; in pinmux_xway_probe()
1488 xway_pctrl_desc.name = dev_name(&pdev->dev); in pinmux_xway_probe()
1493 xway_info.mfp = xway_soc->mfp; in pinmux_xway_probe()
1494 xway_info.grps = xway_soc->grps; in pinmux_xway_probe()
1495 xway_info.num_grps = xway_soc->num_grps; in pinmux_xway_probe()
1496 xway_info.funcs = xway_soc->funcs; in pinmux_xway_probe()
1497 xway_info.num_funcs = xway_soc->num_funcs; in pinmux_xway_probe()
1498 xway_info.exin = xway_soc->exin; in pinmux_xway_probe()
1499 xway_info.num_exin = xway_soc->num_exin; in pinmux_xway_probe()
1504 dev_err(&pdev->dev, "Failed to register pinctrl driver\n"); in pinmux_xway_probe()
1509 xway_chip.parent = &pdev->dev; in pinmux_xway_probe()
1511 ret = devm_gpiochip_add_data(&pdev->dev, &xway_chip, NULL); in pinmux_xway_probe()
1513 dev_err(&pdev->dev, "Failed to register gpio chip\n"); in pinmux_xway_probe()
1518 * For DeviceTree-supported systems, the gpio core checks the in pinmux_xway_probe()
1519 * pinctrl's device node for the "gpio-ranges" property. in pinmux_xway_probe()
1524 * files which don't set the "gpio-ranges" property or systems that in pinmux_xway_probe()
1525 * utilize ACPI the driver has to call gpiochip_add_pin_range(). in pinmux_xway_probe()
1527 if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) { in pinmux_xway_probe()
1534 dev_info(&pdev->dev, "Init done\n"); in pinmux_xway_probe()
1541 .name = "pinctrl-xway",