linux-mips
[Top] [All Lists]

Re: [PATCH 1/4] rbtx4938: Add generic GPIO support

To: ralf@linux-mips.org
Subject: Re: [PATCH 1/4] rbtx4938: Add generic GPIO support
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Mon, 25 Jun 2007 23:36:37 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20070624205429.GB5814@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070622.232155.122616682.anemo@mba.ocn.ne.jp> <20070624205429.GB5814@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Sun, 24 Jun 2007 22:54:29 +0200, Ralf Baechle <ralf@linux-mips.org> wrote:
> > GPIO 0..15 are for TX4938 PIO pins, GPIO 16..18 are for FPGA-driven
> > chipselect signals for SPI devices.
> 
> Queued also.

Thanks.  And please queue this too.


Subject: [PATCH] rbtx4938: Add mmio barriers for GPIO.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/tx4938/toshiba_rbtx4938/setup.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c 
b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index a835870..330ee43 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -1021,6 +1021,7 @@ static void rbtx4938_spi_gpio_set(unsigned gpio, int 
value)
        else
                val &= ~(1 << gpio);
        *rbtx4938_spics_ptr = val;
+       mmiowb();
        spin_unlock_irqrestore(&rbtx4938_spi_gpio_lock, flags);
 }
 
@@ -1053,6 +1054,7 @@ static void tx4938_gpio_set(unsigned gpio, int value)
        unsigned long flags;
        spin_lock_irqsave(&tx4938_gpio_lock, flags);
        tx4938_gpio_set_raw(gpio, value);
+       mmiowb();
        spin_unlock_irqrestore(&tx4938_gpio_lock, flags);
 }
 
@@ -1060,6 +1062,7 @@ static int tx4938_gpio_dir_in(unsigned gpio)
 {
        spin_lock_irq(&tx4938_gpio_lock);
        tx4938_pioptr->dir &= ~(1 << gpio);
+       mmiowb();
        spin_unlock_irq(&tx4938_gpio_lock);
        return 0;
 }
@@ -1069,6 +1072,7 @@ static int tx4938_gpio_dir_out(unsigned int gpio, int 
value)
        spin_lock_irq(&tx4938_gpio_lock);
        tx4938_gpio_set_raw(gpio, value);
        tx4938_pioptr->dir |= 1 << gpio;
+       mmiowb();
        spin_unlock_irq(&tx4938_gpio_lock);
        return 0;
 }

<Prev in Thread] Current Thread [Next in Thread>