Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

LoongArch: Move irqchip function prototypes to irq-loongson.h

Some irqchip functions are only for internal use by irqchip drivers, so
move their prototypes from asm/irq.h to drivers/irqchip/irq-loongson.h.

All related driver files include the new irq-loongson.h.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240823103936.25092-1-zhangtianyang@loongson.cn

authored by

Huacai Chen and committed by
Thomas Gleixner
06fac729 0b3af759

+38 -14
-14
arch/loongarch/include/asm/irq.h
··· 88 88 struct acpi_madt_msi_pic; 89 89 struct acpi_madt_lpc_pic; 90 90 91 - int liointc_acpi_init(struct irq_domain *parent, 92 - struct acpi_madt_lio_pic *acpi_liointc); 93 - int eiointc_acpi_init(struct irq_domain *parent, 94 - struct acpi_madt_eio_pic *acpi_eiointc); 95 - 96 - int htvec_acpi_init(struct irq_domain *parent, 97 - struct acpi_madt_ht_pic *acpi_htvec); 98 - int pch_lpc_acpi_init(struct irq_domain *parent, 99 - struct acpi_madt_lpc_pic *acpi_pchlpc); 100 - int pch_msi_acpi_init(struct irq_domain *parent, 101 - struct acpi_madt_msi_pic *acpi_pchmsi); 102 - int pch_pic_acpi_init(struct irq_domain *parent, 103 - struct acpi_madt_bio_pic *acpi_pchpic); 104 - int find_pch_pic(u32 gsi); 105 91 struct fwnode_handle *get_pch_msi_handle(int pci_segment); 106 92 107 93 extern struct acpi_madt_lio_pic *acpi_liointc;
+2
drivers/irqchip/irq-loongarch-cpu.c
··· 13 13 #include <asm/loongarch.h> 14 14 #include <asm/setup.h> 15 15 16 + #include "irq-loongson.h" 17 + 16 18 static struct irq_domain *irq_domain; 17 19 struct fwnode_handle *cpuintc_handle; 18 20
+2
drivers/irqchip/irq-loongson-eiointc.c
··· 17 17 #include <linux/syscore_ops.h> 18 18 #include <asm/numa.h> 19 19 20 + #include "irq-loongson.h" 21 + 20 22 #define EIOINTC_REG_NODEMAP 0x14a0 21 23 #define EIOINTC_REG_IPMAP 0x14c0 22 24 #define EIOINTC_REG_ENABLE 0x1600
+2
drivers/irqchip/irq-loongson-htvec.c
··· 17 17 #include <linux/of_irq.h> 18 18 #include <linux/syscore_ops.h> 19 19 20 + #include "irq-loongson.h" 21 + 20 22 /* Registers */ 21 23 #define HTVEC_EN_OFF 0x20 22 24 #define HTVEC_MAX_PARENT_IRQ 8
+2
drivers/irqchip/irq-loongson-liointc.c
··· 22 22 #include <asm/loongson.h> 23 23 #endif 24 24 25 + #include "irq-loongson.h" 26 + 25 27 #define LIOINTC_CHIP_IRQ 32 26 28 #define LIOINTC_NUM_PARENT 4 27 29 #define LIOINTC_NUM_CORES 4
+2
drivers/irqchip/irq-loongson-pch-lpc.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/syscore_ops.h> 17 17 18 + #include "irq-loongson.h" 19 + 18 20 /* Registers */ 19 21 #define LPC_INT_CTL 0x00 20 22 #define LPC_INT_ENA 0x04
+1
drivers/irqchip/irq-loongson-pch-msi.c
··· 16 16 #include <linux/slab.h> 17 17 18 18 #include "irq-msi-lib.h" 19 + #include "irq-loongson.h" 19 20 20 21 static int nr_pics; 21 22
+2
drivers/irqchip/irq-loongson-pch-pic.c
··· 17 17 #include <linux/of_irq.h> 18 18 #include <linux/syscore_ops.h> 19 19 20 + #include "irq-loongson.h" 21 + 20 22 /* Registers */ 21 23 #define PCH_PIC_MASK 0x20 22 24 #define PCH_PIC_HTMSI_EN 0x40
+25
drivers/irqchip/irq-loongson.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2024 Loongson Technology Corporation Limited 4 + */ 5 + 6 + #ifndef _DRIVERS_IRQCHIP_IRQ_LOONGSON_H 7 + #define _DRIVERS_IRQCHIP_IRQ_LOONGSON_H 8 + 9 + int find_pch_pic(u32 gsi); 10 + 11 + int liointc_acpi_init(struct irq_domain *parent, 12 + struct acpi_madt_lio_pic *acpi_liointc); 13 + int eiointc_acpi_init(struct irq_domain *parent, 14 + struct acpi_madt_eio_pic *acpi_eiointc); 15 + 16 + int htvec_acpi_init(struct irq_domain *parent, 17 + struct acpi_madt_ht_pic *acpi_htvec); 18 + int pch_lpc_acpi_init(struct irq_domain *parent, 19 + struct acpi_madt_lpc_pic *acpi_pchlpc); 20 + int pch_pic_acpi_init(struct irq_domain *parent, 21 + struct acpi_madt_bio_pic *acpi_pchpic); 22 + int pch_msi_acpi_init(struct irq_domain *parent, 23 + struct acpi_madt_msi_pic *acpi_pchmsi); 24 + 25 + #endif /* _DRIVERS_IRQCHIP_IRQ_LOONGSON_H */