[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-cdb647a772e9def47594ff8ce7acf47f4d257b2e@git.kernel.org>
Date: Mon, 26 Jan 2015 02:43:47 -0800
From: tip-bot for Yingjoe Chen <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org, tglx@...utronix.de,
ijc+devicetree@...lion.org.uk, jason@...edaemon.net,
pawel.moll@....com, peter.maydell@...aro.org, robh+dt@...nel.org,
eddie.huang@...iatek.com, matthias.bgg@...il.com,
marc.zyngier@....com, broonie@...aro.org, olof@...om.net,
srv_heupstream@...iatek.com, rrichter@...ium.com,
galak@...eaurora.org, mingo@...nel.org, kernel@...gutronix.de,
mark.rutland@....com, yingjoe.chen@...iatek.com, hpa@...or.com,
will.deacon@....com, linux-kernel@...r.kernel.org,
catalin.marinas@....com
Subject: [tip:irq/core] irqchip: mtk-sysirq:
Get irq number from register resource size
Commit-ID: cdb647a772e9def47594ff8ce7acf47f4d257b2e
Gitweb: http://git.kernel.org/tip/cdb647a772e9def47594ff8ce7acf47f4d257b2e
Author: Yingjoe Chen <yingjoe.chen@...iatek.com>
AuthorDate: Mon, 12 Jan 2015 17:14:31 +0800
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Mon, 26 Jan 2015 11:38:22 +0100
irqchip: mtk-sysirq: Get irq number from register resource size
Originally mtk-sysirq hardcoded supported irq number to 224. This
was fine since all SoCs before support the same number of irqs for
intpol.
However MT8173 intpol support 32 more irq pins, changes to get
irq number from register resource size to suppor MT8173 properly.
Signed-off-by: Yingjoe Chen <yingjoe.chen@...iatek.com>
Signed-off-by: Eddie Huang <eddie.huang@...iatek.com>
Cc: <srv_heupstream@...iatek.com>
Cc: Pawel Moll <pawel.moll@....com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Ian Campbell <ijc+devicetree@...lion.org.uk>
Cc: Kumar Gala <galak@...eaurora.org>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Will Deacon <will.deacon@....com>
Cc: Olof Johansson <olof@...om.net>
Cc: Robert Richter <rrichter@...ium.com>
Cc: Mark Brown <broonie@...aro.org>
Cc: <linux-arm-kernel@...ts.infradead.org>
Cc: Sascha Hauer <kernel@...gutronix.de>
Cc: <marc.zyngier@....com>
Cc: <peter.maydell@...aro.org>
Cc: Matthias Brugger <matthias.bgg@...il.com>
Cc: Rob Herring <robh+dt@...nel.org>
Cc: Jason Cooper <jason@...edaemon.net>
Link: http://lkml.kernel.org/r/1421054073-43468-3-git-send-email-eddie.huang@mediatek.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
drivers/irqchip/irq-mtk-sysirq.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c
index 0b0d2c0..eaf0a71 100644
--- a/drivers/irqchip/irq-mtk-sysirq.c
+++ b/drivers/irqchip/irq-mtk-sysirq.c
@@ -23,8 +23,6 @@
#include "irqchip.h"
-#define MT6577_SYS_INTPOL_NUM (224)
-
struct mtk_sysirq_chip_data {
spinlock_t lock;
void __iomem *intpol_base;
@@ -124,7 +122,8 @@ static int __init mtk_sysirq_of_init(struct device_node *node,
{
struct irq_domain *domain, *domain_parent;
struct mtk_sysirq_chip_data *chip_data;
- int ret = 0;
+ int ret, size, intpol_num;
+ struct resource res;
domain_parent = irq_find_host(parent);
if (!domain_parent) {
@@ -132,19 +131,24 @@ static int __init mtk_sysirq_of_init(struct device_node *node,
return -EINVAL;
}
+ ret = of_address_to_resource(node, 0, &res);
+ if (ret)
+ return ret;
+
chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL);
if (!chip_data)
return -ENOMEM;
- chip_data->intpol_base = of_io_request_and_map(node, 0, "intpol");
- if (IS_ERR(chip_data->intpol_base)) {
+ size = resource_size(&res);
+ intpol_num = size * 8;
+ chip_data->intpol_base = ioremap(res.start, size);
+ if (!chip_data->intpol_base) {
pr_err("mtk_sysirq: unable to map sysirq register\n");
ret = PTR_ERR(chip_data->intpol_base);
goto out_free;
}
- domain = irq_domain_add_hierarchy(domain_parent, 0,
- MT6577_SYS_INTPOL_NUM, node,
+ domain = irq_domain_add_hierarchy(domain_parent, 0, intpol_num, node,
&sysirq_domain_ops, chip_data);
if (!domain) {
ret = -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists