Sync with Linux acpi4asus, adding support for loads of new models.

MFC after:	3 days
This commit is contained in:
Philip Paeps 2005-05-09 12:51:48 +00:00
parent 5894dd7d1a
commit 18d92cd86c
2 changed files with 168 additions and 19 deletions

View File

@ -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
W1N
S2x
.It
V6V
.El
.Pp
Additionally,

View File

@ -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
@ -115,6 +115,46 @@ struct acpi_asus_softc {
* as a result of calling the ATK0100 'INIT' method.
*/
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",
@ -164,6 +204,17 @@ static struct acpi_asus_model acpi_asus_models[] = {
.disp_get = "\\_SB.PCI0.P0P1.VGA.GETD",
.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 */
@ -207,6 +258,23 @@ static struct acpi_asus_model acpi_asus_models[] = {
.disp_get = "\\SSTE",
.disp_set = "SDSP"
},
{
.name = "S1x",
.mled_set = "MLED",
.wled_set = "WLED",
.lcd_get = "\\PNOF",
.lcd_set = "\\_SB.PCI0.PX40.Q10",
.brn_get = "GPLV",
.brn_set = "SPLV"
},
{
.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",
@ -219,17 +287,6 @@ static struct acpi_asus_model acpi_asus_models[] = {
.disp_get = "\\_SB.PCI0.P0P1.VGA.GETD",
.disp_set = "SDSP"
},
{
.name = "W1N",
.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 = NULL }
};
@ -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);