From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/13] FB: sa1100: make GPIO configuration setting safe
Date: Sat, 04 Feb 2012 09:41:48 +0000 [thread overview]
Message-ID: <E1Rtc7w-0000b2-Ur@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20120204093744.GQ889@n2100.arm.linux.org.uk>
The sa1100fb driver needs to set the GPIO direction and alternate
function register according to the panel that we're driving. We've
done this in the driver by read-modify-writing the register, which
may cause problems with races. Fix this with a minimal change.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/video/sa1100fb.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index d1d97ca..b644f0f 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -761,8 +761,19 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
}
if (mask) {
+ unsigned long flags;
+
+ /*
+ * SA-1100 requires the GPIO direction register set
+ * appropriately for the alternate function. Hence
+ * we set it here via bitmask rather than excessive
+ * fiddling via the GPIO subsystem - and even then
+ * we'll still have to deal with GAFR.
+ */
+ local_irq_save(flags);
GPDR |= mask;
GAFR |= mask;
+ local_irq_restore(flags);
}
}
--
1.7.4.4
WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/13] FB: sa1100: make GPIO configuration setting safe
Date: Sat, 04 Feb 2012 09:41:48 +0000 [thread overview]
Message-ID: <E1Rtc7w-0000b2-Ur@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20120204093744.GQ889@n2100.arm.linux.org.uk>
The sa1100fb driver needs to set the GPIO direction and alternate
function register according to the panel that we're driving. We've
done this in the driver by read-modify-writing the register, which
may cause problems with races. Fix this with a minimal change.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/video/sa1100fb.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index d1d97ca..b644f0f 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -761,8 +761,19 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
}
if (mask) {
+ unsigned long flags;
+
+ /*
+ * SA-1100 requires the GPIO direction register set
+ * appropriately for the alternate function. Hence
+ * we set it here via bitmask rather than excessive
+ * fiddling via the GPIO subsystem - and even then
+ * we'll still have to deal with GAFR.
+ */
+ local_irq_save(flags);
GPDR |= mask;
GAFR |= mask;
+ local_irq_restore(flags);
}
}
--
1.7.4.4
next prev parent reply other threads:[~2012-02-04 9:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-04 9:37 [PATCH 00/13] sa1100fb cleanups Russell King - ARM Linux
2012-02-04 9:37 ` Russell King - ARM Linux
2012-02-04 9:38 ` [PATCH 01/13] FB: sa1100: avoid section mismatch warnings Russell King - ARM Linux
2012-02-04 9:38 ` Russell King - ARM Linux
2012-02-04 9:38 ` [PATCH 02/13] FB: sa1100: add .owner initializer to driver structure Russell King - ARM Linux
2012-02-04 9:38 ` Russell King - ARM Linux
2012-02-04 9:39 ` [PATCH 03/13] FB: sa1100: constify rgb structures Russell King - ARM Linux
2012-02-04 9:39 ` Russell King - ARM Linux
2012-02-04 9:39 ` [PATCH 04/13] FB: sa1100: convert printks to dev_xxx() Russell King - ARM Linux
2012-02-04 9:39 ` Russell King - ARM Linux
2012-02-04 9:39 ` [PATCH 05/13] FB: sa1100: combine RGB bitfield overrides into sa1100fb_mach_info Russell King - ARM Linux
2012-02-04 9:39 ` Russell King - ARM Linux
2012-02-04 9:40 ` [PATCH 06/13] FB: sa1100: move machine inf structures to <video/sa1100fb.h> Russell King - ARM Linux
2012-02-04 9:40 ` Russell King - ARM Linux
2012-02-04 9:40 ` [PATCH 07/13] FB: sa1100: move platform data to platform files Russell King - ARM Linux
2012-02-04 9:40 ` Russell King - ARM Linux
2012-02-04 9:40 ` [PATCH 08/13] FB: sa1100: remove global sa1100fb_.*_power function pointers Russell King - ARM Linux
2012-02-04 9:40 ` Russell King - ARM Linux
2012-02-04 9:41 ` [PATCH 09/13] FB: sa1100: remove assabet specific initialization Russell King - ARM Linux
2012-02-04 9:41 ` Russell King - ARM Linux
2012-02-04 9:41 ` [PATCH 10/13] FB: sa1100: use inf members directly Russell King - ARM Linux
2012-02-04 9:41 ` Russell King - ARM Linux
2012-02-04 9:41 ` Russell King - ARM Linux [this message]
2012-02-04 9:41 ` [PATCH 11/13] FB: sa1100: make GPIO configuration setting safe Russell King - ARM Linux
2012-02-04 9:42 ` [PATCH 12/13] FB: sa11x0: fix shannon GPSR/GPCR accesses Russell King - ARM Linux
2012-02-04 9:42 ` Russell King - ARM Linux
2012-02-04 9:42 ` [PATCH 13/13] FB: sa11x0: convert shannon display enable accesses to use GPIO subsystem Russell King - ARM Linux
2012-02-04 9:42 ` Russell King - ARM Linux
2012-02-19 22:40 ` [PATCH 00/13] sa1100fb cleanups Florian Tobias Schandinat
2012-02-19 22:40 ` Florian Tobias Schandinat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1Rtc7w-0000b2-Ur@rmk-PC.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.