summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpi_support/acpi_asus.c
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2008-04-13 14:40:02 +0000
committerrpaulo <rpaulo@FreeBSD.org>2008-04-13 14:40:02 +0000
commit8a08087c0abff744976a0377efdc8cf787fba0d8 (patch)
tree3663e6424f0e14fa0c0b5238943769cfddb427c2 /sys/dev/acpi_support/acpi_asus.c
parenteae5804c54b40bf47eab590d71708ee151e35de6 (diff)
downloadFreeBSD-src-8a08087c0abff744976a0377efdc8cf787fba0d8.zip
FreeBSD-src-8a08087c0abff744976a0377efdc8cf787fba0d8.tar.gz
Add support for Asus EeePC backlight control.
Submitted by: Akira Funahashi <funa at funa.org> MFC after: 1 week
Diffstat (limited to 'sys/dev/acpi_support/acpi_asus.c')
-rw-r--r--sys/dev/acpi_support/acpi_asus.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c
index 14da41a..72d12a8 100644
--- a/sys/dev/acpi_support/acpi_asus.c
+++ b/sys/dev/acpi_support/acpi_asus.c
@@ -375,6 +375,20 @@ static struct acpi_asus_model acpi_samsung_models[] = {
{ .name = NULL }
};
+/*
+ * EeePC have an Asus ASUS010 gadget interface,
+ * but they can't be probed quite the same way as Asus laptops.
+ */
+static struct acpi_asus_model acpi_eeepc_models[] = {
+ {
+ .name = "EEE",
+ .brn_get = "\\_SB.ATKD.PBLG",
+ .brn_set = "\\_SB.ATKD.PBLS"
+ },
+
+ { .name = NULL }
+};
+
static struct {
char *name;
char *description;
@@ -444,13 +458,17 @@ acpi_asus_probe(device_t dev)
ACPI_BUFFER Buf;
ACPI_OBJECT Arg, *Obj;
ACPI_OBJECT_LIST Args;
- static char *asus_ids[] = { "ATK0100", NULL };
+ static char *asus_ids[] = { "ATK0100", "ASUS010", NULL };
+ char *rstr;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
- if (acpi_disabled("asus") ||
- ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids) == NULL)
+ if (acpi_disabled("asus"))
+ return (ENXIO);
+ rstr = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids);
+ if (rstr == NULL) {
return (ENXIO);
+ }
sc = device_get_softc(dev);
sc->dev = dev;
@@ -489,6 +507,14 @@ acpi_asus_probe(device_t dev)
AcpiOsFree(Buf.Pointer);
return (0);
}
+
+ /* if EeePC */
+ if(strncmp("ASUS010", rstr, 7) == 0) {
+ sc->model = &acpi_eeepc_models[0];
+ device_set_desc(dev, "ASUS EeePC");
+ AcpiOsFree(Buf.Pointer);
+ return (0);
+ }
}
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
OpenPOWER on IntegriCloud