From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Feb 26 00:40:01 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B640E16A403 for ; Tue, 26 Feb 2008 00:40: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 97F0913C4F0 for ; Tue, 26 Feb 2008 00:40: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.2/8.14.2) with ESMTP id m1Q0e1Vv097887 for ; Tue, 26 Feb 2008 00:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1Q0e1fl097886; Tue, 26 Feb 2008 00:40:01 GMT (envelope-from gnats) Resent-Date: Tue, 26 Feb 2008 00:40:01 GMT Resent-Message-Id: <200802260040.m1Q0e1fl097886@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Anish Mistry" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CFDA16A403 for ; Tue, 26 Feb 2008 00:37:51 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from flpi101.prodigy.net (flpi101.sbcis.sbc.com [207.115.20.70]) by mx1.freebsd.org (Postfix) with ESMTP id 2B56E13C4E5 for ; Tue, 26 Feb 2008 00:37:50 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from bigguy.am-productions.biz (adsl-68-77-177-92.dsl.wotnoh.ameritech.net [68.77.177.92]) by flpi101.prodigy.net (8.13.8 out.dk.spool/8.13.8) with ESMTP id m1Q0bnDp021172 for ; Mon, 25 Feb 2008 16:37:49 -0800 Message-Id: <1203986562.85295@bigguy.am-productions.biz> Date: Mon, 25 Feb 2008 19:42:42 -0500 From: "Anish Mistry" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.8 Cc: Subject: ports/121102: Update acpi_fujitsu for the P8010 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 00:40:01 -0000 >Number: 121102 >Category: ports >Synopsis: Update acpi_fujitsu for the P8010 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 26 00:40:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Anish Mistry >Release: FreeBSD 7.0-RELEASE amd64 >Organization: AM Productions >Environment: FreeBSD smallguy.am-productions.biz 7.0-RELEASE FreeBSD 7.0-RELEASE #1: Mon Feb 25 18:43:50 EST 2008 root@smallguy.am-productions.biz:/usr/obj/usr/src/sys/SMALLGUY amd64 >Description: acpi_fujitsu only partially works on the P8010. There are a few issues. 1) The ASL calls out to "External" methods. I don't know how to hook OS code into that external call. Consequently whenever the mouse enable/disable or brightness is press ACPI tells us that there is no method. After looking at the ASL there are Windows version checks and if it can't match a version is falls back to the Windows 2006 settings. ie. Calls the external method. 2) Since there is compatibility code for Windows XP we'll use that and set our hw.acpi.osname="Windows 2001" Unfortunately this doesn't work. The OsdTable patch fixes this problem so that we can actually override the OS name. 3) Now that we can fall back to the "compatibility" mode we can handle the button events. Add the METHOD_GBLS and associated code to handle the "new" brightness changing method in compatibility mode. http://am-productions.biz/docs/smallguy.asl I need some older P Series users to test this out just so it doesn't break anything. This isn't ready to commit, I just want to get it out there so others can have thier hotkeys working. >How-To-Repeat: >Fix: --- acpi_fujitsu-p8010.patch begins here --- --- acpi_fujitsu.c.orig 2008-02-25 17:50:02.000000000 -0500 +++ acpi_fujitsu.c 2008-02-25 19:15:04.000000000 -0500 @@ -64,8 +64,9 @@ #define VOLUME_CHANGED 0x04 #define MOUSE_CHANGED 0x08 /* - * It is unknown which hotkey this bit is supposed to indicate, but - * according to values from GSIF this is a valid flag. + * On the P8010 this indicated a backlight change event when + * Running under a Windows OS that is not Windows 2006 + * We get here by overriding hw.acpi.osname */ #define UNKNOWN_CHANGED 0x10 @@ -84,6 +85,7 @@ #define METHOD_RVOL 6 #define METHOD_GSIF 7 #define METHOD_GHKS 8 +#define METHOD_GBLS 9 /* Notify event */ #define ACPI_NOTIFY_STATUS_CHANGED 0x80 @@ -108,6 +110,7 @@ /* Control methods */ struct int_nameval _sta, /* unused */ gbll, /* brightness */ + gbls, /* get brightness state */ ghks, /* hotkey selector */ gbuf, /* unused (buffer?) */ gmou, /* mouse */ @@ -189,6 +192,11 @@ .description = "Brightness level of the LCD panel" }, { + .name = "backlight", + .method = METHOD_GBLS, + .description = "P8XXX Backlight State" + }, + { .name = "volume", .method = METHOD_GVOL, .description = "Speakers/headphones volume level" @@ -358,6 +366,7 @@ /* Setup all of the names for each control method */ sc->_sta.name = "_STA"; sc->gbll.name = "GBLL"; + sc->gbls.name = "GBLS"; sc->ghks.name = "GHKS"; sc->gmou.name = "GMOU"; sc->gsif.name = "GSIF"; @@ -386,6 +395,9 @@ case METHOD_GBLL: exists = sc->gbll.exists; break; + case METHOD_GBLS: + exists = sc->gbls.exists; + break; case METHOD_GVOL: case METHOD_MUTE: exists = sc->gvol.exists; @@ -462,6 +474,9 @@ case METHOD_GBLL: nv = sc->gbll; break; + case METHOD_GBLS: + nv = sc->gbls; + break; case METHOD_GMOU: nv = sc->gmou; break; @@ -519,6 +534,11 @@ control = "SBLL"; nv = sc->gbll; break; + case METHOD_GBLS: + changed = BRIGHT_CHANGED; + control = "SBL2"; + nv = sc->gbls; + break; case METHOD_GMOU: changed = MOUSE_CHANGED; control = "SMOU"; @@ -608,6 +628,13 @@ } if (ACPI_FAILURE(acpi_GetInteger(sc->handle, + sc->gbls.name, &val))) { + sc->gbls.exists = 0; + } else { + sc->gbls.exists = 1; + } + + if (ACPI_FAILURE(acpi_GetInteger(sc->handle, sc->rbll.name, &val))) { sc->rbll.exists = 0; } else { @@ -683,6 +710,9 @@ /* Clear the modification bit */ sc->gmou.value &= MOUSE_SETTING_BITS; + /* Set the value in case it is not hardware controlled */ + acpi_fujitsu_method_set(sc, METHOD_GMOU, sc->gmou.value); + acpi_UserNotify("FUJITSU", sc->handle, FN_POINTER_ENABLE); ACPI_VPRINT(sc->dev, acpi_sc, "Internal pointer is now %s\n", @@ -690,6 +720,29 @@ } } + /* Screen Brightness P8XXX */ + if(sc->gbls.exists) { + if (ACPI_FAILURE(acpi_GetInteger(sc->handle, + sc->gbls.name, &(sc->gbls.value)))) { + device_printf(sc->dev, "Couldn't query P8XXX brightness level\n"); + return (FALSE); + } + if (changed & BRIGHT_CHANGED) { + /* No state to record here. */ + + /* Clear the modification bit */ + sc->gbls.value &= BRIGHTNESS_SETTING_BITS; + + /* Set the value in case it is not hardware controlled */ + acpi_fujitsu_method_set(sc, METHOD_GBLS, sc->gbls.value); + + acpi_UserNotify("FUJITSU", sc->handle, FN_LCD_BRIGHTNESS); + + ACPI_VPRINT(sc->dev, acpi_sc, "P8XXX Brightness level is now %d\n", + sc->gbls.value); + } + } + /* Screen Brightness Level */ if(sc->gbll.exists) { if (ACPI_FAILURE(acpi_GetInteger(sc->handle, --- acpi_fujitsu-p8010.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: