All of lore.kernel.org
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: philipp.zabel@gmail.com, dbrownell@users.sourceforge.net
Subject: + gpio-api-sa1100-wrapper-cleanup.patch added to -mm tree
Date: Fri, 16 Feb 2007 13:26:04 -0800	[thread overview]
Message-ID: <200702162126.l1GLQ4Et010280@shell0.pdx.osdl.net> (raw)


The patch titled
     GPIO API: SA1100 wrapper cleanup
has been added to the -mm tree.  Its filename is
     gpio-api-sa1100-wrapper-cleanup.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: GPIO API: SA1100 wrapper cleanup
From: Philipp Zabel <philipp.zabel@gmail.com>

Based on the discussion last december (http://lkml.org/lkml/2006/12/20/241),
this patch
  - adds gpio_direction_input/output functions to
    generic.c instead of making them inline,
  - fixes comment and includes and uses inline functions
    instead of macros in gpio.h

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arm/mach-sa1100/generic.c     |   30 +++++++++++++++++++++++
 include/asm-arm/arch-sa1100/gpio.h |   34 +++++++++++----------------
 2 files changed, 44 insertions(+), 20 deletions(-)

diff -puN arch/arm/mach-sa1100/generic.c~gpio-api-sa1100-wrapper-cleanup arch/arm/mach-sa1100/generic.c
--- a/arch/arm/mach-sa1100/generic.c~gpio-api-sa1100-wrapper-cleanup
+++ a/arch/arm/mach-sa1100/generic.c
@@ -138,6 +138,36 @@ unsigned long long sched_clock(void)
 	return v;
 }
 
+int gpio_direction_input(unsigned gpio)
+{
+	unsigned long flags;
+
+	if (gpio > GPIO_MAX)
+		return -EINVAL;
+
+	local_irq_save(flags);
+	GPDR &= ~GPIO_GPIO(gpio);
+	local_irq_restore(flags);
+	return 0;
+}
+
+EXPORT_SYMBOL(gpio_direction_input);
+
+int gpio_direction_output(unsigned gpio)
+{
+	unsigned long flags;
+
+	if (gpio > GPIO_MAX)
+		return -EINVAL;
+
+	local_irq_save(flags);
+	GPDR |= GPIO_GPIO(gpio);
+	local_irq_restore(flags);
+	return 0;
+}
+
+EXPORT_SYMBOL(gpio_direction_output);
+
 /*
  * Default power-off for SA1100
  */
diff -puN include/asm-arm/arch-sa1100/gpio.h~gpio-api-sa1100-wrapper-cleanup include/asm-arm/arch-sa1100/gpio.h
--- a/include/asm-arm/arch-sa1100/gpio.h~gpio-api-sa1100-wrapper-cleanup
+++ a/include/asm-arm/arch-sa1100/gpio.h
@@ -1,5 +1,5 @@
 /*
- * linux/include/asm-arm/arch-pxa/gpio.h
+ * linux/include/asm-arm/arch-sa1100/gpio.h
  *
  * SA1100 GPIO wrappers for arch-neutral GPIO calls
  *
@@ -24,11 +24,8 @@
 #ifndef __ASM_ARCH_SA1100_GPIO_H
 #define __ASM_ARCH_SA1100_GPIO_H
 
-#include <asm/arch/SA-1100.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/hardware.h>
-
-#include <asm/errno.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
 
 static inline int gpio_request(unsigned gpio, const char *label)
 {
@@ -40,26 +37,23 @@ static inline void gpio_free(unsigned gp
 	return;
 }
 
-static inline int gpio_direction_input(unsigned gpio)
+extern int gpio_direction_input(unsigned gpio);
+extern int gpio_direction_output(unsigned gpio);
+
+
+static inline int gpio_get_value(unsigned gpio)
 {
-	if (gpio > GPIO_MAX)
-		return -EINVAL;
-	GPDR = (GPDR_In << gpio) 0
+	return GPLR & GPIO_GPIO(gpio);
 }
 
-static inline int gpio_direction_output(unsigned gpio)
+static inline void gpio_set_value(unsigned gpio, int value)
 {
-	if (gpio > GPIO_MAX)
-		return -EINVAL;
-	GPDR = (GPDR_Out << gpio) 0
+	if (value)
+		GPSR = GPIO_GPIO(gpio);
+	else
+		GPCR = GPIO_GPIO(gpio);
 }
 
-#define gpio_get_value(gpio) \
-	(GPLR & GPIO_GPIO(gpio))
-
-#define gpio_set_value(gpio,value) \
-	((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio)))
-
 #include <asm-generic/gpio.h>			/* cansleep wrappers */
 
 static inline unsigned gpio_to_irq(unsigned gpio)
_

Patches currently in -mm which might be from philipp.zabel@gmail.com are

origin.patch
gpio-api-pxa-wrapper-cleanup.patch
gpio-api-s3c2410-wrapper-cleanup-2.patch
gpio-api-sa1100-wrapper-cleanup.patch

                 reply	other threads:[~2007-02-16 21:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200702162126.l1GLQ4Et010280@shell0.pdx.osdl.net \
    --to=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=philipp.zabel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.