Skip to content

Commit cd05766

Browse files
lvjianmin-loongsonMarc Zyngier
authored andcommitted
LoongArch: Use ACPI_GENERIC_GSI for gsi handling
For LoongArch, generic gsi code(driver/acpi/irq.c) can be reused after following patchs: APCI: irq: Add support for multiple GSI domains ACPI: irq: Allow acpi_gsi_to_irq() to have an arch-specific fallback So, config ACPI_GENERIC_GSI for LoongArch with removing the gsi code in arch directory. Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/1658314292-35346-6-git-send-email-lvjianmin@loongson.cn
1 parent d319a29 commit cd05766

File tree

2 files changed

+1
-65
lines changed

2 files changed

+1
-65
lines changed

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config LOONGARCH
33
bool
44
default y
5+
select ACPI_GENERIC_GSI if ACPI
56
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
67
select ARCH_BINFMT_ELF_STATE
78
select ARCH_ENABLE_MEMORY_HOTPLUG

arch/loongarch/kernel/acpi.c

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -25,78 +25,13 @@ EXPORT_SYMBOL(acpi_pci_disabled);
2525
int acpi_strict = 1; /* We have no workarounds on LoongArch */
2626
int num_processors;
2727
int disabled_cpus;
28-
enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
2928

3029
u64 acpi_saved_sp;
3130

3231
#define MAX_CORE_PIC 256
3332

3433
#define PREFIX "ACPI: "
3534

36-
int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
37-
{
38-
if (irqp != NULL)
39-
*irqp = acpi_register_gsi(NULL, gsi, -1, -1);
40-
return (*irqp >= 0) ? 0 : -EINVAL;
41-
}
42-
EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
43-
44-
int acpi_isa_irq_to_gsi(unsigned int isa_irq, u32 *gsi)
45-
{
46-
if (gsi)
47-
*gsi = isa_irq;
48-
return 0;
49-
}
50-
51-
/*
52-
* success: return IRQ number (>=0)
53-
* failure: return < 0
54-
*/
55-
int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
56-
{
57-
struct irq_fwspec fwspec;
58-
59-
switch (gsi) {
60-
case GSI_MIN_CPU_IRQ ... GSI_MAX_CPU_IRQ:
61-
fwspec.fwnode = liointc_domain->fwnode;
62-
fwspec.param[0] = gsi - GSI_MIN_CPU_IRQ;
63-
fwspec.param_count = 1;
64-
65-
return irq_create_fwspec_mapping(&fwspec);
66-
67-
case GSI_MIN_LPC_IRQ ... GSI_MAX_LPC_IRQ:
68-
if (!pch_lpc_domain)
69-
return -EINVAL;
70-
71-
fwspec.fwnode = pch_lpc_domain->fwnode;
72-
fwspec.param[0] = gsi - GSI_MIN_LPC_IRQ;
73-
fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity);
74-
fwspec.param_count = 2;
75-
76-
return irq_create_fwspec_mapping(&fwspec);
77-
78-
case GSI_MIN_PCH_IRQ ... GSI_MAX_PCH_IRQ:
79-
if (!pch_pic_domain[0])
80-
return -EINVAL;
81-
82-
fwspec.fwnode = pch_pic_domain[0]->fwnode;
83-
fwspec.param[0] = gsi - GSI_MIN_PCH_IRQ;
84-
fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
85-
fwspec.param_count = 2;
86-
87-
return irq_create_fwspec_mapping(&fwspec);
88-
}
89-
90-
return -EINVAL;
91-
}
92-
EXPORT_SYMBOL_GPL(acpi_register_gsi);
93-
94-
void acpi_unregister_gsi(u32 gsi)
95-
{
96-
97-
}
98-
EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
99-
10035
void __init __iomem * __acpi_map_table(unsigned long phys, unsigned long size)
10136
{
10237

0 commit comments

Comments
 (0)