From owner-freebsd-current Thu Mar 6 2:48:51 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0801637B401 for ; Thu, 6 Mar 2003 02:48:49 -0800 (PST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id E770B43F75 for ; Thu, 6 Mar 2003 02:48:47 -0800 (PST) (envelope-from junyer@gmx.net) Received: (qmail 25544 invoked by uid 0); 6 Mar 2003 10:48:45 -0000 Received: from nyquil.insomnia.org (HELO wdcax3-053.dialup.optusnet.com.au) (66.92.123.123) by mail.gmx.net (mp018-rz3) with SMTP; 6 Mar 2003 10:48:45 -0000 Message-Id: <3.0.5.16.20030306205021.0d4f5062@localhost> X-Sender: 13042779@localhost X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (16) Date: Thu, 06 Mar 2003 20:50:21 +1000 To: freebsd-current@freebsd.org From: Paul Wankadia Subject: Re: Sony VAIO, psm and acpi Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 05:11 PM 6/03/03 +0900, User Takawata wrote: >I also wrote it before. But I didn't commit because I don't tested it. >If you tested your patch, I'll willing to commit. Aye, I did this on my VAIO (PCG-GRX5P) and it seems to work fine... --- acpi.c.old Thu Mar 6 18:48:48 2003 +++ acpi.c Thu Mar 6 19:03:29 2003 @@ -107,6 +107,7 @@ u_long start, u_long end, u_long count, u_int flags); static int acpi_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r); static u_int32_t acpi_isa_get_logicalid(device_t dev); +static u_int32_t acpi_isa_get_compatid(device_t dev); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); static void acpi_probe_children(device_t bus); @@ -719,11 +720,38 @@ return_VALUE(pnpid); } +static u_int32_t +acpi_isa_get_compatid(device_t dev) +{ + ACPI_HANDLE h; + ACPI_DEVICE_INFO devinfo; + ACPI_STATUS error; + u_int32_t pnpid; + ACPI_LOCK_DECL; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + pnpid = 0; + ACPI_LOCK; + + /* fetch and validate the HID */ + if ((h = acpi_get_handle(dev)) == NULL) + goto out; + if (ACPI_FAILURE(error = AcpiGetObjectInfo(h, &devinfo))) + goto out; + if (ACPI_FAILURE(error = acpi_EvaluateInteger(h, "_CID", &pnpid))) + goto out; + +out: + ACPI_UNLOCK; + return_VALUE(pnpid); +} + static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids) { int result; - u_int32_t pnpid; + u_int32_t lid, cid; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -735,9 +763,10 @@ result = ENXIO; /* scan the supplied IDs for a match */ - pnpid = acpi_isa_get_logicalid(child); + lid = acpi_isa_get_logicalid(child); + cid = acpi_isa_get_compatid(child); while (ids && ids->ip_id) { - if (pnpid == ids->ip_id) { + if (lid == ids->ip_id || cid == ids->ip_id) { result = 0; goto out; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message