Lines Matching +full:on +full:- +full:chip
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
4 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
6 * This file contains the core interrupt handling code, for irq-chip based
8 * Documentation/core-api/genericirq.rst
29 * Chained handlers should never call action on their IRQ. This default
37 * irq_set_chip - set the irq chip for an irq
39 * @chip: pointer to irq chip description structure
41 int irq_set_chip(unsigned int irq, const struct irq_chip *chip) in irq_set_chip() argument
47 return -EINVAL; in irq_set_chip()
49 desc->irq_data.chip = (struct irq_chip *)(chip ?: &no_irq_chip); in irq_set_chip()
61 * irq_set_irq_type - set the irq trigger type for an irq
63 * @type: IRQ_TYPE_{LEVEL,EDGE}_* value - see include/linux/irq.h
72 return -EINVAL; in irq_set_irq_type()
81 * irq_set_handler_data - set irq handler data for an irq
93 return -EINVAL; in irq_set_handler_data()
94 desc->irq_common_data.handler_data = data; in irq_set_handler_data()
101 * irq_set_msi_desc_off - set MSI descriptor data for an irq at offset
115 return -EINVAL; in irq_set_msi_desc_off()
116 desc->irq_common_data.msi_desc = entry; in irq_set_msi_desc_off()
118 entry->irq = irq_base; in irq_set_msi_desc_off()
124 * irq_set_msi_desc - set MSI descriptor data for an irq
136 * irq_set_chip_data - set irq chip data for an irq
138 * @data: Pointer to chip specific data
140 * Set the hardware irq chip data for an irq
148 return -EINVAL; in irq_set_chip_data()
149 desc->irq_data.chip_data = data; in irq_set_chip_data()
159 return desc ? &desc->irq_data : NULL; in irq_get_irq_data()
165 irqd_clear(&desc->irq_data, IRQD_IRQ_DISABLED); in irq_state_clr_disabled()
170 irqd_clear(&desc->irq_data, IRQD_IRQ_MASKED); in irq_state_clr_masked()
175 irqd_clear(&desc->irq_data, IRQD_IRQ_STARTED); in irq_state_clr_started()
180 irqd_set(&desc->irq_data, IRQD_IRQ_STARTED); in irq_state_set_started()
203 * Catch code which fiddles with enable_irq() on a managed in __irq_startup_managed()
205 * installment or irq auto probing should not happen on in __irq_startup_managed()
243 if (d->chip->irq_startup) { in __irq_startup()
244 ret = d->chip->irq_startup(d); in __irq_startup()
260 desc->depth = 0; in irq_startup()
267 if (d->chip->flags & IRQCHIP_AFFINITY_PRE_STARTUP) in irq_startup()
270 if (!(d->chip->flags & IRQCHIP_AFFINITY_PRE_STARTUP)) in irq_startup()
308 if (irqd_is_started(&desc->irq_data)) { in irq_shutdown()
309 desc->depth = 1; in irq_shutdown()
310 if (desc->irq_data.chip->irq_shutdown) { in irq_shutdown()
311 desc->irq_data.chip->irq_shutdown(&desc->irq_data); in irq_shutdown()
331 irq_domain_deactivate_irq(&desc->irq_data); in irq_shutdown_and_deactivate()
336 if (!irqd_irq_disabled(&desc->irq_data)) { in irq_enable()
340 if (desc->irq_data.chip->irq_enable) { in irq_enable()
341 desc->irq_data.chip->irq_enable(&desc->irq_data); in irq_enable()
351 if (irqd_irq_disabled(&desc->irq_data)) { in __irq_disable()
356 if (desc->irq_data.chip->irq_disable) { in __irq_disable()
357 desc->irq_data.chip->irq_disable(&desc->irq_data); in __irq_disable()
366 * irq_disable - Mark interrupt disabled
369 * If the chip does not implement the irq_disable callback, we
378 * If the interrupt chip does not implement the irq_disable callback,
392 if (desc->irq_data.chip->irq_enable) in irq_percpu_enable()
393 desc->irq_data.chip->irq_enable(&desc->irq_data); in irq_percpu_enable()
395 desc->irq_data.chip->irq_unmask(&desc->irq_data); in irq_percpu_enable()
396 cpumask_set_cpu(cpu, desc->percpu_enabled); in irq_percpu_enable()
401 if (desc->irq_data.chip->irq_disable) in irq_percpu_disable()
402 desc->irq_data.chip->irq_disable(&desc->irq_data); in irq_percpu_disable()
404 desc->irq_data.chip->irq_mask(&desc->irq_data); in irq_percpu_disable()
405 cpumask_clear_cpu(cpu, desc->percpu_enabled); in irq_percpu_disable()
410 if (desc->irq_data.chip->irq_mask_ack) { in mask_ack_irq()
411 desc->irq_data.chip->irq_mask_ack(&desc->irq_data); in mask_ack_irq()
415 if (desc->irq_data.chip->irq_ack) in mask_ack_irq()
416 desc->irq_data.chip->irq_ack(&desc->irq_data); in mask_ack_irq()
422 if (irqd_irq_masked(&desc->irq_data)) in mask_irq()
425 if (desc->irq_data.chip->irq_mask) { in mask_irq()
426 desc->irq_data.chip->irq_mask(&desc->irq_data); in mask_irq()
433 if (!irqd_irq_masked(&desc->irq_data)) in unmask_irq()
436 if (desc->irq_data.chip->irq_unmask) { in unmask_irq()
437 desc->irq_data.chip->irq_unmask(&desc->irq_data); in unmask_irq()
444 struct irq_chip *chip = desc->irq_data.chip; in unmask_threaded_irq() local
446 if (chip->flags & IRQCHIP_EOI_THREADED) in unmask_threaded_irq()
447 chip->irq_eoi(&desc->irq_data); in unmask_threaded_irq()
453 * handle_nested_irq - Handle a nested irq from a irq thread
468 raw_spin_lock_irq(&desc->lock); in handle_nested_irq()
470 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_nested_irq()
472 action = desc->action; in handle_nested_irq()
473 if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) { in handle_nested_irq()
474 desc->istate |= IRQS_PENDING; in handle_nested_irq()
479 irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS); in handle_nested_irq()
480 raw_spin_unlock_irq(&desc->lock); in handle_nested_irq()
484 action_ret |= action->thread_fn(action->irq, action->dev_id); in handle_nested_irq()
489 raw_spin_lock_irq(&desc->lock); in handle_nested_irq()
490 irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); in handle_nested_irq()
493 raw_spin_unlock_irq(&desc->lock); in handle_nested_irq()
499 if (!(desc->istate & IRQS_POLL_INPROGRESS)) in irq_check_poll()
512 if (!irqd_has_set(&desc->irq_data, mask)) in irq_may_run()
524 * Handle a potential concurrent poll on a different core. in irq_may_run()
530 * handle_simple_irq - Simple and software-decoded IRQs.
542 raw_spin_lock(&desc->lock); in handle_simple_irq()
547 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_simple_irq()
549 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { in handle_simple_irq()
550 desc->istate |= IRQS_PENDING; in handle_simple_irq()
558 raw_spin_unlock(&desc->lock); in handle_simple_irq()
563 * handle_untracked_irq - Simple and software-decoded IRQs.
577 raw_spin_lock(&desc->lock); in handle_untracked_irq()
582 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_untracked_irq()
584 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { in handle_untracked_irq()
585 desc->istate |= IRQS_PENDING; in handle_untracked_irq()
589 desc->istate &= ~IRQS_PENDING; in handle_untracked_irq()
590 irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS); in handle_untracked_irq()
591 raw_spin_unlock(&desc->lock); in handle_untracked_irq()
595 raw_spin_lock(&desc->lock); in handle_untracked_irq()
596 irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); in handle_untracked_irq()
599 raw_spin_unlock(&desc->lock); in handle_untracked_irq()
611 * - Standard level irq (IRQF_ONESHOT is not set) in cond_unmask_irq()
612 * - Oneshot irq which did not wake the thread (caused by a in cond_unmask_irq()
616 if (!irqd_irq_disabled(&desc->irq_data) && in cond_unmask_irq()
617 irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot) in cond_unmask_irq()
622 * handle_level_irq - Level type irq handler
632 raw_spin_lock(&desc->lock); in handle_level_irq()
638 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_level_irq()
644 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { in handle_level_irq()
645 desc->istate |= IRQS_PENDING; in handle_level_irq()
655 raw_spin_unlock(&desc->lock); in handle_level_irq()
659 static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip) in cond_unmask_eoi_irq() argument
661 if (!(desc->istate & IRQS_ONESHOT)) { in cond_unmask_eoi_irq()
662 chip->irq_eoi(&desc->irq_data); in cond_unmask_eoi_irq()
667 * - Oneshot irq which did not wake the thread (caused by a in cond_unmask_eoi_irq()
671 if (!irqd_irq_disabled(&desc->irq_data) && in cond_unmask_eoi_irq()
672 irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot) { in cond_unmask_eoi_irq()
673 chip->irq_eoi(&desc->irq_data); in cond_unmask_eoi_irq()
675 } else if (!(chip->flags & IRQCHIP_EOI_THREADED)) { in cond_unmask_eoi_irq()
676 chip->irq_eoi(&desc->irq_data); in cond_unmask_eoi_irq()
681 * handle_fasteoi_irq - irq handler for transparent controllers
684 * Only a single callback will be issued to the chip: an ->eoi()
691 struct irq_chip *chip = desc->irq_data.chip; in handle_fasteoi_irq() local
693 raw_spin_lock(&desc->lock); in handle_fasteoi_irq()
698 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_fasteoi_irq()
704 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { in handle_fasteoi_irq()
705 desc->istate |= IRQS_PENDING; in handle_fasteoi_irq()
711 if (desc->istate & IRQS_ONESHOT) in handle_fasteoi_irq()
716 cond_unmask_eoi_irq(desc, chip); in handle_fasteoi_irq()
718 raw_spin_unlock(&desc->lock); in handle_fasteoi_irq()
721 if (!(chip->flags & IRQCHIP_EOI_IF_HANDLED)) in handle_fasteoi_irq()
722 chip->irq_eoi(&desc->irq_data); in handle_fasteoi_irq()
723 raw_spin_unlock(&desc->lock); in handle_fasteoi_irq()
728 * handle_fasteoi_nmi - irq handler for NMI interrupt lines
731 * A simple NMI-safe handler, considering the restrictions
734 * Only a single callback will be issued to the chip: an ->eoi()
741 struct irq_chip *chip = irq_desc_get_chip(desc); in handle_fasteoi_nmi() local
742 struct irqaction *action = desc->action; in handle_fasteoi_nmi()
752 res = action->handler(irq, action->dev_id); in handle_fasteoi_nmi()
755 if (chip->irq_eoi) in handle_fasteoi_nmi()
756 chip->irq_eoi(&desc->irq_data); in handle_fasteoi_nmi()
761 * handle_edge_irq - edge type IRQ handler
764 * Interrupt occurs on the falling and/or rising edge of a hardware
767 * interrupt can happen on the same source even before the first one
769 * might be necessary to disable (mask) the interrupt depending on the
777 raw_spin_lock(&desc->lock); in handle_edge_irq()
779 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_edge_irq()
782 desc->istate |= IRQS_PENDING; in handle_edge_irq()
791 if (irqd_irq_disabled(&desc->irq_data) || !desc->action) { in handle_edge_irq()
792 desc->istate |= IRQS_PENDING; in handle_edge_irq()
800 desc->irq_data.chip->irq_ack(&desc->irq_data); in handle_edge_irq()
803 if (unlikely(!desc->action)) { in handle_edge_irq()
813 if (unlikely(desc->istate & IRQS_PENDING)) { in handle_edge_irq()
814 if (!irqd_irq_disabled(&desc->irq_data) && in handle_edge_irq()
815 irqd_irq_masked(&desc->irq_data)) in handle_edge_irq()
821 } while ((desc->istate & IRQS_PENDING) && in handle_edge_irq()
822 !irqd_irq_disabled(&desc->irq_data)); in handle_edge_irq()
825 raw_spin_unlock(&desc->lock); in handle_edge_irq()
831 * handle_edge_eoi_irq - edge eoi type IRQ handler
839 struct irq_chip *chip = irq_desc_get_chip(desc); in handle_edge_eoi_irq() local
841 raw_spin_lock(&desc->lock); in handle_edge_eoi_irq()
843 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_edge_eoi_irq()
846 desc->istate |= IRQS_PENDING; in handle_edge_eoi_irq()
854 if (irqd_irq_disabled(&desc->irq_data) || !desc->action) { in handle_edge_eoi_irq()
855 desc->istate |= IRQS_PENDING; in handle_edge_eoi_irq()
862 if (unlikely(!desc->action)) in handle_edge_eoi_irq()
867 } while ((desc->istate & IRQS_PENDING) && in handle_edge_eoi_irq()
868 !irqd_irq_disabled(&desc->irq_data)); in handle_edge_eoi_irq()
871 chip->irq_eoi(&desc->irq_data); in handle_edge_eoi_irq()
872 raw_spin_unlock(&desc->lock); in handle_edge_eoi_irq()
877 * handle_percpu_irq - Per CPU local irq handler
880 * Per CPU interrupts on SMP machines without locking requirements
884 struct irq_chip *chip = irq_desc_get_chip(desc); in handle_percpu_irq() local
888 * desc->tot_count. in handle_percpu_irq()
892 if (chip->irq_ack) in handle_percpu_irq()
893 chip->irq_ack(&desc->irq_data); in handle_percpu_irq()
897 if (chip->irq_eoi) in handle_percpu_irq()
898 chip->irq_eoi(&desc->irq_data); in handle_percpu_irq()
902 * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids
905 * Per CPU interrupts on SMP machines without locking requirements. Same as
908 * action->percpu_dev_id is a pointer to percpu variables which
909 * contain the real device id for the cpu on which this handler is
914 struct irq_chip *chip = irq_desc_get_chip(desc); in handle_percpu_devid_irq() local
915 struct irqaction *action = desc->action; in handle_percpu_devid_irq()
921 * desc->tot_count. in handle_percpu_devid_irq()
925 if (chip->irq_ack) in handle_percpu_devid_irq()
926 chip->irq_ack(&desc->irq_data); in handle_percpu_devid_irq()
930 res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id)); in handle_percpu_devid_irq()
934 bool enabled = cpumask_test_cpu(cpu, desc->percpu_enabled); in handle_percpu_devid_irq()
939 pr_err_once("Spurious%s percpu IRQ%u on CPU%u\n", in handle_percpu_devid_irq()
943 if (chip->irq_eoi) in handle_percpu_devid_irq()
944 chip->irq_eoi(&desc->irq_data); in handle_percpu_devid_irq()
948 * handle_percpu_devid_fasteoi_nmi - Per CPU local NMI handler with per cpu
957 struct irq_chip *chip = irq_desc_get_chip(desc); in handle_percpu_devid_fasteoi_nmi() local
958 struct irqaction *action = desc->action; in handle_percpu_devid_fasteoi_nmi()
965 res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id)); in handle_percpu_devid_fasteoi_nmi()
968 if (chip->irq_eoi) in handle_percpu_devid_fasteoi_nmi()
969 chip->irq_eoi(&desc->irq_data); in handle_percpu_devid_fasteoi_nmi()
979 struct irq_data *irq_data = &desc->irq_data; in __irq_do_set_handler()
983 * situation where the outermost chip is not yet set in __irq_do_set_handler()
989 if (irq_data->chip != &no_irq_chip) in __irq_do_set_handler()
992 * Bail out if the outer chip is not set up in __irq_do_set_handler()
999 irq_data = irq_data->parent_data; in __irq_do_set_handler()
1002 if (WARN_ON(!irq_data || irq_data->chip == &no_irq_chip)) in __irq_do_set_handler()
1008 if (desc->irq_data.chip != &no_irq_chip) in __irq_do_set_handler()
1012 desc->action = NULL; in __irq_do_set_handler()
1015 desc->depth = 1; in __irq_do_set_handler()
1017 desc->handle_irq = handle; in __irq_do_set_handler()
1018 desc->name = name; in __irq_do_set_handler()
1021 unsigned int type = irqd_get_trigger_type(&desc->irq_data); in __irq_do_set_handler()
1033 desc->handle_irq = handle; in __irq_do_set_handler()
1039 desc->action = &chained_action; in __irq_do_set_handler()
1070 desc->irq_common_data.handler_data = data; in irq_set_chained_handler_and_data()
1078 irq_set_chip_and_handler_name(unsigned int irq, const struct irq_chip *chip, in irq_set_chip_and_handler_name() argument
1081 irq_set_chip(irq, chip); in irq_set_chip_and_handler_name()
1095 * Warn when a driver sets the no autoenable flag on an already in irq_modify_status()
1098 WARN_ON_ONCE(!desc->depth && (set & _IRQ_NOAUTOEN)); in irq_modify_status()
1102 trigger = irqd_get_trigger_type(&desc->irq_data); in irq_modify_status()
1104 irqd_clear(&desc->irq_data, IRQD_NO_BALANCING | IRQD_PER_CPU | in irq_modify_status()
1107 irqd_set(&desc->irq_data, IRQD_NO_BALANCING); in irq_modify_status()
1109 irqd_set(&desc->irq_data, IRQD_PER_CPU); in irq_modify_status()
1111 irqd_set(&desc->irq_data, IRQD_MOVE_PCNTXT); in irq_modify_status()
1113 irqd_set(&desc->irq_data, IRQD_LEVEL); in irq_modify_status()
1119 irqd_set(&desc->irq_data, trigger); in irq_modify_status()
1127 * irq_cpu_online - Invoke all irq_cpu_online functions.
1129 * Iterate through all irqs and invoke the chip.irq_cpu_online()
1135 struct irq_chip *chip; in irq_cpu_online() local
1144 raw_spin_lock_irqsave(&desc->lock, flags); in irq_cpu_online()
1146 chip = irq_data_get_irq_chip(&desc->irq_data); in irq_cpu_online()
1147 if (chip && chip->irq_cpu_online && in irq_cpu_online()
1148 (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) || in irq_cpu_online()
1149 !irqd_irq_disabled(&desc->irq_data))) in irq_cpu_online()
1150 chip->irq_cpu_online(&desc->irq_data); in irq_cpu_online()
1152 raw_spin_unlock_irqrestore(&desc->lock, flags); in irq_cpu_online()
1157 * irq_cpu_offline - Invoke all irq_cpu_offline functions.
1159 * Iterate through all irqs and invoke the chip.irq_cpu_offline()
1165 struct irq_chip *chip; in irq_cpu_offline() local
1174 raw_spin_lock_irqsave(&desc->lock, flags); in irq_cpu_offline()
1176 chip = irq_data_get_irq_chip(&desc->irq_data); in irq_cpu_offline()
1177 if (chip && chip->irq_cpu_offline && in irq_cpu_offline()
1178 (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) || in irq_cpu_offline()
1179 !irqd_irq_disabled(&desc->irq_data))) in irq_cpu_offline()
1180 chip->irq_cpu_offline(&desc->irq_data); in irq_cpu_offline()
1182 raw_spin_unlock_irqrestore(&desc->lock, flags); in irq_cpu_offline()
1191 * handle_fasteoi_ack_irq - irq handler for edge hierarchy
1192 * stacked on transparent controllers
1197 * the irq_chip also needs to have its ->irq_ack() function
1202 struct irq_chip *chip = desc->irq_data.chip; in handle_fasteoi_ack_irq() local
1204 raw_spin_lock(&desc->lock); in handle_fasteoi_ack_irq()
1209 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_fasteoi_ack_irq()
1215 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { in handle_fasteoi_ack_irq()
1216 desc->istate |= IRQS_PENDING; in handle_fasteoi_ack_irq()
1222 if (desc->istate & IRQS_ONESHOT) in handle_fasteoi_ack_irq()
1226 desc->irq_data.chip->irq_ack(&desc->irq_data); in handle_fasteoi_ack_irq()
1230 cond_unmask_eoi_irq(desc, chip); in handle_fasteoi_ack_irq()
1232 raw_spin_unlock(&desc->lock); in handle_fasteoi_ack_irq()
1235 if (!(chip->flags & IRQCHIP_EOI_IF_HANDLED)) in handle_fasteoi_ack_irq()
1236 chip->irq_eoi(&desc->irq_data); in handle_fasteoi_ack_irq()
1237 raw_spin_unlock(&desc->lock); in handle_fasteoi_ack_irq()
1242 * handle_fasteoi_mask_irq - irq handler for level hierarchy
1243 * stacked on transparent controllers
1248 * the irq_chip also needs to have its ->irq_mask_ack() function
1253 struct irq_chip *chip = desc->irq_data.chip; in handle_fasteoi_mask_irq() local
1255 raw_spin_lock(&desc->lock); in handle_fasteoi_mask_irq()
1261 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); in handle_fasteoi_mask_irq()
1267 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { in handle_fasteoi_mask_irq()
1268 desc->istate |= IRQS_PENDING; in handle_fasteoi_mask_irq()
1274 if (desc->istate & IRQS_ONESHOT) in handle_fasteoi_mask_irq()
1279 cond_unmask_eoi_irq(desc, chip); in handle_fasteoi_mask_irq()
1281 raw_spin_unlock(&desc->lock); in handle_fasteoi_mask_irq()
1284 if (!(chip->flags & IRQCHIP_EOI_IF_HANDLED)) in handle_fasteoi_mask_irq()
1285 chip->irq_eoi(&desc->irq_data); in handle_fasteoi_mask_irq()
1286 raw_spin_unlock(&desc->lock); in handle_fasteoi_mask_irq()
1293 * irq_chip_set_parent_state - set the state of a parent interrupt.
1305 data = data->parent_data; in irq_chip_set_parent_state()
1307 if (!data || !data->chip->irq_set_irqchip_state) in irq_chip_set_parent_state()
1310 return data->chip->irq_set_irqchip_state(data, which, val); in irq_chip_set_parent_state()
1315 * irq_chip_get_parent_state - get the state of a parent interrupt.
1327 data = data->parent_data; in irq_chip_get_parent_state()
1329 if (!data || !data->chip->irq_get_irqchip_state) in irq_chip_get_parent_state()
1332 return data->chip->irq_get_irqchip_state(data, which, state); in irq_chip_get_parent_state()
1337 * irq_chip_enable_parent - Enable the parent interrupt (defaults to unmask if
1343 data = data->parent_data; in irq_chip_enable_parent()
1344 if (data->chip->irq_enable) in irq_chip_enable_parent()
1345 data->chip->irq_enable(data); in irq_chip_enable_parent()
1347 data->chip->irq_unmask(data); in irq_chip_enable_parent()
1352 * irq_chip_disable_parent - Disable the parent interrupt (defaults to mask if
1358 data = data->parent_data; in irq_chip_disable_parent()
1359 if (data->chip->irq_disable) in irq_chip_disable_parent()
1360 data->chip->irq_disable(data); in irq_chip_disable_parent()
1362 data->chip->irq_mask(data); in irq_chip_disable_parent()
1367 * irq_chip_ack_parent - Acknowledge the parent interrupt
1372 data = data->parent_data; in irq_chip_ack_parent()
1373 data->chip->irq_ack(data); in irq_chip_ack_parent()
1378 * irq_chip_mask_parent - Mask the parent interrupt
1383 data = data->parent_data; in irq_chip_mask_parent()
1384 data->chip->irq_mask(data); in irq_chip_mask_parent()
1389 * irq_chip_mask_ack_parent - Mask and acknowledge the parent interrupt
1394 data = data->parent_data; in irq_chip_mask_ack_parent()
1395 data->chip->irq_mask_ack(data); in irq_chip_mask_ack_parent()
1400 * irq_chip_unmask_parent - Unmask the parent interrupt
1405 data = data->parent_data; in irq_chip_unmask_parent()
1406 data->chip->irq_unmask(data); in irq_chip_unmask_parent()
1411 * irq_chip_eoi_parent - Invoke EOI on the parent interrupt
1416 data = data->parent_data; in irq_chip_eoi_parent()
1417 data->chip->irq_eoi(data); in irq_chip_eoi_parent()
1422 * irq_chip_set_affinity_parent - Set affinity on the parent interrupt
1427 * Conditional, as the underlying parent chip might not implement it.
1432 data = data->parent_data; in irq_chip_set_affinity_parent()
1433 if (data->chip->irq_set_affinity) in irq_chip_set_affinity_parent()
1434 return data->chip->irq_set_affinity(data, dest, force); in irq_chip_set_affinity_parent()
1436 return -ENOSYS; in irq_chip_set_affinity_parent()
1441 * irq_chip_set_type_parent - Set IRQ type on the parent interrupt
1443 * @type: IRQ_TYPE_{LEVEL,EDGE}_* value - see include/linux/irq.h
1445 * Conditional, as the underlying parent chip might not implement it.
1449 data = data->parent_data; in irq_chip_set_type_parent()
1451 if (data->chip->irq_set_type) in irq_chip_set_type_parent()
1452 return data->chip->irq_set_type(data, type); in irq_chip_set_type_parent()
1454 return -ENOSYS; in irq_chip_set_type_parent()
1459 * irq_chip_retrigger_hierarchy - Retrigger an interrupt in hardware
1467 for (data = data->parent_data; data; data = data->parent_data) in irq_chip_retrigger_hierarchy()
1468 if (data->chip && data->chip->irq_retrigger) in irq_chip_retrigger_hierarchy()
1469 return data->chip->irq_retrigger(data); in irq_chip_retrigger_hierarchy()
1476 * irq_chip_set_vcpu_affinity_parent - Set vcpu affinity on the parent interrupt
1482 data = data->parent_data; in irq_chip_set_vcpu_affinity_parent()
1483 if (data->chip->irq_set_vcpu_affinity) in irq_chip_set_vcpu_affinity_parent()
1484 return data->chip->irq_set_vcpu_affinity(data, vcpu_info); in irq_chip_set_vcpu_affinity_parent()
1486 return -ENOSYS; in irq_chip_set_vcpu_affinity_parent()
1490 * irq_chip_set_wake_parent - Set/reset wake-up on the parent interrupt
1492 * @on: Whether to set or reset the wake-up capability of this irq
1494 * Conditional, as the underlying parent chip might not implement it.
1496 int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on) in irq_chip_set_wake_parent() argument
1498 data = data->parent_data; in irq_chip_set_wake_parent()
1500 if (data->chip->flags & IRQCHIP_SKIP_SET_WAKE) in irq_chip_set_wake_parent()
1503 if (data->chip->irq_set_wake) in irq_chip_set_wake_parent()
1504 return data->chip->irq_set_wake(data, on); in irq_chip_set_wake_parent()
1506 return -ENOSYS; in irq_chip_set_wake_parent()
1511 * irq_chip_request_resources_parent - Request resources on the parent interrupt
1516 data = data->parent_data; in irq_chip_request_resources_parent()
1518 if (data->chip->irq_request_resources) in irq_chip_request_resources_parent()
1519 return data->chip->irq_request_resources(data); in irq_chip_request_resources_parent()
1521 /* no error on missing optional irq_chip::irq_request_resources */ in irq_chip_request_resources_parent()
1527 * irq_chip_release_resources_parent - Release resources on the parent interrupt
1532 data = data->parent_data; in irq_chip_release_resources_parent()
1533 if (data->chip->irq_release_resources) in irq_chip_release_resources_parent()
1534 data->chip->irq_release_resources(data); in irq_chip_release_resources_parent()
1540 * irq_chip_compose_msi_msg - Compose msi message for a irq chip
1544 * For hierarchical domains we find the first chip in the hierarchy
1546 * hierarchical we use the top level chip.
1553 if (data->chip && data->chip->irq_compose_msi_msg) in irq_chip_compose_msi_msg()
1558 return -ENOSYS; in irq_chip_compose_msi_msg()
1560 pos->chip->irq_compose_msi_msg(pos, msg); in irq_chip_compose_msi_msg()
1566 if (data->domain) in irq_get_parent_device()
1567 return data->domain->dev; in irq_get_parent_device()
1573 * irq_chip_pm_get - Enable power for an IRQ chip
1576 * Enable the power to the IRQ chip referenced by the interrupt data
1591 * irq_chip_pm_put - Disable power for an IRQ chip
1594 * Disable the power to the IRQ chip referenced by the interrupt data