From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: GPIO support for HTC Dream
Date: Wed, 9 Dec 2009 12:41:43 +0100 [thread overview]
Message-ID: <20091209114143.GD22752@elf.ucw.cz> (raw)
In-Reply-To: <20091208224550.GA26915@n2100.arm.linux.org.uk>
On Tue 2009-12-08 22:45:50, Russell King - ARM Linux wrote:
> On Tue, Dec 08, 2009 at 11:28:43AM +0100, Pavel Machek wrote:
> > Add GPIO support for HTC Dream.
> >
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> >
> > diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
> > index f780086..774c50e 100644
> > --- a/arch/arm/mach-msm/Kconfig
> > +++ b/arch/arm/mach-msm/Kconfig
> > @@ -40,4 +40,8 @@ config MACH_TROUT
> > help
> > Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
> >
> > +config GENERIC_GPIO
> > + bool
> > + default y
>
> Please arrange for this to be handled just like every other ARM
> platform via a 'select' statement - eg:
>
> config ARCH_AT91
> bool "Atmel AT91"
> select GENERIC_GPIO
> select ARCH_REQUIRE_GPIOLIB
> select HAVE_CLK
>
> It is not nice to have multiple definitions of the same symbol scattered
> throughout the Kconfig files.
Ok, fixed.
> > +#include <linux/kernel.h>
> > +#include <linux/errno.h>
> > +#include <linux/irq.h>
> > +#include <linux/pm.h>
> > +#include <linux/sysdev.h>
> > +#include <linux/io.h>
> > +
> > +#include <asm/gpio.h>
>
> linux/gpio.h is preferred over asm/gpio.h
Ok.
> > +++ b/arch/arm/mach-msm/board-dream.c
> > @@ -18,11 +18,13 @@
> > #include <asm/setup.h>
> > +#include <asm/gpio.h>
>
> ditto.
Ok.
> > +++ b/arch/arm/mach-msm/generic_gpio.c
> > @@ -0,0 +1,274 @@
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/errno.h>
> > +#include <linux/slab.h>
> > +#include <linux/spinlock.h>
> > +#include <asm/gpio.h>
>
> ditto.
Ok. Incremental patch looks like:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1c4119c..db622a5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -565,6 +565,7 @@ config ARCH_MSM
select CPU_V6
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select GENERIC_GPIO
help
Support for Qualcomm MSM7K based systems. This runs on the ARM11
apps processor of the MSM7K and depends on a shared memory
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 774c50e..f780086 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -40,8 +40,4 @@ config MACH_TROUT
help
Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
-config GENERIC_GPIO
- bool
- default y
-
endif
diff --git a/arch/arm/mach-msm/board-dream-gpio.c b/arch/arm/mach-msm/board-dream-gpio.c
index 7796254..d9201f9 100644
--- a/arch/arm/mach-msm/board-dream-gpio.c
+++ b/arch/arm/mach-msm/board-dream-gpio.c
@@ -19,15 +19,16 @@
#include <linux/pm.h>
#include <linux/sysdev.h>
#include <linux/io.h>
+#include <linux/gpio.h>
-#include <asm/gpio.h>
#include <asm/mach-types.h>
#include "board-dream.h"
#include "gpio_chip.h"
+/* We want to be compatible with existing bootloaders */
#undef MODULE_PARAM_PREFIX
-#define MODULE_PARAM_PREFIX "board_dream."
+#define MODULE_PARAM_PREFIX "board_trout."
static uint cpld_usb_h2w_sw;
module_param_named(usb_h2w_sw, cpld_usb_h2w_sw, uint, 0);
diff --git a/arch/arm/mach-msm/board-dream.c b/arch/arm/mach-msm/board-dream.c
index 3e8e54a..edefacf 100644
--- a/arch/arm/mach-msm/board-dream.c
+++ b/arch/arm/mach-msm/board-dream.c
@@ -19,12 +19,12 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
+#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/setup.h>
-#include <asm/gpio.h>
#include <mach/board.h>
#include <mach/hardware.h>
diff --git a/arch/arm/mach-msm/generic_gpio.c b/arch/arm/mach-msm/generic_gpio.c
index 8ee7bd5..5164c77 100644
--- a/arch/arm/mach-msm/generic_gpio.c
+++ b/arch/arm/mach-msm/generic_gpio.c
@@ -18,7 +18,8 @@
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
-#include <asm/gpio.h>
+#include <linux/gpio.h>
+
#include "gpio_chip.h"
#define GPIO_NUM_TO_CHIP_INDEX(gpio) ((gpio)>>5)
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Arve Hj?nnev?g <arve@android.com>,
kernel list <linux-kernel@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
Brian Swetland <swetland@google.com>,
Daniel Walker <dwalker@codeaurora.org>,
Iliyan Malchev <malchev@google.com>
Subject: Re: GPIO support for HTC Dream
Date: Wed, 9 Dec 2009 12:41:43 +0100 [thread overview]
Message-ID: <20091209114143.GD22752@elf.ucw.cz> (raw)
In-Reply-To: <20091208224550.GA26915@n2100.arm.linux.org.uk>
On Tue 2009-12-08 22:45:50, Russell King - ARM Linux wrote:
> On Tue, Dec 08, 2009 at 11:28:43AM +0100, Pavel Machek wrote:
> > Add GPIO support for HTC Dream.
> >
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> >
> > diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
> > index f780086..774c50e 100644
> > --- a/arch/arm/mach-msm/Kconfig
> > +++ b/arch/arm/mach-msm/Kconfig
> > @@ -40,4 +40,8 @@ config MACH_TROUT
> > help
> > Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
> >
> > +config GENERIC_GPIO
> > + bool
> > + default y
>
> Please arrange for this to be handled just like every other ARM
> platform via a 'select' statement - eg:
>
> config ARCH_AT91
> bool "Atmel AT91"
> select GENERIC_GPIO
> select ARCH_REQUIRE_GPIOLIB
> select HAVE_CLK
>
> It is not nice to have multiple definitions of the same symbol scattered
> throughout the Kconfig files.
Ok, fixed.
> > +#include <linux/kernel.h>
> > +#include <linux/errno.h>
> > +#include <linux/irq.h>
> > +#include <linux/pm.h>
> > +#include <linux/sysdev.h>
> > +#include <linux/io.h>
> > +
> > +#include <asm/gpio.h>
>
> linux/gpio.h is preferred over asm/gpio.h
Ok.
> > +++ b/arch/arm/mach-msm/board-dream.c
> > @@ -18,11 +18,13 @@
> > #include <asm/setup.h>
> > +#include <asm/gpio.h>
>
> ditto.
Ok.
> > +++ b/arch/arm/mach-msm/generic_gpio.c
> > @@ -0,0 +1,274 @@
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/errno.h>
> > +#include <linux/slab.h>
> > +#include <linux/spinlock.h>
> > +#include <asm/gpio.h>
>
> ditto.
Ok. Incremental patch looks like:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1c4119c..db622a5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -565,6 +565,7 @@ config ARCH_MSM
select CPU_V6
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select GENERIC_GPIO
help
Support for Qualcomm MSM7K based systems. This runs on the ARM11
apps processor of the MSM7K and depends on a shared memory
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 774c50e..f780086 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -40,8 +40,4 @@ config MACH_TROUT
help
Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
-config GENERIC_GPIO
- bool
- default y
-
endif
diff --git a/arch/arm/mach-msm/board-dream-gpio.c b/arch/arm/mach-msm/board-dream-gpio.c
index 7796254..d9201f9 100644
--- a/arch/arm/mach-msm/board-dream-gpio.c
+++ b/arch/arm/mach-msm/board-dream-gpio.c
@@ -19,15 +19,16 @@
#include <linux/pm.h>
#include <linux/sysdev.h>
#include <linux/io.h>
+#include <linux/gpio.h>
-#include <asm/gpio.h>
#include <asm/mach-types.h>
#include "board-dream.h"
#include "gpio_chip.h"
+/* We want to be compatible with existing bootloaders */
#undef MODULE_PARAM_PREFIX
-#define MODULE_PARAM_PREFIX "board_dream."
+#define MODULE_PARAM_PREFIX "board_trout."
static uint cpld_usb_h2w_sw;
module_param_named(usb_h2w_sw, cpld_usb_h2w_sw, uint, 0);
diff --git a/arch/arm/mach-msm/board-dream.c b/arch/arm/mach-msm/board-dream.c
index 3e8e54a..edefacf 100644
--- a/arch/arm/mach-msm/board-dream.c
+++ b/arch/arm/mach-msm/board-dream.c
@@ -19,12 +19,12 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
+#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/setup.h>
-#include <asm/gpio.h>
#include <mach/board.h>
#include <mach/hardware.h>
diff --git a/arch/arm/mach-msm/generic_gpio.c b/arch/arm/mach-msm/generic_gpio.c
index 8ee7bd5..5164c77 100644
--- a/arch/arm/mach-msm/generic_gpio.c
+++ b/arch/arm/mach-msm/generic_gpio.c
@@ -18,7 +18,8 @@
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
-#include <asm/gpio.h>
+#include <linux/gpio.h>
+
#include "gpio_chip.h"
#define GPIO_NUM_TO_CHIP_INDEX(gpio) ((gpio)>>5)
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2009-12-09 11:41 UTC|newest]
Thread overview: 118+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 10:28 GPIO support for HTC Dream Pavel Machek
2009-12-08 10:28 ` Pavel Machek
2009-12-08 20:22 ` Ryan Mallon
2009-12-08 20:22 ` Ryan Mallon
2009-12-08 21:37 ` Pavel Machek
2009-12-08 21:37 ` Pavel Machek
2009-12-08 21:53 ` Ryan Mallon
2009-12-08 21:53 ` Ryan Mallon
2009-12-10 16:26 ` Pavel Machek
2009-12-10 16:26 ` Pavel Machek
2009-12-08 21:56 ` Arve Hjønnevåg
2009-12-08 21:56 ` Arve Hjønnevåg
2009-12-09 11:32 ` Pavel Machek
2009-12-09 11:32 ` Pavel Machek
2009-12-08 21:46 ` Pavel Machek
2009-12-08 21:46 ` Pavel Machek
2009-12-08 22:03 ` Joe Perches
2009-12-08 22:03 ` Joe Perches
2009-12-09 11:46 ` Pavel Machek
2009-12-09 11:46 ` Pavel Machek
2009-12-08 22:10 ` Ryan Mallon
2009-12-08 22:10 ` Ryan Mallon
2009-12-09 23:40 ` Ryan Mallon
2009-12-09 23:40 ` Ryan Mallon
2009-12-10 17:24 ` Pavel Machek
2009-12-10 17:24 ` Pavel Machek
2009-12-10 17:41 ` Mark Brown
2009-12-10 17:41 ` Mark Brown
2009-12-10 19:49 ` Ryan Mallon
2009-12-10 19:49 ` Ryan Mallon
2009-12-10 23:14 ` H Hartley Sweeten
2009-12-10 23:14 ` H Hartley Sweeten
2009-12-11 19:58 ` Pavel Machek
2009-12-11 19:58 ` Pavel Machek
2009-12-11 22:10 ` Pavel Machek
2009-12-11 22:10 ` Pavel Machek
2009-12-11 22:40 ` Arve Hjønnevåg
2009-12-11 22:40 ` Arve Hjønnevåg
2009-12-11 23:12 ` H Hartley Sweeten
2009-12-11 23:12 ` H Hartley Sweeten
2009-12-16 22:53 ` Pavel Machek
2009-12-16 22:53 ` Pavel Machek
2009-12-16 23:03 ` Daniel Walker
2009-12-16 23:03 ` Daniel Walker
2009-12-11 23:04 ` H Hartley Sweeten
2009-12-11 23:04 ` H Hartley Sweeten
2009-12-14 6:45 ` Pavel Machek
2009-12-14 6:45 ` Pavel Machek
2009-12-14 17:54 ` Daniel Walker
2009-12-14 17:54 ` Daniel Walker
2009-12-14 18:12 ` H Hartley Sweeten
2009-12-14 18:12 ` H Hartley Sweeten
2009-12-15 6:40 ` Arve Hjønnevåg
2009-12-15 6:40 ` Arve Hjønnevåg
2009-12-15 19:12 ` Pavel Machek
2009-12-15 19:12 ` Pavel Machek
2009-12-15 20:07 ` Daniel Walker
2009-12-15 20:07 ` Daniel Walker
2009-12-15 21:21 ` Pavel Machek
2009-12-15 21:21 ` Pavel Machek
2009-12-15 20:48 ` Jamie Lokier
2009-12-15 20:48 ` Jamie Lokier
2009-12-15 21:07 ` Brian Swetland
2009-12-15 21:07 ` Brian Swetland
2009-12-14 19:00 ` H Hartley Sweeten
2009-12-14 19:00 ` H Hartley Sweeten
2009-12-15 19:47 ` Pavel Machek
2009-12-15 19:47 ` Pavel Machek
2009-12-15 20:15 ` H Hartley Sweeten
2009-12-15 20:15 ` H Hartley Sweeten
2009-12-15 20:47 ` Pavel Machek
2009-12-15 20:47 ` Pavel Machek
2009-12-15 21:16 ` [patch] " Pavel Machek
2009-12-15 21:16 ` Pavel Machek
2009-12-25 17:10 ` Pavel Machek
2009-12-25 17:10 ` Pavel Machek
2009-12-25 23:49 ` Daniel Walker
2009-12-25 23:49 ` Daniel Walker
2009-12-26 8:51 ` Pavel Machek
2009-12-26 8:51 ` Pavel Machek
2009-12-15 20:24 ` Ryan Mallon
2009-12-15 20:24 ` Ryan Mallon
2009-12-15 20:44 ` Pavel Machek
2009-12-15 20:44 ` Pavel Machek
2009-12-15 6:48 ` Arve Hjønnevåg
2009-12-15 6:48 ` Arve Hjønnevåg
2009-12-11 23:28 ` Russell King - ARM Linux
2009-12-11 23:28 ` Russell King - ARM Linux
2009-12-11 23:50 ` H Hartley Sweeten
2009-12-11 23:50 ` H Hartley Sweeten
2009-12-14 6:24 ` Pavel Machek
2009-12-14 6:24 ` Pavel Machek
2009-12-10 16:57 ` Pavel Machek
2009-12-10 16:57 ` Pavel Machek
2009-12-08 22:45 ` Russell King - ARM Linux
2009-12-08 22:45 ` Russell King - ARM Linux
2009-12-09 0:39 ` Arve Hjønnevåg
2009-12-09 0:39 ` Arve Hjønnevåg
2009-12-09 11:37 ` Pavel Machek
2009-12-09 11:37 ` Pavel Machek
2009-12-09 11:42 ` Arve Hjønnevåg
2009-12-09 11:42 ` Arve Hjønnevåg
2009-12-10 16:27 ` Pavel Machek
2009-12-10 16:27 ` Pavel Machek
2009-12-09 16:18 ` Daniel Walker
2009-12-09 16:18 ` Daniel Walker
2009-12-13 21:29 ` Pavel Machek
2009-12-13 21:29 ` Pavel Machek
2009-12-13 21:38 ` Brian Swetland
2009-12-13 21:38 ` Brian Swetland
2009-12-15 19:09 ` Pavel Machek
2009-12-15 19:09 ` Pavel Machek
2009-12-14 17:40 ` Daniel Walker
2009-12-14 17:40 ` Daniel Walker
2009-12-15 19:10 ` Pavel Machek
2009-12-15 19:10 ` Pavel Machek
2009-12-09 11:41 ` Pavel Machek [this message]
2009-12-09 11:41 ` Pavel Machek
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=20091209114143.GD22752@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-arm-kernel@lists.infradead.org \
/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.