* [GIT PULL] rmobile updates for 3.2
From: Paul Mundt @ 2011-11-06 1:33 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-sh, linux-kernel
Please pull from:
git://github.com/pmundt/linux-sh.git rmobile-latest
Which contains:
Bastian Hecht (1):
ARM: sh7372 ap4evb NOR Flash USB boot fix
Guennadi Liakhovetski (1):
ARM: mach-shmobile: ag5evm needs CONFIG_I2C
Magnus Damm (19):
ARM: mach-shmobile: sh73a0 PFC pull-up support for SDHI0+2
ARM: mach-shmobile: Kota2 SCIFA2 and SMSC911X support
ARM: mach-shmobile: Kota2 KEYSC support
ARM: mach-shmobile: Kota2 GPIO Keys support
ARM: mach-shmobile: Kota2 GPIO LEDs support
ARM: mach-shmobile: Kota2 MMCIF support
ARM: mach-shmobile: Kota2 SCIFA4 and SCIFB support
ARM: mach-shmobile: Kota2 SDHI0 and SDHI1 support
ARM: mach-shmobile: Break out INTC IRQ code
sh: intc: Allow triggering on both edges for ARM SoCs
ARM: mach-shmobile: sh7372 Mackerel NOR Flash USB boot fix
ARM: mach-shmobile: sh73a0 GPIO IRQ support
ARM: mach-shmobile: Use common INTC IRQ code on sh7367
ARM: mach-shmobile: Use common INTC IRQ code on sh7377
ARM: mach-shmobile: Use common INTC IRQ code on sh7372
ARM: mach-shmobile: Use common INTC IRQ code on sh73a0
ARM: mach-shmobile: SDHI0 GPIO hotplug for AG5EVM
ARM: mach-shmobile: Add support for PINT though INTC macros
ARM: mach-shmobile: sh73a0 and AG5EVM PINT support
arch/arm/mach-shmobile/Kconfig | 8 +
arch/arm/mach-shmobile/Makefile | 1 +
arch/arm/mach-shmobile/board-ag5evm.c | 36 ++-
arch/arm/mach-shmobile/board-ap4evb.c | 4 +-
arch/arm/mach-shmobile/board-kota2.c | 447 ++++++++++++++++++++++++++
arch/arm/mach-shmobile/board-mackerel.c | 4 +-
arch/arm/mach-shmobile/include/mach/intc.h | 246 ++++++++++++++
arch/arm/mach-shmobile/include/mach/sh73a0.h | 17 +
arch/arm/mach-shmobile/intc-sh7367.c | 40 +--
arch/arm/mach-shmobile/intc-sh7372.c | 72 +----
arch/arm/mach-shmobile/intc-sh7377.c | 67 +----
arch/arm/mach-shmobile/intc-sh73a0.c | 187 +++++++++++
arch/arm/mach-shmobile/pfc-sh73a0.c | 120 ++++++-
arch/arm/mach-shmobile/platsmp.c | 10 +-
drivers/sh/intc/chip.c | 2 +-
15 files changed, 1063 insertions(+), 198 deletions(-)
create mode 100644 arch/arm/mach-shmobile/board-kota2.c
create mode 100644 arch/arm/mach-shmobile/include/mach/intc.h
^ permalink raw reply
* Re: [PATCH 07/10 v2] sh: clkfwk: add clk_rate_mult_range_round()
From: Paul Mundt @ 2011-11-04 16:05 UTC (permalink / raw)
To: linux-sh
On Mon, Sep 19, 2011 at 06:51:13PM -0700, Kuninori Morimoto wrote:
> Some llock pulse generator has PLL multiplication.
> clk_rate_mult_range_round() will be good helper for it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
>
> o xx_multi_xx -> xx_mult_xx
> o div_xxx -> mult_xxx
>
> drivers/sh/clk/core.c | 20 ++++++++++++++++++++
> include/linux/sh_clk.h | 3 +++
> 2 files changed, 23 insertions(+), 0 deletions(-)
>
I've applied this one now, though it will take a bit to get the rest of
the series sorted out.
^ permalink raw reply
* Re: [PATCH 01/07] ARM: mach-shmobile: Kota2 SCIFA2 and SMSC911X support
From: Paul Mundt @ 2011-11-04 14:14 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <20110818054407.23410.98641.sendpatchset@rxone.opensource.se>
On Mon, Aug 22, 2011 at 12:43:29PM +0900, Paul Mundt wrote:
> On Thu, Aug 18, 2011 at 02:44:07PM +0900, Magnus Damm wrote:
> > +static void __init kota2_timer_init(void)
> > +{
> > + sh73a0_clock_init();
> > + shmobile_timer.init();
> > + return;
> > +}
> > +
> Pointless return.
>
> > --- 0001/arch/arm/mach-shmobile/platsmp.c
> > +++ work/arch/arm/mach-shmobile/platsmp.c 2011-08-18 13:38:02.000000000 +0900
> > @@ -21,9 +21,11 @@
> > #include <asm/mach-types.h>
> > #include <mach/common.h>
> >
> > +#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2())
> > +
> > static unsigned int __init shmobile_smp_get_core_count(void)
> > {
> > - if (machine_is_ag5evm())
> > + if (is_sh73a0())
> > return sh73a0_get_core_count();
> >
> > return 1;
>
> No. If you want to do this then simply do what the other platforms are
> doing and construct a cpu.h, then you can centrally define things and use
> cpu_is_xxx() outright. Making CPU inferences from mach type is just
> asking for trouble.
I don't see any updates to this series that address any of these issues,
even after I went to all of the trouble of setting them up in a topic
branch for incremental fixing.
I'll merge the topic branch for now, but don't expect this to happen
again if I don't see cleanup patches or the same lazy-ass approach is
taken for any additional boards.
^ permalink raw reply
* Re: R-Mobile A1 support
From: Paul Mundt @ 2011-11-04 14:10 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <87bou4qgof.wl%kuninori.morimoto.gx@renesas.com>
On Fri, Sep 30, 2011 at 12:56:18AM -0700, Kuninori Morimoto wrote:
>
> Hi Iwamatsu-san
>
> > Do you forget to send an email of 2/5?
>
> Hmm.. strange..
>
> I sent 2/5 email, but linux-sh ML didn't get it ?
> OK. I will re-send it
>
I am still not able to find it anywhere, making me think that it was too
large and was dropped by the list software. Perhaps it can be broken up
in to smaller parts? Also make sure that you are including a stripped
defconfig and not the entire thing, as that will needlessly bloat up the
patch (and I'll just have to strip out the unecessary symbols later),
too.
^ permalink raw reply
* Re: Ecovec (SH7724) board doesn't work on latest linus tree
From: Paul Mundt @ 2011-11-04 13:23 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <w3pvcwf5xuu.wl%kuninori.morimoto.gx@renesas.com>
On Wed, Oct 05, 2011 at 08:16:10AM +0900, Simon Horman wrote:
> On Mon, Sep 19, 2011 at 07:08:18PM -0700, Kuninori Morimoto wrote:
> >
> > Hi Paul, Iwamatsu-san
> >
> > > On Thu, Sep 08, 2011 at 05:52:11PM +0900, Nobuhiro Iwamatsu wrote:
> > > > Your patch does not seem to have a meaning.
> > > > In the case of 29bit, CAC/UNCAC_ADDR may not return a right address.
> > > > I think that it is to use P1SEGADDR, and P2SEGADDR in CAC/UNCAC_ADDR
> > > > to easily revise this.
> > > > I attached my patch.
> > > >
> > > Morimoto-san, does this fix your issue? If you can provide your Tested-by
> > > for this then I'll queue it up and get it off to Linus.
> >
> > Thank you.
> >
> > I tested this patch on linus/master.
> > And this patch solved Ecovec board boot issue.
> >
> > # I tested it on mackerel (SH7372) board too.
> > # It works well
> >
> > Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> FWIW, this resolved a failure to boot on Ecovec for me too.
>
> Tested-by: Simon Horman <horms@verge.net.au>
Seem to have somehow missed this one, too. Applied now, thanks everyone.
^ permalink raw reply
* Re: [PATCH] sh: Fix serial for SH7203
From: Paul Mundt @ 2011-11-04 13:10 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <1317651407-6155-1-git-send-email-phil.edworthy@renesas.com>
On Fri, Nov 04, 2011 at 11:42:27AM +0000, phil.edworthy@renesas.com wrote:
> Hi Paul,
>
> From: Federico Fuga <ml@studiofuga.com>
> Date: 10/10/2011 14:22
>
> > Il giorno 03/ott/2011, alle ore 16.16, Phil Edworthy ha scritto:
> >
> > > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> >
> > Works correctly on sh7203, fix several crashes when FIFO buffers
> overflows .
> > Thanks
> >
> > Tested-by: Federico Fuga <fuga@studiofuga.com>
>
> I haven't heard anything on this... Is this patch ok?
>
Sorry about that, this is one of the ones that went out when I was
somehow unsubbed from the list and so didn't make it in to my inbox. I
dug the patch up from alternate archives, and will queue it up. Thanks
for reminding me!
^ permalink raw reply
* Re: [PATCH] sh: Fix serial for SH7203
From: phil.edworthy @ 2011-11-04 11:42 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <1317651407-6155-1-git-send-email-phil.edworthy@renesas.com>
Hi Paul,
From: Federico Fuga <ml@studiofuga.com>
Date: 10/10/2011 14:22
> Il giorno 03/ott/2011, alle ore 16.16, Phil Edworthy ha scritto:
>
> > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
>
> Works correctly on sh7203, fix several crashes when FIFO buffers
overflows .
> Thanks
>
> Tested-by: Federico Fuga <fuga@studiofuga.com>
I haven't heard anything on this... Is this patch ok?
Thanks
Phil
^ permalink raw reply
* Re: Question about clk->usecount
From: Kuninori Morimoto @ 2011-11-04 4:30 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <87fwihj3x8.wl%kuninori.morimoto.gx@renesas.com>
Hi Paul
> > @@ -152,7 +159,12 @@ int __init sh_hwblk_clk_register(struct clk *clks, int nr)
> > continue;
> >
> > clkp->ops = &sh_hwblk_clk_ops;
> > - ret |= clk_register(clkp);
> > + ret = clk_register(clkp);
> > + if (ret < 0)
> > + return ret;
> > +
> > + if (hwblk_info)
> > + hwblk_info->hwblks[k].clk = clkp;
> > }
> >
> > return ret;
>
> The error path handling here is a bit of an unusual case. clk_register()
> failing on one clock is not necessarily an indicator that other clocks
> can't be succesfully registered, so we're better off simply checking if
> clk_register() succeeds and then stashing the clock pointer, rather than
> bailing on the loop entirely.
>
> The general idea seems to be heading in the right direction though.
Thank you for your comment.
I understand it.
But I have 1 thing to worry about on this rough patch.
it is clock parent.
I'm not sure who/how control clock parent.
Because current pm_runtime_xxx() functions which was calling hwblk_enable/disable()
(seems) didn't care its parent clock.
but clk_enable/disable() care it.
if we used clk_enable/disable() instead of hwblk_enable/disable(),
but some upper function is already caring clock parent,
it will be double cared (from upper function / clk_enable/disable())
But if upper function didn't care parent,
clock parent will be out of PM control (?).
I'm not sure.
Best regards
---
Kuninori Morimoto
^ permalink raw reply
* Re: Question about clk->usecount
From: Paul Mundt @ 2011-11-04 3:30 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <87fwihj3x8.wl%kuninori.morimoto.gx@renesas.com>
On Fri, Oct 28, 2011 at 03:53:19AM -0700, Kuninori Morimoto wrote:
> @@ -152,7 +159,12 @@ int __init sh_hwblk_clk_register(struct clk *clks, int nr)
> continue;
>
> clkp->ops = &sh_hwblk_clk_ops;
> - ret |= clk_register(clkp);
> + ret = clk_register(clkp);
> + if (ret < 0)
> + return ret;
> +
> + if (hwblk_info)
> + hwblk_info->hwblks[k].clk = clkp;
> }
>
> return ret;
The error path handling here is a bit of an unusual case. clk_register()
failing on one clock is not necessarily an indicator that other clocks
can't be succesfully registered, so we're better off simply checking if
clk_register() succeeds and then stashing the clock pointer, rather than
bailing on the loop entirely.
The general idea seems to be heading in the right direction though.
^ permalink raw reply
* Re: [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Mike Frysinger @ 2011-11-04 2:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111103231707.GU12913@n2100.arm.linux.org.uk>
[-- Attachment #1: Type: Text/Plain, Size: 325 bytes --]
On Thursday 03 November 2011 19:17:07 Russell King - ARM Linux wrote:
> (b) that's effectively what it is - if you understand what's going on with
> the 'default' statements.
>
> For any option, there can be multiple 'default' statements:
thanks, i wasn't aware of the cascading nature of the default keyword
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Russell King - ARM Linux @ 2011-11-03 23:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201111031907.46434.vapier@gentoo.org>
On Thu, Nov 03, 2011 at 07:07:42PM -0400, Mike Frysinger wrote:
> On Thursday 03 November 2011 18:44:52 Russell King - ARM Linux wrote:
> > It most certainly is an improvement.
> >
> > One of the things that we (the ARM community as a whole) is focused on to
> > is to reduce the amount of code in arch/arm through consolidation, removing
> > as much duplication as practical between the various SoCs.
> >
> > One of the other factors that we're also focused on is:
> > (a) reducing the number of configurations which have to be built to
> > properly build-test ARM
> > (b) reducing the number of kernels which have to be built to support a
> > range of ARM platforms
>
> i'm aware of these efforts, but i don't see how this Kconfig solution gets you
> there. it's still a single define depending on arch-specific knobs. now, if
> this were treated as a max value that was based on all the arch needs, it's
> now useful across SoCs.
(a) you need to read other discussions on this subject which have already
been had on linux-arm-kernel. Essentially I've had it in the neck for
less than 128 bytes of needless bloat. So when I'm faced with 8K of
bloat, what do you think my reaction will be? Roll over and capitulate
only to get it in the neck again? Or come up with an easy solution?
(b) that's effectively what it is - if you understand what's going on with
the 'default' statements.
For any option, there can be multiple 'default' statements:
- default value: "default" <expr> ["if" <expr>]
A config option can have any number of default values. If multiple
default values are visible, only the first defined one is active.
...
Optionally, dependencies only for this default value can be added with
"if".
Now, because of that well defined order, if we do this:
config FOO
int
default 1024 if A
default 512 if B
default 256
Then we end up with this truth table:
A B FOO
n n 256
n y 512
y n 1024
y y 1024
Which - provided the order is highest value first - gets us the highest
value for this variable dependent on which platforms have been selected.
And - given that we don't have many which require this treatment, this
is a sane solution to the problem. Not only that but it's one which can
be trivially deleted from one file if and when we have sparse gpio.
^ permalink raw reply
* Re: [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Mike Frysinger @ 2011-11-03 23:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201111031907.46434.vapier@gentoo.org>
[-- Attachment #1: Type: Text/Plain, Size: 354 bytes --]
On Thursday 03 November 2011 19:07:42 Mike Frysinger wrote:
> i'm aware of these efforts, but i don't see how this Kconfig solution gets
> you there. it's still a single define depending on arch-specific knobs.
> now, if this were treated as a max value that was based on all the arch
> needs, it's now useful across SoCs.
s/arch/mach/g
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Mike Frysinger @ 2011-11-03 23:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111103224452.GS12913@n2100.arm.linux.org.uk>
[-- Attachment #1: Type: Text/Plain, Size: 2284 bytes --]
On Thursday 03 November 2011 18:44:52 Russell King - ARM Linux wrote:
> On Thu, Nov 03, 2011 at 06:16:33PM -0400, Mike Frysinger wrote:
> > On Thursday 03 November 2011 13:00:44 Peter De Schrijver wrote:
> > > This patchset converts ARCH_NR_GPIO to a Kconfig variable as suggested
> > > by Russel King. It also converts some platforms to the new model.
> > >
> > > Peter De Schrijver (3):
> > > ARM: ARCH_NR_GPIO: Make ARCH_NR_GPIO a Kconfig variable
> > > ARM: mach-shmobile: Use CONFIG_ARCH_NR_GPIO
> > > ARM: mach-ux500 Use CONFIG_ARCH_NR_GPIO
> > >
> > > arch/arm/Kconfig | 10 ++++++++++
> > > arch/arm/include/asm/gpio.h | 4 ++++
> > > arch/arm/mach-shmobile/include/mach/gpio.h | 2 --
> > > arch/arm/mach-ux500/include/mach/gpio.h | 5 -----
> > > 4 files changed, 14 insertions(+), 7 deletions(-)
> >
> > i'm not sure how this is an improvement. we go from declaring the define
> > in the right mach-specific subdir
> > (arch/arm/mach-xxx/include/mach/gpio.h) to an arm-global file
> > (arm/Kconfig). i'd think the ideal would be to keep all the mach cruft
> > in the mach-xxx/ subdir.
>
> It most certainly is an improvement.
>
> One of the things that we (the ARM community as a whole) is focused on to
> is to reduce the amount of code in arch/arm through consolidation, removing
> as much duplication as practical between the various SoCs.
>
> One of the other factors that we're also focused on is:
> (a) reducing the number of configurations which have to be built to
> properly build-test ARM
> (b) reducing the number of kernels which have to be built to support a
> range of ARM platforms
i'm aware of these efforts, but i don't see how this Kconfig solution gets you
there. it's still a single define depending on arch-specific knobs. now, if
this were treated as a max value that was based on all the arch needs, it's
now useful across SoCs.
> It's one reason why I won't be acking your patch which pushes new stuff
> into the mach/gpio.h headers at a time when we're trying to get rid of
> them.
i already described in the patch that it was an improvement, and that it makes
things even easier to move away from mach gpio.h.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Russell King - ARM Linux @ 2011-11-03 22:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201111031816.37427.vapier@gentoo.org>
On Thu, Nov 03, 2011 at 06:16:33PM -0400, Mike Frysinger wrote:
> On Thursday 03 November 2011 13:00:44 Peter De Schrijver wrote:
> > This patchset converts ARCH_NR_GPIO to a Kconfig variable as suggested by
> > Russel King. It also converts some platforms to the new model.
> >
> > Peter De Schrijver (3):
> > ARM: ARCH_NR_GPIO: Make ARCH_NR_GPIO a Kconfig variable
> > ARM: mach-shmobile: Use CONFIG_ARCH_NR_GPIO
> > ARM: mach-ux500 Use CONFIG_ARCH_NR_GPIO
> >
> > arch/arm/Kconfig | 10 ++++++++++
> > arch/arm/include/asm/gpio.h | 4 ++++
> > arch/arm/mach-shmobile/include/mach/gpio.h | 2 --
> > arch/arm/mach-ux500/include/mach/gpio.h | 5 -----
> > 4 files changed, 14 insertions(+), 7 deletions(-)
>
> i'm not sure how this is an improvement. we go from declaring the define in
> the right mach-specific subdir (arch/arm/mach-xxx/include/mach/gpio.h) to an
> arm-global file (arm/Kconfig). i'd think the ideal would be to keep all the
> mach cruft in the mach-xxx/ subdir.
It most certainly is an improvement.
One of the things that we (the ARM community as a whole) is focused on to
is to reduce the amount of code in arch/arm through consolidation, removing
as much duplication as practical between the various SoCs.
One of the other factors that we're also focused on is:
(a) reducing the number of configurations which have to be built to properly
build-test ARM
(b) reducing the number of kernels which have to be built to support a
range of ARM platforms
Those two things together dictate that we remove the mach/ header files
which are included outside of the individual mach-* directories, so that
the entire kernel does not depend on anything in those mach/ header files.
That includes mach/gpio.h.
It is the long term goal of Linaro to move the ARM kernel forward to such
a point.
Having ARCH_NR_GPIO definitions in mach/gpio.h is a blocker to both these
efforts and, therefore, must be removed. Therefore, before we have a
better solution (such as sparse gpios in the same way as we have sparse
irqs) we're going to stop the problem escalating still further by removing
the need for new definitions of this constant in yet more new mach/gpio.h
headers - which could otherwise be empty.
It's one reason why I won't be acking your patch which pushes new stuff
into the mach/gpio.h headers at a time when we're trying to get rid of
them.
^ permalink raw reply
* Re: [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Mike Frysinger @ 2011-11-03 22:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1320339647-30255-1-git-send-email-pdeschrijver@nvidia.com>
[-- Attachment #1: Type: Text/Plain, Size: 976 bytes --]
On Thursday 03 November 2011 13:00:44 Peter De Schrijver wrote:
> This patchset converts ARCH_NR_GPIO to a Kconfig variable as suggested by
> Russel King. It also converts some platforms to the new model.
>
> Peter De Schrijver (3):
> ARM: ARCH_NR_GPIO: Make ARCH_NR_GPIO a Kconfig variable
> ARM: mach-shmobile: Use CONFIG_ARCH_NR_GPIO
> ARM: mach-ux500 Use CONFIG_ARCH_NR_GPIO
>
> arch/arm/Kconfig | 10 ++++++++++
> arch/arm/include/asm/gpio.h | 4 ++++
> arch/arm/mach-shmobile/include/mach/gpio.h | 2 --
> arch/arm/mach-ux500/include/mach/gpio.h | 5 -----
> 4 files changed, 14 insertions(+), 7 deletions(-)
i'm not sure how this is an improvement. we go from declaring the define in
the right mach-specific subdir (arch/arm/mach-xxx/include/mach/gpio.h) to an
arm-global file (arm/Kconfig). i'd think the ideal would be to keep all the
mach cruft in the mach-xxx/ subdir.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH 3/3] ARM: mach-ux500 Use CONFIG_ARCH_NR_GPIO
From: Peter De Schrijver @ 2011-11-03 17:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1320339647-30255-1-git-send-email-pdeschrijver@nvidia.com>
Add default value for CONFIG_ARCH_NR_GPIO to Kconfig and remove the definition
in gpio.h. We can't remove gpio.h yet as asm/gpio.h still includes it.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-ux500/include/mach/gpio.h | 5 -----
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b9cfa99..8da1f5f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1510,6 +1510,7 @@ config LOCAL_TIMERS
config ARCH_NR_GPIO
int
default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
+ default 350 if ARCH_U8500
default 0
help
Maximum number of GPIOs in the system.
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h
index 7389df9..c01ef66 100644
--- a/arch/arm/mach-ux500/include/mach/gpio.h
+++ b/arch/arm/mach-ux500/include/mach/gpio.h
@@ -1,10 +1,5 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H
-/*
- * 288 (#267 is the highest one actually hooked up) onchip GPIOs, plus enough
- * room for a couple of GPIO expanders.
- */
-#define ARCH_NR_GPIOS 350
#endif /* __ASM_ARCH_GPIO_H */
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply related
* [PATCH 2/3] ARM: mach-shmobile: Use CONFIG_ARCH_NR_GPIO
From: Peter De Schrijver @ 2011-11-03 17:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1320339647-30255-1-git-send-email-pdeschrijver@nvidia.com>
Add default value for CONFIG_ARCH_NR_GPIO to Kconfig and remove the definition
in gpio.h.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
arch/arm/Kconfig | 2 +-
arch/arm/mach-shmobile/include/mach/gpio.h | 2 --
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 924f685..b9cfa99 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1509,7 +1509,7 @@ config LOCAL_TIMERS
config ARCH_NR_GPIO
int
- default 1024 if ARCH_TEGRA
+ default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
default 0
help
Maximum number of GPIOs in the system.
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index 7bf0890..de795b4 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -12,8 +12,6 @@
#include <linux/kernel.h>
#include <linux/errno.h>
-
-#define ARCH_NR_GPIOS 1024
#include <linux/sh_pfc.h>
#ifdef CONFIG_GPIOLIB
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply related
* [PATCH 1/3] ARM: ARCH_NR_GPIO: Make ARCH_NR_GPIO a Kconfig variable
From: Peter De Schrijver @ 2011-11-03 17:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1320339647-30255-1-git-send-email-pdeschrijver@nvidia.com>
Change ARCH_NR_GPIO into a Kconfig variable as suggested by Russel King. This
makes ARCH_NR_GPIO single zImage friendly. The default value for tegra is
defined as well.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
arch/arm/Kconfig | 9 +++++++++
arch/arm/include/asm/gpio.h | 4 ++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7e8ffe7..924f685 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1507,6 +1507,15 @@ config LOCAL_TIMERS
accounting to be spread across the timer interval, preventing a
"thundering herd" at every timer tick.
+config ARCH_NR_GPIO
+ int
+ default 1024 if ARCH_TEGRA
+ default 0
+ help
+ Maximum number of GPIOs in the system.
+
+ If unsure, leave the default value.
+
source kernel/Kconfig.preempt
config HZ
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 11ad0bf..7151753 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -1,6 +1,10 @@
#ifndef _ARCH_ARM_GPIO_H
#define _ARCH_ARM_GPIO_H
+#if CONFIG_ARCH_NR_GPIO > 0
+#define ARCH_NR_GPIO CONFIG_ARCH_NR_GPIO
+#endif
+
/* not all ARM platforms necessarily support this API ... */
#include <mach/gpio.h>
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply related
* [PATCH 0/3] Change ARCH_NR_GPIO into a Kconfig variable
From: Peter De Schrijver @ 2011-11-03 17:00 UTC (permalink / raw)
To: linux-arm-kernel
This patchset converts ARCH_NR_GPIO to a Kconfig variable as suggested by
Russel King. It also converts some platforms to the new model.
Peter De Schrijver (3):
ARM: ARCH_NR_GPIO: Make ARCH_NR_GPIO a Kconfig variable
ARM: mach-shmobile: Use CONFIG_ARCH_NR_GPIO
ARM: mach-ux500 Use CONFIG_ARCH_NR_GPIO
arch/arm/Kconfig | 10 ++++++++++
arch/arm/include/asm/gpio.h | 4 ++++
arch/arm/mach-shmobile/include/mach/gpio.h | 2 --
arch/arm/mach-ux500/include/mach/gpio.h | 5 -----
4 files changed, 14 insertions(+), 7 deletions(-)
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply
* Re: [GIT PULL] sh updates for 3.2
From: Paul Mundt @ 2011-11-03 14:41 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-sh, linux-kernel
In-Reply-To: <CA+55aFzE9aFuPmXGm8u64rWXD8WhLhuz+-c7rBgoiUosaru7jg@mail.gmail.com>
On Wed, Nov 02, 2011 at 09:52:39AM -0700, Linus Torvalds wrote:
> On Wed, Nov 2, 2011 at 7:22 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> > Please pull from:
> >
> > ? ? ? ?git://github.com/pmundt/linux-sh.git sh-latest
>
> Paul, please verify this for me somehow. You used to have a kernel.org
> account, and this is a repo I haven't seen before. Admittedly all the
> changes are to sh-specific files, so I don't think anybody *really*
> cares, but still..
>
That's correct. I moved to github when hera became unavailable and
haven't gotten around to re-establishing credentials there. I'm not sure
what else you'd like me to do to verify the tree location however, so
please let me know if I've overlooked something.
^ permalink raw reply
* [PATCH v3] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Mike Frysinger @ 2011-11-03 3:45 UTC (permalink / raw)
To: Grant Likely, Richard Henderson, Ivan Kokshaysky, Matt Turner,
Haavard Skinnemoen <hskin>
Cc: linux-alpha, linux-arch, linux-ia64, microblaze-uclinux,
linux-mips, linux-sh, linux, linuxppc-dev, sparclinux, x86,
linux-arm-kernel, uclinux-dist-devel, linux-kernel,
Mike Frysinger, linux-m68k
In-Reply-To: <1319720503-3183-1-git-send-email-vapier@gentoo.org>
Rather than requiring architectures that use gpiolib but don't have
any need to define anything custom to copy an asm/gpio.h, merge this
code into the asm-generic/gpio.h. We add ifdef checks so that arches
can still override things while using the asm-generic/gpio.h, but on
a more fine grained per-func approach.
I've compile tested these guys (with & without GPIOLIB), but don't
have the hardware to boot:
- alpha defconfig
- arm: all defconfigs
- blackfin defconfig
- ia64 defconfig
- m68k: multi & m5208evb defconfig
- mips: ar7 & ath79 & bcm47xx & bcm63xx & ip22 defconfig
- powerpc: mpc85xx & ppc64 defconfig
- sh: kfr2r09 defconfig
- sparc defconfig
- x86_64 defconfig
I don't have any toolchains for avr32, microblaze, openrisc, unicore32,
or xtensa. So they lose :x.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v3
- built on top of Linus' recent gpio fixes
- fixes builds for one or two arm platforms
- all the arm defconfigs have been checked on the disassembly level
arch/alpha/include/asm/Kbuild | 2 +
arch/alpha/include/asm/gpio.h | 55 -------------------
arch/arm/include/asm/gpio.h | 16 ------
arch/arm/include/asm/hardware/iop3xx-gpio.h | 21 ++------
arch/arm/mach-davinci/include/mach/gpio.h | 13 ++---
arch/arm/mach-ixp4xx/include/mach/gpio.h | 8 +--
arch/arm/mach-ks8695/include/mach/gpio.h | 1 +
arch/arm/mach-mmp/include/mach/gpio.h | 2 -
arch/arm/mach-pxa/include/mach/gpio.h | 2 +-
arch/arm/mach-sa1100/include/mach/gpio.h | 13 ++---
arch/arm/mach-shmobile/include/mach/gpio.h | 16 ------
arch/arm/mach-w90x900/include/mach/gpio.h | 1 +
arch/arm/plat-omap/include/plat/gpio.h | 4 +-
arch/arm/plat-pxa/include/plat/gpio.h | 8 ++--
arch/avr32/mach-at32ap/include/mach/gpio.h | 19 +------
arch/blackfin/include/asm/gpio.h | 16 ++----
arch/ia64/include/asm/Kbuild | 2 +
arch/ia64/include/asm/gpio.h | 55 -------------------
arch/m68k/include/asm/gpio.h | 7 +++
arch/microblaze/include/asm/Kbuild | 2 +
arch/microblaze/include/asm/gpio.h | 53 ------------------
arch/mips/include/asm/mach-ar7/gpio.h | 5 --
arch/mips/include/asm/mach-ath79/gpio.h | 8 ++-
arch/mips/include/asm/mach-bcm47xx/gpio.h | 3 +
arch/mips/include/asm/mach-bcm63xx/gpio.h | 5 --
arch/mips/include/asm/mach-generic/gpio.h | 8 +--
arch/mips/include/asm/mach-loongson/gpio.h | 7 +--
arch/mips/include/asm/mach-rc32434/gpio.h | 10 +---
arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h | 12 +---
arch/openrisc/include/asm/Kbuild | 1 +
arch/openrisc/include/asm/gpio.h | 65 -----------------------
arch/powerpc/include/asm/Kbuild | 2 +
arch/powerpc/include/asm/gpio.h | 53 ------------------
arch/sh/include/asm/gpio.h | 32 +-----------
arch/sparc/include/asm/Kbuild | 1 +
arch/sparc/include/asm/gpio.h | 36 -------------
arch/unicore32/include/asm/gpio.h | 8 ++-
arch/x86/include/asm/Kbuild | 2 +
arch/x86/include/asm/gpio.h | 53 ------------------
arch/xtensa/include/asm/Kbuild | 2 +
arch/xtensa/include/asm/gpio.h | 56 -------------------
include/asm-generic/gpio.h | 23 ++++++++
42 files changed, 107 insertions(+), 601 deletions(-)
delete mode 100644 arch/alpha/include/asm/gpio.h
delete mode 100644 arch/ia64/include/asm/gpio.h
delete mode 100644 arch/microblaze/include/asm/gpio.h
delete mode 100644 arch/openrisc/include/asm/gpio.h
delete mode 100644 arch/powerpc/include/asm/gpio.h
delete mode 100644 arch/sparc/include/asm/gpio.h
delete mode 100644 arch/x86/include/asm/gpio.h
delete mode 100644 arch/xtensa/include/asm/gpio.h
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index e423def..0bcff1a 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += compiler.h
header-y += console.h
header-y += fpu.h
diff --git a/arch/alpha/include/asm/gpio.h b/arch/alpha/include/asm/gpio.h
deleted file mode 100644
index 7dc6a63..0000000
--- a/arch/alpha/include/asm/gpio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generic GPIO API implementation for Alpha.
- *
- * A stright copy of that for PowerPC which was:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_ALPHA_GPIO_H
-#define _ASM_ALPHA_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_ALPHA_GPIO_H */
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 11ad0bf..9818329 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -4,23 +4,7 @@
/* not all ARM platforms necessarily support this API ... */
#include <mach/gpio.h>
-#ifndef __ARM_GPIOLIB_COMPLEX
/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
#include <asm-generic/gpio.h>
-/* The trivial gpiolib dispatchers */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-#endif
-
-/*
- * Provide a default gpio_to_irq() which should satisfy every case.
- * However, some platforms want to do this differently, so allow them
- * to override it.
- */
-#ifndef gpio_to_irq
-#define gpio_to_irq __gpio_to_irq
-#endif
-
#endif /* _ARCH_ARM_GPIO_H */
diff --git a/arch/arm/include/asm/hardware/iop3xx-gpio.h b/arch/arm/include/asm/hardware/iop3xx-gpio.h
index 9eda7dc..4033b81 100644
--- a/arch/arm/include/asm/hardware/iop3xx-gpio.h
+++ b/arch/arm/include/asm/hardware/iop3xx-gpio.h
@@ -25,11 +25,14 @@
#ifndef __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
#define __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_cansleep gpio_cansleep
+
#include <mach/hardware.h>
#include <asm-generic/gpio.h>
-#define __ARM_GPIOLIB_COMPLEX
-
#define IOP3XX_N_GPIOS 8
static inline int gpio_get_value(unsigned gpio)
@@ -57,19 +60,5 @@ static inline int gpio_cansleep(unsigned gpio)
return __gpio_cansleep(gpio);
}
-/*
- * The GPIOs are not generating any interrupt
- * Note : manuals are not clear about this
- */
-static inline int gpio_to_irq(int gpio)
-{
- return -EINVAL;
-}
-
-static inline int irq_to_gpio(int gpio)
-{
- return -EINVAL;
-}
-
#endif
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index 960e9de..1604005 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -13,9 +13,12 @@
#ifndef __DAVINCI_GPIO_H
#define __DAVINCI_GPIO_H
-#include <asm-generic/gpio.h>
+/* We implement a few ourself */
+#define gpio_set_value gpio_set_value
+#define gpio_get_value gpio_get_value
+#define gpio_cansleep gpio_cansleep
-#define __ARM_GPIOLIB_COMPLEX
+#include <asm-generic/gpio.h>
/* The inline versions use the static inlines in the driver header */
#include "gpio-davinci.h"
@@ -79,10 +82,4 @@ static inline int gpio_cansleep(unsigned gpio)
return __gpio_cansleep(gpio);
}
-static inline int irq_to_gpio(unsigned irq)
-{
- /* don't support the reverse mapping */
- return -ENOSYS;
-}
-
#endif /* __DAVINCI_GPIO_H */
diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h
index 83d6b4e..7835e31 100644
--- a/arch/arm/mach-ixp4xx/include/mach/gpio.h
+++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h
@@ -28,8 +28,6 @@
#include <linux/kernel.h>
#include <mach/hardware.h>
-#define __ARM_GPIOLIB_COMPLEX
-
static inline int gpio_request(unsigned gpio, const char *label)
{
return 0;
@@ -63,17 +61,17 @@ static inline int gpio_get_value(unsigned gpio)
return value;
}
+#define gpio_get_value gpio_get_value
static inline void gpio_set_value(unsigned gpio, int value)
{
gpio_line_set(gpio, value);
}
-
-#include <asm-generic/gpio.h> /* cansleep wrappers */
+#define gpio_set_value gpio_set_value
extern int gpio_to_irq(int gpio);
#define gpio_to_irq gpio_to_irq
extern int irq_to_gpio(unsigned int irq);
+#define irq_to_gpio irq_to_gpio
#endif
-
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h
index f5fda36..d81c6f8 100644
--- a/arch/arm/mach-ks8695/include/mach/gpio.h
+++ b/arch/arm/mach-ks8695/include/mach/gpio.h
@@ -15,5 +15,6 @@
* Map IRQ number to GPIO line.
*/
extern int irq_to_gpio(unsigned int irq);
+#define irq_to_gpio irq_to_gpio
#endif
diff --git a/arch/arm/mach-mmp/include/mach/gpio.h b/arch/arm/mach-mmp/include/mach/gpio.h
index 6812623..871b4c8 100644
--- a/arch/arm/mach-mmp/include/mach/gpio.h
+++ b/arch/arm/mach-mmp/include/mach/gpio.h
@@ -1,8 +1,6 @@
#ifndef __ASM_MACH_GPIO_H
#define __ASM_MACH_GPIO_H
-#include <asm-generic/gpio.h>
-
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
diff --git a/arch/arm/mach-pxa/include/mach/gpio.h b/arch/arm/mach-pxa/include/mach/gpio.h
index 004cade..a28277c 100644
--- a/arch/arm/mach-pxa/include/mach/gpio.h
+++ b/arch/arm/mach-pxa/include/mach/gpio.h
@@ -24,7 +24,6 @@
#ifndef __ASM_ARCH_PXA_GPIO_H
#define __ASM_ARCH_PXA_GPIO_H
-#include <asm-generic/gpio.h>
/* The defines for the driver are needed for the accelerated accessors */
#include "gpio-pxa.h"
@@ -43,6 +42,7 @@ static inline int irq_to_gpio(unsigned int irq)
return -1;
}
+#define irq_to_gpio irq_to_gpio
#include <plat/gpio.h>
#endif
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
index 7036318..6198f7a 100644
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/gpio.h
@@ -24,12 +24,16 @@
#ifndef __ASM_ARCH_SA1100_GPIO_H
#define __ASM_ARCH_SA1100_GPIO_H
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
+ (IRQ_GPIO11 - 11 + gpio))
+
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm-generic/gpio.h>
-#define __ARM_GPIOLIB_COMPLEX
-
static inline int gpio_get_value(unsigned gpio)
{
if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
@@ -49,9 +53,4 @@ static inline void gpio_set_value(unsigned gpio, int value)
__gpio_set_value(gpio, value);
}
-#define gpio_cansleep __gpio_cansleep
-
-#define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
- (IRQ_GPIO11 - 11 + gpio))
-
#endif
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index 7bf0890..f8a5637 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -10,23 +10,7 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H
-#include <linux/kernel.h>
-#include <linux/errno.h>
-
#define ARCH_NR_GPIOS 1024
#include <linux/sh_pfc.h>
-#ifdef CONFIG_GPIOLIB
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -ENOSYS;
-}
-
-#else
-
-#define __ARM_GPIOLIB_COMPLEX
-
-#endif /* CONFIG_GPIOLIB */
-
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
index 5385a42..c905219 100644
--- a/arch/arm/mach-w90x900/include/mach/gpio.h
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -26,5 +26,6 @@ static inline int irq_to_gpio(unsigned irq)
{
return irq;
}
+#define irq_to_gpio irq_to_gpio
#endif
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 9e86ee0..1fd4986 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -219,9 +219,6 @@ extern void omap_gpio_restore_context(void);
* The original OMAP-specific calls should eventually be removed.
*/
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
static inline int irq_to_gpio(unsigned irq)
{
int tmp;
@@ -238,5 +235,6 @@ static inline int irq_to_gpio(unsigned irq)
/* we don't supply reverse mappings for non-SOC gpios */
return -EIO;
}
+#define irq_to_gpio irq_to_gpio
#endif
diff --git a/arch/arm/plat-pxa/include/plat/gpio.h b/arch/arm/plat-pxa/include/plat/gpio.h
index 258f772..60380f7 100644
--- a/arch/arm/plat-pxa/include/plat/gpio.h
+++ b/arch/arm/plat-pxa/include/plat/gpio.h
@@ -1,11 +1,13 @@
#ifndef __PLAT_GPIO_H
#define __PLAT_GPIO_H
-#define __ARM_GPIOLIB_COMPLEX
-
/* The individual machine provides register offsets and NR_BUILTIN_GPIO */
#include <mach/gpio-pxa.h>
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#include <asm-generic/gpio.h>
+
static inline int gpio_get_value(unsigned gpio)
{
if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
@@ -25,6 +27,4 @@ static inline void gpio_set_value(unsigned gpio, int value)
__gpio_set_value(gpio, value);
}
-#define gpio_cansleep __gpio_cansleep
-
#endif /* __PLAT_GPIO_H */
diff --git a/arch/avr32/mach-at32ap/include/mach/gpio.h b/arch/avr32/mach-at32ap/include/mach/gpio.h
index 0180f58..f2ff962 100644
--- a/arch/avr32/mach-at32ap/include/mach/gpio.h
+++ b/arch/avr32/mach-at32ap/include/mach/gpio.h
@@ -10,26 +10,13 @@
*/
#define ARCH_NR_GPIOS (NR_GPIO_IRQS + 2 * 32)
+/* We implement a few ourself */
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
/* Arch-neutral GPIO API, supporting both "native" and external GPIOs. */
#include <asm-generic/gpio.h>
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-
static inline int gpio_to_irq(unsigned int gpio)
{
if (gpio < NR_GPIO_IRQS)
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h
index 5a25856..6e25dcc 100644
--- a/arch/blackfin/include/asm/gpio.h
+++ b/arch/blackfin/include/asm/gpio.h
@@ -189,6 +189,12 @@ void bfin_gpio_set_value(unsigned gpio, int value);
#include <asm/errno.h>
#ifdef CONFIG_GPIOLIB
+
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define irq_to_gpio irq_to_gpio
+
#include <asm-generic/gpio.h> /* cansleep wrappers */
static inline int gpio_get_value(unsigned int gpio)
@@ -207,16 +213,6 @@ static inline void gpio_set_value(unsigned int gpio, int value)
__gpio_set_value(gpio, value);
}
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
#else /* !CONFIG_GPIOLIB */
static inline int gpio_request(unsigned gpio, const char *label)
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index 241d1c5..d0fdd2d 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += break.h
header-y += fpu.h
header-y += gcc_intrin.h
diff --git a/arch/ia64/include/asm/gpio.h b/arch/ia64/include/asm/gpio.h
deleted file mode 100644
index 590a20d..0000000
--- a/arch/ia64/include/asm/gpio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generic GPIO API implementation for IA-64.
- *
- * A stright copy of that for PowerPC which was:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_IA64_GPIO_H
-#define _ASM_IA64_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_IA64_GPIO_H */
diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h
index b204683..4544b6a 100644
--- a/arch/m68k/include/asm/gpio.h
+++ b/arch/m68k/include/asm/gpio.h
@@ -16,6 +16,13 @@
#ifndef coldfire_gpio_h
#define coldfire_gpio_h
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_cansleep gpio_cansleep
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
+
#include <linux/io.h>
#include <asm-generic/gpio.h>
#include <asm/coldfire.h>
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index db5294c..5bf1ca7 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -1,3 +1,5 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += elf.h
diff --git a/arch/microblaze/include/asm/gpio.h b/arch/microblaze/include/asm/gpio.h
deleted file mode 100644
index 2b2c18b..0000000
--- a/arch/microblaze/include/asm/gpio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Generic GPIO API implementation for PowerPC.
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_MICROBLAZE_GPIO_H
-#define _ASM_MICROBLAZE_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_MICROBLAZE_GPIO_H */
diff --git a/arch/mips/include/asm/mach-ar7/gpio.h b/arch/mips/include/asm/mach-ar7/gpio.h
index c177cd1..78f40c2 100644
--- a/arch/mips/include/asm/mach-ar7/gpio.h
+++ b/arch/mips/include/asm/mach-ar7/gpio.h
@@ -27,11 +27,6 @@
#define gpio_to_irq(gpio) -1
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-
-#define gpio_cansleep __gpio_cansleep
-
/* Board specific GPIO functions */
int ar7_gpio_enable(unsigned gpio);
int ar7_gpio_disable(unsigned gpio);
diff --git a/arch/mips/include/asm/mach-ath79/gpio.h b/arch/mips/include/asm/mach-ath79/gpio.h
index 60dcb62..2c570a0 100644
--- a/arch/mips/include/asm/mach-ath79/gpio.h
+++ b/arch/mips/include/asm/mach-ath79/gpio.h
@@ -13,6 +13,12 @@
#ifndef __ASM_MACH_ATH79_GPIO_H
#define __ASM_MACH_ATH79_GPIO_H
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
+
#define ARCH_NR_GPIOS 64
#include <asm-generic/gpio.h>
@@ -21,6 +27,4 @@ int irq_to_gpio(unsigned irq);
int gpio_get_value(unsigned gpio);
void gpio_set_value(unsigned gpio, int value);
-#define gpio_cansleep __gpio_cansleep
-
#endif /* __ASM_MACH_ATH79_GPIO_H */
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h
index 76961ca..d678316 100644
--- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
@@ -19,6 +19,7 @@
extern int gpio_request(unsigned gpio, const char *label);
extern void gpio_free(unsigned gpio);
extern int gpio_to_irq(unsigned gpio);
+#define gpio_to_irq gpio_to_irq
static inline int gpio_get_value(unsigned gpio)
{
@@ -35,6 +36,7 @@ static inline int gpio_get_value(unsigned gpio)
}
return -EINVAL;
}
+#define gpio_get_value gpio_get_value
static inline void gpio_set_value(unsigned gpio, int value)
{
@@ -53,6 +55,7 @@ static inline void gpio_set_value(unsigned gpio, int value)
#endif
}
}
+#define gpio_set_value gpio_set_value
static inline int gpio_direction_input(unsigned gpio)
{
diff --git a/arch/mips/include/asm/mach-bcm63xx/gpio.h b/arch/mips/include/asm/mach-bcm63xx/gpio.h
index 1eb534d..c71bf66 100644
--- a/arch/mips/include/asm/mach-bcm63xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm63xx/gpio.h
@@ -5,11 +5,6 @@
#define gpio_to_irq(gpio) -1
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-
-#define gpio_cansleep __gpio_cansleep
-
#include <asm-generic/gpio.h>
#endif /* __ASM_MIPS_MACH_BCM63XX_GPIO_H */
diff --git a/arch/mips/include/asm/mach-generic/gpio.h b/arch/mips/include/asm/mach-generic/gpio.h
index b4e7020..e8a89c5 100644
--- a/arch/mips/include/asm/mach-generic/gpio.h
+++ b/arch/mips/include/asm/mach-generic/gpio.h
@@ -1,11 +1,7 @@
#ifndef __ASM_MACH_GENERIC_GPIO_H
#define __ASM_MACH_GENERIC_GPIO_H
-#ifdef CONFIG_GPIOLIB
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-#else
+#ifndef CONFIG_GPIOLIB
int gpio_request(unsigned gpio, const char *label);
void gpio_free(unsigned gpio);
int gpio_direction_input(unsigned gpio);
@@ -14,7 +10,9 @@ int gpio_get_value(unsigned gpio);
void gpio_set_value(unsigned gpio, int value);
#endif
int gpio_to_irq(unsigned gpio);
+#define gpio_to_irq gpio_to_irq
int irq_to_gpio(unsigned irq);
+#define irq_to_gpio irq_to_gpio
#include <asm-generic/gpio.h> /* cansleep wrappers */
diff --git a/arch/mips/include/asm/mach-loongson/gpio.h b/arch/mips/include/asm/mach-loongson/gpio.h
index e30e73d..df6efc0 100644
--- a/arch/mips/include/asm/mach-loongson/gpio.h
+++ b/arch/mips/include/asm/mach-loongson/gpio.h
@@ -13,6 +13,8 @@
#ifndef __STLS2F_GPIO_H
#define __STLS2F_GPIO_H
+#define gpio_to_irq gpio_to_irq
+
#include <asm-generic/gpio.h>
extern void gpio_set_value(unsigned gpio, int value);
@@ -27,9 +29,4 @@ static inline int gpio_to_irq(int gpio)
return -EINVAL;
}
-static inline int irq_to_gpio(int gpio)
-{
- return -EINVAL;
-}
-
#endif /* __STLS2F_GPIO_H */
diff --git a/arch/mips/include/asm/mach-rc32434/gpio.h b/arch/mips/include/asm/mach-rc32434/gpio.h
index 12ee8d5..8b0815b 100644
--- a/arch/mips/include/asm/mach-rc32434/gpio.h
+++ b/arch/mips/include/asm/mach-rc32434/gpio.h
@@ -13,18 +13,14 @@
#ifndef _RC32434_GPIO_H_
#define _RC32434_GPIO_H_
+#define gpio_to_irq(gpio) (8 + 4 * 32 + gpio)
+#define irq_to_gpio(irq) (irq - (8 + 4 * 32))
+
#include <linux/types.h>
#include <asm-generic/gpio.h>
#define NR_BUILTIN_GPIO 32
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-
-#define gpio_to_irq(gpio) (8 + 4 * 32 + gpio)
-#define irq_to_gpio(irq) (irq - (8 + 4 * 32))
-
struct rb532_gpio_reg {
u32 gpiofunc; /* GPIO Function Register
* gpiofunc[x]=0 bit = gpio
diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h b/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h
index ebdbab9..8356a8e 100644
--- a/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h
+++ b/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h
@@ -11,16 +11,15 @@
#ifndef __PMC_MSP71XX_GPIO_H
#define __PMC_MSP71XX_GPIO_H
+/* We implement a few ourself */
+#define gpio_to_irq gpio_to_irq
+
/* Max number of gpio's is 28 on chip plus 3 banks of I2C IO Expanders */
#define ARCH_NR_GPIOS (28 + (3 * 8))
/* new generic GPIO API - see Documentation/gpio.txt */
#include <asm-generic/gpio.h>
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-
/* Setup calls for the gpio and gpio extended */
extern void msp71xx_init_gpio(void);
extern void msp71xx_init_gpio_extended(void);
@@ -38,9 +37,4 @@ static inline int gpio_to_irq(unsigned gpio)
return -EINVAL;
}
-static inline int irq_to_gpio(unsigned irq)
-{
- return -EINVAL;
-}
-
#endif /* __PMC_MSP71XX_GPIO_H */
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 11162e6..03f0823 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -23,6 +23,7 @@ generic-y += fb.h
generic-y += fcntl.h
generic-y += ftrace.h
generic-y += futex.h
+generic-y += gpio.h
generic-y += hardirq.h
generic-y += hw_irq.h
generic-y += ioctl.h
diff --git a/arch/openrisc/include/asm/gpio.h b/arch/openrisc/include/asm/gpio.h
deleted file mode 100644
index 0b0d174..0000000
--- a/arch/openrisc/include/asm/gpio.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * OpenRISC Linux
- *
- * Linux architectural port borrowing liberally from similar works of
- * others. All original copyrights apply as per the original source
- * declaration.
- *
- * OpenRISC implementation:
- * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
- * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
- * et al.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __ASM_OPENRISC_GPIO_H
-#define __ASM_OPENRISC_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * OpenRISC (or1k) does not have on-chip GPIO's so there is not really
- * any standardized implementation that makes sense here. If passing
- * through gpiolib becomes a bottleneck then it may make sense, on a
- * case-by-case basis, to implement these inlined/rapid versions.
- *
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-/*
- * Not implemented, yet.
- */
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return -ENOSYS;
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* __ASM_OPENRISC_GPIO_H */
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index d51df17..9cf0632 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += auxvec.h
header-y += bootx.h
header-y += byteorder.h
diff --git a/arch/powerpc/include/asm/gpio.h b/arch/powerpc/include/asm/gpio.h
deleted file mode 100644
index 38762ed..0000000
--- a/arch/powerpc/include/asm/gpio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Generic GPIO API implementation for PowerPC.
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __ASM_POWERPC_GPIO_H
-#define __ASM_POWERPC_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* __ASM_POWERPC_GPIO_H */
diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h
index 04f53d3..44fee05 100644
--- a/arch/sh/include/asm/gpio.h
+++ b/arch/sh/include/asm/gpio.h
@@ -12,9 +12,6 @@
#ifndef __ASM_SH_GPIO_H
#define __ASM_SH_GPIO_H
-#include <linux/kernel.h>
-#include <linux/errno.h>
-
#if defined(CONFIG_CPU_SH3)
#include <cpu/gpio.h>
#endif
@@ -22,33 +19,6 @@
#define ARCH_NR_GPIOS 512
#include <linux/sh_pfc.h>
-#ifdef CONFIG_GPIOLIB
-
-static inline int gpio_get_value(unsigned gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -ENOSYS;
-}
-
-#endif /* CONFIG_GPIOLIB */
+#include <asm-generic/gpio.h>
#endif /* __ASM_SH_GPIO_H */
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 2c2e388..6d27595 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -18,6 +18,7 @@ header-y += utrap.h
header-y += watchdog.h
generic-y += div64.h
+generic-y += gpio.h
generic-y += local64.h
generic-y += irq_regs.h
generic-y += local.h
diff --git a/arch/sparc/include/asm/gpio.h b/arch/sparc/include/asm/gpio.h
deleted file mode 100644
index a0e3ac0..0000000
--- a/arch/sparc/include/asm/gpio.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef __ASM_SPARC_GPIO_H
-#define __ASM_SPARC_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return -ENOSYS;
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* __ASM_SPARC_GPIO_H */
diff --git a/arch/unicore32/include/asm/gpio.h b/arch/unicore32/include/asm/gpio.h
index 2716f14..437f4e8 100644
--- a/arch/unicore32/include/asm/gpio.h
+++ b/arch/unicore32/include/asm/gpio.h
@@ -13,6 +13,12 @@
#ifndef __UNICORE_GPIO_H__
#define __UNICORE_GPIO_H__
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
+
#include <linux/io.h>
#include <asm/irq.h>
#include <mach/hardware.h>
@@ -83,8 +89,6 @@ static inline void gpio_set_value(unsigned gpio, int value)
__gpio_set_value(gpio, value);
}
-#define gpio_cansleep __gpio_cansleep
-
static inline unsigned gpio_to_irq(unsigned gpio)
{
if ((gpio < IRQ_GPIOHIGH) && (FIELD(1, 1, gpio) & readl(GPIO_GPIR)))
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 6fa90a8..99d44ce 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += boot.h
header-y += bootparam.h
header-y += debugreg.h
diff --git a/arch/x86/include/asm/gpio.h b/arch/x86/include/asm/gpio.h
deleted file mode 100644
index 91d915a..0000000
--- a/arch/x86/include/asm/gpio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Generic GPIO API implementation for x86.
- *
- * Derived from the generic GPIO API for powerpc:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_X86_GPIO_H
-#define _ASM_X86_GPIO_H
-
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_X86_GPIO_H */
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index c68e168..7d52c50 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -1 +1,3 @@
include include/asm-generic/Kbuild.asm
+
+generic-y += gpio.h
diff --git a/arch/xtensa/include/asm/gpio.h b/arch/xtensa/include/asm/gpio.h
deleted file mode 100644
index a8c9fc4..0000000
--- a/arch/xtensa/include/asm/gpio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Generic GPIO API implementation for xtensa.
- *
- * Stolen from x86, which is derived from the generic GPIO API for powerpc:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_XTENSA_GPIO_H
-#define _ASM_XTENSA_GPIO_H
-
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-/*
- * Not implemented, yet.
- */
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_XTENSA_GPIO_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 8c86210..1990836 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -171,6 +171,29 @@ extern int __gpio_cansleep(unsigned gpio);
extern int __gpio_to_irq(unsigned gpio);
+#ifndef gpio_get_value
+#define gpio_get_value(gpio) __gpio_get_value(gpio)
+#endif
+
+#ifndef gpio_set_value
+#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
+#endif
+
+#ifndef gpio_cansleep
+#define gpio_cansleep(gpio) __gpio_cansleep(gpio)
+#endif
+
+#ifndef gpio_to_irq
+#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
+#endif
+
+#ifndef irq_to_gpio
+static inline int irq_to_gpio(unsigned int irq)
+{
+ return -EINVAL;
+}
+#endif
+
extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
extern int gpio_request_array(const struct gpio *array, size_t num);
extern void gpio_free_array(const struct gpio *array, size_t num);
--
1.7.6.1
^ permalink raw reply related
* Re: [PATCH 3/3] ARM: mach-shmobile: sh7372 A4R support (v4)
From: Rafael J. Wysocki @ 2011-11-02 23:17 UTC (permalink / raw)
To: Magnus Damm
Cc: Guennadi Liakhovetski, Linux-sh list, Linux PM list, Linux Kernel
In-Reply-To: <CANqRtoS5KTws7rDoHkxrq8DP+js5xq=YF3zQG4MYmmjHEtv5NA@mail.gmail.com>
On Wednesday, November 02, 2011, Magnus Damm wrote:
> On Wed, Nov 2, 2011 at 11:38 AM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> > On Thu, 20 Oct 2011, Rafael J. Wysocki wrote:
> >
> >> From: Magnus Damm <damm@opensource.se>
> >>
> >> This change adds support for the sh7372 A4R power domain.
> >
> > This version still breaks I2C (#0) on mackerel. Tested with your
> > sh7372-test branch of Oct 18th plus these four patches:
> >
> > 6b29305a PM / Domains: Add default power off governor function (v2)
> > 3d578ae PM / Domains: Add device stop governor function (v2)
> > 6c2cd02 ARM: mach-shmobile: sh7372 A4R support (v4)
> > 9da11f4 ARM: mach-shmobile: sh7372 A3SP support (v4)
>
> Exactly how does it break IIC0?
It causes some initialization issues to happen. I get the following
messages on every boot:
i2c-sh_mobile i2c-sh_mobile.0: Transfer request timed out
i2c-sh_mobile i2c-sh_mobile.0: Polling timed out
three times in a row (there's a delay too).
The A4R patch is the source of that.
> Does the same happen with the code base for upcoming 3.2-rc1 from
> latest linux git?
Yes, it does, AFAICT.
Thanks,
Rafael
^ permalink raw reply
* Re: [PATCH 3/3] ARM: mach-shmobile: sh7372 A4R support (v4)
From: Guennadi Liakhovetski @ 2011-11-02 22:00 UTC (permalink / raw)
To: Magnus Damm; +Cc: Rafael J. Wysocki, Linux-sh list, Linux PM list, Linux Kernel
In-Reply-To: <Pine.LNX.4.64.1111022131460.19054@axis700.grange>
On Wed, 2 Nov 2011, Guennadi Liakhovetski wrote:
> Hi Magnus
>
> On Wed, 2 Nov 2011, Magnus Damm wrote:
>
> > On Wed, Nov 2, 2011 at 11:38 AM, Guennadi Liakhovetski
> > <g.liakhovetski@gmx.de> wrote:
> > > On Thu, 20 Oct 2011, Rafael J. Wysocki wrote:
> > >
> > >> From: Magnus Damm <damm@opensource.se>
> > >>
> > >> This change adds support for the sh7372 A4R power domain.
> > >
> > > This version still breaks I2C (#0) on mackerel. Tested with your
> > > sh7372-test branch of Oct 18th plus these four patches:
> > >
> > > 6b29305a PM / Domains: Add default power off governor function (v2)
> > > 3d578ae PM / Domains: Add device stop governor function (v2)
> > > 6c2cd02 ARM: mach-shmobile: sh7372 A4R support (v4)
> > > 9da11f4 ARM: mach-shmobile: sh7372 A3SP support (v4)
> >
> > Exactly how does it break IIC0?
>
> We discussed it a couple of weeks ago, remember? Here's a quote:
>
> > > > 3. I2C #0 doesn't work (last worked with some 3.1-rc7 based kernel). It is
> > > > needed for the keypad, without which I don't know how the board can be
> > > > woken up
> > >
> > > That's odd. It worked fine when I tested with Morimoto-san earlier
> > > today. Are we using the same code?
> >
> > I hope so. I'm using what Rafael suggested in his mail:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git sh7372-test
> >
> > HEAD currently at commit
> >
> > commit 2b7a2158042fbed2dc0c677d24efc2d3c8680186
> > Author: Magnus Damm <damm@opensource.se>
> > Date: Sun Oct 16 23:35:59 2011 +0200
> >
> > ARM: mach-shmobile: sh7372 A4R support (v3)
> >
> > I2C works with HEAD^
>
> Of course, now testing with v4 of A3SP and A4R patches. As for "exactly
> how":
>
> i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 100000 Hz
> i2c-sh_mobile i2c-sh_mobile.1: I2C adapter 1 with bus speed 100000 Hz
> Linux video capture interface: v2.00
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0
> sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0
> sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0
> sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0
> i2c-sh_mobile i2c-sh_mobile.0: Transfer request timed out
> i2c-sh_mobile i2c-sh_mobile.0: Polling timed out
> tca6416-keypad 0-0020: tca6416_read_reg failed, reg: 1, error: -5
> tca6416-keypad: probe of 0-0020 failed with error -5
>
> So, seems just not to be enabled.
>
> > Does the same happen with the code base for upcoming 3.2-rc1 from
> > latest linux git?
>
> Good question:
>
> linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
> linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
After an "obvious" fix:
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 9ad50c4..6f8fbfe 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -497,7 +497,7 @@ ENDPROC(__und_usr)
.popsection
.pushsection __ex_table,"a"
.long 1b, 4b
-#if __LINUX_ARM_ARCH__ >= 7
+#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 7
.long 2b, 4b
.long 3b, 4b
#endif
(not sure, whether " && CONFIG_CPU_V7" is also needed), and a manual fix
for ASoC / I2C Kconfig failure, the kernel builds and boots, but I2C fails
in the same way. I.e., PM patches up to A3SP fix that problem, and A4R
brings it back.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply related
* Re: [PATCH 3/3] ARM: mach-shmobile: sh7372 A4R support (v4)
From: Guennadi Liakhovetski @ 2011-11-02 20:52 UTC (permalink / raw)
To: Magnus Damm; +Cc: Rafael J. Wysocki, Linux-sh list, Linux PM list, Linux Kernel
In-Reply-To: <CANqRtoS5KTws7rDoHkxrq8DP+js5xq=YF3zQG4MYmmjHEtv5NA@mail.gmail.com>
Hi Magnus
On Wed, 2 Nov 2011, Magnus Damm wrote:
> On Wed, Nov 2, 2011 at 11:38 AM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> > On Thu, 20 Oct 2011, Rafael J. Wysocki wrote:
> >
> >> From: Magnus Damm <damm@opensource.se>
> >>
> >> This change adds support for the sh7372 A4R power domain.
> >
> > This version still breaks I2C (#0) on mackerel. Tested with your
> > sh7372-test branch of Oct 18th plus these four patches:
> >
> > 6b29305a PM / Domains: Add default power off governor function (v2)
> > 3d578ae PM / Domains: Add device stop governor function (v2)
> > 6c2cd02 ARM: mach-shmobile: sh7372 A4R support (v4)
> > 9da11f4 ARM: mach-shmobile: sh7372 A3SP support (v4)
>
> Exactly how does it break IIC0?
We discussed it a couple of weeks ago, remember? Here's a quote:
> > > 3. I2C #0 doesn't work (last worked with some 3.1-rc7 based kernel). It is
> > > needed for the keypad, without which I don't know how the board can be
> > > woken up
> >
> > That's odd. It worked fine when I tested with Morimoto-san earlier
> > today. Are we using the same code?
>
> I hope so. I'm using what Rafael suggested in his mail:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git sh7372-test
>
> HEAD currently at commit
>
> commit 2b7a2158042fbed2dc0c677d24efc2d3c8680186
> Author: Magnus Damm <damm@opensource.se>
> Date: Sun Oct 16 23:35:59 2011 +0200
>
> ARM: mach-shmobile: sh7372 A4R support (v3)
>
> I2C works with HEAD^
Of course, now testing with v4 of A3SP and A4R patches. As for "exactly
how":
i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 100000 Hz
i2c-sh_mobile i2c-sh_mobile.1: I2C adapter 1 with bus speed 100000 Hz
Linux video capture interface: v2.00
soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0
sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0
sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0
sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0
i2c-sh_mobile i2c-sh_mobile.0: Transfer request timed out
i2c-sh_mobile i2c-sh_mobile.0: Polling timed out
tca6416-keypad 0-0020: tca6416_read_reg failed, reg: 1, error: -5
tca6416-keypad: probe of 0-0020 failed with error -5
So, seems just not to be enabled.
> Does the same happen with the code base for upcoming 3.2-rc1 from
> latest linux git?
Good question:
linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
So, no, it doesn't;-)
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [GIT PULL] sh updates for 3.2
From: Linus Torvalds @ 2011-11-02 16:52 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-sh, linux-kernel
In-Reply-To: <20111102142233.GC5972@linux-sh.org>
On Wed, Nov 2, 2011 at 7:22 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> Please pull from:
>
> git://github.com/pmundt/linux-sh.git sh-latest
Paul, please verify this for me somehow. You used to have a kernel.org
account, and this is a repo I haven't seen before. Admittedly all the
changes are to sh-specific files, so I don't think anybody *really*
cares, but still..
Linus
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox