Commit c5b0f11b authored by Andy Grover's avatar Andy Grover

ACPI: Fix IRQ assignment on Tiger (JI Lee)

parent cb699d3d
/******************************************************************************
*
* Module Name: evrgnini- ACPI Address_space (Op_region) init
* $Revision: 63 $
* $Revision: 64 $
*
*****************************************************************************/
......@@ -269,6 +269,11 @@ acpi_ev_pci_config_region_setup (
pci_id->bus = ACPI_LOWORD (temp);
}
/*
* Complete this device's Pci_id
*/
acpi_os_derive_pci_id (node, region_obj->region.node, &pci_id);
*region_context = pci_id;
return_ACPI_STATUS (AE_OK);
}
......
......@@ -246,6 +246,14 @@ acpi_os_write_pci_configuration (
acpi_integer value,
u32 width);
/*
* Interim function needed for PCI IRQ routing
*/
void
acpi_os_derive_pci_id(
acpi_handle rhandle,
acpi_handle chandle,
acpi_pci_id **pci_id);
/*
* Miscellaneous
......
......@@ -36,6 +36,7 @@
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <asm/io.h>
#include "acpi_bus.h"
#include "acpi.h"
#ifdef CONFIG_ACPI_EFI
......@@ -483,6 +484,44 @@ acpi_os_write_pci_configuration (
return (result ? AE_ERROR : AE_OK);
}
/* TODO: Rewrite this code!!! */
void
acpi_os_derive_pci_id (
acpi_handle rhandle, /* upper bound */
acpi_handle chandle, /* current node */
acpi_pci_id **id)
{
acpi_handle handle;
acpi_pci_id *pci_id = *id;
acpi_status status;
unsigned long temp;
acpi_object_type type;
u8 tu8;
acpi_get_parent(chandle, &handle);
if (handle != rhandle) {
acpi_os_derive_pci_id(rhandle, handle, &pci_id);
status = acpi_get_type(handle, &type);
if ( (ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE) )
return;
status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &temp);
if (ACPI_SUCCESS(status)) {
pci_id->device = ACPI_HIWORD (ACPI_LODWORD (temp));
pci_id->function = ACPI_LOWORD (ACPI_LODWORD (temp));
/* any nicer way to get bus number of bridge ? */
status = acpi_os_read_pci_configuration(pci_id, 0x0e, &tu8, 8);
if (ACPI_SUCCESS(status) && (tu8 & 0x7f) == 1) {
status = acpi_os_read_pci_configuration(pci_id, 0x19, &tu8, 8);
if (ACPI_SUCCESS(status))
pci_id->bus = tu8;
}
}
}
}
#else /*!CONFIG_ACPI_PCI*/
acpi_status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment