Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
95d77884 EB |
2 | #ifndef LINUX_HTIRQ_H |
3 | #define LINUX_HTIRQ_H | |
4 | ||
49e07d8f JL |
5 | struct pci_dev; |
6 | struct irq_data; | |
7 | ||
ec68307c EB |
8 | struct ht_irq_msg { |
9 | u32 address_lo; /* low 32 bits of the ht irq message */ | |
10 | u32 address_hi; /* high 32 bits of the it irq message */ | |
11 | }; | |
12 | ||
49e07d8f JL |
13 | typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq, |
14 | struct ht_irq_msg *msg); | |
15 | ||
16 | struct ht_irq_cfg { | |
17 | struct pci_dev *dev; | |
18 | /* Update callback used to cope with buggy hardware */ | |
19 | ht_irq_update_t *update; | |
20 | unsigned pos; | |
21 | unsigned idx; | |
22 | struct ht_irq_msg msg; | |
23 | }; | |
24 | ||
95d77884 | 25 | /* Helper functions.. */ |
ec68307c EB |
26 | void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg); |
27 | void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg); | |
e9f7ac66 TG |
28 | void mask_ht_irq(struct irq_data *data); |
29 | void unmask_ht_irq(struct irq_data *data); | |
95d77884 EB |
30 | |
31 | /* The arch hook for getting things started */ | |
49e07d8f JL |
32 | int arch_setup_ht_irq(int idx, int pos, struct pci_dev *dev, |
33 | ht_irq_update_t *update); | |
34 | void arch_teardown_ht_irq(unsigned int irq); | |
95d77884 | 35 | |
43539c38 | 36 | /* For drivers of buggy hardware */ |
43539c38 EB |
37 | int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update); |
38 | ||
95d77884 | 39 | #endif /* LINUX_HTIRQ_H */ |