Merge tag 'gpio-v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/linusw...
[sfrench/cifs-2.6.git] / include / linux / htirq.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_HTIRQ_H
3 #define LINUX_HTIRQ_H
4
5 struct pci_dev;
6 struct irq_data;
7
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
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
25 /* Helper functions.. */
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);
28 void mask_ht_irq(struct irq_data *data);
29 void unmask_ht_irq(struct irq_data *data);
30
31 /* The arch hook for getting things started */
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);
35
36 /* For drivers of buggy hardware */
37 int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update);
38
39 #endif /* LINUX_HTIRQ_H */