From amistry@am-productions.biz  Tue Feb 26 00:37:51 2008
Return-Path: <amistry@am-productions.biz>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CFDA16A403
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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" <amistry@am-productions.biz>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Subject: Update acpi_fujitsu for the P8010
X-Send-Pr-Version: gtk-send-pr 0.4.8 
X-GNATS-Notify:

>Number:         121102
>Category:       kern
>Synopsis:       [acpi] [patch] update acpi_fujitsu for the P8010
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    avg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 26 00:40:01 UTC 2008
>Closed-Date:    Fri Mar 11 18:11:16 UTC 2011
>Last-Modified:  Fri Mar 11 18:20:10 UTC 2011
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-bugs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Feb 26 11:37:45 UTC 2008 
Responsible-Changed-Why:  
Looks more like a kernel issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121102 
Responsible-Changed-From-To: freebsd-bugs->freebsd-acpi 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Tue Feb 26 13:15:59 UTC 2008 
Responsible-Changed-Why:  
Over to acpi mailing list 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121102 

From: Anish Mistry <amistry@am-productions.biz>
To: bug-followup@freebsd.org, amistry@am-productions.biz
Cc:  
Subject: Re: kern/121102: [acpi_fujitsu] [patch] update acpi_fujitsu for the P8010
Date: Sun, 9 Mar 2008 00:41:52 -0500

 --nextPart4469211.P4Ef0ajpp9
 Content-Type: multipart/mixed;
   boundary="Boundary-01=_gi30HMk3uIOdACM"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 --Boundary-01=_gi30HMk3uIOdACM
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 The attached diff is in a commitable form.  I've tested it on my P2110=20
 and P8010.
 
 Depends on:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=3D121504
 Needed to set hw.acpi.osname to "Windows 2001.1"
 
 
 =2D-=20
 Anish Mistry
 amistry@am-productions.biz
 AM Productions http://am-productions.biz/
 
 --Boundary-01=_gi30HMk3uIOdACM
 Content-Type: text/x-diff;
   charset="us-ascii";
   name="acpi_fujitsu-p8010.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="acpi_fujitsu-p8010.patch"
 
 =2D-- sys/dev/acpi_support/acpi_fujitsu.c.orig	2007-03-22 14:16:39.00000000=
 0 -0400
 +++ sys/dev/acpi_support/acpi_fujitsu.c	2008-03-08 23:32:02.000000000 -0500
 @@ -1,6 +1,6 @@
  /*-
   * Copyright (c) 2002 Sean Bullington <seanATstalker.org>
 =2D *               2003-2006 Anish Mistry <amistry@am-productions.biz>
 + *               2003-2008 Anish Mistry <amistry@am-productions.biz>
   *               2004 Mark Santcroos <marks@ripe.net>
   * All Rights Reserved.
   *
 @@ -84,6 +84,7 @@
  #define METHOD_RVOL	6
  #define METHOD_GSIF	7
  #define METHOD_GHKS	8
 +#define METHOD_GBLS	9
 =20
  /* Notify event */
  #define	ACPI_NOTIFY_STATUS_CHANGED	0x80
 @@ -108,6 +109,7 @@
  	/* Control methods */
  	struct int_nameval	_sta,	/* unused */
  				gbll,	/* brightness */
 +				gbls,	/* get brightness state */
  				ghks,	/* hotkey selector */
  				gbuf,	/* unused (buffer?) */
  				gmou,	/* mouse */
 @@ -189,6 +191,11 @@
  		.description	=3D "Brightness level of the LCD panel"
  	},
  	{
 +		.name		=3D "lcd_brightness",
 +		.method		=3D METHOD_GBLS,
 +		.description	=3D "Brightness level of the LCD panel"
 +	},
 +	{
  		.name		=3D "volume",
  		.method		=3D METHOD_GVOL,
  		.description	=3D "Speakers/headphones volume level"
 @@ -358,6 +365,7 @@
  	/* Setup all of the names for each control method */
  	sc->_sta.name =3D "_STA";
  	sc->gbll.name =3D "GBLL";
 +	sc->gbls.name =3D "GBLS";
  	sc->ghks.name =3D "GHKS";
  	sc->gmou.name =3D "GMOU";
  	sc->gsif.name =3D "GSIF";
 @@ -386,6 +394,9 @@
  			case METHOD_GBLL:
  				exists =3D sc->gbll.exists;
  				break;
 +			case METHOD_GBLS:
 +				exists =3D sc->gbls.exists;
 +				break;
  			case METHOD_GVOL:
  			case METHOD_MUTE:
  				exists =3D sc->gvol.exists;
 @@ -462,6 +473,9 @@
  		case METHOD_GBLL:
  			nv =3D sc->gbll;
  			break;
 +		case METHOD_GBLS:
 +			nv =3D sc->gbls;
 +			break;
  		case METHOD_GMOU:
  			nv =3D sc->gmou;
  			break;
 @@ -519,6 +533,11 @@
  			control =3D "SBLL";
  			nv =3D sc->gbll;
  			break;
 +		case METHOD_GBLS:
 +			changed =3D BRIGHT_CHANGED;
 +			control =3D "SBL2";
 +			nv =3D sc->gbls;
 +			break;
  		case METHOD_GMOU:
  			changed =3D MOUSE_CHANGED;
  			control =3D "SMOU";
 @@ -587,6 +606,14 @@
  	}
 =20
  	if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
 +		sc->gbls.name, &val))) {
 +		sc->gbls.exists =3D 0;
 +	} else {
 +		sc->gbls.exists =3D 1;
 +	}
 +
 +	// don't add if we can use the new method
 +	if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle,
  	    sc->gbll.name, &val))) {
  		sc->gbll.exists =3D 0;
  	} else {
 @@ -683,6 +710,9 @@
  			/* Clear the modification bit */
  			sc->gmou.value &=3D MOUSE_SETTING_BITS;
  		=09
 +			/* 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);
  =09
  			ACPI_VPRINT(sc->dev, acpi_sc, "Internal pointer is now %s\n",
 @@ -690,6 +720,29 @@
  		}
  	}
 =20
 +	/* Screen Brightness Level 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 brigh=
 tness level\n");
 +                        return (FALSE);
 +                }
 +		if (changed & BRIGHT_CHANGED) {
 +			/* No state to record here. */
 +
 +			/* Clear the modification bit */
 +			sc->gbls.value &=3D 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,
 
 --Boundary-01=_gi30HMk3uIOdACM--
 
 --nextPart4469211.P4Ef0ajpp9
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (FreeBSD)
 
 iEYEABECAAYFAkfTeKAACgkQxqA5ziudZT2WlgCg1x9R00XZ0DIxhUWjjHrvljym
 DukAnjANGdsKJ6MO5eWDiEKpWM3LrMyL
 =5SBN
 -----END PGP SIGNATURE-----
 
 --nextPart4469211.P4Ef0ajpp9--

From: Anish Mistry <amistry@am-productions.biz>
To: bug-followup@freebsd.org, amistry@am-productions.biz
Cc:  
Subject: Re: kern/121102: [acpi_fujitsu] [patch] update acpi_fujitsu for the P8010
Date: Wed, 30 Apr 2008 22:15:59 -0400

 --nextPart5846104.NFOZF52qm8
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 This doesn't need to wait on kern/121504 since it still fixes the=20
 sysctl toggling not working on the P8010.
 =2D-=20
 Anish Mistry
 amistry@am-productions.biz
 AM Productions http://am-productions.biz/
 
 --nextPart5846104.NFOZF52qm8
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (FreeBSD)
 
 iEYEABECAAYFAkgZJ+AACgkQxqA5ziudZT0N6gCfd+NZtu5QOhsrE7Z5IR2QpKrK
 Q9UAn1Uws3AimopH9RlWHq+sXhCm5VQk
 =DhIx
 -----END PGP SIGNATURE-----
 
 --nextPart5846104.NFOZF52qm8--

From: Andriy Gapon <avg@freebsd.org>
To: bug-followup@freebsd.org, amistry@am-productions.biz
Cc:  
Subject: Re: kern/121102: [acpi] [patch] update acpi_fujitsu for the P8010
Date: Sun, 05 Dec 2010 17:08:46 +0200

 Anish,
 is this patch still needed?
 It's been > 2 years since you've updated it and there was no obvious action on
 our part, so I'd like to clarify current status.
 Thanks!
 -- 
 Andriy Gapon

From: Anish Mistry <amistry@am-productions.biz>
To: Andriy Gapon <avg@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: kern/121102: [acpi] [patch] update acpi_fujitsu for the P8010
Date: Sun, 5 Dec 2010 12:27:44 -0500

 --nextPart2057847.A2nRExZtRS
 Content-Type: Text/Plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 On Sunday 05 December 2010 10:08:46 Andriy Gapon wrote:
 > Anish,
 > is this patch still needed?
 
 Yes.
 
 > It's been > 2 years since you've updated it and there was no obvious
 > action on our part, so I'd like to clarify current status.
 > Thanks!
 
 =2D-=20
 Anish Mistry
 
 --nextPart2057847.A2nRExZtRS
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.16 (FreeBSD)
 
 iEYEABECAAYFAkz7y5sACgkQxqA5ziudZT3XFgCcDZCo/PB8Mhqbrg64mfi0YvqL
 xKoAoIDLZ5orIOJwkdZl9Y+VtGduJerG
 =vEgg
 -----END PGP SIGNATURE-----
 
 --nextPart2057847.A2nRExZtRS--
State-Changed-From-To: open->patched 
State-Changed-By: avg 
State-Changed-When: Sat Dec 11 10:56:20 UTC 2010 
State-Changed-Why:  
Patch applied in head. 


Responsible-Changed-From-To: freebsd-acpi->avg 
Responsible-Changed-By: avg 
Responsible-Changed-When: Sat Dec 11 10:56:20 UTC 2010 
Responsible-Changed-Why:  
I am handling this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121102 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/121102: commit references a PR
Date: Sat, 11 Dec 2010 10:55:28 +0000 (UTC)

 Author: avg
 Date: Sat Dec 11 10:55:18 2010
 New Revision: 216376
 URL: http://svn.freebsd.org/changeset/base/216376
 
 Log:
   acpi_fujitsu: update for P8010
   
   PR:		kern/121102
   Submitted by:	Anish Mistry <amistry@am-productions.biz>
   MFC after:	3 weeks
 
 Modified:
   head/sys/dev/acpi_support/acpi_fujitsu.c
 
 Modified: head/sys/dev/acpi_support/acpi_fujitsu.c
 ==============================================================================
 --- head/sys/dev/acpi_support/acpi_fujitsu.c	Sat Dec 11 10:21:38 2010	(r216375)
 +++ head/sys/dev/acpi_support/acpi_fujitsu.c	Sat Dec 11 10:55:18 2010	(r216376)
 @@ -1,6 +1,6 @@
  /*-
   * Copyright (c) 2002 Sean Bullington <seanATstalker.org>
 - *               2003-2006 Anish Mistry <amistry@am-productions.biz>
 + *               2003-2008 Anish Mistry <amistry@am-productions.biz>
   *               2004 Mark Santcroos <marks@ripe.net>
   * All Rights Reserved.
   *
 @@ -86,6 +86,7 @@ ACPI_MODULE_NAME("Fujitsu")
  #define METHOD_RVOL	6
  #define METHOD_GSIF	7
  #define METHOD_GHKS	8
 +#define METHOD_GBLS	9
  
  /* Notify event */
  #define	ACPI_NOTIFY_STATUS_CHANGED	0x80
 @@ -110,6 +111,7 @@ struct acpi_fujitsu_softc {
  	/* Control methods */
  	struct int_nameval	_sta,	/* unused */
  				gbll,	/* brightness */
 +				gbls,	/* get brightness state */
  				ghks,	/* hotkey selector */
  				gbuf,	/* unused (buffer?) */
  				gmou,	/* mouse */
 @@ -191,6 +193,11 @@ static struct {
  		.description	= "Brightness level of the LCD panel"
  	},
  	{
 +		.name		= "lcd_brightness",
 +		.method		= METHOD_GBLS,
 +		.description	= "Brightness level of the LCD panel"
 +	},
 +	{
  		.name		= "volume",
  		.method		= METHOD_GVOL,
  		.description	= "Speakers/headphones volume level"
 @@ -360,6 +367,7 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
  	/* 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";
 @@ -387,6 +395,9 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
  			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;
 @@ -463,6 +474,9 @@ acpi_fujitsu_method_get(struct acpi_fuji
  		case METHOD_GBLL:
  			nv = sc->gbll;
  			break;
 +		case METHOD_GBLS:
 +			nv = sc->gbls;
 +			break;
  		case METHOD_GMOU:
  			nv = sc->gmou;
  			break;
 @@ -520,6 +534,11 @@ acpi_fujitsu_method_set(struct acpi_fuji
  			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";
 @@ -585,6 +604,14 @@ acpi_fujitsu_check_hardware(struct acpi_
  	}
  
  	if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
 +		sc->gbls.name, &val))) {
 +		sc->gbls.exists = 0;
 +	} else {
 +		sc->gbls.exists = 1;
 +	}
 +
 +	// don't add if we can use the new method
 +	if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle,
  	    sc->gbll.name, &val))) {
  		sc->gbll.exists = 0;
  	} else {
 @@ -681,6 +708,9 @@ acpi_fujitsu_update(struct acpi_fujitsu_
  			/* 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",
 @@ -688,6 +718,29 @@ acpi_fujitsu_update(struct acpi_fujitsu_
  		}
  	}
  
 +	/* Screen Brightness Level 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,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/121102: commit references a PR
Date: Fri, 11 Mar 2011 18:08:08 +0000 (UTC)

 Author: avg
 Date: Fri Mar 11 18:07:49 2011
 New Revision: 219513
 URL: http://svn.freebsd.org/changeset/base/219513
 
 Log:
   MFC r216376: acpi_fujitsu: update for P8010
   
   PR:		kern/121102
 
 Modified:
   stable/8/sys/dev/acpi_support/acpi_fujitsu.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
 
 Modified: stable/8/sys/dev/acpi_support/acpi_fujitsu.c
 ==============================================================================
 --- stable/8/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 17:47:59 2011	(r219512)
 +++ stable/8/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 18:07:49 2011	(r219513)
 @@ -1,6 +1,6 @@
  /*-
   * Copyright (c) 2002 Sean Bullington <seanATstalker.org>
 - *               2003-2006 Anish Mistry <amistry@am-productions.biz>
 + *               2003-2008 Anish Mistry <amistry@am-productions.biz>
   *               2004 Mark Santcroos <marks@ripe.net>
   * All Rights Reserved.
   *
 @@ -86,6 +86,7 @@ ACPI_MODULE_NAME("Fujitsu")
  #define METHOD_RVOL	6
  #define METHOD_GSIF	7
  #define METHOD_GHKS	8
 +#define METHOD_GBLS	9
  
  /* Notify event */
  #define	ACPI_NOTIFY_STATUS_CHANGED	0x80
 @@ -110,6 +111,7 @@ struct acpi_fujitsu_softc {
  	/* Control methods */
  	struct int_nameval	_sta,	/* unused */
  				gbll,	/* brightness */
 +				gbls,	/* get brightness state */
  				ghks,	/* hotkey selector */
  				gbuf,	/* unused (buffer?) */
  				gmou,	/* mouse */
 @@ -191,6 +193,11 @@ static struct {
  		.description	= "Brightness level of the LCD panel"
  	},
  	{
 +		.name		= "lcd_brightness",
 +		.method		= METHOD_GBLS,
 +		.description	= "Brightness level of the LCD panel"
 +	},
 +	{
  		.name		= "volume",
  		.method		= METHOD_GVOL,
  		.description	= "Speakers/headphones volume level"
 @@ -360,6 +367,7 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
  	/* 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";
 @@ -387,6 +395,9 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
  			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;
 @@ -463,6 +474,9 @@ acpi_fujitsu_method_get(struct acpi_fuji
  		case METHOD_GBLL:
  			nv = sc->gbll;
  			break;
 +		case METHOD_GBLS:
 +			nv = sc->gbls;
 +			break;
  		case METHOD_GMOU:
  			nv = sc->gmou;
  			break;
 @@ -520,6 +534,11 @@ acpi_fujitsu_method_set(struct acpi_fuji
  			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";
 @@ -585,6 +604,14 @@ acpi_fujitsu_check_hardware(struct acpi_
  	}
  
  	if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
 +		sc->gbls.name, &val))) {
 +		sc->gbls.exists = 0;
 +	} else {
 +		sc->gbls.exists = 1;
 +	}
 +
 +	// don't add if we can use the new method
 +	if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle,
  	    sc->gbll.name, &val))) {
  		sc->gbll.exists = 0;
  	} else {
 @@ -681,6 +708,9 @@ acpi_fujitsu_update(struct acpi_fujitsu_
  			/* 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",
 @@ -688,6 +718,29 @@ acpi_fujitsu_update(struct acpi_fujitsu_
  		}
  	}
  
 +	/* Screen Brightness Level 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,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: avg 
State-Changed-When: Fri Mar 11 18:10:45 UTC 2011 
State-Changed-Why:  
The fix has been MFCed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121102 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/121102: commit references a PR
Date: Fri, 11 Mar 2011 18:10:51 +0000 (UTC)

 Author: avg
 Date: Fri Mar 11 18:10:37 2011
 New Revision: 219514
 URL: http://svn.freebsd.org/changeset/base/219514
 
 Log:
   MFC r216376: acpi_fujitsu: update for P8010
   
   PR:		kern/121102
 
 Modified:
   stable/7/sys/dev/acpi_support/acpi_fujitsu.c
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/cddl/contrib/opensolaris/   (props changed)
   stable/7/sys/contrib/dev/acpica/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/dev/acpi_support/acpi_fujitsu.c
 ==============================================================================
 --- stable/7/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 18:07:49 2011	(r219513)
 +++ stable/7/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 18:10:37 2011	(r219514)
 @@ -1,6 +1,6 @@
  /*-
   * Copyright (c) 2002 Sean Bullington <seanATstalker.org>
 - *               2003-2006 Anish Mistry <amistry@am-productions.biz>
 + *               2003-2008 Anish Mistry <amistry@am-productions.biz>
   *               2004 Mark Santcroos <marks@ripe.net>
   * All Rights Reserved.
   *
 @@ -84,6 +84,7 @@ ACPI_MODULE_NAME("Fujitsu")
  #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 +109,7 @@ struct acpi_fujitsu_softc {
  	/* Control methods */
  	struct int_nameval	_sta,	/* unused */
  				gbll,	/* brightness */
 +				gbls,	/* get brightness state */
  				ghks,	/* hotkey selector */
  				gbuf,	/* unused (buffer?) */
  				gmou,	/* mouse */
 @@ -189,6 +191,11 @@ static struct {
  		.description	= "Brightness level of the LCD panel"
  	},
  	{
 +		.name		= "lcd_brightness",
 +		.method		= METHOD_GBLS,
 +		.description	= "Brightness level of the LCD panel"
 +	},
 +	{
  		.name		= "volume",
  		.method		= METHOD_GVOL,
  		.description	= "Speakers/headphones volume level"
 @@ -358,6 +365,7 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
  	/* 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 +394,9 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
  			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 +473,9 @@ acpi_fujitsu_method_get(struct acpi_fuji
  		case METHOD_GBLL:
  			nv = sc->gbll;
  			break;
 +		case METHOD_GBLS:
 +			nv = sc->gbls;
 +			break;
  		case METHOD_GMOU:
  			nv = sc->gmou;
  			break;
 @@ -519,6 +533,11 @@ acpi_fujitsu_method_set(struct acpi_fuji
  			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";
 @@ -587,6 +606,14 @@ acpi_fujitsu_check_hardware(struct acpi_
  	}
  
  	if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
 +		sc->gbls.name, &val))) {
 +		sc->gbls.exists = 0;
 +	} else {
 +		sc->gbls.exists = 1;
 +	}
 +
 +	// don't add if we can use the new method
 +	if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle,
  	    sc->gbll.name, &val))) {
  		sc->gbll.exists = 0;
  	} else {
 @@ -683,6 +710,9 @@ acpi_fujitsu_update(struct acpi_fujitsu_
  			/* 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 @@ acpi_fujitsu_update(struct acpi_fujitsu_
  		}
  	}
  
 +	/* Screen Brightness Level 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,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
