diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-18 13:52:59 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-21 12:56:21 +0100 |
commit | 058502eb38a0f687e5af37209488d03656f87ffe (patch) | |
tree | 5de1c1786585782379809acaab73a67433a8b67f /drivers/video/sa1100fb.c | |
parent | FB: sa1100: use inf members directly (diff) | |
download | linux-058502eb38a0f687e5af37209488d03656f87ffe.tar.xz linux-058502eb38a0f687e5af37209488d03656f87ffe.zip |
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/video/sa1100fb.c')
-rw-r--r-- | 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 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) } 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); } } |