* [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
2009-12-31 13:23 ` Thomas Kunze
2009-12-28 5:18 ` [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ Eric Miao
` (5 subsequent siblings)
6 siblings, 1 reply; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
These IRQ definitions related to LOCOMO are never referenced anywhere,
thus could be safely removed.
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/mach-sa1100/include/mach/collie.h | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index 71a0b3f..52acda7 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -72,13 +72,6 @@
#define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25
#define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26
-#define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0
-#define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1
-#define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2
-#define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3
-#define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13
-#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
-
/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
#define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions
2009-12-28 5:18 ` [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions Eric Miao
@ 2009-12-31 13:23 ` Thomas Kunze
2010-01-10 17:04 ` Marek Vasut
0 siblings, 1 reply; 21+ messages in thread
From: Thomas Kunze @ 2009-12-31 13:23 UTC (permalink / raw)
To: linux-arm-kernel
Eric Miao wrote:
> These IRQ definitions related to LOCOMO are never referenced anywhere,
> thus could be safely removed.
>
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
> ---
> arch/arm/mach-sa1100/include/mach/collie.h | 7 -------
> 1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
> index 71a0b3f..52acda7 100644
> --- a/arch/arm/mach-sa1100/include/mach/collie.h
> +++ b/arch/arm/mach-sa1100/include/mach/collie.h
> @@ -72,13 +72,6 @@
> #define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25
> #define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26
>
> -#define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0
> -#define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1
> -#define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2
> -#define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3
> -#define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13
> -#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
> -
> /* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
> #define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
> #define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
>
Those definitions are used in out-of-tree drivers. So please don't
remove them.
Regards,
Thomas
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions
2009-12-31 13:23 ` Thomas Kunze
@ 2010-01-10 17:04 ` Marek Vasut
2010-01-21 18:01 ` Thomas Kunze
0 siblings, 1 reply; 21+ messages in thread
From: Marek Vasut @ 2010-01-10 17:04 UTC (permalink / raw)
To: linux-arm-kernel
Dne ?t 31. prosince 2009 14:23:56 Thomas Kunze napsal(a):
> Eric Miao wrote:
> > These IRQ definitions related to LOCOMO are never referenced anywhere,
> > thus could be safely removed.
> >
> > Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
> > ---
> > arch/arm/mach-sa1100/include/mach/collie.h | 7 -------
> > 1 files changed, 0 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm/mach-sa1100/include/mach/collie.h
> > b/arch/arm/mach-sa1100/include/mach/collie.h index 71a0b3f..52acda7
> > 100644
> > --- a/arch/arm/mach-sa1100/include/mach/collie.h
> > +++ b/arch/arm/mach-sa1100/include/mach/collie.h
> > @@ -72,13 +72,6 @@
> > #define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25
> > #define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26
> >
> > -#define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0
> > -#define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1
> > -#define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2
> > -#define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3
> > -#define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13
> > -#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
> > -
> > /* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
> > #define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
> > #define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
>
> Those definitions are used in out-of-tree drivers. So please don't
> remove them.
Why aren't those in-the-tree already?
>
> Regards,
> Thomas
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions
2010-01-10 17:04 ` Marek Vasut
@ 2010-01-21 18:01 ` Thomas Kunze
0 siblings, 0 replies; 21+ messages in thread
From: Thomas Kunze @ 2010-01-21 18:01 UTC (permalink / raw)
To: linux-arm-kernel
Marek Vasut schrieb:
> Dne ?t 31. prosince 2009 14:23:56 Thomas Kunze napsal(a):
>
>> Eric Miao wrote:
>>
>>> These IRQ definitions related to LOCOMO are never referenced anywhere,
>>> thus could be safely removed.
>>>
>>> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>>> ---
>>> arch/arm/mach-sa1100/include/mach/collie.h | 7 -------
>>> 1 files changed, 0 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-sa1100/include/mach/collie.h
>>> b/arch/arm/mach-sa1100/include/mach/collie.h index 71a0b3f..52acda7
>>> 100644
>>> --- a/arch/arm/mach-sa1100/include/mach/collie.h
>>> +++ b/arch/arm/mach-sa1100/include/mach/collie.h
>>> @@ -72,13 +72,6 @@
>>> #define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25
>>> #define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26
>>>
>>> -#define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0
>>> -#define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1
>>> -#define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2
>>> -#define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3
>>> -#define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13
>>> -#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
>>> -
>>> /* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
>>> #define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
>>> #define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
>>>
>> Those definitions are used in out-of-tree drivers. So please don't
>> remove them.
>>
>
> Why aren't those in-the-tree already?
>
Because I always seem to miss the right time to submit pull requests.
>> Regards,
>> Thomas
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
2009-12-28 5:18 ` [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
2009-12-31 13:47 ` Thomas Kunze
2010-01-02 11:43 ` Russell King - ARM Linux
2009-12-28 5:18 ` [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade Eric Miao
` (4 subsequent siblings)
6 siblings, 2 replies; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
It is not necessary and over-complicated that IRQ_LOCOMO_KEY is a cascaded
IRQ of IRQ_LOCOMO_KEY_BASE. Removed and introduced locomokbd_{open,close}
for masking/unmasking of the keyboard IRQ.
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/common/locomo.c | 5 +++--
drivers/input/keyboard/locomokbd.c | 32 +++++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index bd36c77..43cdb5a 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -82,7 +82,7 @@ static struct locomo_dev_info locomo_devices[] = {
{
.devid = LOCOMO_DEVID_KEYBOARD,
.irq = {
- IRQ_LOCOMO_KEY,
+ IRQ_LOCOMO_KEY_BASE,
},
.name = "locomo-keyboard",
.offset = LOCOMO_KEYBOARD,
@@ -470,7 +470,8 @@ static void locomo_setup_irq(struct locomo *lchip)
/* Install handlers for IRQ_LOCOMO_*_BASE */
set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip);
set_irq_chip_data(IRQ_LOCOMO_KEY_BASE, irqbase);
- set_irq_chained_handler(IRQ_LOCOMO_KEY_BASE, locomo_key_handler);
+ set_irq_handler(IRQ_LOCOMO_KEY_BASE, handle_level_irq);
+ set_irq_flags(IRQ_LOCOMO_KEY_BASE, IRQF_VALID | IRQF_PROBE);
set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
set_irq_chip_data(IRQ_LOCOMO_GPIO_BASE, irqbase);
diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
index 9caed30..b1ab298 100644
--- a/drivers/input/keyboard/locomokbd.c
+++ b/drivers/input/keyboard/locomokbd.c
@@ -192,11 +192,18 @@ static void locomokbd_scankeyboard(struct locomokbd *locomokbd)
static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
{
struct locomokbd *locomokbd = dev_id;
+ u16 r;
+
+ r = locomo_readl(locomokbd->base + LOCOMO_KIC);
+ if ((r & 0x0001) == 0)
+ return IRQ_HANDLED;
+
+ locomo_writel(r & ~0x0100, locomokbd->base + LOCOMO_KIC); /* Ack */
+
/** wait chattering delay **/
udelay(100);
locomokbd_scankeyboard(locomokbd);
-
return IRQ_HANDLED;
}
@@ -210,6 +217,25 @@ static void locomokbd_timer_callback(unsigned long data)
locomokbd_scankeyboard(locomokbd);
}
+static int locomokbd_open(struct input_dev *dev)
+{
+ struct locomokbd *locomokbd = input_get_drvdata(dev);
+ u16 r;
+
+ r = locomo_readl(locomokbd->base + LOCOMO_KIC) | 0x0010;
+ locomo_writel(r, locomokbd->base + LOCOMO_KIC);
+ return 0;
+}
+
+static void locomokbd_close(struct input_dev *dev)
+{
+ struct locomokbd *locomokbd = input_get_drvdata(dev);
+ u16 r;
+
+ r = locomo_readl(locomokbd->base + LOCOMO_KIC) & ~0x0010;
+ locomo_writel(r, locomokbd->base + LOCOMO_KIC);
+}
+
static int __devinit locomokbd_probe(struct locomo_dev *dev)
{
struct locomokbd *locomokbd;
@@ -253,6 +279,8 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
input_dev->id.vendor = 0x0001;
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
+ input_dev->open = locomokbd_open;
+ input_dev->close = locomokbd_close;
input_dev->dev.parent = &dev->dev;
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
@@ -261,6 +289,8 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
input_dev->keycodesize = sizeof(locomokbd_keycode[0]);
input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode);
+ input_set_drvdata(input_dev, locomokbd);
+
memcpy(locomokbd->keycode, locomokbd_keycode, sizeof(locomokbd->keycode));
for (i = 0; i < LOCOMOKBD_NUMKEYS; i++)
set_bit(locomokbd->keycode[i], input_dev->keybit);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ
2009-12-28 5:18 ` [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ Eric Miao
@ 2009-12-31 13:47 ` Thomas Kunze
2010-01-01 3:35 ` Eric Miao
2010-01-02 11:43 ` Russell King - ARM Linux
1 sibling, 1 reply; 21+ messages in thread
From: Thomas Kunze @ 2009-12-31 13:47 UTC (permalink / raw)
To: linux-arm-kernel
Eric Miao wrote:
> It is not necessary and over-complicated that IRQ_LOCOMO_KEY is a cascaded
> IRQ of IRQ_LOCOMO_KEY_BASE. Removed and introduced locomokbd_{open,close}
> for masking/unmasking of the keyboard IRQ.
>
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>
I think sth. similar could be done for the other locomo. But I don't see
why this is
preferable to the chained irq handlers.
Regards,
Thomas
> ---
> arch/arm/common/locomo.c | 5 +++--
> drivers/input/keyboard/locomokbd.c | 32 +++++++++++++++++++++++++++++++-
> 2 files changed, 34 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
> index bd36c77..43cdb5a 100644
> --- a/arch/arm/common/locomo.c
> +++ b/arch/arm/common/locomo.c
> @@ -82,7 +82,7 @@ static struct locomo_dev_info locomo_devices[] = {
> {
> .devid = LOCOMO_DEVID_KEYBOARD,
> .irq = {
> - IRQ_LOCOMO_KEY,
> + IRQ_LOCOMO_KEY_BASE,
> },
> .name = "locomo-keyboard",
> .offset = LOCOMO_KEYBOARD,
> @@ -470,7 +470,8 @@ static void locomo_setup_irq(struct locomo *lchip)
> /* Install handlers for IRQ_LOCOMO_*_BASE */
> set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip);
> set_irq_chip_data(IRQ_LOCOMO_KEY_BASE, irqbase);
> - set_irq_chained_handler(IRQ_LOCOMO_KEY_BASE, locomo_key_handler);
> + set_irq_handler(IRQ_LOCOMO_KEY_BASE, handle_level_irq);
> + set_irq_flags(IRQ_LOCOMO_KEY_BASE, IRQF_VALID | IRQF_PROBE);
>
> set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
> set_irq_chip_data(IRQ_LOCOMO_GPIO_BASE, irqbase);
> diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
> index 9caed30..b1ab298 100644
> --- a/drivers/input/keyboard/locomokbd.c
> +++ b/drivers/input/keyboard/locomokbd.c
> @@ -192,11 +192,18 @@ static void locomokbd_scankeyboard(struct locomokbd *locomokbd)
> static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
> {
> struct locomokbd *locomokbd = dev_id;
> + u16 r;
> +
> + r = locomo_readl(locomokbd->base + LOCOMO_KIC);
> + if ((r & 0x0001) == 0)
> + return IRQ_HANDLED;
> +
> + locomo_writel(r & ~0x0100, locomokbd->base + LOCOMO_KIC); /* Ack */
> +
> /** wait chattering delay **/
> udelay(100);
>
> locomokbd_scankeyboard(locomokbd);
> -
> return IRQ_HANDLED;
> }
>
> @@ -210,6 +217,25 @@ static void locomokbd_timer_callback(unsigned long data)
> locomokbd_scankeyboard(locomokbd);
> }
>
> +static int locomokbd_open(struct input_dev *dev)
> +{
> + struct locomokbd *locomokbd = input_get_drvdata(dev);
> + u16 r;
> +
> + r = locomo_readl(locomokbd->base + LOCOMO_KIC) | 0x0010;
> + locomo_writel(r, locomokbd->base + LOCOMO_KIC);
> + return 0;
> +}
> +
> +static void locomokbd_close(struct input_dev *dev)
> +{
> + struct locomokbd *locomokbd = input_get_drvdata(dev);
> + u16 r;
> +
> + r = locomo_readl(locomokbd->base + LOCOMO_KIC) & ~0x0010;
> + locomo_writel(r, locomokbd->base + LOCOMO_KIC);
> +}
> +
> static int __devinit locomokbd_probe(struct locomo_dev *dev)
> {
> struct locomokbd *locomokbd;
> @@ -253,6 +279,8 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
> input_dev->id.vendor = 0x0001;
> input_dev->id.product = 0x0001;
> input_dev->id.version = 0x0100;
> + input_dev->open = locomokbd_open;
> + input_dev->close = locomokbd_close;
> input_dev->dev.parent = &dev->dev;
>
> input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
> @@ -261,6 +289,8 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
> input_dev->keycodesize = sizeof(locomokbd_keycode[0]);
> input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode);
>
> + input_set_drvdata(input_dev, locomokbd);
> +
> memcpy(locomokbd->keycode, locomokbd_keycode, sizeof(locomokbd->keycode));
> for (i = 0; i < LOCOMOKBD_NUMKEYS; i++)
> set_bit(locomokbd->keycode[i], input_dev->keybit);
>
^ permalink raw reply [flat|nested] 21+ messages in thread* [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ
2009-12-31 13:47 ` Thomas Kunze
@ 2010-01-01 3:35 ` Eric Miao
0 siblings, 0 replies; 21+ messages in thread
From: Eric Miao @ 2010-01-01 3:35 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 31, 2009 at 9:47 PM, Thomas Kunze <thommycheck@gmx.de> wrote:
> Eric Miao wrote:
>>
>> It is not necessary and over-complicated that IRQ_LOCOMO_KEY is a cascaded
>> IRQ of IRQ_LOCOMO_KEY_BASE. Removed and introduced locomokbd_{open,close}
>> for masking/unmasking of the keyboard IRQ.
>>
>> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>>
>
> I think sth. similar could be done for the other locomo. But I don't see why
> this is
> preferable to the chained irq handlers.
>
That's just un-necessary, think about a keypad controller. Why would it
bother to introduce another level provided there is only one IRQ for it.
And the SPI, it looks to me one IRQ for the SPI is enough instead of
another level detailed in what caused that SPI IRQ, which can just be
read from the status register.
So just a simplification, but I may overlooked something.
> Regards,
> Thomas
>>
>> ---
>> ?arch/arm/common/locomo.c ? ? ? ? ? | ? ?5 +++--
>> ?drivers/input/keyboard/locomokbd.c | ? 32
>> +++++++++++++++++++++++++++++++-
>> ?2 files changed, 34 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
>> index bd36c77..43cdb5a 100644
>> --- a/arch/arm/common/locomo.c
>> +++ b/arch/arm/common/locomo.c
>> @@ -82,7 +82,7 @@ static struct locomo_dev_info locomo_devices[] = {
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?.devid ? ? ? ? ?= LOCOMO_DEVID_KEYBOARD,
>> ? ? ? ? ? ? ? ?.irq = {
>> - ? ? ? ? ? ? ? ? ? ? ? IRQ_LOCOMO_KEY,
>> + ? ? ? ? ? ? ? ? ? ? ? IRQ_LOCOMO_KEY_BASE,
>> ? ? ? ? ? ? ? ?},
>> ? ? ? ? ? ? ? ?.name ? ? ? ? ? = "locomo-keyboard",
>> ? ? ? ? ? ? ? ?.offset ? ? ? ? = LOCOMO_KEYBOARD,
>> @@ -470,7 +470,8 @@ static void locomo_setup_irq(struct locomo *lchip)
>> ? ? ? ?/* Install handlers for IRQ_LOCOMO_*_BASE */
>> ? ? ? ?set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip);
>> ? ? ? ?set_irq_chip_data(IRQ_LOCOMO_KEY_BASE, irqbase);
>> - ? ? ? set_irq_chained_handler(IRQ_LOCOMO_KEY_BASE, locomo_key_handler);
>> + ? ? ? set_irq_handler(IRQ_LOCOMO_KEY_BASE, handle_level_irq);
>> + ? ? ? set_irq_flags(IRQ_LOCOMO_KEY_BASE, IRQF_VALID | IRQF_PROBE);
>> ? ? ? ? ?set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
>> ? ? ? ?set_irq_chip_data(IRQ_LOCOMO_GPIO_BASE, irqbase);
>> diff --git a/drivers/input/keyboard/locomokbd.c
>> b/drivers/input/keyboard/locomokbd.c
>> index 9caed30..b1ab298 100644
>> --- a/drivers/input/keyboard/locomokbd.c
>> +++ b/drivers/input/keyboard/locomokbd.c
>> @@ -192,11 +192,18 @@ static void locomokbd_scankeyboard(struct locomokbd
>> *locomokbd)
>> ?static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
>> ?{
>> ? ? ? ?struct locomokbd *locomokbd = dev_id;
>> + ? ? ? u16 r;
>> +
>> + ? ? ? r = locomo_readl(locomokbd->base + LOCOMO_KIC);
>> + ? ? ? if ((r & 0x0001) == 0)
>> + ? ? ? ? ? ? ? return IRQ_HANDLED;
>> +
>> + ? ? ? locomo_writel(r & ~0x0100, locomokbd->base + LOCOMO_KIC); /* Ack
>> */
>> +
>> ? ? ? ?/** wait chattering delay **/
>> ? ? ? ?udelay(100);
>> ? ? ? ? ?locomokbd_scankeyboard(locomokbd);
>> -
>> ? ? ? ?return IRQ_HANDLED;
>> ?}
>> ?@@ -210,6 +217,25 @@ static void locomokbd_timer_callback(unsigned long
>> data)
>> ? ? ? ?locomokbd_scankeyboard(locomokbd);
>> ?}
>> ?+static int locomokbd_open(struct input_dev *dev)
>> +{
>> + ? ? ? struct locomokbd *locomokbd = input_get_drvdata(dev);
>> + ? ? ? u16 r;
>> +
>> + ? ? ? r = locomo_readl(locomokbd->base + LOCOMO_KIC) | 0x0010;
>> + ? ? ? locomo_writel(r, locomokbd->base + LOCOMO_KIC);
>> + ? ? ? return 0;
>> +}
>> +
>> +static void locomokbd_close(struct input_dev *dev)
>> +{
>> + ? ? ? struct locomokbd *locomokbd = input_get_drvdata(dev);
>> + ? ? ? u16 r;
>> +
>> + ? ? ? r = locomo_readl(locomokbd->base + LOCOMO_KIC) & ~0x0010;
>> + ? ? ? locomo_writel(r, locomokbd->base + LOCOMO_KIC);
>> +}
>> +
>> ?static int __devinit locomokbd_probe(struct locomo_dev *dev)
>> ?{
>> ? ? ? ?struct locomokbd *locomokbd;
>> @@ -253,6 +279,8 @@ static int __devinit locomokbd_probe(struct locomo_dev
>> *dev)
>> ? ? ? ?input_dev->id.vendor = 0x0001;
>> ? ? ? ?input_dev->id.product = 0x0001;
>> ? ? ? ?input_dev->id.version = 0x0100;
>> + ? ? ? input_dev->open = locomokbd_open;
>> + ? ? ? input_dev->close = locomokbd_close;
>> ? ? ? ?input_dev->dev.parent = &dev->dev;
>> ? ? ? ? ?input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
>> @@ -261,6 +289,8 @@ static int __devinit locomokbd_probe(struct locomo_dev
>> *dev)
>> ? ? ? ?input_dev->keycodesize = sizeof(locomokbd_keycode[0]);
>> ? ? ? ?input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode);
>> ?+ ? ? ? input_set_drvdata(input_dev, locomokbd);
>> +
>> ? ? ? ?memcpy(locomokbd->keycode, locomokbd_keycode,
>> sizeof(locomokbd->keycode));
>> ? ? ? ?for (i = 0; i < LOCOMOKBD_NUMKEYS; i++)
>> ? ? ? ? ? ? ? ?set_bit(locomokbd->keycode[i], input_dev->keybit);
>>
>
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ
2009-12-28 5:18 ` [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ Eric Miao
2009-12-31 13:47 ` Thomas Kunze
@ 2010-01-02 11:43 ` Russell King - ARM Linux
2010-01-03 8:07 ` Eric Miao
1 sibling, 1 reply; 21+ messages in thread
From: Russell King - ARM Linux @ 2010-01-02 11:43 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 28, 2009 at 01:18:03PM +0800, Eric Miao wrote:
> It is not necessary and over-complicated that IRQ_LOCOMO_KEY is a cascaded
> IRQ of IRQ_LOCOMO_KEY_BASE. Removed and introduced locomokbd_{open,close}
> for masking/unmasking of the keyboard IRQ.
What about removing these as well:
/* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
set_irq_chip(LOCOMO_IRQ_KEY_START, &locomo_key_chip);
set_irq_chip_data(LOCOMO_IRQ_KEY_START, irqbase);
set_irq_handler(LOCOMO_IRQ_KEY_START, handle_edge_irq);
set_irq_flags(LOCOMO_IRQ_KEY_START, IRQF_VALID | IRQF_PROBE);
the locomo_key_chip structure, locomo_key_handler() itself, and the
associated handlers? AFAICS, after this change, none of this is
used anymore.
^ permalink raw reply [flat|nested] 21+ messages in thread* [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ
2010-01-02 11:43 ` Russell King - ARM Linux
@ 2010-01-03 8:07 ` Eric Miao
0 siblings, 0 replies; 21+ messages in thread
From: Eric Miao @ 2010-01-03 8:07 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jan 2, 2010 at 7:43 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Dec 28, 2009 at 01:18:03PM +0800, Eric Miao wrote:
>> It is not necessary and over-complicated that IRQ_LOCOMO_KEY is a cascaded
>> IRQ of IRQ_LOCOMO_KEY_BASE. Removed and introduced locomokbd_{open,close}
>> for masking/unmasking of the keyboard IRQ.
>
> What about removing these as well:
>
> ? ? ? ?/* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
> ? ? ? ?set_irq_chip(LOCOMO_IRQ_KEY_START, &locomo_key_chip);
> ? ? ? ?set_irq_chip_data(LOCOMO_IRQ_KEY_START, irqbase);
> ? ? ? ?set_irq_handler(LOCOMO_IRQ_KEY_START, handle_edge_irq);
> ? ? ? ?set_irq_flags(LOCOMO_IRQ_KEY_START, IRQF_VALID | IRQF_PROBE);
>
> the locomo_key_chip structure, locomo_key_handler() itself, and the
> associated handlers? ?AFAICS, after this change, none of this is
> used anymore.
>
These are removed in a subsequent patch.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
2009-12-28 5:18 ` [PATCH 1/7] [ARM] sa1100: remove unreferenced IRQ definitions Eric Miao
2009-12-28 5:18 ` [PATCH 2/7] [ARM] locomo: avoid the unnecessary cascade of keyboard IRQ Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
2009-12-31 13:42 ` Thomas Kunze
2010-01-02 11:45 ` Russell King - ARM Linux
2009-12-28 5:18 ` [PATCH 4/7] [ARM] locomo: allow cascaded IRQ base to be specified by platforms Eric Miao
` (3 subsequent siblings)
6 siblings, 2 replies; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
IRQ_LOCOMO_* are never used elsewhere, remove these definitions. As well
as the cascade of these IRQs. IRQ_LOCOMO_*_BASE changed to IRQ_LOCOMO_*.
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/common/locomo.c | 325 +-----------------------------
arch/arm/mach-pxa/Kconfig | 1 +
arch/arm/mach-pxa/include/mach/irqs.h | 34 +---
arch/arm/mach-sa1100/include/mach/irqs.h | 36 +---
4 files changed, 19 insertions(+), 377 deletions(-)
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 43cdb5a..a16df07 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -82,7 +82,7 @@ static struct locomo_dev_info locomo_devices[] = {
{
.devid = LOCOMO_DEVID_KEYBOARD,
.irq = {
- IRQ_LOCOMO_KEY_BASE,
+ IRQ_LOCOMO_KEY,
},
.name = "locomo-keyboard",
.offset = LOCOMO_KEYBOARD,
@@ -133,39 +133,6 @@ static struct locomo_dev_info locomo_devices[] = {
},
};
-
-/** LoCoMo interrupt handling stuff.
- * NOTE: LoCoMo has a 1 to many mapping on all of its IRQs.
- * that is, there is only one real hardware interrupt
- * we determine which interrupt it is by reading some IO memory.
- * We have two levels of expansion, first in the handler for the
- * hardware interrupt we generate an interrupt
- * IRQ_LOCOMO_*_BASE and those handlers generate more interrupts
- *
- * hardware irq reads LOCOMO_ICR & 0x0f00
- * IRQ_LOCOMO_KEY_BASE
- * IRQ_LOCOMO_GPIO_BASE
- * IRQ_LOCOMO_LT_BASE
- * IRQ_LOCOMO_SPI_BASE
- * IRQ_LOCOMO_KEY_BASE reads LOCOMO_KIC & 0x0001
- * IRQ_LOCOMO_KEY
- * IRQ_LOCOMO_GPIO_BASE reads LOCOMO_GIR & LOCOMO_GPD & 0xffff
- * IRQ_LOCOMO_GPIO[0-15]
- * IRQ_LOCOMO_LT_BASE reads LOCOMO_LTINT & 0x0001
- * IRQ_LOCOMO_LT
- * IRQ_LOCOMO_SPI_BASE reads LOCOMO_SPIIR & 0x000F
- * IRQ_LOCOMO_SPI_RFR
- * IRQ_LOCOMO_SPI_RFW
- * IRQ_LOCOMO_SPI_OVRN
- * IRQ_LOCOMO_SPI_TEND
- */
-
-#define LOCOMO_IRQ_START (IRQ_LOCOMO_KEY_BASE)
-#define LOCOMO_IRQ_KEY_START (IRQ_LOCOMO_KEY)
-#define LOCOMO_IRQ_GPIO_START (IRQ_LOCOMO_GPIO0)
-#define LOCOMO_IRQ_LT_START (IRQ_LOCOMO_LT)
-#define LOCOMO_IRQ_SPI_START (IRQ_LOCOMO_SPI_RFR)
-
static void locomo_handler(unsigned int irq, struct irq_desc *desc)
{
int req, i;
@@ -179,7 +146,7 @@ static void locomo_handler(unsigned int irq, struct irq_desc *desc)
if (req) {
/* generate the next interrupt(s) */
- irq = LOCOMO_IRQ_START;
+ irq = IRQ_LOCOMO_KEY;
for (i = 0; i <= 3; i++, irq++) {
if (req & (0x0100 << i)) {
generic_handle_irq(irq);
@@ -198,7 +165,7 @@ static void locomo_mask_irq(unsigned int irq)
void __iomem *mapbase = get_irq_chip_data(irq);
unsigned int r;
r = locomo_readl(mapbase + LOCOMO_ICR);
- r &= ~(0x0010 << (irq - LOCOMO_IRQ_START));
+ r &= ~(0x0010 << (irq - IRQ_LOCOMO_KEY));
locomo_writel(r, mapbase + LOCOMO_ICR);
}
@@ -207,7 +174,7 @@ static void locomo_unmask_irq(unsigned int irq)
void __iomem *mapbase = get_irq_chip_data(irq);
unsigned int r;
r = locomo_readl(mapbase + LOCOMO_ICR);
- r |= (0x0010 << (irq - LOCOMO_IRQ_START));
+ r |= (0x0010 << (irq - IRQ_LOCOMO_KEY));
locomo_writel(r, mapbase + LOCOMO_ICR);
}
@@ -218,243 +185,6 @@ static struct irq_chip locomo_chip = {
.unmask = locomo_unmask_irq,
};
-static void locomo_key_handler(unsigned int irq, struct irq_desc *desc)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
-
- if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
- generic_handle_irq(LOCOMO_IRQ_KEY_START);
- }
-}
-
-static void locomo_key_ack_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
- r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START));
- locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
-}
-
-static void locomo_key_mask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
- r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START));
- locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
-}
-
-static void locomo_key_unmask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
- r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START));
- locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
-}
-
-static struct irq_chip locomo_key_chip = {
- .name = "LOCOMO-key",
- .ack = locomo_key_ack_irq,
- .mask = locomo_key_mask_irq,
- .unmask = locomo_key_unmask_irq,
-};
-
-static void locomo_gpio_handler(unsigned int irq, struct irq_desc *desc)
-{
- int req, i;
- void __iomem *mapbase = get_irq_chip_data(irq);
-
- req = locomo_readl(mapbase + LOCOMO_GIR) &
- locomo_readl(mapbase + LOCOMO_GPD) &
- 0xffff;
-
- if (req) {
- irq = LOCOMO_IRQ_GPIO_START;
- for (i = 0; i <= 15; i++, irq++) {
- if (req & (0x0001 << i)) {
- generic_handle_irq(irq);
- }
- }
- }
-}
-
-static void locomo_gpio_ack_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_GWE);
- r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
- locomo_writel(r, mapbase + LOCOMO_GWE);
-
- r = locomo_readl(mapbase + LOCOMO_GIS);
- r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
- locomo_writel(r, mapbase + LOCOMO_GIS);
-
- r = locomo_readl(mapbase + LOCOMO_GWE);
- r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
- locomo_writel(r, mapbase + LOCOMO_GWE);
-}
-
-static void locomo_gpio_mask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_GIE);
- r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
- locomo_writel(r, mapbase + LOCOMO_GIE);
-}
-
-static void locomo_gpio_unmask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_GIE);
- r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
- locomo_writel(r, mapbase + LOCOMO_GIE);
-}
-
-static int GPIO_IRQ_rising_edge;
-static int GPIO_IRQ_falling_edge;
-
-static int locomo_gpio_type(unsigned int irq, unsigned int type)
-{
- unsigned int mask;
- void __iomem *mapbase = get_irq_chip_data(irq);
-
- mask = 1 << (irq - LOCOMO_IRQ_GPIO_START);
-
- if (type == IRQ_TYPE_PROBE) {
- if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask)
- return 0;
- type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
- }
-
- if (type & IRQ_TYPE_EDGE_RISING)
- GPIO_IRQ_rising_edge |= mask;
- else
- GPIO_IRQ_rising_edge &= ~mask;
- if (type & IRQ_TYPE_EDGE_FALLING)
- GPIO_IRQ_falling_edge |= mask;
- else
- GPIO_IRQ_falling_edge &= ~mask;
- locomo_writel(GPIO_IRQ_rising_edge, mapbase + LOCOMO_GRIE);
- locomo_writel(GPIO_IRQ_falling_edge, mapbase + LOCOMO_GFIE);
-
- return 0;
-}
-
-static struct irq_chip locomo_gpio_chip = {
- .name = "LOCOMO-gpio",
- .ack = locomo_gpio_ack_irq,
- .mask = locomo_gpio_mask_irq,
- .unmask = locomo_gpio_unmask_irq,
- .set_type = locomo_gpio_type,
-};
-
-static void locomo_lt_handler(unsigned int irq, struct irq_desc *desc)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
-
- if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
- generic_handle_irq(LOCOMO_IRQ_LT_START);
- }
-}
-
-static void locomo_lt_ack_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_LTINT);
- r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START));
- locomo_writel(r, mapbase + LOCOMO_LTINT);
-}
-
-static void locomo_lt_mask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_LTINT);
- r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START));
- locomo_writel(r, mapbase + LOCOMO_LTINT);
-}
-
-static void locomo_lt_unmask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_LTINT);
- r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START));
- locomo_writel(r, mapbase + LOCOMO_LTINT);
-}
-
-static struct irq_chip locomo_lt_chip = {
- .name = "LOCOMO-lt",
- .ack = locomo_lt_ack_irq,
- .mask = locomo_lt_mask_irq,
- .unmask = locomo_lt_unmask_irq,
-};
-
-static void locomo_spi_handler(unsigned int irq, struct irq_desc *desc)
-{
- int req, i;
- void __iomem *mapbase = get_irq_chip_data(irq);
-
- req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F;
- if (req) {
- irq = LOCOMO_IRQ_SPI_START;
-
- for (i = 0; i <= 3; i++, irq++) {
- if (req & (0x0001 << i)) {
- generic_handle_irq(irq);
- }
- }
- }
-}
-
-static void locomo_spi_ack_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
- r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
- locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
-
- r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
- r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
- locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
-
- r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
- r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
- locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
-}
-
-static void locomo_spi_mask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
- r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
- locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
-}
-
-static void locomo_spi_unmask_irq(unsigned int irq)
-{
- void __iomem *mapbase = get_irq_chip_data(irq);
- unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
- r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
- locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
-}
-
-static struct irq_chip locomo_spi_chip = {
- .name = "LOCOMO-spi",
- .ack = locomo_spi_ack_irq,
- .mask = locomo_spi_mask_irq,
- .unmask = locomo_spi_unmask_irq,
-};
-
static void locomo_setup_irq(struct locomo *lchip)
{
int irq;
@@ -467,54 +197,15 @@ static void locomo_setup_irq(struct locomo *lchip)
set_irq_chip_data(lchip->irq, irqbase);
set_irq_chained_handler(lchip->irq, locomo_handler);
- /* Install handlers for IRQ_LOCOMO_*_BASE */
- set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip);
- set_irq_chip_data(IRQ_LOCOMO_KEY_BASE, irqbase);
- set_irq_handler(IRQ_LOCOMO_KEY_BASE, handle_level_irq);
- set_irq_flags(IRQ_LOCOMO_KEY_BASE, IRQF_VALID | IRQF_PROBE);
-
- set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
- set_irq_chip_data(IRQ_LOCOMO_GPIO_BASE, irqbase);
- set_irq_chained_handler(IRQ_LOCOMO_GPIO_BASE, locomo_gpio_handler);
-
- set_irq_chip(IRQ_LOCOMO_LT_BASE, &locomo_chip);
- set_irq_chip_data(IRQ_LOCOMO_LT_BASE, irqbase);
- set_irq_chained_handler(IRQ_LOCOMO_LT_BASE, locomo_lt_handler);
-
- set_irq_chip(IRQ_LOCOMO_SPI_BASE, &locomo_chip);
- set_irq_chip_data(IRQ_LOCOMO_SPI_BASE, irqbase);
- set_irq_chained_handler(IRQ_LOCOMO_SPI_BASE, locomo_spi_handler);
-
- /* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
- set_irq_chip(LOCOMO_IRQ_KEY_START, &locomo_key_chip);
- set_irq_chip_data(LOCOMO_IRQ_KEY_START, irqbase);
- set_irq_handler(LOCOMO_IRQ_KEY_START, handle_edge_irq);
- set_irq_flags(LOCOMO_IRQ_KEY_START, IRQF_VALID | IRQF_PROBE);
-
- /* install handlers for IRQ_LOCOMO_GPIO_BASE generated interrupts */
- for (irq = LOCOMO_IRQ_GPIO_START; irq < LOCOMO_IRQ_GPIO_START + 16; irq++) {
- set_irq_chip(irq, &locomo_gpio_chip);
- set_irq_chip_data(irq, irqbase);
- set_irq_handler(irq, handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
- }
-
- /* install handlers for IRQ_LOCOMO_LT_BASE generated interrupts */
- set_irq_chip(LOCOMO_IRQ_LT_START, &locomo_lt_chip);
- set_irq_chip_data(LOCOMO_IRQ_LT_START, irqbase);
- set_irq_handler(LOCOMO_IRQ_LT_START, handle_edge_irq);
- set_irq_flags(LOCOMO_IRQ_LT_START, IRQF_VALID | IRQF_PROBE);
-
- /* install handlers for IRQ_LOCOMO_SPI_BASE generated interrupts */
- for (irq = LOCOMO_IRQ_SPI_START; irq < LOCOMO_IRQ_SPI_START + 4; irq++) {
- set_irq_chip(irq, &locomo_spi_chip);
+ /* Install handlers for IRQ_LOCOMO_* */
+ for (irq = IRQ_LOCOMO_KEY; irq <= IRQ_LOCOMO_SPI; irq++) {
+ set_irq_chip(irq, &locomo_chip);
set_irq_chip_data(irq, irqbase);
- set_irq_handler(irq, handle_edge_irq);
+ set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
}
-
static void locomo_dev_release(struct device *_dev)
{
struct locomo_dev *dev = LOCOMO_DEV(_dev);
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 8a0837e..7fdc914 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -443,6 +443,7 @@ config MACH_POODLE
depends on PXA_SHARPSL
select PXA25x
select SHARP_LOCOMO
+ select PXA_HAVE_BOARD_IRQS
select PXA_SSP
config MACH_CORGI
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index 3677a9a..56a2c61 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -187,30 +187,6 @@
#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
-#define IRQ_LOCOMO_START (IRQ_BOARD_END)
-#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
-#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
-#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
-#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
-#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
-#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
-#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
-#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
-#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
-#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
-#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
-#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
-#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
-#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
-#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
-#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
-#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
-#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
-#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
-#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
-#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
-#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
-
/*
* Figure out the MAX IRQ number.
*
@@ -220,8 +196,6 @@
*/
#ifdef CONFIG_SA1111
#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
-#elif defined(CONFIG_SHARP_LOCOMO)
-#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
#define NR_IRQS (IRQ_BOARD_END)
#else
@@ -274,10 +248,10 @@
#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
-#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
-#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
-#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
-#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
+#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
+#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
+#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
+#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
/* phyCORE-PXA270 (PCM027) Interrupts */
#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
diff --git a/arch/arm/mach-sa1100/include/mach/irqs.h b/arch/arm/mach-sa1100/include/mach/irqs.h
index ae81f80..a8dc68e 100644
--- a/arch/arm/mach-sa1100/include/mach/irqs.h
+++ b/arch/arm/mach-sa1100/include/mach/irqs.h
@@ -120,30 +120,6 @@
#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
-#define IRQ_LOCOMO_START (IRQ_BOARD_END)
-#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
-#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
-#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
-#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
-#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
-#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
-#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
-#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
-#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
-#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
-#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
-#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
-#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
-#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
-#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
-#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
-#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
-#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
-#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
-#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
-#define IRQ_LOCOMO_SPI_REND (IRQ_BOARD_END + 20)
-#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
-
/*
* Figure out the MAX IRQ number.
*
@@ -153,8 +129,8 @@
*/
#ifdef CONFIG_SA1111
#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
-#elif defined(CONFIG_SHARP_LOCOMO)
-#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
+#elif CONFIG_SHARPSL_LOCOMO
+#define NR_IRQS (IRQ_LOCOMO_SPI + 1)
#else
#define NR_IRQS (IRQ_BOARD_START)
#endif
@@ -168,8 +144,8 @@
#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
-#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
-#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
-#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
-#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
+#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
+#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
+#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
+#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade
2009-12-28 5:18 ` [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade Eric Miao
@ 2009-12-31 13:42 ` Thomas Kunze
2010-01-01 2:59 ` Eric Miao
2010-01-02 11:45 ` Russell King - ARM Linux
1 sibling, 1 reply; 21+ messages in thread
From: Thomas Kunze @ 2009-12-31 13:42 UTC (permalink / raw)
To: linux-arm-kernel
Eric Miao wrote:
> IRQ_LOCOMO_* are never used elsewhere, remove these definitions. As well
> as the cascade of these IRQs. IRQ_LOCOMO_*_BASE changed to IRQ_LOCOMO_*.
>
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>
Unlike poodle which AFAIK only uses locomo for keyboard Collie needs
most of these irqs for various subdevices (for example SD-Card on SPI
bus) . The drivers for these devices
will find their way into mainline as time permits. So please don't
remove this functionality.
Regards,
Thomas
> ---
> arch/arm/common/locomo.c | 325 +-----------------------------
> arch/arm/mach-pxa/Kconfig | 1 +
> arch/arm/mach-pxa/include/mach/irqs.h | 34 +---
> arch/arm/mach-sa1100/include/mach/irqs.h | 36 +---
> 4 files changed, 19 insertions(+), 377 deletions(-)
>
> diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
> index 43cdb5a..a16df07 100644
> --- a/arch/arm/common/locomo.c
> +++ b/arch/arm/common/locomo.c
> @@ -82,7 +82,7 @@ static struct locomo_dev_info locomo_devices[] = {
> {
> .devid = LOCOMO_DEVID_KEYBOARD,
> .irq = {
> - IRQ_LOCOMO_KEY_BASE,
> + IRQ_LOCOMO_KEY,
> },
> .name = "locomo-keyboard",
> .offset = LOCOMO_KEYBOARD,
> @@ -133,39 +133,6 @@ static struct locomo_dev_info locomo_devices[] = {
> },
> };
>
> -
> -/** LoCoMo interrupt handling stuff.
> - * NOTE: LoCoMo has a 1 to many mapping on all of its IRQs.
> - * that is, there is only one real hardware interrupt
> - * we determine which interrupt it is by reading some IO memory.
> - * We have two levels of expansion, first in the handler for the
> - * hardware interrupt we generate an interrupt
> - * IRQ_LOCOMO_*_BASE and those handlers generate more interrupts
> - *
> - * hardware irq reads LOCOMO_ICR & 0x0f00
> - * IRQ_LOCOMO_KEY_BASE
> - * IRQ_LOCOMO_GPIO_BASE
> - * IRQ_LOCOMO_LT_BASE
> - * IRQ_LOCOMO_SPI_BASE
> - * IRQ_LOCOMO_KEY_BASE reads LOCOMO_KIC & 0x0001
> - * IRQ_LOCOMO_KEY
> - * IRQ_LOCOMO_GPIO_BASE reads LOCOMO_GIR & LOCOMO_GPD & 0xffff
> - * IRQ_LOCOMO_GPIO[0-15]
> - * IRQ_LOCOMO_LT_BASE reads LOCOMO_LTINT & 0x0001
> - * IRQ_LOCOMO_LT
> - * IRQ_LOCOMO_SPI_BASE reads LOCOMO_SPIIR & 0x000F
> - * IRQ_LOCOMO_SPI_RFR
> - * IRQ_LOCOMO_SPI_RFW
> - * IRQ_LOCOMO_SPI_OVRN
> - * IRQ_LOCOMO_SPI_TEND
> - */
> -
> -#define LOCOMO_IRQ_START (IRQ_LOCOMO_KEY_BASE)
> -#define LOCOMO_IRQ_KEY_START (IRQ_LOCOMO_KEY)
> -#define LOCOMO_IRQ_GPIO_START (IRQ_LOCOMO_GPIO0)
> -#define LOCOMO_IRQ_LT_START (IRQ_LOCOMO_LT)
> -#define LOCOMO_IRQ_SPI_START (IRQ_LOCOMO_SPI_RFR)
> -
> static void locomo_handler(unsigned int irq, struct irq_desc *desc)
> {
> int req, i;
> @@ -179,7 +146,7 @@ static void locomo_handler(unsigned int irq, struct irq_desc *desc)
>
> if (req) {
> /* generate the next interrupt(s) */
> - irq = LOCOMO_IRQ_START;
> + irq = IRQ_LOCOMO_KEY;
> for (i = 0; i <= 3; i++, irq++) {
> if (req & (0x0100 << i)) {
> generic_handle_irq(irq);
> @@ -198,7 +165,7 @@ static void locomo_mask_irq(unsigned int irq)
> void __iomem *mapbase = get_irq_chip_data(irq);
> unsigned int r;
> r = locomo_readl(mapbase + LOCOMO_ICR);
> - r &= ~(0x0010 << (irq - LOCOMO_IRQ_START));
> + r &= ~(0x0010 << (irq - IRQ_LOCOMO_KEY));
> locomo_writel(r, mapbase + LOCOMO_ICR);
> }
>
> @@ -207,7 +174,7 @@ static void locomo_unmask_irq(unsigned int irq)
> void __iomem *mapbase = get_irq_chip_data(irq);
> unsigned int r;
> r = locomo_readl(mapbase + LOCOMO_ICR);
> - r |= (0x0010 << (irq - LOCOMO_IRQ_START));
> + r |= (0x0010 << (irq - IRQ_LOCOMO_KEY));
> locomo_writel(r, mapbase + LOCOMO_ICR);
> }
>
> @@ -218,243 +185,6 @@ static struct irq_chip locomo_chip = {
> .unmask = locomo_unmask_irq,
> };
>
> -static void locomo_key_handler(unsigned int irq, struct irq_desc *desc)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> -
> - if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
> - generic_handle_irq(LOCOMO_IRQ_KEY_START);
> - }
> -}
> -
> -static void locomo_key_ack_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
> - r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START));
> - locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
> -}
> -
> -static void locomo_key_mask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
> - r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START));
> - locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
> -}
> -
> -static void locomo_key_unmask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
> - r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START));
> - locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
> -}
> -
> -static struct irq_chip locomo_key_chip = {
> - .name = "LOCOMO-key",
> - .ack = locomo_key_ack_irq,
> - .mask = locomo_key_mask_irq,
> - .unmask = locomo_key_unmask_irq,
> -};
> -
> -static void locomo_gpio_handler(unsigned int irq, struct irq_desc *desc)
> -{
> - int req, i;
> - void __iomem *mapbase = get_irq_chip_data(irq);
> -
> - req = locomo_readl(mapbase + LOCOMO_GIR) &
> - locomo_readl(mapbase + LOCOMO_GPD) &
> - 0xffff;
> -
> - if (req) {
> - irq = LOCOMO_IRQ_GPIO_START;
> - for (i = 0; i <= 15; i++, irq++) {
> - if (req & (0x0001 << i)) {
> - generic_handle_irq(irq);
> - }
> - }
> - }
> -}
> -
> -static void locomo_gpio_ack_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_GWE);
> - r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
> - locomo_writel(r, mapbase + LOCOMO_GWE);
> -
> - r = locomo_readl(mapbase + LOCOMO_GIS);
> - r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
> - locomo_writel(r, mapbase + LOCOMO_GIS);
> -
> - r = locomo_readl(mapbase + LOCOMO_GWE);
> - r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
> - locomo_writel(r, mapbase + LOCOMO_GWE);
> -}
> -
> -static void locomo_gpio_mask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_GIE);
> - r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
> - locomo_writel(r, mapbase + LOCOMO_GIE);
> -}
> -
> -static void locomo_gpio_unmask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_GIE);
> - r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
> - locomo_writel(r, mapbase + LOCOMO_GIE);
> -}
> -
> -static int GPIO_IRQ_rising_edge;
> -static int GPIO_IRQ_falling_edge;
> -
> -static int locomo_gpio_type(unsigned int irq, unsigned int type)
> -{
> - unsigned int mask;
> - void __iomem *mapbase = get_irq_chip_data(irq);
> -
> - mask = 1 << (irq - LOCOMO_IRQ_GPIO_START);
> -
> - if (type == IRQ_TYPE_PROBE) {
> - if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask)
> - return 0;
> - type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
> - }
> -
> - if (type & IRQ_TYPE_EDGE_RISING)
> - GPIO_IRQ_rising_edge |= mask;
> - else
> - GPIO_IRQ_rising_edge &= ~mask;
> - if (type & IRQ_TYPE_EDGE_FALLING)
> - GPIO_IRQ_falling_edge |= mask;
> - else
> - GPIO_IRQ_falling_edge &= ~mask;
> - locomo_writel(GPIO_IRQ_rising_edge, mapbase + LOCOMO_GRIE);
> - locomo_writel(GPIO_IRQ_falling_edge, mapbase + LOCOMO_GFIE);
> -
> - return 0;
> -}
> -
> -static struct irq_chip locomo_gpio_chip = {
> - .name = "LOCOMO-gpio",
> - .ack = locomo_gpio_ack_irq,
> - .mask = locomo_gpio_mask_irq,
> - .unmask = locomo_gpio_unmask_irq,
> - .set_type = locomo_gpio_type,
> -};
> -
> -static void locomo_lt_handler(unsigned int irq, struct irq_desc *desc)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> -
> - if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
> - generic_handle_irq(LOCOMO_IRQ_LT_START);
> - }
> -}
> -
> -static void locomo_lt_ack_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_LTINT);
> - r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START));
> - locomo_writel(r, mapbase + LOCOMO_LTINT);
> -}
> -
> -static void locomo_lt_mask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_LTINT);
> - r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START));
> - locomo_writel(r, mapbase + LOCOMO_LTINT);
> -}
> -
> -static void locomo_lt_unmask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_LTINT);
> - r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START));
> - locomo_writel(r, mapbase + LOCOMO_LTINT);
> -}
> -
> -static struct irq_chip locomo_lt_chip = {
> - .name = "LOCOMO-lt",
> - .ack = locomo_lt_ack_irq,
> - .mask = locomo_lt_mask_irq,
> - .unmask = locomo_lt_unmask_irq,
> -};
> -
> -static void locomo_spi_handler(unsigned int irq, struct irq_desc *desc)
> -{
> - int req, i;
> - void __iomem *mapbase = get_irq_chip_data(irq);
> -
> - req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F;
> - if (req) {
> - irq = LOCOMO_IRQ_SPI_START;
> -
> - for (i = 0; i <= 3; i++, irq++) {
> - if (req & (0x0001 << i)) {
> - generic_handle_irq(irq);
> - }
> - }
> - }
> -}
> -
> -static void locomo_spi_ack_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
> - r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
> - locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
> -
> - r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
> - r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
> - locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
> -
> - r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
> - r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
> - locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
> -}
> -
> -static void locomo_spi_mask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
> - r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
> - locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
> -}
> -
> -static void locomo_spi_unmask_irq(unsigned int irq)
> -{
> - void __iomem *mapbase = get_irq_chip_data(irq);
> - unsigned int r;
> - r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
> - r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
> - locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
> -}
> -
> -static struct irq_chip locomo_spi_chip = {
> - .name = "LOCOMO-spi",
> - .ack = locomo_spi_ack_irq,
> - .mask = locomo_spi_mask_irq,
> - .unmask = locomo_spi_unmask_irq,
> -};
> -
> static void locomo_setup_irq(struct locomo *lchip)
> {
> int irq;
> @@ -467,54 +197,15 @@ static void locomo_setup_irq(struct locomo *lchip)
> set_irq_chip_data(lchip->irq, irqbase);
> set_irq_chained_handler(lchip->irq, locomo_handler);
>
> - /* Install handlers for IRQ_LOCOMO_*_BASE */
> - set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip);
> - set_irq_chip_data(IRQ_LOCOMO_KEY_BASE, irqbase);
> - set_irq_handler(IRQ_LOCOMO_KEY_BASE, handle_level_irq);
> - set_irq_flags(IRQ_LOCOMO_KEY_BASE, IRQF_VALID | IRQF_PROBE);
> -
> - set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
> - set_irq_chip_data(IRQ_LOCOMO_GPIO_BASE, irqbase);
> - set_irq_chained_handler(IRQ_LOCOMO_GPIO_BASE, locomo_gpio_handler);
> -
> - set_irq_chip(IRQ_LOCOMO_LT_BASE, &locomo_chip);
> - set_irq_chip_data(IRQ_LOCOMO_LT_BASE, irqbase);
> - set_irq_chained_handler(IRQ_LOCOMO_LT_BASE, locomo_lt_handler);
> -
> - set_irq_chip(IRQ_LOCOMO_SPI_BASE, &locomo_chip);
> - set_irq_chip_data(IRQ_LOCOMO_SPI_BASE, irqbase);
> - set_irq_chained_handler(IRQ_LOCOMO_SPI_BASE, locomo_spi_handler);
> -
> - /* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
> - set_irq_chip(LOCOMO_IRQ_KEY_START, &locomo_key_chip);
> - set_irq_chip_data(LOCOMO_IRQ_KEY_START, irqbase);
> - set_irq_handler(LOCOMO_IRQ_KEY_START, handle_edge_irq);
> - set_irq_flags(LOCOMO_IRQ_KEY_START, IRQF_VALID | IRQF_PROBE);
> -
> - /* install handlers for IRQ_LOCOMO_GPIO_BASE generated interrupts */
> - for (irq = LOCOMO_IRQ_GPIO_START; irq < LOCOMO_IRQ_GPIO_START + 16; irq++) {
> - set_irq_chip(irq, &locomo_gpio_chip);
> - set_irq_chip_data(irq, irqbase);
> - set_irq_handler(irq, handle_edge_irq);
> - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
> - }
> -
> - /* install handlers for IRQ_LOCOMO_LT_BASE generated interrupts */
> - set_irq_chip(LOCOMO_IRQ_LT_START, &locomo_lt_chip);
> - set_irq_chip_data(LOCOMO_IRQ_LT_START, irqbase);
> - set_irq_handler(LOCOMO_IRQ_LT_START, handle_edge_irq);
> - set_irq_flags(LOCOMO_IRQ_LT_START, IRQF_VALID | IRQF_PROBE);
> -
> - /* install handlers for IRQ_LOCOMO_SPI_BASE generated interrupts */
> - for (irq = LOCOMO_IRQ_SPI_START; irq < LOCOMO_IRQ_SPI_START + 4; irq++) {
> - set_irq_chip(irq, &locomo_spi_chip);
> + /* Install handlers for IRQ_LOCOMO_* */
> + for (irq = IRQ_LOCOMO_KEY; irq <= IRQ_LOCOMO_SPI; irq++) {
> + set_irq_chip(irq, &locomo_chip);
> set_irq_chip_data(irq, irqbase);
> - set_irq_handler(irq, handle_edge_irq);
> + set_irq_handler(irq, handle_level_irq);
> set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
> }
> }
>
> -
> static void locomo_dev_release(struct device *_dev)
> {
> struct locomo_dev *dev = LOCOMO_DEV(_dev);
> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> index 8a0837e..7fdc914 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -443,6 +443,7 @@ config MACH_POODLE
> depends on PXA_SHARPSL
> select PXA25x
> select SHARP_LOCOMO
> + select PXA_HAVE_BOARD_IRQS
> select PXA_SSP
>
> config MACH_CORGI
> diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
> index 3677a9a..56a2c61 100644
> --- a/arch/arm/mach-pxa/include/mach/irqs.h
> +++ b/arch/arm/mach-pxa/include/mach/irqs.h
> @@ -187,30 +187,6 @@
> #define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
> #define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
>
> -#define IRQ_LOCOMO_START (IRQ_BOARD_END)
> -#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
> -#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
> -#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
> -#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
> -#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
> -#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
> -#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
> -#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
> -#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
> -#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
> -#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
> -#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
> -#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
> -#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
> -#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
> -#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
> -#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
> -#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
> -#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
> -#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
> -#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
> -#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
> -
> /*
> * Figure out the MAX IRQ number.
> *
> @@ -220,8 +196,6 @@
> */
> #ifdef CONFIG_SA1111
> #define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
> -#elif defined(CONFIG_SHARP_LOCOMO)
> -#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
> #elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
> #define NR_IRQS (IRQ_BOARD_END)
> #else
> @@ -274,10 +248,10 @@
> #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
>
> /* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
> -#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
> -#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
> -#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
> -#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
> +#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
> +#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
> +#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
> +#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
>
> /* phyCORE-PXA270 (PCM027) Interrupts */
> #define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
> diff --git a/arch/arm/mach-sa1100/include/mach/irqs.h b/arch/arm/mach-sa1100/include/mach/irqs.h
> index ae81f80..a8dc68e 100644
> --- a/arch/arm/mach-sa1100/include/mach/irqs.h
> +++ b/arch/arm/mach-sa1100/include/mach/irqs.h
> @@ -120,30 +120,6 @@
> #define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
> #define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
>
> -#define IRQ_LOCOMO_START (IRQ_BOARD_END)
> -#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
> -#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
> -#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
> -#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
> -#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
> -#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
> -#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
> -#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
> -#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
> -#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
> -#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
> -#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
> -#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
> -#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
> -#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
> -#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
> -#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
> -#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
> -#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
> -#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
> -#define IRQ_LOCOMO_SPI_REND (IRQ_BOARD_END + 20)
> -#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
> -
> /*
> * Figure out the MAX IRQ number.
> *
> @@ -153,8 +129,8 @@
> */
> #ifdef CONFIG_SA1111
> #define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
> -#elif defined(CONFIG_SHARP_LOCOMO)
> -#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
> +#elif CONFIG_SHARPSL_LOCOMO
> +#define NR_IRQS (IRQ_LOCOMO_SPI + 1)
> #else
> #define NR_IRQS (IRQ_BOARD_START)
> #endif
> @@ -168,8 +144,8 @@
> #define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
>
> /* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
> -#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
> -#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
> -#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
> -#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
> +#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
> +#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
> +#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
> +#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
>
>
^ permalink raw reply [flat|nested] 21+ messages in thread* [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade
2009-12-31 13:42 ` Thomas Kunze
@ 2010-01-01 2:59 ` Eric Miao
2010-01-10 14:31 ` Thomas Kunze
0 siblings, 1 reply; 21+ messages in thread
From: Eric Miao @ 2010-01-01 2:59 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 31, 2009 at 9:42 PM, Thomas Kunze <thommycheck@gmx.de> wrote:
> Eric Miao wrote:
>>
>> IRQ_LOCOMO_* are never used elsewhere, remove these definitions. As well
>> as the cascade of these IRQs. IRQ_LOCOMO_*_BASE changed to IRQ_LOCOMO_*.
>>
>> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>>
>
> Unlike poodle which AFAIK only uses locomo for keyboard Collie needs most of
> these irqs for various subdevices (for example SD-Card on SPI bus) . The
> drivers for these devices
> will find their way into mainline as time permits. So please don't remove
> this functionality.
>
The LoCoMo driver is really weird, it has a second cascade of the IRQ
which looks to me unnecessary.
Could you look into the possibility that the subdevices driver on collie
can make use only of the first level IRQ?
The GPIO IRQs, which I'm seeking alternate solution with dynamic IRQ.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade
2010-01-01 2:59 ` Eric Miao
@ 2010-01-10 14:31 ` Thomas Kunze
0 siblings, 0 replies; 21+ messages in thread
From: Thomas Kunze @ 2010-01-10 14:31 UTC (permalink / raw)
To: linux-arm-kernel
Eric Miao schrieb:
> On Thu, Dec 31, 2009 at 9:42 PM, Thomas Kunze <thommycheck@gmx.de> wrote:
>
>> Eric Miao wrote:
>>
>>> IRQ_LOCOMO_* are never used elsewhere, remove these definitions. As well
>>> as the cascade of these IRQs. IRQ_LOCOMO_*_BASE changed to IRQ_LOCOMO_*.
>>>
>>> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>>>
>>>
>> Unlike poodle which AFAIK only uses locomo for keyboard Collie needs most of
>> these irqs for various subdevices (for example SD-Card on SPI bus) . The
>> drivers for these devices
>> will find their way into mainline as time permits. So please don't remove
>> this functionality.
>>
>>
>
> The LoCoMo driver is really weird, it has a second cascade of the IRQ
> which looks to me unnecessary.
>
> Could you look into the possibility that the subdevices driver on collie
> can make use only of the first level IRQ?
>
> The GPIO IRQs, which I'm seeking alternate solution with dynamic IRQ.
>
I think all devices but GPIO can use these base irqs. Unfortunately I
don't have a real network connection available until
end of january. I will test this then.
Regards,
Thomas
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade
2009-12-28 5:18 ` [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade Eric Miao
2009-12-31 13:42 ` Thomas Kunze
@ 2010-01-02 11:45 ` Russell King - ARM Linux
1 sibling, 0 replies; 21+ messages in thread
From: Russell King - ARM Linux @ 2010-01-02 11:45 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 28, 2009 at 01:18:04PM +0800, Eric Miao wrote:
> IRQ_LOCOMO_* are never used elsewhere, remove these definitions. As well
> as the cascade of these IRQs. IRQ_LOCOMO_*_BASE changed to IRQ_LOCOMO_*.
I think the removal of the KEY stuff should be part of the previous
patch; the removal of the keyboard interrupt indirection as a whole
forms one logical and self-contained change.
The removal of the other unnecessary indirections should probably
live as a separate patch.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 4/7] [ARM] locomo: allow cascaded IRQ base to be specified by platforms
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
` (2 preceding siblings ...)
2009-12-28 5:18 ` [PATCH 3/7] [ARM] locomo: remove unused IRQs and avoid unnecessary cascade Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
2009-12-28 21:14 ` Pavel Machek
2009-12-28 5:18 ` [PATCH 5/7] [ARM] sa1111: avoid using hardcoded IRQ numbers for PCMCIA driver Eric Miao
` (2 subsequent siblings)
6 siblings, 1 reply; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/common/locomo.c | 49 +++++++++++++++++-------------
arch/arm/include/asm/hardware/locomo.h | 4 ++
arch/arm/mach-pxa/include/mach/irqs.h | 6 ----
arch/arm/mach-pxa/poodle.c | 7 ++++
arch/arm/mach-sa1100/collie.c | 4 ++
arch/arm/mach-sa1100/include/mach/irqs.h | 11 +-----
6 files changed, 45 insertions(+), 36 deletions(-)
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index a16df07..aef6cc4 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -32,6 +32,12 @@
#include <asm/hardware/locomo.h>
+/* LoCoMo Interrupts */
+#define IRQ_LOCOMO_KEY (0)
+#define IRQ_LOCOMO_GPIO (1)
+#define IRQ_LOCOMO_LT (2)
+#define IRQ_LOCOMO_SPI (3)
+
/* M62332 output channel selection */
#define M62332_EVR_CH 1 /* M62332 volume channel number */
/* 0 : CH.1 , 1 : CH. 2 */
@@ -58,6 +64,7 @@ struct locomo {
struct device *dev;
unsigned long phys;
unsigned int irq;
+ int irq_base;
spinlock_t lock;
void __iomem *base;
#ifdef CONFIG_PM
@@ -81,9 +88,7 @@ struct locomo_dev_info {
static struct locomo_dev_info locomo_devices[] = {
{
.devid = LOCOMO_DEVID_KEYBOARD,
- .irq = {
- IRQ_LOCOMO_KEY,
- },
+ .irq = { IRQ_LOCOMO_KEY },
.name = "locomo-keyboard",
.offset = LOCOMO_KEYBOARD,
.length = 16,
@@ -135,18 +140,18 @@ static struct locomo_dev_info locomo_devices[] = {
static void locomo_handler(unsigned int irq, struct irq_desc *desc)
{
+ struct locomo *lchip = get_irq_chip_data(irq);
int req, i;
- void __iomem *mapbase = get_irq_chip_data(irq);
/* Acknowledge the parent IRQ */
desc->chip->ack(irq);
/* check why this interrupt was generated */
- req = locomo_readl(mapbase + LOCOMO_ICR) & 0x0f00;
+ req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00;
if (req) {
/* generate the next interrupt(s) */
- irq = IRQ_LOCOMO_KEY;
+ irq = lchip->irq_base;
for (i = 0; i <= 3; i++, irq++) {
if (req & (0x0100 << i)) {
generic_handle_irq(irq);
@@ -162,20 +167,20 @@ static void locomo_ack_irq(unsigned int irq)
static void locomo_mask_irq(unsigned int irq)
{
- void __iomem *mapbase = get_irq_chip_data(irq);
+ struct locomo *lchip = get_irq_chip_data(irq);
unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_ICR);
- r &= ~(0x0010 << (irq - IRQ_LOCOMO_KEY));
- locomo_writel(r, mapbase + LOCOMO_ICR);
+ r = locomo_readl(lchip->base + LOCOMO_ICR);
+ r &= ~(0x0010 << (irq - lchip->irq_base));
+ locomo_writel(r, lchip->base + LOCOMO_ICR);
}
static void locomo_unmask_irq(unsigned int irq)
{
- void __iomem *mapbase = get_irq_chip_data(irq);
+ struct locomo *lchip = get_irq_chip_data(irq);
unsigned int r;
- r = locomo_readl(mapbase + LOCOMO_ICR);
- r |= (0x0010 << (irq - IRQ_LOCOMO_KEY));
- locomo_writel(r, mapbase + LOCOMO_ICR);
+ r = locomo_readl(lchip->base + LOCOMO_ICR);
+ r |= (0x0010 << (irq - lchip->irq_base));
+ locomo_writel(r, lchip->base + LOCOMO_ICR);
}
static struct irq_chip locomo_chip = {
@@ -187,20 +192,19 @@ static struct irq_chip locomo_chip = {
static void locomo_setup_irq(struct locomo *lchip)
{
- int irq;
- void __iomem *irqbase = lchip->base;
+ int irq = lchip->irq_base;
/*
* Install handler for IRQ_LOCOMO_HW.
*/
set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING);
- set_irq_chip_data(lchip->irq, irqbase);
+ set_irq_chip_data(lchip->irq, lchip);
set_irq_chained_handler(lchip->irq, locomo_handler);
/* Install handlers for IRQ_LOCOMO_* */
- for (irq = IRQ_LOCOMO_KEY; irq <= IRQ_LOCOMO_SPI; irq++) {
+ for ( ; irq <= lchip->irq_base + 3; irq++) {
set_irq_chip(irq, &locomo_chip);
- set_irq_chip_data(irq, irqbase);
+ set_irq_chip_data(irq, lchip);
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
@@ -247,7 +251,8 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
dev->mapbase = 0;
dev->length = info->length;
- memmove(dev->irq, info->irq, sizeof(dev->irq));
+ dev->irq[0] = (lchip->irq_base == NO_IRQ) ?
+ NO_IRQ : lchip->irq_base + info->irq[0];
ret = device_register(&dev->dev);
if (ret) {
@@ -364,6 +369,7 @@ static int locomo_resume(struct platform_device *dev)
static int
__locomo_probe(struct device *me, struct resource *mem, int irq)
{
+ struct locomo_platform_data *pdata = me->platform_data;
struct locomo *lchip;
unsigned long r;
int i, ret = -ENODEV;
@@ -379,6 +385,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
lchip->phys = mem->start;
lchip->irq = irq;
+ lchip->irq_base = (pdata) ? pdata->irq_base : NO_IRQ;
/*
* Map the whole region. This also maps the
@@ -445,7 +452,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
* The interrupt controller must be initialised before any
* other device to ensure that the interrupts are available.
*/
- if (lchip->irq != NO_IRQ)
+ if (lchip->irq != NO_IRQ && lchip->irq_base != NO_IRQ)
locomo_setup_irq(lchip);
for (i = 0; i < ARRAY_SIZE(locomo_devices); i++)
diff --git a/arch/arm/include/asm/hardware/locomo.h b/arch/arm/include/asm/hardware/locomo.h
index 954b1be..74e51d6 100644
--- a/arch/arm/include/asm/hardware/locomo.h
+++ b/arch/arm/include/asm/hardware/locomo.h
@@ -214,4 +214,8 @@ void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int
/* Frontlight control */
void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf);
+struct locomo_platform_data {
+ int irq_base; /* IRQ base for cascaded on-chip IRQs */
+};
+
#endif
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index 56a2c61..83b14f1 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -247,12 +247,6 @@
#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
-/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
-#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
-#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
-#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
-#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
-
/* phyCORE-PXA270 (PCM027) Interrupts */
#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
#define PCM027_BTDET_IRQ PCM027_IRQ(0)
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index c2b938a..35ce7ea 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -193,11 +193,18 @@ static struct resource locomo_resources[] = {
},
};
+static struct locomo_platform_data locomo_info = {
+ .irq_base = IRQ_BOARD_START,
+};
+
struct platform_device poodle_locomo_device = {
.name = "locomo",
.id = 0,
.num_resources = ARRAY_SIZE(locomo_resources),
.resource = locomo_resources,
+ .dev = {
+ .platform_data = &locomo_info,
+ },
};
EXPORT_SYMBOL(poodle_locomo_device);
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 9982c5c..5d5f330 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -234,6 +234,10 @@ static struct resource locomo_resources[] = {
},
};
+static struct locomo_platform_data locomo_info = {
+ .irq_base = IRQ_BOARD_START,
+};
+
struct platform_device collie_locomo_device = {
.name = "locomo",
.id = 0,
diff --git a/arch/arm/mach-sa1100/include/mach/irqs.h b/arch/arm/mach-sa1100/include/mach/irqs.h
index a8dc68e..bc67722 100644
--- a/arch/arm/mach-sa1100/include/mach/irqs.h
+++ b/arch/arm/mach-sa1100/include/mach/irqs.h
@@ -124,13 +124,13 @@
* Figure out the MAX IRQ number.
*
* If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
- * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
+ * If we have an LoCoMo, the max IRQ is IRQ_BOARD_START + 4
* Otherwise, we have the standard IRQs only.
*/
#ifdef CONFIG_SA1111
#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
#elif CONFIG_SHARPSL_LOCOMO
-#define NR_IRQS (IRQ_LOCOMO_SPI + 1)
+#define NR_IRQS (IRQ_BOARD_START + 4)
#else
#define NR_IRQS (IRQ_BOARD_START)
#endif
@@ -142,10 +142,3 @@
#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0)
#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1)
#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
-
-/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
-#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
-#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
-#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
-#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
-
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 4/7] [ARM] locomo: allow cascaded IRQ base to be specified by platforms
2009-12-28 5:18 ` [PATCH 4/7] [ARM] locomo: allow cascaded IRQ base to be specified by platforms Eric Miao
@ 2009-12-28 21:14 ` Pavel Machek
2009-12-29 1:07 ` Eric Miao
0 siblings, 1 reply; 21+ messages in thread
From: Pavel Machek @ 2009-12-28 21:14 UTC (permalink / raw)
To: linux-arm-kernel
On Mon 2009-12-28 13:18:05, Eric Miao wrote:
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
> ---
> arch/arm/common/locomo.c | 49 +++++++++++++++++-------------
> arch/arm/include/asm/hardware/locomo.h | 4 ++
> arch/arm/mach-pxa/include/mach/irqs.h | 6 ----
> arch/arm/mach-pxa/poodle.c | 7 ++++
> arch/arm/mach-sa1100/collie.c | 4 ++
> arch/arm/mach-sa1100/include/mach/irqs.h | 11 +-----
> 6 files changed, 45 insertions(+), 36 deletions(-)
How was this tested? Maybe ccing thomas would be good idea?
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 4/7] [ARM] locomo: allow cascaded IRQ base to be specified by platforms
2009-12-28 21:14 ` Pavel Machek
@ 2009-12-29 1:07 ` Eric Miao
0 siblings, 0 replies; 21+ messages in thread
From: Eric Miao @ 2009-12-29 1:07 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Dec 29, 2009 at 5:14 AM, Pavel Machek <pavel@ucw.cz> wrote:
> On Mon 2009-12-28 13:18:05, Eric Miao wrote:
>> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>> ---
>> ?arch/arm/common/locomo.c ? ? ? ? ? ? ? ? | ? 49 +++++++++++++++++-------------
>> ?arch/arm/include/asm/hardware/locomo.h ? | ? ?4 ++
>> ?arch/arm/mach-pxa/include/mach/irqs.h ? ?| ? ?6 ----
>> ?arch/arm/mach-pxa/poodle.c ? ? ? ? ? ? ? | ? ?7 ++++
>> ?arch/arm/mach-sa1100/collie.c ? ? ? ? ? ?| ? ?4 ++
>> ?arch/arm/mach-sa1100/include/mach/irqs.h | ? 11 +-----
>> ?6 files changed, 45 insertions(+), 36 deletions(-)
>
> How was this tested? Maybe ccing thomas would be good idea?
>
(.... Trying to think why Yinghai is Cc'ed here?)
Yeah, I almost forgot. Now Thomas CC'ed. I've roughly tested this
on SL-5600 (poodle), which seems to be all right. Yet, collie seems
to declare several sub-devices which are never used. Thomas' test
on this will be really appreciated.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 5/7] [ARM] sa1111: avoid using hardcoded IRQ numbers for PCMCIA driver
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
` (3 preceding siblings ...)
2009-12-28 5:18 ` [PATCH 4/7] [ARM] locomo: allow cascaded IRQ base to be specified by platforms Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
2009-12-28 5:18 ` [PATCH 6/7] [ARM] sa1111: allow cascaded IRQs to be used by platforms Eric Miao
2009-12-28 5:18 ` [PATCH 7/7] [ARM] pxa: move board board IRQ definitions out of irqs.h Eric Miao
6 siblings, 0 replies; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
The IRQs for card detect and status change are currently hardcoded in
SA1111 PCMCIA driver, which can be actually obtained from the .irq[]
from 'struct sa1111_dev' to keep it generic.
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
drivers/pcmcia/sa1111_generic.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index de6bc33..db79ca6 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -21,11 +21,18 @@
#include "sa1111_generic.h"
+#define IDX_IRQ_S0_READY_NINT (0)
+#define IDX_IRQ_S0_CD_VALID (1)
+#define IDX_IRQ_S0_BVD1_STSCHG (2)
+#define IDX_IRQ_S1_READY_NINT (3)
+#define IDX_IRQ_S1_CD_VALID (4)
+#define IDX_IRQ_S1_BVD1_STSCHG (5)
+
static struct pcmcia_irqs irqs[] = {
- { 0, IRQ_S0_CD_VALID, "SA1111 PCMCIA card detect" },
- { 0, IRQ_S0_BVD1_STSCHG, "SA1111 PCMCIA BVD1" },
- { 1, IRQ_S1_CD_VALID, "SA1111 CF card detect" },
- { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" },
+ { 0, NO_IRQ, "SA1111 PCMCIA card detect" },
+ { 0, NO_IRQ, "SA1111 PCMCIA BVD1" },
+ { 1, NO_IRQ, "SA1111 CF card detect" },
+ { 1, NO_IRQ, "SA1111 CF BVD1" },
};
static int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
@@ -136,7 +143,9 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
s->soc.ops = ops;
s->soc.socket.owner = ops->owner;
s->soc.socket.dev.parent = &dev->dev;
- s->soc.socket.pci_irq = s->soc.nr ? IRQ_S1_READY_NINT : IRQ_S0_READY_NINT;
+ s->soc.socket.pci_irq = s->soc.nr ?
+ dev->irq[IDX_IRQ_S0_READY_NINT] :
+ dev->irq[IDX_IRQ_S1_READY_NINT];
s->dev = dev;
ret = add(&s->soc);
@@ -162,6 +171,12 @@ static int pcmcia_probe(struct sa1111_dev *dev)
base = dev->mapbase;
+ /* Initialize PCMCIA IRQs */
+ irqs[0].irq = dev->irq[IDX_IRQ_S0_CD_VALID];
+ irqs[1].irq = dev->irq[IDX_IRQ_S0_BVD1_STSCHG];
+ irqs[2].irq = dev->irq[IDX_IRQ_S1_CD_VALID];
+ irqs[3].irq = dev->irq[IDX_IRQ_S1_BVD1_STSCHG];
+
/*
* Initialise the suspend state.
*/
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 6/7] [ARM] sa1111: allow cascaded IRQs to be used by platforms
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
` (4 preceding siblings ...)
2009-12-28 5:18 ` [PATCH 5/7] [ARM] sa1111: avoid using hardcoded IRQ numbers for PCMCIA driver Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
2009-12-28 5:18 ` [PATCH 7/7] [ARM] pxa: move board board IRQ definitions out of irqs.h Eric Miao
6 siblings, 0 replies; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/common/sa1111.c | 112 +++++++++++++++++++++++-------
arch/arm/include/asm/hardware/sa1111.h | 4 +
arch/arm/mach-pxa/include/mach/irqs.h | 54 +--------------
arch/arm/mach-pxa/lubbock.c | 7 ++
arch/arm/mach-sa1100/badge4.c | 5 ++
arch/arm/mach-sa1100/include/mach/irqs.h | 54 +--------------
arch/arm/mach-sa1100/jornada720.c | 5 ++
arch/arm/mach-sa1100/neponset.c | 5 ++
8 files changed, 116 insertions(+), 130 deletions(-)
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 8ba7044..a52a27c 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -35,6 +35,58 @@
#include <asm/hardware/sa1111.h>
+/* SA1111 IRQs */
+#define IRQ_GPAIN0 (0)
+#define IRQ_GPAIN1 (1)
+#define IRQ_GPAIN2 (2)
+#define IRQ_GPAIN3 (3)
+#define IRQ_GPBIN0 (4)
+#define IRQ_GPBIN1 (5)
+#define IRQ_GPBIN2 (6)
+#define IRQ_GPBIN3 (7)
+#define IRQ_GPBIN4 (8)
+#define IRQ_GPBIN5 (9)
+#define IRQ_GPCIN0 (10)
+#define IRQ_GPCIN1 (11)
+#define IRQ_GPCIN2 (12)
+#define IRQ_GPCIN3 (13)
+#define IRQ_GPCIN4 (14)
+#define IRQ_GPCIN5 (15)
+#define IRQ_GPCIN6 (16)
+#define IRQ_GPCIN7 (17)
+#define IRQ_MSTXINT (18)
+#define IRQ_MSRXINT (19)
+#define IRQ_MSSTOPERRINT (20)
+#define IRQ_TPTXINT (21)
+#define IRQ_TPRXINT (22)
+#define IRQ_TPSTOPERRINT (23)
+#define SSPXMTINT (24)
+#define SSPRCVINT (25)
+#define SSPROR (26)
+#define AUDXMTDMADONEA (32)
+#define AUDRCVDMADONEA (33)
+#define AUDXMTDMADONEB (34)
+#define AUDRCVDMADONEB (35)
+#define AUDTFSR (36)
+#define AUDRFSR (37)
+#define AUDTUR (38)
+#define AUDROR (39)
+#define AUDDTS (40)
+#define AUDRDD (41)
+#define AUDSTO (42)
+#define IRQ_USBPWR (43)
+#define IRQ_HCIM (44)
+#define IRQ_HCIBUFFACC (45)
+#define IRQ_HCIRMTWKP (46)
+#define IRQ_NHCIMFCIR (47)
+#define IRQ_USB_PORT_RESUME (48)
+#define IRQ_S0_READY_NINT (49)
+#define IRQ_S1_READY_NINT (50)
+#define IRQ_S0_CD_VALID (51)
+#define IRQ_S1_CD_VALID (52)
+#define IRQ_S0_BVD1_STSCHG (53)
+#define IRQ_S1_BVD1_STSCHG (54)
+
extern void __init sa1110_mb_enable(void);
/*
@@ -49,6 +101,7 @@ struct sa1111 {
struct clk *clk;
unsigned long phys;
int irq;
+ int irq_base; /* base for cascaded on-chip IRQs */
spinlock_t lock;
void __iomem *base;
#ifdef CONFIG_PM
@@ -152,36 +205,37 @@ static void
sa1111_irq_handler(unsigned int irq, struct irq_desc *desc)
{
unsigned int stat0, stat1, i;
- void __iomem *base = get_irq_data(irq);
+ struct sa1111 *sachip = get_irq_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
- stat0 = sa1111_readl(base + SA1111_INTSTATCLR0);
- stat1 = sa1111_readl(base + SA1111_INTSTATCLR1);
+ stat0 = sa1111_readl(mapbase + SA1111_INTSTATCLR0);
+ stat1 = sa1111_readl(mapbase + SA1111_INTSTATCLR1);
- sa1111_writel(stat0, base + SA1111_INTSTATCLR0);
+ sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0);
desc->chip->ack(irq);
- sa1111_writel(stat1, base + SA1111_INTSTATCLR1);
+ sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1);
if (stat0 == 0 && stat1 == 0) {
do_bad_IRQ(irq, desc);
return;
}
- for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1)
+ for (i = 0; stat0; i++, stat0 >>= 1)
if (stat0 & 1)
- handle_edge_irq(i, irq_desc + i);
+ generic_handle_irq(i + sachip->irq_base);
- for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1)
+ for (i = 32; stat1; i++, stat1 >>= 1)
if (stat1 & 1)
- handle_edge_irq(i, irq_desc + i);
+ generic_handle_irq(i + sachip->irq_base);
/* For level-based interrupts */
desc->chip->unmask(irq);
}
-#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START))
-#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32))
+#define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base))
+#define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32))
static void sa1111_ack_irq(unsigned int irq)
{
@@ -189,7 +243,8 @@ static void sa1111_ack_irq(unsigned int irq)
static void sa1111_mask_lowirq(unsigned int irq)
{
- void __iomem *mapbase = get_irq_chip_data(irq);
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned long ie0;
ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
@@ -199,7 +254,8 @@ static void sa1111_mask_lowirq(unsigned int irq)
static void sa1111_unmask_lowirq(unsigned int irq)
{
- void __iomem *mapbase = get_irq_chip_data(irq);
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned long ie0;
ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
@@ -216,8 +272,9 @@ static void sa1111_unmask_lowirq(unsigned int irq)
*/
static int sa1111_retrigger_lowirq(unsigned int irq)
{
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned int mask = SA1111_IRQMASK_LO(irq);
- void __iomem *mapbase = get_irq_chip_data(irq);
unsigned long ip0;
int i;
@@ -237,8 +294,9 @@ static int sa1111_retrigger_lowirq(unsigned int irq)
static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
{
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned int mask = SA1111_IRQMASK_LO(irq);
- void __iomem *mapbase = get_irq_chip_data(irq);
unsigned long ip0;
if (flags == IRQ_TYPE_PROBE)
@@ -260,8 +318,9 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
{
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned int mask = SA1111_IRQMASK_LO(irq);
- void __iomem *mapbase = get_irq_chip_data(irq);
unsigned long we0;
we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
@@ -286,7 +345,8 @@ static struct irq_chip sa1111_low_chip = {
static void sa1111_mask_highirq(unsigned int irq)
{
- void __iomem *mapbase = get_irq_chip_data(irq);
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned long ie1;
ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
@@ -296,7 +356,8 @@ static void sa1111_mask_highirq(unsigned int irq)
static void sa1111_unmask_highirq(unsigned int irq)
{
- void __iomem *mapbase = get_irq_chip_data(irq);
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned long ie1;
ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
@@ -313,8 +374,9 @@ static void sa1111_unmask_highirq(unsigned int irq)
*/
static int sa1111_retrigger_highirq(unsigned int irq)
{
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned int mask = SA1111_IRQMASK_HI(irq);
- void __iomem *mapbase = get_irq_chip_data(irq);
unsigned long ip1;
int i;
@@ -334,8 +396,9 @@ static int sa1111_retrigger_highirq(unsigned int irq)
static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
{
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned int mask = SA1111_IRQMASK_HI(irq);
- void __iomem *mapbase = get_irq_chip_data(irq);
unsigned long ip1;
if (flags == IRQ_TYPE_PROBE)
@@ -357,8 +420,9 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
{
+ struct sa1111 *sachip = get_irq_chip_data(irq);
+ void __iomem *mapbase = sachip->base + SA1111_INTC;
unsigned int mask = SA1111_IRQMASK_HI(irq);
- void __iomem *mapbase = get_irq_chip_data(irq);
unsigned long we1;
we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
@@ -412,14 +476,14 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) {
set_irq_chip(irq, &sa1111_low_chip);
- set_irq_chip_data(irq, irqbase);
+ set_irq_chip_data(irq, sachip);
set_irq_handler(irq, handle_edge_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) {
set_irq_chip(irq, &sa1111_high_chip);
- set_irq_chip_data(irq, irqbase);
+ set_irq_chip_data(irq, sachip);
set_irq_handler(irq, handle_edge_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
@@ -428,7 +492,7 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
* Register SA1111 interrupt
*/
set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING);
- set_irq_data(sachip->irq, irqbase);
+ set_irq_data(sachip->irq, sachip);
set_irq_chained_handler(sachip->irq, sa1111_irq_handler);
}
diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h
index 5da2595..92ed254 100644
--- a/arch/arm/include/asm/hardware/sa1111.h
+++ b/arch/arm/include/asm/hardware/sa1111.h
@@ -578,4 +578,8 @@ void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int
void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
+struct sa1111_platform_data {
+ int irq_base; /* base for cascaded on-chip IRQs */
+};
+
#endif /* _ASM_ARCH_SA1111 */
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index 83b14f1..b35b3ac 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -135,58 +135,6 @@
#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
#endif
-#define IRQ_SA1111_START (IRQ_BOARD_END)
-#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
-#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
-#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
-#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
-#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
-#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
-#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
-#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
-#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
-#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
-#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
-#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
-#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
-#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
-#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
-#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
-#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
-#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
-#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
-#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
-#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
-#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
-#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
-#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
-#define SSPXMTINT (IRQ_BOARD_END + 24)
-#define SSPRCVINT (IRQ_BOARD_END + 25)
-#define SSPROR (IRQ_BOARD_END + 26)
-#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
-#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
-#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
-#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
-#define AUDTFSR (IRQ_BOARD_END + 36)
-#define AUDRFSR (IRQ_BOARD_END + 37)
-#define AUDTUR (IRQ_BOARD_END + 38)
-#define AUDROR (IRQ_BOARD_END + 39)
-#define AUDDTS (IRQ_BOARD_END + 40)
-#define AUDRDD (IRQ_BOARD_END + 41)
-#define AUDSTO (IRQ_BOARD_END + 42)
-#define IRQ_USBPWR (IRQ_BOARD_END + 43)
-#define IRQ_HCIM (IRQ_BOARD_END + 44)
-#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
-#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
-#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
-#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
-#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
-#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
-#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
-#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
-#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
-#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
-
/*
* Figure out the MAX IRQ number.
*
@@ -195,7 +143,7 @@
* Otherwise, we have the standard IRQs only.
*/
#ifdef CONFIG_SA1111
-#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
+#define NR_IRQS (IRQ_BOARD_END + 55)
#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
#define NR_IRQS (IRQ_BOARD_END)
#else
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 98ee7e5..c8b9bd8 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -240,11 +240,18 @@ static struct resource sa1111_resources[] = {
},
};
+static struct sa1111_platform_data sa1111_info = {
+ .irq_base = IRQ_BOARD_END,
+};
+
static struct platform_device sa1111_device = {
.name = "sa1111",
.id = -1,
.num_resources = ARRAY_SIZE(sa1111_resources),
.resource = sa1111_resources,
+ .dev = {
+ .platform_data = &sa1111_info,
+ },
};
/* ADS7846 is connected through SSP ... and if your board has J5 populated,
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 051ec0f..259cb2c 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -51,6 +51,10 @@ static struct resource sa1111_resources[] = {
},
};
+static struct sa1111_platform_data sa1111_info = {
+ .irq_base = IRQ_BOARD_END,
+};
+
static u64 sa1111_dmamask = 0xffffffffUL;
static struct platform_device sa1111_device = {
@@ -59,6 +63,7 @@ static struct platform_device sa1111_device = {
.dev = {
.dma_mask = &sa1111_dmamask,
.coherent_dma_mask = 0xffffffff,
+ .platform_data = &sa1111_info,
},
.num_resources = ARRAY_SIZE(sa1111_resources),
.resource = sa1111_resources,
diff --git a/arch/arm/mach-sa1100/include/mach/irqs.h b/arch/arm/mach-sa1100/include/mach/irqs.h
index bc67722..daf74dc 100644
--- a/arch/arm/mach-sa1100/include/mach/irqs.h
+++ b/arch/arm/mach-sa1100/include/mach/irqs.h
@@ -68,58 +68,6 @@
#define IRQ_BOARD_START 49
#define IRQ_BOARD_END 65
-#define IRQ_SA1111_START (IRQ_BOARD_END)
-#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
-#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
-#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
-#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
-#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
-#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
-#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
-#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
-#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
-#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
-#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
-#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
-#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
-#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
-#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
-#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
-#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
-#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
-#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
-#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
-#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
-#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
-#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
-#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
-#define SSPXMTINT (IRQ_BOARD_END + 24)
-#define SSPRCVINT (IRQ_BOARD_END + 25)
-#define SSPROR (IRQ_BOARD_END + 26)
-#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
-#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
-#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
-#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
-#define AUDTFSR (IRQ_BOARD_END + 36)
-#define AUDRFSR (IRQ_BOARD_END + 37)
-#define AUDTUR (IRQ_BOARD_END + 38)
-#define AUDROR (IRQ_BOARD_END + 39)
-#define AUDDTS (IRQ_BOARD_END + 40)
-#define AUDRDD (IRQ_BOARD_END + 41)
-#define AUDSTO (IRQ_BOARD_END + 42)
-#define IRQ_USBPWR (IRQ_BOARD_END + 43)
-#define IRQ_HCIM (IRQ_BOARD_END + 44)
-#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
-#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
-#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
-#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
-#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
-#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
-#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
-#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
-#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
-#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
-
/*
* Figure out the MAX IRQ number.
*
@@ -128,7 +76,7 @@
* Otherwise, we have the standard IRQs only.
*/
#ifdef CONFIG_SA1111
-#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
+#define NR_IRQS (IRQ_BOARD_END + 55)
#elif CONFIG_SHARPSL_LOCOMO
#define NR_IRQS (IRQ_BOARD_START + 4)
#else
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 13ebd2d..d3ec620 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -208,6 +208,10 @@ static struct resource sa1111_resources[] = {
},
};
+static struct sa1111_platform_data sa1111_info = {
+ .irq_base = IRQ_BOARD_END,
+};
+
static u64 sa1111_dmamask = 0xffffffffUL;
static struct platform_device sa1111_device = {
@@ -216,6 +220,7 @@ static struct platform_device sa1111_device = {
.dev = {
.dma_mask = &sa1111_dmamask,
.coherent_dma_mask = 0xffffffff,
+ .platform_data = &sa1111_info,
},
.num_resources = ARRAY_SIZE(sa1111_resources),
.resource = sa1111_resources,
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 6ccd175..0b505d9 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -241,6 +241,10 @@ static struct resource sa1111_resources[] = {
},
};
+static struct sa1111_platform_data sa1111_info = {
+ .irq_base = IRQ_BOARD_END,
+};
+
static u64 sa1111_dmamask = 0xffffffffUL;
static struct platform_device sa1111_device = {
@@ -249,6 +253,7 @@ static struct platform_device sa1111_device = {
.dev = {
.dma_mask = &sa1111_dmamask,
.coherent_dma_mask = 0xffffffff,
+ .platform_data = &sa1111_info,
},
.num_resources = ARRAY_SIZE(sa1111_resources),
.resource = sa1111_resources,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 7/7] [ARM] pxa: move board board IRQ definitions out of irqs.h
2009-12-28 5:18 [PATCH 0/7] pxa/sa1100: irqs.h cleanup Eric Miao
` (5 preceding siblings ...)
2009-12-28 5:18 ` [PATCH 6/7] [ARM] sa1111: allow cascaded IRQs to be used by platforms Eric Miao
@ 2009-12-28 5:18 ` Eric Miao
6 siblings, 0 replies; 21+ messages in thread
From: Eric Miao @ 2009-12-28 5:18 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/include/asm/hardware/it8152.h | 12 +++++
arch/arm/mach-pxa/include/mach/balloon3.h | 10 ++++
arch/arm/mach-pxa/include/mach/irqs.h | 67 +---------------------------
arch/arm/mach-pxa/include/mach/lpd270.h | 4 ++
arch/arm/mach-pxa/include/mach/lubbock.h | 11 +++++
arch/arm/mach-pxa/include/mach/mainstone.h | 17 +++++++
arch/arm/mach-pxa/include/mach/pcm027.h | 7 +++
drivers/usb/gadget/pxa25x_udc.c | 4 ++
8 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/arch/arm/include/asm/hardware/it8152.h b/arch/arm/include/asm/hardware/it8152.h
index 74b5fff..6700c7f 100644
--- a/arch/arm/include/asm/hardware/it8152.h
+++ b/arch/arm/include/asm/hardware/it8152.h
@@ -75,6 +75,18 @@ extern unsigned long it8152_base_address;
IT8152_PD_IRQ(1) USB (USBR)
IT8152_PD_IRQ(0) Audio controller (ACR)
*/
+#define IT8152_IRQ(x) (IRQ_BOARD_END + (x))
+
+/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
+#define IT8152_LD_IRQ_COUNT 9
+#define IT8152_LP_IRQ_COUNT 16
+#define IT8152_PD_IRQ_COUNT 15
+
+/* Priorities: */
+#define IT8152_PD_IRQ(i) IT8152_IRQ(i)
+#define IT8152_LP_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT)
+#define IT8152_LD_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT + IT8152_LP_IRQ_COUNT)
+
/* frequently used interrupts */
#define IT8152_PCISERR IT8152_PD_IRQ(14)
#define IT8152_H2PTADR IT8152_PD_IRQ(13)
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index bfec09b..1a74106 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -129,6 +129,16 @@ enum balloon3_features {
#define CPLD_AROUTING_LOONR2INT_BIT 6
#define CPLD_AROUTING_LOONR2EXT_BIT 7
+/* Balloon3 Interrupts */
+#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
+
+#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
+#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
+
+#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
+#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
+#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
+
extern int balloon3_has(enum balloon3_features feature);
#endif
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index b35b3ac..ffc8314 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -150,74 +150,9 @@
#define NR_IRQS (IRQ_BOARD_START)
#endif
-/*
- * Board specific IRQs. Define them here.
- * Do not surround them with ifdefs.
- */
-#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
-#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
-#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
-#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
-#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
-#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
-#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
-#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
-#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
-
-#define LPD270_IRQ(x) (IRQ_BOARD_START + (x))
-#define LPD270_USBC_IRQ LPD270_IRQ(2)
-#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
-#define LPD270_AC97_IRQ LPD270_IRQ(4)
-
-#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
-#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
-#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
-#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
-#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
-#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
-#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
-#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
-#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
-#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
-#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
-#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
-#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
-#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
-#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
-
-/* Balloon3 Interrupts */
-#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
-
-#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
-#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
-
-#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
-#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
-#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
-
-/* phyCORE-PXA270 (PCM027) Interrupts */
-#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
-#define PCM027_BTDET_IRQ PCM027_IRQ(0)
-#define PCM027_FF_RI_IRQ PCM027_IRQ(1)
-#define PCM027_MMCDET_IRQ PCM027_IRQ(2)
-#define PCM027_PM_5V_IRQ PCM027_IRQ(3)
-
-/* ITE8152 irqs */
/* add IT8152 IRQs beyond BOARD_END */
#ifdef CONFIG_PCI_HOST_ITE8152
-#define IT8152_IRQ(x) (IRQ_BOARD_END + (x))
-
-/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
-#define IT8152_LD_IRQ_COUNT 9
-#define IT8152_LP_IRQ_COUNT 16
-#define IT8152_PD_IRQ_COUNT 15
-
-/* Priorities: */
-#define IT8152_PD_IRQ(i) IT8152_IRQ(i)
-#define IT8152_LP_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT)
-#define IT8152_LD_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT + IT8152_LP_IRQ_COUNT)
-
-#define IT8152_LAST_IRQ IT8152_LD_IRQ(IT8152_LD_IRQ_COUNT - 1)
+#define IT8152_LAST_IRQ (IRQ_BOARD_END + 40)
#if NR_IRQS < (IT8152_LAST_IRQ+1)
#undef NR_IRQS
diff --git a/arch/arm/mach-pxa/include/mach/lpd270.h b/arch/arm/mach-pxa/include/mach/lpd270.h
index f89fb71..0e6440c 100644
--- a/arch/arm/mach-pxa/include/mach/lpd270.h
+++ b/arch/arm/mach-pxa/include/mach/lpd270.h
@@ -34,5 +34,9 @@
#define LPD270_INT_ETHERNET (1 << 3) /* Ethernet controller IRQ */
#define LPD270_INT_USBC (1 << 2) /* USB client cable detection IRQ */
+#define LPD270_IRQ(x) (IRQ_BOARD_START + (x))
+#define LPD270_USBC_IRQ LPD270_IRQ(2)
+#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
+#define LPD270_AC97_IRQ LPD270_IRQ(4)
#endif
diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h
index 751b748..a0d4247 100644
--- a/arch/arm/mach-pxa/include/mach/lubbock.h
+++ b/arch/arm/mach-pxa/include/mach/lubbock.h
@@ -34,6 +34,17 @@
#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0)
#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100)
+/* Board specific IRQs */
+#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
+#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
+#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
+#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
+#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
+#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
+#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
+#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
+#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
+
#ifndef __ASSEMBLY__
extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
#endif
diff --git a/arch/arm/mach-pxa/include/mach/mainstone.h b/arch/arm/mach-pxa/include/mach/mainstone.h
index 3461c43..86e623a 100644
--- a/arch/arm/mach-pxa/include/mach/mainstone.h
+++ b/arch/arm/mach-pxa/include/mach/mainstone.h
@@ -117,4 +117,21 @@
#define MST_PCMCIA_PWR_VCC_33 0x8 /* voltage VCC = 3.3V */
#define MST_PCMCIA_PWR_VCC_50 0x4 /* voltage VCC = 5.0V */
+/* board specific IRQs */
+#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
+#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
+#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
+#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
+#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
+#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
+#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
+#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
+#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
+#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
+#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
+#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
+#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
+#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
+#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
+
#endif
diff --git a/arch/arm/mach-pxa/include/mach/pcm027.h b/arch/arm/mach-pxa/include/mach/pcm027.h
index 4dcd2e8..0408326 100644
--- a/arch/arm/mach-pxa/include/mach/pcm027.h
+++ b/arch/arm/mach-pxa/include/mach/pcm027.h
@@ -23,6 +23,13 @@
* Definitions of CPU card resources only
*/
+/* phyCORE-PXA270 (PCM027) Interrupts */
+#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
+#define PCM027_BTDET_IRQ PCM027_IRQ(0)
+#define PCM027_FF_RI_IRQ PCM027_IRQ(1)
+#define PCM027_MMCDET_IRQ PCM027_IRQ(2)
+#define PCM027_PM_5V_IRQ PCM027_IRQ(3)
+
/* I2C RTC */
#define PCM027_RTC_IRQ_GPIO 0
#define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO)
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index e6fedbd..be5fb34 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -65,6 +65,10 @@
#include <mach/pxa25x-udc.h>
#endif
+#ifdef CONFIG_ARCH_LUBBOCK
+#include <mach/lubbock.h>
+#endif
+
#include <asm/mach/udc_pxa2xx.h>
--
1.6.3.3
^ permalink raw reply related [flat|nested] 21+ messages in thread