MIPS: BCM63xx: Initialize gpio_out_low & out_high to current value at boot.
authorMaxime Bizon <mbizon@freebox.fr>
Sat, 30 Jan 2010 17:34:58 +0000 (18:34 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 12 Apr 2010 16:26:19 +0000 (17:26 +0100)
To avoid a glitch during GPIO initialisation read GPIO output register
values left by the firmware.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/903/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm63xx/gpio.c

index 37253452d39601ba853e96dc6afb812867b0d828..315bc7f79ce15bf9ff78f57b6f331200478c27d0 100644 (file)
@@ -125,6 +125,8 @@ static struct gpio_chip bcm63xx_gpio_chip = {
 
 int __init bcm63xx_gpio_init(void)
 {
+       gpio_out_low = bcm_gpio_readl(GPIO_DATA_LO_REG);
+       gpio_out_high = bcm_gpio_readl(GPIO_DATA_HI_REG);
        bcm63xx_gpio_chip.ngpio = bcm63xx_gpio_count();
        pr_info("registering %d GPIOs\n", bcm63xx_gpio_chip.ngpio);