Lines Matching +full:serial +full:- +full:clk +full:- +full:low
6 * This is a group-only pin controller.
19 #include <linux/pinctrl/pinconf-generic.h>
24 #include "pinctrl-utils.h"
26 #define DRIVER_NAME "pinctrl-gemini"
29 * struct gemini_pin_conf - information about configuring a pin
41 * struct gemini_pmx - state holder for the gemini pin controller
64 * struct gemini_pin_group - describes a Gemini pin group
67 * from the driver-local pin enumeration space
85 /* Some straight-forward control registers */
98 * - For the bits named *_ENABLE, once you DISABLE something, it simply cannot
101 * - For the bits named *_DISABLE, once you enable something, it cannot be
131 "serial flash",
142 "LPC CLK",
143 "PCI CLK",
145 "TVC CLK",
222 PINCTRL_PIN(67, "D14 PCI CLK"),
449 PINCTRL_PIN(282, "T13 EXT CLK"),
483 PINCTRL_PIN(314, "V9 REF CLK"),
487 PINCTRL_PIN(318, "V13 M30 CLK"),
569 285, /* SSP_97RST# SSP AC97 Reset, active low */
578 267, /* UART_SIN serial input, RX */
579 322, /* UART_SOUT serial output, TX */
612 /* Parallel (NOR) flash pins, D[0-15], A[16-25], CE0, CE1, RB, WE, OE, ALE */
620 * The parallel flash can be set up in a 26-bit address bus mode exposing
621 * A[0-15] (A[15] takes the place of ALE), but it has the
634 /* Serial flash pins CE0, CE1, DI, DO, CK */
637 /* The GPIO0A (0) pin overlap with TVC CLK and extended parallel flash */
640 /* The GPIO0B (1-4) pins overlap with TVC and ICE */
643 /* The GPIO0C (5-7) pins overlap with ICE */
649 /* The GPIO0E (8,11-15) pins overlap with LPC, UART modem pins, SSP */
661 /* The GPIO0I (21,22) pins overlap with serial flash CE0, CE1 */
670 /* The GPIO0L (26-29) pins overlap with parallel flash */
676 /* The GPIO1A (0-4) pins that overlap with IDE and parallel flash */
679 /* The GPIO1B (5-10, 27) pins overlap with just IDE */
684 /* The GPIO1C (11-26) pins overlap with IDE, parallel flash and NAND flash */
690 /* The GPIO1D (28-31) pins overlap with LCD and TVC */
693 /* The GPIO2A (0-3) pins overlap with GMII GMAC1 and extended parallel flash */
696 /* The GPIO2B (4-7) pins overlap with GMII GMAC1, extended parallel flash and LCD */
699 /* The GPIO2C (8-31) pins overlap with PCI */
840 * The construction is done such that it is possible to use a serial
842 * possible to use NAND and parallel flash together. To use serial
850 /* Conflict with IDE, parallel and serial flash */
858 /* Conflict with IDE, NAND and serial flash */
874 /* Conflict with TVC CLK */
928 /* Conflict with serial flash */
1138 PINCTRL_PIN(115, "F16 PCI CLK"),
1365 PINCTRL_PIN(331, "U12 EXT CLK"),
1425 PINCTRL_PIN(388, "Y9 REF CLK"),
1429 PINCTRL_PIN(392, "Y13 M30 CLK"),
1518 355, /* SSP_97RST# SSP AC97 Reset, active low */
1527 313, /* UART_SIN serial input, RX */
1528 335, /* UART_SOUT serial output, TX */
1561 /* Parallel (NOR) flash pins, D[0-15], A[16-25], CE0, CE1, RB, WE, OE, ALE */
1569 * The parallel flash can be set up in a 26-bit address bus mode exposing
1570 * A[0-15] (A[15] takes the place of ALE), but it has the
1583 /* Serial flash pins CE0, CE1, DI, DO, CK */
1586 /* The GPIO0A (0-4) pins overlap with TVC and extended parallel flash */
1589 /* The GPIO0B (5-7) pins overlap with ICE */
1592 /* The GPIO0C (8,11-15) pins overlap with LPC, UART and SSP */
1604 /* The GPIO0G (19,20,26-29) pins overlap with parallel flash */
1607 /* The GPIO0H (21,22) pins overlap with serial flash CE0, CE1 */
1622 /* The GPIO1A (0-4) pins that overlap with IDE and parallel flash */
1625 /* The GPIO1B (5-10,27) pins overlap with just IDE */
1628 /* The GPIO1C (11-26) pins overlap with IDE, parallel flash and NAND flash */
1634 /* The GPIO1D (28-31) pins overlap with TVC */
1637 /* The GPIO2A (0-3) pins overlap with GMII GMAC1 and extended parallel flash */
1640 /* The GPIO2B (4-7) pins overlap with GMII GMAC1, extended parallel flash and LCD */
1643 /* The GPIO2C (8-31) pins overlap with PCI */
1790 * The construction is done such that it is possible to use a serial
1792 * possible to use NAND and parallel flash together. To use serial
1800 /* Conflict with IDE, parallel and serial flash */
1808 /* Conflict with IDE, NAND and serial flash */
1871 /* Conflict with serial flash */
1902 /* Conflict with TVE CLK */
1962 if (pmx->is_3512) in gemini_get_groups_count()
1964 if (pmx->is_3516) in gemini_get_groups_count()
1974 if (pmx->is_3512) in gemini_get_group_name()
1976 if (pmx->is_3516) in gemini_get_group_name()
1989 if (pmx->flash_pin && in gemini_get_group_pins()
1990 pmx->is_3512 && in gemini_get_group_pins()
1996 if (pmx->flash_pin && in gemini_get_group_pins()
1997 pmx->is_3516 && in gemini_get_group_pins()
2003 if (pmx->is_3512) { in gemini_get_group_pins()
2007 if (pmx->is_3516) { in gemini_get_group_pins()
2030 * struct gemini_pmx_func - describes Gemini pinmux functions
2203 if (pmx->is_3512) in gemini_pmx_set_mux()
2205 else if (pmx->is_3516) in gemini_pmx_set_mux()
2208 dev_err(pmx->dev, "invalid SoC type\n"); in gemini_pmx_set_mux()
2209 return -ENODEV; in gemini_pmx_set_mux()
2212 dev_dbg(pmx->dev, in gemini_pmx_set_mux()
2214 func->name, grp->name); in gemini_pmx_set_mux()
2216 regmap_read(pmx->map, GLOBAL_MISC_CTRL, &before); in gemini_pmx_set_mux()
2217 regmap_update_bits(pmx->map, GLOBAL_MISC_CTRL, in gemini_pmx_set_mux()
2218 grp->mask | grp->value, in gemini_pmx_set_mux()
2219 grp->value); in gemini_pmx_set_mux()
2220 regmap_read(pmx->map, GLOBAL_MISC_CTRL, &after); in gemini_pmx_set_mux()
2225 expected = before &= ~grp->mask; in gemini_pmx_set_mux()
2226 expected |= grp->value; in gemini_pmx_set_mux()
2230 tmp = grp->mask; in gemini_pmx_set_mux()
2234 /* Did not go low though it should */ in gemini_pmx_set_mux()
2236 dev_err(pmx->dev, in gemini_pmx_set_mux()
2241 dev_err(pmx->dev, in gemini_pmx_set_mux()
2245 dev_dbg(pmx->dev, in gemini_pmx_set_mux()
2252 tmp = grp->value; in gemini_pmx_set_mux()
2258 dev_err(pmx->dev, in gemini_pmx_set_mux()
2263 dev_err(pmx->dev, in gemini_pmx_set_mux()
2267 dev_dbg(pmx->dev, in gemini_pmx_set_mux()
2371 for (i = 0; i < pmx->nconfs; i++) { in gemini_get_pin_conf()
2372 retconf = &pmx->confs[i]; in gemini_get_pin_conf()
2373 if (retconf->pin == pin) in gemini_get_pin_conf()
2391 return -ENOTSUPP; in gemini_pinconf_get()
2392 regmap_read(pmx->map, conf->reg, &val); in gemini_pinconf_get()
2393 val &= conf->mask; in gemini_pinconf_get()
2394 val >>= (ffs(conf->mask) - 1); in gemini_pinconf_get()
2398 return -ENOTSUPP; in gemini_pinconf_get()
2421 return -EINVAL; in gemini_pinconf_set()
2424 dev_err(pmx->dev, in gemini_pinconf_set()
2426 return -ENOTSUPP; in gemini_pinconf_set()
2428 arg <<= (ffs(conf->mask) - 1); in gemini_pinconf_set()
2429 dev_dbg(pmx->dev, in gemini_pinconf_set()
2431 pin, conf->mask, arg); in gemini_pinconf_set()
2432 regmap_update_bits(pmx->map, conf->reg, conf->mask, arg); in gemini_pinconf_set()
2435 dev_err(pmx->dev, "Invalid config param %04x\n", param); in gemini_pinconf_set()
2436 return -ENOTSUPP; in gemini_pinconf_set()
2455 if (pmx->is_3512) in gemini_pinconf_group_set()
2457 if (pmx->is_3516) in gemini_pinconf_group_set()
2461 if (!grp->driving_mask) { in gemini_pinconf_group_set()
2462 dev_err(pmx->dev, "pin config group \"%s\" does " in gemini_pinconf_group_set()
2464 grp->name); in gemini_pinconf_group_set()
2465 return -EINVAL; in gemini_pinconf_group_set()
2488 dev_err(pmx->dev, in gemini_pinconf_group_set()
2491 return -ENOTSUPP; in gemini_pinconf_group_set()
2493 val <<= (ffs(grp->driving_mask) - 1); in gemini_pinconf_group_set()
2494 regmap_update_bits(pmx->map, GLOBAL_IODRIVE, in gemini_pinconf_group_set()
2495 grp->driving_mask, in gemini_pinconf_group_set()
2497 dev_dbg(pmx->dev, in gemini_pinconf_group_set()
2499 grp->name, arg, grp->driving_mask, val); in gemini_pinconf_group_set()
2502 dev_err(pmx->dev, "invalid config param %04x\n", param); in gemini_pinconf_group_set()
2503 return -ENOTSUPP; in gemini_pinconf_group_set()
2529 struct device *dev = &pdev->dev; in gemini_pmx_probe()
2537 pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL); in gemini_pmx_probe()
2539 return -ENOMEM; in gemini_pmx_probe()
2541 pmx->dev = &pdev->dev; in gemini_pmx_probe()
2542 parent = dev->parent; in gemini_pmx_probe()
2545 return -ENODEV; in gemini_pmx_probe()
2547 map = syscon_node_to_regmap(parent->of_node); in gemini_pmx_probe()
2552 pmx->map = map; in gemini_pmx_probe()
2563 pmx->is_3512 = true; in gemini_pmx_probe()
2564 pmx->confs = gemini_confs_3512; in gemini_pmx_probe()
2565 pmx->nconfs = ARRAY_SIZE(gemini_confs_3512); in gemini_pmx_probe()
2570 pmx->is_3516 = true; in gemini_pmx_probe()
2571 pmx->confs = gemini_confs_3516; in gemini_pmx_probe()
2572 pmx->nconfs = ARRAY_SIZE(gemini_confs_3516); in gemini_pmx_probe()
2578 return -ENODEV; in gemini_pmx_probe()
2596 pmx->flash_pin = !!(val & GLOBAL_STATUS_FLPIN); in gemini_pmx_probe()
2597 dev_info(dev, "flash pin is %s\n", pmx->flash_pin ? "set" : "not set"); in gemini_pmx_probe()
2599 pmx->pctl = devm_pinctrl_register(dev, &gemini_pmx_desc, pmx); in gemini_pmx_probe()
2600 if (IS_ERR(pmx->pctl)) { in gemini_pmx_probe()
2602 return PTR_ERR(pmx->pctl); in gemini_pmx_probe()
2611 { .compatible = "cortina,gemini-pinctrl" },