public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Florian Fainelli <florian.fainelli@telecomint.eu>,
	linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de,
	Ingo Molnar <mingo@elte.hu>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH 1/4 resend] [x86] Add generic GPIO support to x86
Date: Wed, 13 Feb 2008 15:25:05 -0800	[thread overview]
Message-ID: <200802131525.05967.david-b@pacbell.net> (raw)
In-Reply-To: <20080213140258.78380f5d.akpm@linux-foundation.org>

On Wednesday 13 February 2008, Andrew Morton wrote:
> Someone please fix.

This is what I was using purely for test builds ... most x86 hardware
actually has no GPIOs, and I sure don't have any of the "unusual" x86
platforms here, so I'd not want to see this version merge.  Someone
more clued in on how x86 handles what ARM does with e.g. <asm/arch/...>
should make a better patch.

(And my vote is to **NOT** use the "-I..." magic that PowerPC uses,
that's just confusing as all get-out.  And not needed.)


> It would be more modern to have a <linux/gpio.h> which takes care of
> cruddy details, but it's getting too late for that.

That could be added eventually ... if the platform has GPIO support
it could include the <asm/gpio.h> else it could define all the calls
as error-returning inlines.

- Dave


========= CUT HERE
DEBUG ONLY -- make X86_PC use gpiolib.

It's not clear to me how the various x86-ish platforms should
be made to work here, since there seems to be no convention
that each platform type has its own <asm/arch/...> subdir.

---
 arch/x86/Kconfig       |    2 ++
 include/asm-x86/gpio.h |   19 ++++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

--- g26.orig/arch/x86/Kconfig	2008-02-10 16:06:30.000000000 -0800
+++ g26/arch/x86/Kconfig	2008-02-10 16:09:44.000000000 -0800
@@ -228,6 +228,8 @@ choice
 
 config X86_PC
 	bool "PC-compatible"
+	select GENERIC_GPIO
+	select HAVE_GPIO_LIB
 	help
 	  Choose this option if your computer is a standard PC or compatible.
 
--- g26.orig/include/asm-x86/gpio.h	2008-02-10 16:06:30.000000000 -0800
+++ g26/include/asm-x86/gpio.h	2008-02-10 16:09:44.000000000 -0800
@@ -1,6 +1,23 @@
 #ifndef _ASM_I386_GPIO_H
 #define _ASM_I386_GPIO_H
 
-#include <gpio.h>
+// #include <gpio.h>
+
+#include <asm-generic/gpio.h>           /* cansleep wrappers */
+
+#define gpio_get_value	__gpio_get_value
+#define gpio_set_value	__gpio_set_value
+#define gpio_cansleep	__gpio_cansleep
+
+static inline int gpio_to_irq(unsigned gpio)
+{
+	return -ENOSYS;
+}
+
+static inline int irq_to_gpio(unsigned irq)
+{
+	return -EINVAL;
+}
+
 
 #endif /* _ASM_I386_GPIO_H */


  reply	other threads:[~2008-02-13 23:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18 13:51 [PATCH 1/4 resend] [x86] Add generic GPIO support to x86 Florian Fainelli
2007-10-18 21:38 ` Andres Salomon
2007-10-19 12:01   ` Florian Fainelli
2007-10-19 21:32     ` Jordan Crouse
2007-10-21 16:06       ` Haavard Skinnemoen
2007-10-22 19:18     ` Andres Salomon
2007-10-22 19:59       ` Florian Fainelli
2007-10-25  8:18       ` Thomas Gleixner
2007-10-25 12:30         ` Florian Fainelli
2007-10-25 15:24           ` Thomas Gleixner
2008-02-13 22:02 ` Andrew Morton
2008-02-13 23:25   ` David Brownell [this message]
2008-02-14  1:55   ` David Brownell
2008-02-22 23:56     ` Anton Vorontsov
2008-02-23  0:51       ` David Brownell

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=200802131525.05967.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=florian.fainelli@telecomint.eu \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox