aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-18 07:52:59 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-21 06:56:21 -0500
commit058502eb38a0f687e5af37209488d03656f87ffe (patch)
tree5de1c1786585782379809acaab73a67433a8b67f /drivers
parentba5fd193f4fd35e5e1771de15cc1aba11d19590d (diff)
FB: sa1100: make GPIO configuration setting safe
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. Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sa1100fb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index d1d97cab24c8..b644f0f1268c 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -761,8 +761,19 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
761 } 761 }
762 762
763 if (mask) { 763 if (mask) {
764 unsigned long flags;
765
766 /*
767 * SA-1100 requires the GPIO direction register set
768 * appropriately for the alternate function. Hence
769 * we set it here via bitmask rather than excessive
770 * fiddling via the GPIO subsystem - and even then
771 * we'll still have to deal with GAFR.
772 */
773 local_irq_save(flags);
764 GPDR |= mask; 774 GPDR |= mask;
765 GAFR |= mask; 775 GAFR |= mask;
776 local_irq_restore(flags);
766 } 777 }
767} 778}
768 779