kern/121102: [acpi_fujitsu] [patch] update acpi_fujitsu for the P8010

Anish Mistry amistry at am-productions.biz
Sun Mar 9 06:20:03 UTC 2008


The following reply was made to PR kern/121102; it has been noted by GNATS.

From: Anish Mistry <amistry at am-productions.biz>
To: bug-followup at freebsd.org, amistry at 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 at 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 at am-productions.biz>
 + *               2003-2008 Anish Mistry <amistry at am-productions.biz>
   *               2004 Mark Santcroos <marks at 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--


More information about the freebsd-acpi mailing list