diff options
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r-- | kernel/irq/chip.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 47f4c6469a43..63c16d165e78 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -926,3 +926,29 @@ int irq_chip_retrigger_hierarchy(struct irq_data *data) | |||
926 | return -ENOSYS; | 926 | return -ENOSYS; |
927 | } | 927 | } |
928 | #endif | 928 | #endif |
929 | |||
930 | /** | ||
931 | * irq_chip_compose_msi_msg - Componse msi message for a irq chip | ||
932 | * @data: Pointer to interrupt specific data | ||
933 | * @msg: Pointer to the MSI message | ||
934 | * | ||
935 | * For hierarchical domains we find the first chip in the hierarchy | ||
936 | * which implements the irq_compose_msi_msg callback. For non | ||
937 | * hierarchical we use the top level chip. | ||
938 | */ | ||
939 | int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) | ||
940 | { | ||
941 | struct irq_data *pos = NULL; | ||
942 | |||
943 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | ||
944 | for (; data; data = data->parent_data) | ||
945 | #endif | ||
946 | if (data->chip && data->chip->irq_compose_msi_msg) | ||
947 | pos = data; | ||
948 | if (!pos) | ||
949 | return -ENOSYS; | ||
950 | |||
951 | pos->chip->irq_compose_msi_msg(pos, msg); | ||
952 | |||
953 | return 0; | ||
954 | } | ||