summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpi_support
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-12-11 10:55:18 +0000
committeravg <avg@FreeBSD.org>2010-12-11 10:55:18 +0000
commitddb2dc922502c229678c386e874636f95003c3e3 (patch)
tree2d5254bdbf875ab58295029bc2eaeb68e9837445 /sys/dev/acpi_support
parent6f970f64093c1c1b2023477eebfba9aeab0c5adb (diff)
downloadFreeBSD-src-ddb2dc922502c229678c386e874636f95003c3e3.zip
FreeBSD-src-ddb2dc922502c229678c386e874636f95003c3e3.tar.gz
acpi_fujitsu: update for P8010
PR: kern/121102 Submitted by: Anish Mistry <amistry@am-productions.biz> MFC after: 3 weeks
Diffstat (limited to 'sys/dev/acpi_support')
-rw-r--r--sys/dev/acpi_support/acpi_fujitsu.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/sys/dev/acpi_support/acpi_fujitsu.c b/sys/dev/acpi_support/acpi_fujitsu.c
index c825254..2455b50 100644
--- a/sys/dev/acpi_support/acpi_fujitsu.c
+++ b/sys/dev/acpi_support/acpi_fujitsu.c
@@ -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_softc *sc)
/* 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_softc *sc)
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_fujitsu_softc *sc, int method)
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_fujitsu_softc *sc, int method, int value)
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_fujitsu_softc *sc)
}
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_softc *sc)
/* 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_softc *sc)
}
}
+ /* 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,
OpenPOWER on IntegriCloud