Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 058502eb authored by Russell King's avatar Russell King
Browse files

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: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent ba5fd193
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -761,8 +761,19 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
	}
	}


	if (mask) {
	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;
		GPDR |= mask;
		GAFR |= mask;
		GAFR |= mask;
		local_irq_restore(flags);
	}
	}
}
}