Patchwork [7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot.

login
register
mail settings
Submitter Maxime Bizon
Date 2010-01-30 05:01:58
Message ID <1264872898-28149-8-git-send-email-mbizon@freebox.fr>
Download mbox | patch
Permalink /patch/903/
State Accepted
Delegated to: Ralf Baechle
Headers show

Comments

Maxime Bizon - 2010-01-30 05:01:58
To avoid glitch during gpio initialisation, fetch gpio output
registers values left by bootloader.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/gpio.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Ralf Baechle - 2010-03-19 01:03:25
On Sat, Jan 30, 2010 at 06:34:58PM +0100, Maxime Bizon wrote:

> To avoid glitch during gpio initialisation, fetch gpio output
> registers values left by bootloader.

Applied as well.

Thanks,

  Ralf

Patch

diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c
index 3725345..315bc7f 100644
--- a/arch/mips/bcm63xx/gpio.c
+++ b/arch/mips/bcm63xx/gpio.c
@@ -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);