aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYingjoe Chen <yingjoe.chen@mediatek.com>2014-11-13 10:37:05 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-11-23 07:01:46 -0500
commit56e8abab615e0c5858cfb9fa0015a44641762b9d (patch)
treeb901401d90577e00ff7a11bd31c291f14720c8a3
parent85f08c17de26f117be6ca7aa260d2ec02a2248ba (diff)
genirq: Add more helper functions to support stacked irq_chip
Add more helper function for stacked irq_chip to just call parent's function. Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Gran Likely <grant.likely@linaro.org> Cc: Boris BREZILLON <boris.brezillon@free-electrons.com> Cc: <linux-arm-kernel@lists.infradead.org> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Yijing Wang <wangyijing@huawei.com> Cc: <srv_heupstream@mediatek.com> Cc: <yingjoe.chen@gmail.com> Cc: <hc.yen@mediatek.com> Cc: <eddie.huang@mediatek.com> Cc: <nathan.chung@mediatek.com> Cc: <yh.chen@mediatek.com> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Link: http://lkml.kernel.org/r/1415893029-2971-3-git-send-email-yingjoe.chen@mediatek.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/irq.h6
-rw-r--r--kernel/irq/chip.c48
2 files changed, 54 insertions, 0 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 0adcbbbf2e87..fad4bf6f15f6 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -446,6 +446,12 @@ extern void handle_nested_irq(unsigned int irq);
446#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 446#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
447extern void irq_chip_ack_parent(struct irq_data *data); 447extern void irq_chip_ack_parent(struct irq_data *data);
448extern int irq_chip_retrigger_hierarchy(struct irq_data *data); 448extern int irq_chip_retrigger_hierarchy(struct irq_data *data);
449extern void irq_chip_mask_parent(struct irq_data *data);
450extern void irq_chip_unmask_parent(struct irq_data *data);
451extern void irq_chip_eoi_parent(struct irq_data *data);
452extern int irq_chip_set_affinity_parent(struct irq_data *data,
453 const struct cpumask *dest,
454 bool force);
449#endif 455#endif
450 456
451/* Handling of unhandled and spurious interrupts: */ 457/* Handling of unhandled and spurious interrupts: */
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index dd1d3c4c93a2..47f4c6469a43 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -863,6 +863,54 @@ void irq_chip_ack_parent(struct irq_data *data)
863} 863}
864 864
865/** 865/**
866 * irq_chip_mask_parent - Mask the parent interrupt
867 * @data: Pointer to interrupt specific data
868 */
869void irq_chip_mask_parent(struct irq_data *data)
870{
871 data = data->parent_data;
872 data->chip->irq_mask(data);
873}
874
875/**
876 * irq_chip_unmask_parent - Unmask the parent interrupt
877 * @data: Pointer to interrupt specific data
878 */
879void irq_chip_unmask_parent(struct irq_data *data)
880{
881 data = data->parent_data;
882 data->chip->irq_unmask(data);
883}
884
885/**
886 * irq_chip_eoi_parent - Invoke EOI on the parent interrupt
887 * @data: Pointer to interrupt specific data
888 */
889void irq_chip_eoi_parent(struct irq_data *data)
890{
891 data = data->parent_data;
892 data->chip->irq_eoi(data);
893}
894
895/**
896 * irq_chip_set_affinity_parent - Set affinity on the parent interrupt
897 * @data: Pointer to interrupt specific data
898 * @dest: The affinity mask to set
899 * @force: Flag to enforce setting (disable online checks)
900 *
901 * Conditinal, as the underlying parent chip might not implement it.
902 */
903int irq_chip_set_affinity_parent(struct irq_data *data,
904 const struct cpumask *dest, bool force)
905{
906 data = data->parent_data;
907 if (data->chip->irq_set_affinity)
908 return data->chip->irq_set_affinity(data, dest, force);
909
910 return -ENOSYS;
911}
912
913/**
866 * irq_chip_retrigger_hierarchy - Retrigger an interrupt in hardware 914 * irq_chip_retrigger_hierarchy - Retrigger an interrupt in hardware
867 * @data: Pointer to interrupt specific data 915 * @data: Pointer to interrupt specific data
868 * 916 *