ARM: at91: Give the PIT irq as an argument of at91sam926x_pit_init
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 15 Sep 2014 14:02:24 +0000 (16:02 +0200)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Mon, 15 Sep 2014 15:55:47 +0000 (17:55 +0200)
This allows to remove the dependency of the timer driver on mach/hardware.h and
having an hardcoded interrupt number in the driver itself.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam926x_time.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/generic.h

index b61a255d414183415efbf7a2cef55760a0b298ba..aab1f969a7c3f6bba1b2d51824c34e3e28a2f13d 100644 (file)
@@ -442,7 +442,7 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
 
 static void __init at91sam9260_init_time(void)
 {
-       at91sam926x_pit_init();
+       at91sam926x_pit_init(NR_IRQS_LEGACY + AT91_ID_SYS);
 }
 
 AT91_SOC_START(at91sam9260)
index badf20c2cd6736bc8e3825c9ab81bd82b955077e..a8bd35963332f540bdcac00e87f04d09f121b805 100644 (file)
@@ -401,7 +401,7 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
 
 static void __init at91sam9261_init_time(void)
 {
-       at91sam926x_pit_init();
+       at91sam926x_pit_init(NR_IRQS_LEGACY + AT91_ID_SYS);
 }
 
 AT91_SOC_START(at91sam9261)
index ebb413e7f653d017ca5cd3cf3fe82388839bb644..fbff228cc63ed5e54da7c97f79f140083845dc6d 100644 (file)
@@ -424,7 +424,7 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
 
 static void __init at91sam9263_init_time(void)
 {
-       at91sam926x_pit_init();
+       at91sam926x_pit_init(NR_IRQS_LEGACY + AT91_ID_SYS);
 }
 
 AT91_SOC_START(at91sam9263)
index 9abb289dce72996afd9e3402278589971868dd74..d5289098b3df41547e63630f1fc24b17e725cb0b 100644 (file)
@@ -22,8 +22,6 @@
 #include <linux/of_irq.h>
 #include <linux/slab.h>
 
-#include <mach/hardware.h>
-
 #define AT91_PIT_MR            0x00                    /* Mode Register */
 #define AT91_PIT_PITIEN                        BIT(25)                 /* Timer Interrupt Enable */
 #define AT91_PIT_PITEN                 BIT(24)                 /* Timer Enabled */
@@ -267,7 +265,7 @@ CLOCKSOURCE_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit",
 
 static void __iomem *pit_base_addr;
 
-void __init at91sam926x_pit_init(void)
+void __init at91sam926x_pit_init(int irq)
 {
        struct pit_data *data;
 
@@ -281,7 +279,7 @@ void __init at91sam926x_pit_init(void)
        if (IS_ERR(data->mck))
                panic(pr_fmt("Unable to get mck clk\n"));
 
-       data->irq = NR_IRQS_LEGACY + AT91_ID_SYS;
+       data->irq = irq;
 
        at91sam926x_pit_common_init(data);
 }
index f725814c556d7af1a18a79bc3ca32d0b17ee76f7..405427ec05f8a923f153fa9d384071fd8f3ef72a 100644 (file)
@@ -479,7 +479,7 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {
 
 static void __init at91sam9g45_init_time(void)
 {
-       at91sam926x_pit_init();
+       at91sam926x_pit_init(NR_IRQS_LEGACY + AT91_ID_SYS);
 }
 
 AT91_SOC_START(at91sam9g45)
index 361b4a6e765147051f96c954a5d7bbbbbfe27005..f553e4ea034bade189daebc308c79343939aa813 100644 (file)
@@ -412,7 +412,7 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {
 
 static void __init at91sam9rl_init_time(void)
 {
-       at91sam926x_pit_init();
+       at91sam926x_pit_init(NR_IRQS_LEGACY + AT91_ID_SYS);
 }
 
 AT91_SOC_START(at91sam9rl)
index fb99dabab8f76071488715caeb1464ab56947fb2..189d7c7e7f60a377094a16cb6ed3fea747b4fc31 100644 (file)
@@ -48,7 +48,7 @@ extern void __init at91_init_time(void);
 extern void at91rm9200_ioremap_st(u32 addr);
 extern void at91rm9200_timer_init(void);
 extern void at91sam926x_ioremap_pit(u32 addr);
-extern void at91sam926x_pit_init(void);
+extern void at91sam926x_pit_init(int irq);
 extern void at91x40_timer_init(void);
 
  /* Clocks */