diff options
author | Jon Hunter <jonathanh@nvidia.com> | 2016-06-07 11:12:32 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-06-13 06:53:52 -0400 |
commit | cdbb813db6925f9dcd352841d8ba28f2edd83ff8 (patch) | |
tree | a13e0fea29fae0874d6d49305620da394f8ec6ef /drivers/irqchip/irq-gic.c | |
parent | faea645585de88303a74171321a9188fd3dd7df5 (diff) |
irqchip/gic: Prepare for adding platform driver
To support GICs that require runtime power management, it is necessary
to add a platform driver, so that the probing of the chip can be
deferred if resources, such as a power-domain, is not yet available.
To prepare for adding a platform driver:
1. Drop the __init section from the gic_dist_config() so this can be
re-used by the platform driver.
2. Add prototypes for functions required by the platform driver to the
GIC header file so they can be re-used.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r-- | drivers/irqchip/irq-gic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 94eab6e23124..141ea5801784 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -449,7 +449,7 @@ static void gic_cpu_if_up(struct gic_chip_data *gic) | |||
449 | } | 449 | } |
450 | 450 | ||
451 | 451 | ||
452 | static void __init gic_dist_init(struct gic_chip_data *gic) | 452 | static void gic_dist_init(struct gic_chip_data *gic) |
453 | { | 453 | { |
454 | unsigned int i; | 454 | unsigned int i; |
455 | u32 cpumask; | 455 | u32 cpumask; |
@@ -535,7 +535,7 @@ int gic_cpu_if_down(unsigned int gic_nr) | |||
535 | * this function, no interrupts will be delivered by the GIC, and another | 535 | * this function, no interrupts will be delivered by the GIC, and another |
536 | * platform-specific wakeup source must be enabled. | 536 | * platform-specific wakeup source must be enabled. |
537 | */ | 537 | */ |
538 | static void gic_dist_save(struct gic_chip_data *gic) | 538 | void gic_dist_save(struct gic_chip_data *gic) |
539 | { | 539 | { |
540 | unsigned int gic_irqs; | 540 | unsigned int gic_irqs; |
541 | void __iomem *dist_base; | 541 | void __iomem *dist_base; |
@@ -574,7 +574,7 @@ static void gic_dist_save(struct gic_chip_data *gic) | |||
574 | * handled normally, but any edge interrupts that occured will not be seen by | 574 | * handled normally, but any edge interrupts that occured will not be seen by |
575 | * the GIC and need to be handled by the platform-specific wakeup source. | 575 | * the GIC and need to be handled by the platform-specific wakeup source. |
576 | */ | 576 | */ |
577 | static void gic_dist_restore(struct gic_chip_data *gic) | 577 | void gic_dist_restore(struct gic_chip_data *gic) |
578 | { | 578 | { |
579 | unsigned int gic_irqs; | 579 | unsigned int gic_irqs; |
580 | unsigned int i; | 580 | unsigned int i; |
@@ -620,7 +620,7 @@ static void gic_dist_restore(struct gic_chip_data *gic) | |||
620 | writel_relaxed(GICD_ENABLE, dist_base + GIC_DIST_CTRL); | 620 | writel_relaxed(GICD_ENABLE, dist_base + GIC_DIST_CTRL); |
621 | } | 621 | } |
622 | 622 | ||
623 | static void gic_cpu_save(struct gic_chip_data *gic) | 623 | void gic_cpu_save(struct gic_chip_data *gic) |
624 | { | 624 | { |
625 | int i; | 625 | int i; |
626 | u32 *ptr; | 626 | u32 *ptr; |
@@ -650,7 +650,7 @@ static void gic_cpu_save(struct gic_chip_data *gic) | |||
650 | 650 | ||
651 | } | 651 | } |
652 | 652 | ||
653 | static void gic_cpu_restore(struct gic_chip_data *gic) | 653 | void gic_cpu_restore(struct gic_chip_data *gic) |
654 | { | 654 | { |
655 | int i; | 655 | int i; |
656 | u32 *ptr; | 656 | u32 *ptr; |
@@ -727,7 +727,7 @@ static struct notifier_block gic_notifier_block = { | |||
727 | .notifier_call = gic_notifier, | 727 | .notifier_call = gic_notifier, |
728 | }; | 728 | }; |
729 | 729 | ||
730 | static int __init gic_pm_init(struct gic_chip_data *gic) | 730 | static int gic_pm_init(struct gic_chip_data *gic) |
731 | { | 731 | { |
732 | gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4, | 732 | gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4, |
733 | sizeof(u32)); | 733 | sizeof(u32)); |
@@ -757,7 +757,7 @@ free_ppi_enable: | |||
757 | return -ENOMEM; | 757 | return -ENOMEM; |
758 | } | 758 | } |
759 | #else | 759 | #else |
760 | static int __init gic_pm_init(struct gic_chip_data *gic) | 760 | static int gic_pm_init(struct gic_chip_data *gic) |
761 | { | 761 | { |
762 | return 0; | 762 | return 0; |
763 | } | 763 | } |