From owner-freebsd-i386@FreeBSD.ORG Thu Nov 6 10:20:01 2008 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA4191065692 for ; Thu, 6 Nov 2008 10:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BABA88FC08 for ; Thu, 6 Nov 2008 10:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6AK1nJ020856 for ; Thu, 6 Nov 2008 10:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mA6AK12P020855; Thu, 6 Nov 2008 10:20:01 GMT (envelope-from gnats) Resent-Date: Thu, 6 Nov 2008 10:20:01 GMT Resent-Message-Id: <200811061020.mA6AK12P020855@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Akira Funahashi Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 479261065679 for ; Thu, 6 Nov 2008 10:18:40 +0000 (UTC) (envelope-from funa@funa.org) Received: from mail.fun.bio.keio.ac.jp (ns.fun.bio.keio.ac.jp [131.113.63.81]) by mx1.freebsd.org (Postfix) with SMTP id DCB6B8FC29 for ; Thu, 6 Nov 2008 10:18:39 +0000 (UTC) (envelope-from funa@funa.org) Received: (qmail 50993 invoked by uid 11960); 6 Nov 2008 09:51:57 -0000 Message-Id: <20081106095157.50992.qmail@mail.fun.bio.keio.ac.jp> Date: 6 Nov 2008 18:51:57 +0900 From: Akira Funahashi To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: rpaulo@FreeBSD.org Subject: i386/128639: [PATCH] acpi for ASUS A6F,A3E,A3F,A3N not working X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Akira Funahashi List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 10:20:02 -0000 >Number: 128639 >Category: i386 >Synopsis: [PATCH] acpi for ASUS A6F,A3E,A3F,A3N not working >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Nov 06 10:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Akira Funahashi >Release: FreeBSD 7.0-RELEASE i386 >Organization: >Environment: System: FreeBSD ochibi 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Fri Dec 28 14:42:51 JST 2007 root@ochibi:/usr/obj/usr/src/sys/OCHIBI i386 >Description: Acpi for ASUS A6F, A3E, A3F won't work due to the fact that the current acpi_asus.c doesn't have an entry for above configuration. >How-To-Repeat: # kldload acpi_asus acpi_asus0: Unsupported Asus laptop: A6F >Fix: I've created a patch for 7.0-RELEASE which will support ASUS A3E, A3F and A6F. This patch also includes some fix to A3N, which seems to be not working for hw.acpi.asus.lcd_brightness. This patch also includes EeePC support, which already included in the source tree. --- acpi_asus.c.diff begins here --- --- acpi_asus.c.dist 2007-06-03 06:10:00.000000000 +0900 +++ acpi_asus.c 2008-04-15 22:47:29.000000000 +0900 @@ -146,16 +146,39 @@ .disp_set = "SDSP" }, { + .name = "A3E", + .mled_set = "MLED", + .wled_set = "WLED", + .lcd_get = "\\_SB.PCI0.SBRG.EC0.RPIN(0x67)", + .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", + .brn_set = "SPLV", + .disp_get = "\\_SB.PCI0.P0P2.VGA.GETD", + .disp_set = "SDSP" + }, + { + .name = "A3F", + .mled_set = "MLED", + .wled_set = "WLED", + .bled_set = "BLED", + .lcd_get = "\\_SB.PCI0.SBRG.EC0.RPIN(0x11)", + .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", + .brn_set = "SPLV", + .disp_get = "\\SSTE", + .disp_set = "SDSP" + }, + { .name = "A3N", .mled_set = "MLED", .bled_set = "BLED", .wled_set = "WLED", - .lcd_get = NULL, + .lcd_get = "\\BKLT", .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", .brn_set = "SPLV", - .brn_get = "SDSP", - .disp_set = "SDSP", - .disp_get = "\\_SB.PCI0.P0P3.VGA.GETD" + .disp_get = "\\_SB.PCI0.P0P3.VGA.GETD", + .disp_set = "SDSP" }, { .name = "A4D", @@ -354,6 +377,20 @@ { .name = NULL } }; +/* + * EeePC have an Asus ASUS010 gadget interface, + * but they can't be probed quite the same way as Asus laptops. + */ +static struct acpi_asus_model acpi_eeepc_models[] = { + { + .name = "EEE", + .brn_get = "\\_SB.ATKD.PBLG", + .brn_set = "\\_SB.ATKD.PBLS" + }, + + { .name = NULL } +}; + static struct { char *name; char *description; @@ -423,13 +460,17 @@ ACPI_BUFFER Buf; ACPI_OBJECT Arg, *Obj; ACPI_OBJECT_LIST Args; - static char *asus_ids[] = { "ATK0100", NULL }; + static char *asus_ids[] = { "ATK0100", "ASUS010", NULL }; + char *rstr; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - if (acpi_disabled("asus") || - ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids) == NULL) + if (acpi_disabled("asus")) return (ENXIO); + rstr = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids); + if (rstr == NULL) { + return (ENXIO); + } sc = device_get_softc(dev); sc->dev = dev; @@ -468,6 +509,14 @@ AcpiOsFree(Buf.Pointer); return (0); } + + /* if EeePC */ + if(strncmp("ASUS010", rstr, 7) == 0) { + sc->model = &acpi_eeepc_models[0]; + device_set_desc(dev, "ASUS EeePC"); + AcpiOsFree(Buf.Pointer); + return (0); + } } sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); @@ -511,6 +560,9 @@ else if (strncmp(model->name, "A2x", 3) == 0 && strncmp(Obj->String.Pointer, "A2", 2) == 0) goto good; + else if (strncmp(model->name, "A3F", 3) == 0 && + strncmp(Obj->String.Pointer, "A6F", 3) == 0) + goto good; else if (strncmp(model->name, "D1x", 3) == 0 && strncmp(Obj->String.Pointer, "D1", 2) == 0) goto good; --- acpi_asus.c.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: