Commit f4c869b9 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] Add HP AGP 8x bridge and fix ACPI claim

The following patch to the HP ZX1 GART driver
- adds recognition of the "HWP0007" device (an AGP 8X bridge)
- fixes the use of acpi_get_devices()

The problem with acpi_get_devices() is that it always returns AE_OK,
except when the callback (zx1_gart_probe()) returns a failure.  That
means agp_hp_init() cannot use the status from acpi_get_devices()
to distinguish between (1) an AGP bridge was found and successfully
initialized, and (2) no AGP bridge was found at all.
parent 7693c69c
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
/* AGP bridge need not be PCI device, but DRM thinks it is. */ /* AGP bridge need not be PCI device, but DRM thinks it is. */
static struct pci_dev fake_bridge_dev; static struct pci_dev fake_bridge_dev;
static int hp_zx1_gart_found;
static struct aper_size_info_fixed hp_zx1_sizes[] = static struct aper_size_info_fixed hp_zx1_sizes[] =
{ {
{0, 0, 0}, /* filled in by hp_zx1_fetch_size() */ {0, 0, 0}, /* filled in by hp_zx1_fetch_size() */
...@@ -386,8 +388,6 @@ hp_zx1_setup (u64 ioc_hpa, u64 lba_hpa) ...@@ -386,8 +388,6 @@ hp_zx1_setup (u64 ioc_hpa, u64 lba_hpa)
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
int error; int error;
printk(KERN_INFO PFX "Detected HP ZX1 AGP chipset (ioc=%lx, lba=%lx)\n", ioc_hpa, lba_hpa);
error = hp_zx1_ioc_init(ioc_hpa, lba_hpa); error = hp_zx1_ioc_init(ioc_hpa, lba_hpa);
if (error) if (error)
return error; return error;
...@@ -416,7 +416,7 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) ...@@ -416,7 +416,7 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
status = hp_acpi_csr_space(obj, &lba_hpa, &length); status = hp_acpi_csr_space(obj, &lba_hpa, &length);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return 1; return AE_OK;
/* Look for an enclosing IOC scope and find its CSR space */ /* Look for an enclosing IOC scope and find its CSR space */
handle = obj; handle = obj;
...@@ -436,7 +436,7 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) ...@@ -436,7 +436,7 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
else { else {
printk(KERN_ERR PFX "Detected HP ZX1 " printk(KERN_ERR PFX "Detected HP ZX1 "
"AGP LBA but no IOC.\n"); "AGP LBA but no IOC.\n");
return status; return AE_OK;
} }
} }
} }
...@@ -446,22 +446,28 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) ...@@ -446,22 +446,28 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
} while (ACPI_SUCCESS(status)); } while (ACPI_SUCCESS(status));
if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa))
return 1; return AE_OK;
return 0;
printk(KERN_INFO PFX "Detected HP ZX1 %s AGP chipset (ioc=%lx, lba=%lx)\n",
(char *) context, sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa);
hp_zx1_gart_found = 1;
return AE_CTRL_TERMINATE;
} }
static int __init static int __init
agp_hp_init (void) agp_hp_init (void)
{ {
acpi_status status;
status = acpi_get_devices("HWP0003", zx1_gart_probe, "HWP0003 AGP LBA", NULL); acpi_get_devices("HWP0003", zx1_gart_probe, "HWP0003", NULL);
if (!(ACPI_SUCCESS(status))) { if (hp_zx1_gart_found)
agp_bridge->type = NOT_SUPPORTED; return 0;
printk(KERN_INFO PFX "Failed to initialize zx1 AGP.\n");
return -ENODEV; acpi_get_devices("HWP0007", zx1_gart_probe, "HWP0007", NULL);
} if (hp_zx1_gart_found)
return 0; return 0;
return -ENODEV;
} }
static void __exit static void __exit
......
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