* [PATCH] ARM: OMAP2+: Fixed inverted OMAP_OFFOUT_EN
@ 2015-10-08 16:19 Ben Tucker
0 siblings, 0 replies; 2+ messages in thread
From: Ben Tucker @ 2015-10-08 16:19 UTC (permalink / raw)
To: linux-arm-kernel
The OFFOUTENABLE bit of the omap PADCONF registers is active low.
The mux code assumed that it was active high and this patch fixes this
problem.
Tested on an AM37x device.
Signed-off-by: Ben Tucker <benjamint@bsquare.com>
---
arch/arm/mach-omap2/mux.c | 2 +-
arch/arm/mach-omap2/mux.h | 13 +++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 176eef6..427a7f88 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -523,7 +523,7 @@ static inline void omap_mux_decode(struct seq_file *s, u16 val)
OMAP_MUX_TEST_FLAG(val, OMAP_PIN_OFF_WAKEUPENABLE);
if (val & OMAP_OFF_EN) {
- if (!(val & OMAP_OFFOUT_EN)) {
+ if (val & OMAP_OFFOUT_EN) {
if (!(val & OMAP_OFF_PULL_UP)) {
OMAP_MUX_TEST_FLAG(val,
OMAP_PIN_OFF_INPUT_PULLDOWN);
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index d121fb6..9a5fd76 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -29,7 +29,7 @@
/* omap3/4/5 specific mux bit defines */
#define OMAP_INPUT_EN (1 << 8)
#define OMAP_OFF_EN (1 << 9)
-#define OMAP_OFFOUT_EN (1 << 10)
+#define OMAP_OFFOUT_EN (1 << 10) /* 1 for input, 0 for output */
#define OMAP_OFFOUT_VAL (1 << 11)
#define OMAP_OFF_PULL_EN (1 << 12)
#define OMAP_OFF_PULL_UP (1 << 13)
@@ -45,12 +45,13 @@
/* Off mode states */
#define OMAP_PIN_OFF_NONE 0
-#define OMAP_PIN_OFF_OUTPUT_HIGH (OMAP_OFF_EN | OMAP_OFFOUT_EN \
- | OMAP_OFFOUT_VAL)
-#define OMAP_PIN_OFF_OUTPUT_LOW (OMAP_OFF_EN | OMAP_OFFOUT_EN)
-#define OMAP_PIN_OFF_INPUT_PULLUP (OMAP_OFF_EN | OMAP_OFF_PULL_EN \
+#define OMAP_PIN_OFF_OUTPUT_HIGH (OMAP_OFF_EN | OMAP_OFFOUT_VAL)
+#define OMAP_PIN_OFF_OUTPUT_LOW (OMAP_OFF_EN)
+#define OMAP_PIN_OFF_INPUT_PULLUP (OMAP_OFF_EN | OMAP_OFFOUT_EN \
+ | OMAP_OFF_PULL_EN \
| OMAP_OFF_PULL_UP)
-#define OMAP_PIN_OFF_INPUT_PULLDOWN (OMAP_OFF_EN | OMAP_OFF_PULL_EN)
+#define OMAP_PIN_OFF_INPUT_PULLDOWN (OMAP_OFF_EN | OMAP_OFFOUT_EN \
+ | OMAP_OFF_PULL_EN)
#define OMAP_PIN_OFF_WAKEUPENABLE OMAP_WAKEUP_EN
#define OMAP_MODE_GPIO(partition, x) (((x) & OMAP_MUX_MODE7) == \
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] ARM: OMAP2+: Fixed inverted OMAP_OFFOUT_EN
[not found] <1444308486-16204-1-git-send-email-benjamint@bsquare.com>
@ 2015-10-09 6:40 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2015-10-09 6:40 UTC (permalink / raw)
To: linux-arm-kernel
* Ben Tucker <benjamint@bsquare.com> [151008 06:09]:
> The OFFOUTENABLE bit of the omap PADCONF registers is active low.
> The mux code assumed that it was active high and this patch fixes this
> problem.
>
> Tested on an AM37x device.
Hmm what are the test cases you're using to validate this so
I can try to reproduce?
AFAIK because of erratum 1.158 for GPIO pins needing to be
muxed temporarly for input + pull + safe mode for off mode,
so I'm wondering in which cases the OFFOUTENABLE can be used.
I have a patch in works for 1.158 using gpio-ranges, and the
test case I'm using is the reset of WLAN that happens in off
mode as the enable GPIO glitches when returning from off mode.
Also.. I'm wondring why this has not been caught earlier?
Maybe because 1.158 is needed on omap3?
Regrds,
Tony
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-09 6:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1444308486-16204-1-git-send-email-benjamint@bsquare.com>
2015-10-09 6:40 ` [PATCH] ARM: OMAP2+: Fixed inverted OMAP_OFFOUT_EN Tony Lindgren
2015-10-08 16:19 Ben Tucker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).