irqchip: renesas-irqc: Minor update
[PATCH 01/03] irqchip: renesas-irqc: Get rid of IRQF_VALID
[PATCH 02/03] irqchip: renesas-irqc: Use linear IRQ domain
[PATCH 03/03] irqchip: renesas-irqc: Make use of irq_find_mapping()
This series contains a few minor updates for the IRQC driver, some
basic cleanups as preparation series for future generic chip rework.
With these patches applied the driver is becoming less special
and closer to the generic chip implementation.
Signed-off-by: Magnus Damm <[email protected]>
---
Written against renesas-devel-20150720-v4.2-rc3
drivers/irqchip/irq-renesas-irqc.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
From: Magnus Damm <[email protected]>
IRQF_VALID is not needed on ARM anymore, so get rid of it.
Signed-off-by: Magnus Damm <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 1 -
1 file changed, 1 deletion(-)
--- 0001/drivers/irqchip/irq-renesas-irqc.c
+++ work/drivers/irqchip/irq-renesas-irqc.c 2015-07-20 17:40:00.272366518 +0900
@@ -162,7 +162,6 @@ static int irqc_irq_domain_map(struct ir
irqc_dbg(&p->irq[hw], "map");
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID); /* kill me now */
return 0;
}
From: Magnus Damm <[email protected]>
Use linear IRQ domain instead of irq_domain_add_simple()
that also handles non-DT cases. This reduces the delta
between the IRQC code and the generic chip implementation.
Signed-off-by: Magnus Damm <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- 0002/drivers/irqchip/irq-renesas-irqc.c
+++ work/drivers/irqchip/irq-renesas-irqc.c 2015-07-20 18:42:39.762366518 +0900
@@ -242,8 +242,8 @@ static int irqc_probe(struct platform_de
irq_chip->irq_set_wake = irqc_irq_set_wake;
irq_chip->flags = IRQCHIP_MASK_ON_SUSPEND;
- p->irq_domain = irq_domain_add_simple(pdev->dev.of_node,
- p->number_of_irqs, 0,
+ p->irq_domain = irq_domain_add_linear(pdev->dev.of_node,
+ p->number_of_irqs,
&irqc_irq_domain_ops, p);
if (!p->irq_domain) {
ret = -ENXIO;
From: Magnus Damm <[email protected]>
Instead of locally caching the virq as domain_irq
simply rely on the IRQ domain code and irq_find_mapping().
This reduces the delta between the IRQC driver and
the generic chip implementation.
Signed-off-by: Magnus Damm <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
--- 0003/drivers/irqchip/irq-renesas-irqc.c
+++ work/drivers/irqchip/irq-renesas-irqc.c 2015-07-20 17:59:13.000000000 +0900
@@ -53,7 +53,6 @@
struct irqc_irq {
int hw_irq;
int requested_irq;
- int domain_irq;
struct irqc_priv *p;
};
@@ -70,8 +69,8 @@ struct irqc_priv {
static void irqc_dbg(struct irqc_irq *i, char *str)
{
- dev_dbg(&i->p->pdev->dev, "%s (%d:%d:%d)\n",
- str, i->requested_irq, i->hw_irq, i->domain_irq);
+ dev_dbg(&i->p->pdev->dev, "%s (%d:%d)\n",
+ str, i->requested_irq, i->hw_irq);
}
static void irqc_irq_enable(struct irq_data *d)
@@ -145,7 +144,7 @@ static irqreturn_t irqc_irq_handler(int
if (ioread32(p->iomem + DETECT_STATUS) & bit) {
iowrite32(bit, p->iomem + DETECT_STATUS);
irqc_dbg(i, "demux2");
- generic_handle_irq(i->domain_irq);
+ generic_handle_irq(irq_find_mapping(p->irq_domain, i->hw_irq));
return IRQ_HANDLED;
}
return IRQ_NONE;
@@ -156,9 +155,6 @@ static int irqc_irq_domain_map(struct ir
{
struct irqc_priv *p = h->host_data;
- p->irq[hw].domain_irq = virq;
- p->irq[hw].hw_irq = hw;
-
irqc_dbg(&p->irq[hw], "map");
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
@@ -214,6 +210,7 @@ static int irqc_probe(struct platform_de
break;
p->irq[k].p = p;
+ p->irq[k].hw_irq = k;
p->irq[k].requested_irq = irq->start;
}
Commit-ID: 35c3f67f11849d80cc0e3cd3dd898977567c9c29
Gitweb: http://git.kernel.org/tip/35c3f67f11849d80cc0e3cd3dd898977567c9c29
Author: Magnus Damm <[email protected]>
AuthorDate: Mon, 20 Jul 2015 19:06:14 +0900
Committer: Thomas Gleixner <[email protected]>
CommitDate: Mon, 20 Jul 2015 13:18:59 +0200
irqchip/renesas-irqc: Get rid of IRQF_VALID
IRQF_VALID is not needed on ARM anymore, so get rid of it.
Signed-off-by: Magnus Damm <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Magnus Damm <[email protected]>
Link: http://lkml.kernel.org/r/20150720100614.2552.86867.sendpatchset@little-apple
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 778bd07..74e980f 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -162,7 +162,6 @@ static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,
irqc_dbg(&p->irq[hw], "map");
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID); /* kill me now */
return 0;
}
Commit-ID: 7d153751c79e84a88e8c80e82ee5293085b9081b
Gitweb: http://git.kernel.org/tip/7d153751c79e84a88e8c80e82ee5293085b9081b
Author: Magnus Damm <[email protected]>
AuthorDate: Mon, 20 Jul 2015 19:06:25 +0900
Committer: Thomas Gleixner <[email protected]>
CommitDate: Mon, 20 Jul 2015 13:19:00 +0200
irqchip/renesas-irqc: Use linear IRQ domain
Use linear IRQ domain instead of irq_domain_add_simple() that also
handles non-DT cases. This reduces the delta between the IRQC code and
the generic chip implementation.
Signed-off-by: Magnus Damm <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Magnus Damm <[email protected]>
Link: http://lkml.kernel.org/r/20150720100625.2552.63939.sendpatchset@little-apple
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 74e980f..7f75092 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -242,8 +242,8 @@ static int irqc_probe(struct platform_device *pdev)
irq_chip->irq_set_wake = irqc_irq_set_wake;
irq_chip->flags = IRQCHIP_MASK_ON_SUSPEND;
- p->irq_domain = irq_domain_add_simple(pdev->dev.of_node,
- p->number_of_irqs, 0,
+ p->irq_domain = irq_domain_add_linear(pdev->dev.of_node,
+ p->number_of_irqs,
&irqc_irq_domain_ops, p);
if (!p->irq_domain) {
ret = -ENXIO;
Commit-ID: e10fc03c4f89e5191f0ad2a3885d476f498bf131
Gitweb: http://git.kernel.org/tip/e10fc03c4f89e5191f0ad2a3885d476f498bf131
Author: Magnus Damm <[email protected]>
AuthorDate: Mon, 20 Jul 2015 19:06:35 +0900
Committer: Thomas Gleixner <[email protected]>
CommitDate: Mon, 20 Jul 2015 13:19:00 +0200
irqchip/renesas-irqc: Make use of irq_find_mapping()
Instead of locally caching the virq as domain_irq simply rely on the
IRQ domain code and irq_find_mapping(). This reduces the delta
between the IRQC driver and the generic chip implementation.
Signed-off-by: Magnus Damm <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Magnus Damm <[email protected]>
Link: http://lkml.kernel.org/r/20150720100635.2552.20906.sendpatchset@little-apple
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 7f75092..2aa3add 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -53,7 +53,6 @@
struct irqc_irq {
int hw_irq;
int requested_irq;
- int domain_irq;
struct irqc_priv *p;
};
@@ -70,8 +69,8 @@ struct irqc_priv {
static void irqc_dbg(struct irqc_irq *i, char *str)
{
- dev_dbg(&i->p->pdev->dev, "%s (%d:%d:%d)\n",
- str, i->requested_irq, i->hw_irq, i->domain_irq);
+ dev_dbg(&i->p->pdev->dev, "%s (%d:%d)\n",
+ str, i->requested_irq, i->hw_irq);
}
static void irqc_irq_enable(struct irq_data *d)
@@ -145,7 +144,7 @@ static irqreturn_t irqc_irq_handler(int irq, void *dev_id)
if (ioread32(p->iomem + DETECT_STATUS) & bit) {
iowrite32(bit, p->iomem + DETECT_STATUS);
irqc_dbg(i, "demux2");
- generic_handle_irq(i->domain_irq);
+ generic_handle_irq(irq_find_mapping(p->irq_domain, i->hw_irq));
return IRQ_HANDLED;
}
return IRQ_NONE;
@@ -156,9 +155,6 @@ static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,
{
struct irqc_priv *p = h->host_data;
- p->irq[hw].domain_irq = virq;
- p->irq[hw].hw_irq = hw;
-
irqc_dbg(&p->irq[hw], "map");
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
@@ -214,6 +210,7 @@ static int irqc_probe(struct platform_device *pdev)
break;
p->irq[k].p = p;
+ p->irq[k].hw_irq = k;
p->irq[k].requested_irq = irq->start;
}