mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
acpi_fujitsu: update for P8010
PR: kern/121102 Submitted by: Anish Mistry <amistry@am-productions.biz> MFC after: 3 weeks
This commit is contained in:
parent
4fa9db8da0
commit
c82eedb465
1 changed files with 54 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
@ -190,6 +192,11 @@ static struct {
|
|||
.method = METHOD_GBLL,
|
||||
.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,
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue