Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2012 13:57:13 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-acpi@freebsd.org
Cc:        simplicissimus <hans-wurst19@web.de>
Subject:   Re: ACPI for Asus Notebook N50Vc
Message-ID:  <201202211357.13783.jhb@freebsd.org>
In-Reply-To: <1329176306514-5480937.post@n5.nabble.com>
References:  <1328719807459-5467015.post@n5.nabble.com> <201202131014.33895.jhb@freebsd.org> <1329176306514-5480937.post@n5.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, February 13, 2012 6:38:26 pm simplicissimus wrote:
> Hello John,
>=20
> Thank you very much for your patch.
>=20
> This is how my laptop=E2=80=99s behaviour changed:
>=20
> % sysctl -a | grep -i asus
> hw.acpi.asus.lcd_brightness: 4
> dev.acpi.0.%desc: _ASUS_ Notebook
> dev.acpi_asus.0.%desc: Asus N50Vc Laptop Extras
> dev.acpi_asus.0.%driver: acpi_asus
> dev.acpi_asus.0.%location: handle=3D\_SB_.ATKD
> dev.acpi_asus.0.%pnpinfo: _HID=3DATK0100 _UID=3D16843008
> dev.acpi_asus.0.%parent: acpi0
>=20
> hw.acpi.asus.lcd_brightness shows the correct brightness (with acpi_video
> loaded).
>=20
> My notebook has a combined switch for wifi/bluetooth.
> Without (the modified) acpi_asus the Wifi LED would be always off, althou=
gh
> wifi worked.
> By pressing the button, bluetooth was toggled on/off with the correspondi=
ng
> LED going on/off.
>=20
> Now the button cycles through these LED statuses:
> both on > both off > wifi only > bluetooth only
> Wifi stays on all the time, bluetooth works as it is supposed to (like it
> did before).
>=20
> Is there a chance to get ATK0110 events working? I tried xev, but had no
> output there.
>=20
> Thanks in advance

Can you try this?  BTW, someone should port the asus-laptop.c driver from=20
Linux over to replace acpi_asus.c.

Index: acpi_asus.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- acpi_asus.c	(revision 231973)
+++ acpi_asus.c	(working copy)
@@ -379,6 +379,18 @@ static struct acpi_asus_model acpi_asus_models[] =3D
 		.disp_set	=3D "SDSP"
 	},
 	{
+		.name		=3D "N50Vc",
+		.bled_set       =3D "BLED",
+		.wled_set	=3D "WLED",
+		.brn_get	=3D "GPLV",
+		.brn_set	=3D "SPLV",
+#if 0
+		.lcd_set	=3D "\\_SB.PCI0.SBRG.EC0._Q10",
+#endif
+		.disp_get	=3D "\\_SB.PCI0.P0P1.VGA.GETD",
+		.disp_set	=3D "SDSP"
+	},
+	{
 		.name		=3D "S1x",
 		.mled_set	=3D "MLED",
 		.wled_set	=3D "WLED",
@@ -509,6 +521,9 @@ static struct {
=20
 ACPI_SERIAL_DECL(asus, "ACPI ASUS extras");
=20
+static int acpi_asus_wapf =3D 1;
+TUNABLE_INT_FETCH("hw.acpi.asus.wapf" &acpi_asus_wapf);
+
 /* Function prototypes */
 static int	acpi_asus_probe(device_t dev);
 static int	acpi_asus_attach(device_t dev);
@@ -724,6 +739,8 @@ acpi_asus_attach(device_t dev)
 {
 	struct acpi_asus_softc	*sc;
 	struct acpi_softc	*acpi_sc;
+	ACPI_OBJECT		Arg;
+	ACPI_OBJECT_LIST	Args;
=20
 	ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
=20
@@ -735,6 +752,9 @@ acpi_asus_attach(device_t dev)
 	sc->sysctl_tree =3D SYSCTL_ADD_NODE(&sc->sysctl_ctx,
 	    SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree),
 	    OID_AUTO, "asus", CTLFLAG_RD, 0, "");
+	SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
+	    OID_AUTO, "wapf", CTLFLAG_RD, &acpi_asus_wapf, 0,
+	    "Argument to pass WAPF method during initialization");
=20
 	/* Hook up nodes */
 	for (int i =3D 0; acpi_asus_sysctls[i].name !=3D NULL; i++) {
@@ -804,6 +824,9 @@ acpi_asus_attach(device_t dev)
 	/* Activate hotkeys */
 	AcpiEvaluateObject(sc->handle, "BSTS", NULL, NULL);
=20
+	/* Configure wlan key. */
+	acpi_SetInteger(sc->handle, "WAPF", acpi_asus_wapf);
+
 	/* Handle notifies */
 	if (sc->model->n_func =3D=3D NULL)
 		sc->model->n_func =3D acpi_asus_notify;

=2D-=20
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202211357.13783.jhb>