summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphilip <philip@FreeBSD.org>2005-05-09 12:51:48 +0000
committerphilip <philip@FreeBSD.org>2005-05-09 12:51:48 +0000
commit7993c4292d145a1c61b5465ce3735a8c9b867e3f (patch)
tree8e8fedffa57327f0bf8939ce0775e5dd5eac1dc1
parent69bb917a2e75480475841572d38e772f24128b5e (diff)
downloadFreeBSD-src-7993c4292d145a1c61b5465ce3735a8c9b867e3f.zip
FreeBSD-src-7993c4292d145a1c61b5465ce3735a8c9b867e3f.tar.gz
Sync with Linux acpi4asus, adding support for loads of new models.
MFC after: 3 days
-rw-r--r--share/man/man4/man4.i386/acpi_asus.428
-rw-r--r--sys/dev/acpi_support/acpi_asus.c157
2 files changed, 167 insertions, 18 deletions
diff --git a/share/man/man4/man4.i386/acpi_asus.4 b/share/man/man4/man4.i386/acpi_asus.4
index 6d15798..84666b2 100644
--- a/share/man/man4/man4.i386/acpi_asus.4
+++ b/share/man/man4/man4.i386/acpi_asus.4
@@ -50,29 +50,47 @@ Currently, the following Asus laptops are fully supported:
.Pp
.Bl -item -offset indent -compact
.It
+xxN
+.It
+A1x
+.It
+A2x
+.It
+D1x
+.It
+J1x
+.It
+L2B
+.It
L2D
.It
+L2E
+.It
L3C
.It
L3D
.It
L3H
.It
+L4E
+.It
L4R
.It
-L8L
+L5x
+.It
+L8x
.It
M1A
.It
M2E
.It
-M6N
-.It
M6R
.It
-V6V
+S1x
+.It
+S2x
.It
-W1N
+V6V
.El
.Pp
Additionally,
diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c
index 77eba58..45bd7f3 100644
--- a/sys/dev/acpi_support/acpi_asus.c
+++ b/sys/dev/acpi_support/acpi_asus.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2004 Philip Paeps <philip@FreeBSD.org>
+ * Copyright (c) 2004, 2005 Philip Paeps <philip@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -116,6 +116,46 @@ struct acpi_asus_softc {
*/
static struct acpi_asus_model acpi_asus_models[] = {
{
+ .name = "xxN",
+ .mled_set = "MLED",
+ .wled_set = "WLED",
+ .lcd_get = "\\BKLT",
+ .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10",
+ .brn_get = "GPLV",
+ .brn_set = "SPLV",
+ .disp_get = "\\ADVG",
+ .disp_set = "SDSP"
+ },
+ {
+ .name = "A1x",
+ .mled_set = "MLED",
+ .lcd_get = "\\BKLI",
+ .lcd_set = "\\_SB.PCI0.ISA.EC0._Q10",
+ .brn_up = "\\_SB.PCI0.ISA.EC0._Q0E",
+ .brn_dn = "\\_SB.PCI0.ISA.EC0._Q0F"
+ },
+ {
+ .name = "A2x",
+ .mled_set = "MLED",
+ .wled_set = "WLED",
+ .lcd_get = "\\BAOF",
+ .lcd_set = "\\Q10",
+ .brn_get = "GPLV",
+ .brn_set = "SPLV",
+ .disp_get = "\\INFB",
+ .disp_set = "SDSP"
+ },
+ {
+ .name = "D1x",
+ .mled_set = "MLED",
+ .lcd_get = "\\GP11",
+ .lcd_set = "\\Q0D",
+ .brn_up = "\\Q0C",
+ .brn_dn = "\\Q0B",
+ .disp_get = "\\INFB",
+ .disp_set = "SDSP"
+ },
+ {
.name = "L2D",
.mled_set = "MLED",
.wled_set = "WLED",
@@ -165,6 +205,17 @@ static struct acpi_asus_model acpi_asus_models[] = {
.disp_set = "SDSP"
},
{
+ .name = "L5x",
+ .mled_set = "MLED",
+ .tled_set = "TLED",
+ .lcd_get = "\\BAOF",
+ .lcd_set = "\\Q0D",
+ .brn_get = "GPLV",
+ .brn_set = "SPLV",
+ .disp_get = "\\INFB",
+ .disp_set = "SDSP"
+ },
+ {
.name = "L8L"
/* Only has hotkeys, apparantly */
},
@@ -208,26 +259,32 @@ static struct acpi_asus_model acpi_asus_models[] = {
.disp_set = "SDSP"
},
{
- .name = "V6V",
- .bled_set = "BLED",
- .tled_set = "TLED",
+ .name = "S1x",
+ .mled_set = "MLED",
.wled_set = "WLED",
- .lcd_get = "\\BKLT",
- .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10",
+ .lcd_get = "\\PNOF",
+ .lcd_set = "\\_SB.PCI0.PX40.Q10",
.brn_get = "GPLV",
- .brn_set = "SPLV",
- .disp_get = "\\_SB.PCI0.P0P1.VGA.GETD",
- .disp_set = "SDSP"
+ .brn_set = "SPLV"
},
{
- .name = "W1N",
+ .name = "S2x",
.mled_set = "MLED",
+ .lcd_get = "\\BKLI",
+ .lcd_set = "\\_SB.PCI0.ISA.EC0._Q10",
+ .brn_up = "\\_SB.PCI0.ISA.EC0._Q0B",
+ .brn_dn = "\\_SB.PCI0.ISA.EC0._Q0A"
+ },
+ {
+ .name = "V6V",
+ .bled_set = "BLED",
+ .tled_set = "TLED",
.wled_set = "WLED",
.lcd_get = "\\BKLT",
.lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10",
.brn_get = "GPLV",
.brn_set = "SPLV",
- .disp_get = "\\ADVG",
+ .disp_get = "\\_SB.PCI0.P0P1.VGA.GETD",
.disp_set = "SDSP"
},
@@ -374,9 +431,12 @@ acpi_asus_probe(device_t dev)
/*
* Asus laptops are simply identified by name, easy!
*/
- for (model = acpi_asus_models; model->name != NULL; model++)
+ for (model = acpi_asus_models; model->name != NULL; model++) {
if (strncmp(Obj->String.Pointer, model->name, 3) == 0) {
- sbuf_printf(sb, "Asus %s Laptop Extras", model->name);
+
+good:
+ sbuf_printf(sb, "Asus %s Laptop Extras",
+ Obj->String.Pointer);
sbuf_finish(sb);
sc->model = model;
@@ -386,6 +446,77 @@ acpi_asus_probe(device_t dev)
AcpiOsFree(Buf.Pointer);
return (0);
}
+
+ /*
+ * Some models look exactly the same as other models, but have
+ * their own ids. If we spot these, set them up with the same
+ * details as the models they're like, possibly dealing with
+ * small differences.
+ *
+ * XXX: there must be a prettier way to do this!
+ */
+ else if (strncmp(model->name, "xxN", 3) == 0 &&
+ (strncmp(Obj->String.Pointer, "M3N", 3) == 0 ||
+ strncmp(Obj->String.Pointer, "S1N", 3) == 0))
+ goto good;
+ else if (strncmp(model->name, "A1x", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "A1", 2) == 0)
+ goto good;
+ else if (strncmp(model->name, "A2x", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "A2", 2) == 0)
+ goto good;
+ else if (strncmp(model->name, "D1x", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "D1", 2) == 0)
+ goto good;
+ else if (strncmp(model->name, "L3H", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "L2E", 3) == 0)
+ goto good;
+ else if (strncmp(model->name, "L5x", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "L5", 2) == 0)
+ goto good;
+ else if (strncmp(model->name, "M2E", 3) == 0 &&
+ (strncmp(Obj->String.Pointer, "M2", 2) == 0 ||
+ strncmp(Obj->String.Pointer, "L4E", 3) == 0))
+ goto good;
+ else if (strncmp(model->name, "S1x", 3) == 0 &&
+ (strncmp(Obj->String.Pointer, "L8", 2) == 0 ||
+ strncmp(Obj->String.Pointer, "S1", 2) == 0))
+ goto good;
+ else if (strncmp(model->name, "S2x", 3) == 0 &&
+ (strncmp(Obj->String.Pointer, "J1", 2) == 0 ||
+ strncmp(Obj->String.Pointer, "S2", 2) == 0))
+ goto good;
+
+ /* L2B is like L3C but has no lcd_get method */
+ else if (strncmp(model->name, "L3C", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "L2B", 3) == 0) {
+ model->lcd_get = NULL;
+ goto good;
+ }
+
+ /* A3G is like M6R but with a different lcd_get method */
+ else if (strncmp(model->name, "M6R", 3) == 0 &&
+ strncmp(Obj->String.Pointer, "A3G", 3) == 0) {
+ model->lcd_get = "\\BLFG";
+ goto good;
+ }
+
+ /* M2N and W1N are like xxN with added WLED */
+ else if (strncmp(model->name, "xxN", 3) == 0 &&
+ (strncmp(Obj->String.Pointer, "M2N", 3) == 0 ||
+ strncmp(Obj->String.Pointer, "W1N", 3) == 0)) {
+ model->wled_set = "WLED";
+ goto good;
+ }
+
+ /* M5N and S5N are like xxN without MLED */
+ else if (strncmp(model->name, "xxN", 3) == 0 &&
+ (strncmp(Obj->String.Pointer, "M5N", 3) == 0 ||
+ strncmp(Obj->String.Pointer, "S5N", 3) == 0)) {
+ model->mled_set = NULL;
+ goto good;
+ }
+ }
sbuf_printf(sb, "Unsupported Asus laptop: %s\n", Obj->String.Pointer);
sbuf_finish(sb);
OpenPOWER on IntegriCloud