Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jon Hunter and committed by
Marc Zyngier
cdbb813d faea6455

+14 -9
+2 -2
drivers/irqchip/irq-gic-common.c
··· 90 90 return ret; 91 91 } 92 92 93 - void __init gic_dist_config(void __iomem *base, int gic_irqs, 94 - void (*sync_access)(void)) 93 + void gic_dist_config(void __iomem *base, int gic_irqs, 94 + void (*sync_access)(void)) 95 95 { 96 96 unsigned int i; 97 97
+7 -7
drivers/irqchip/irq-gic.c
··· 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 454 unsigned int i; 455 455 u32 cpumask; ··· 535 535 * this function, no interrupts will be delivered by the GIC, and another 536 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 540 unsigned int gic_irqs; 541 541 void __iomem *dist_base; ··· 574 574 * handled normally, but any edge interrupts that occured will not be seen by 575 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 579 unsigned int gic_irqs; 580 580 unsigned int i; ··· 620 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 625 int i; 626 626 u32 *ptr; ··· 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 655 int i; 656 656 u32 *ptr; ··· 727 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 732 gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4, 733 733 sizeof(u32)); ··· 757 757 return -ENOMEM; 758 758 } 759 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 762 return 0; 763 763 }
+5
include/linux/irqchip/arm-gic.h
··· 101 101 #include <linux/irqdomain.h> 102 102 103 103 struct device_node; 104 + struct gic_chip_data; 104 105 105 106 void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); 106 107 int gic_cpu_if_down(unsigned int gic_nr); 108 + void gic_cpu_save(struct gic_chip_data *gic); 109 + void gic_cpu_restore(struct gic_chip_data *gic); 110 + void gic_dist_save(struct gic_chip_data *gic); 111 + void gic_dist_restore(struct gic_chip_data *gic); 107 112 108 113 /* 109 114 * Subdrivers that need some preparatory work can initialize their