diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-05-22 05:46:45 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-06-17 13:44:44 -0400 |
commit | daf731748f978efb4f741d19b499236e03bf667f (patch) | |
tree | 4f6a27525562ee0717d628353de75f0ebb8ed917 /drivers/pinctrl/pinctrl-nomadik.c | |
parent | 14e1e9f5cadb7cff3a2846c27cc1b9c8f207ee18 (diff) |
pinctrl/nomadik: document Alt-C glitch
This documentation comment existed in an earlier patch set for
GPIO consolidation, so I'm saving it for maintainability of the
code.
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index e8937e7e4999..3e7e47d6b385 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -1438,7 +1438,27 @@ static int nmk_pmx_enable(struct pinctrl_dev *pctldev, unsigned function, | |||
1438 | 1438 | ||
1439 | dev_dbg(npct->dev, "enable group %s, %u pins\n", g->name, g->npins); | 1439 | dev_dbg(npct->dev, "enable group %s, %u pins\n", g->name, g->npins); |
1440 | 1440 | ||
1441 | /* Handle this special glitch on altfunction C */ | 1441 | /* |
1442 | * If we're setting altfunc C by setting both AFSLA and AFSLB to 1, | ||
1443 | * we may pass through an undesired state. In this case we take | ||
1444 | * some extra care. | ||
1445 | * | ||
1446 | * Safe sequence used to switch IOs between GPIO and Alternate-C mode: | ||
1447 | * - Save SLPM registers (since we have a shadow register in the | ||
1448 | * nmk_chip we're using that as backup) | ||
1449 | * - Set SLPM=0 for the IOs you want to switch and others to 1 | ||
1450 | * - Configure the GPIO registers for the IOs that are being switched | ||
1451 | * - Set IOFORCE=1 | ||
1452 | * - Modify the AFLSA/B registers for the IOs that are being switched | ||
1453 | * - Set IOFORCE=0 | ||
1454 | * - Restore SLPM registers | ||
1455 | * - Any spurious wake up event during switch sequence to be ignored | ||
1456 | * and cleared | ||
1457 | * | ||
1458 | * We REALLY need to save ALL slpm registers, because the external | ||
1459 | * IOFORCE will switch *all* ports to their sleepmode setting to as | ||
1460 | * to avoid glitches. (Not just one port!) | ||
1461 | */ | ||
1442 | glitch = (g->altsetting == NMK_GPIO_ALT_C); | 1462 | glitch = (g->altsetting == NMK_GPIO_ALT_C); |
1443 | 1463 | ||
1444 | if (glitch) { | 1464 | if (glitch) { |