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
This commit is contained in:
parent
d319a299f4
commit
cd05766758
@ -2,6 +2,7 @@
|
||||
config LOONGARCH
|
||||
bool
|
||||
default y
|
||||
select ACPI_GENERIC_GSI if ACPI
|
||||
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
|
||||
select ARCH_BINFMT_ELF_STATE
|
||||
select ARCH_ENABLE_MEMORY_HOTPLUG
|
||||
|
@ -25,7 +25,6 @@ EXPORT_SYMBOL(acpi_pci_disabled);
|
||||
int acpi_strict = 1; /* We have no workarounds on LoongArch */
|
||||
int num_processors;
|
||||
int disabled_cpus;
|
||||
enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
|
||||
|
||||
u64 acpi_saved_sp;
|
||||
|
||||
@ -33,70 +32,6 @@ u64 acpi_saved_sp;
|
||||
|
||||
#define PREFIX "ACPI: "
|
||||
|
||||
int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
|
||||
{
|
||||
if (irqp != NULL)
|
||||
*irqp = acpi_register_gsi(NULL, gsi, -1, -1);
|
||||
return (*irqp >= 0) ? 0 : -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
|
||||
|
||||
int acpi_isa_irq_to_gsi(unsigned int isa_irq, u32 *gsi)
|
||||
{
|
||||
if (gsi)
|
||||
*gsi = isa_irq;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* success: return IRQ number (>=0)
|
||||
* failure: return < 0
|
||||
*/
|
||||
int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
|
||||
{
|
||||
struct irq_fwspec fwspec;
|
||||
|
||||
switch (gsi) {
|
||||
case GSI_MIN_CPU_IRQ ... GSI_MAX_CPU_IRQ:
|
||||
fwspec.fwnode = liointc_domain->fwnode;
|
||||
fwspec.param[0] = gsi - GSI_MIN_CPU_IRQ;
|
||||
fwspec.param_count = 1;
|
||||
|
||||
return irq_create_fwspec_mapping(&fwspec);
|
||||
|
||||
case GSI_MIN_LPC_IRQ ... GSI_MAX_LPC_IRQ:
|
||||
if (!pch_lpc_domain)
|
||||
return -EINVAL;
|
||||
|
||||
fwspec.fwnode = pch_lpc_domain->fwnode;
|
||||
fwspec.param[0] = gsi - GSI_MIN_LPC_IRQ;
|
||||
fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity);
|
||||
fwspec.param_count = 2;
|
||||
|
||||
return irq_create_fwspec_mapping(&fwspec);
|
||||
|
||||
case GSI_MIN_PCH_IRQ ... GSI_MAX_PCH_IRQ:
|
||||
if (!pch_pic_domain[0])
|
||||
return -EINVAL;
|
||||
|
||||
fwspec.fwnode = pch_pic_domain[0]->fwnode;
|
||||
fwspec.param[0] = gsi - GSI_MIN_PCH_IRQ;
|
||||
fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
|
||||
fwspec.param_count = 2;
|
||||
|
||||
return irq_create_fwspec_mapping(&fwspec);
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_register_gsi);
|
||||
|
||||
void acpi_unregister_gsi(u32 gsi)
|
||||
{
|
||||
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
|
||||
|
||||
void __init __iomem * __acpi_map_table(unsigned long phys, unsigned long size)
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user