On Thu, Jul 14, 2016 at 08:41:42PM +0200, Frank Groeneveld wrote:
> Thanks for reviewing. This the only ACPI device that works when
> attaching (volume buttons start working). I've added the dumps
> below.

Attached updated patch also adds the ws_get_param and ws_set_param
methods to prevent acpivideo from attaching. This makes the backlight
control work (altough not with hotkeys, only audio keys seem to work).

Frank
Index: dev/acpi/acpiasus.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiasus.c,v
retrieving revision 1.17
diff -u -p -r1.17 acpiasus.c
--- dev/acpi/acpiasus.c 21 Feb 2014 18:49:06 -0000      1.17
+++ dev/acpi/acpiasus.c 16 Jul 2016 14:05:43 -0000
@@ -39,6 +39,7 @@
 #include <dev/acpi/acpidev.h>
 #include <dev/acpi/amltypes.h>
 #include <dev/acpi/dsdt.h>
+#include <dev/wscons/wsconsio.h>
 
 #include "audio.h"
 #include "wskbd.h"
@@ -81,6 +82,10 @@ void acpiasus_attach(struct device *, st
 void   acpiasus_init(struct device *);
 int    acpiasus_notify(struct aml_node *, int, void *);
 int    acpiasus_activate(struct device *, int);
+int    acpiasus_get_param(struct wsdisplay_param *);
+int    acpiasus_set_param(struct wsdisplay_param *);
+extern int (*ws_get_param)(struct wsdisplay_param *);
+extern int (*ws_set_param)(struct wsdisplay_param *);
 
 #if NAUDIO > 0 && NWSKBD > 0
 extern int wskbd_set_mixervolume(long, long);
@@ -95,7 +100,7 @@ struct cfdriver acpiasus_cd = {
        NULL, "acpiasus", DV_DULL
 };
 
-const char *acpiasus_hids[] = { ACPI_DEV_ASUS, 0 };
+const char *acpiasus_hids[] = { ACPI_DEV_ASUS, ACPI_DEV_ASUS2, 0 };
 
 int
 acpiasus_match(struct device *parent, void *match, void *aux)
@@ -119,6 +124,9 @@ acpiasus_attach(struct device *parent, s
 
        acpiasus_init(self);
 
+       ws_get_param = acpiasus_get_param;
+       ws_set_param = acpiasus_set_param;
+
        aml_register_notify(sc->sc_devnode, aa->aaa_dev,
            acpiasus_notify, sc, ACPIDEV_NOPOLL);
 }
@@ -225,4 +233,16 @@ acpiasus_activate(struct device *self, i
                break;
        }
        return (0);
+}
+
+int
+acpiasus_get_param(struct wsdisplay_param *dp)
+{
+       return -1;
+}
+
+int
+acpiasus_set_param(struct wsdisplay_param *dp)
+{
+       return -1;
 }
Index: dev/acpi/acpireg.h
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpireg.h,v
retrieving revision 1.36
diff -u -p -r1.36 acpireg.h
--- dev/acpi/acpireg.h  10 Jul 2016 20:36:41 -0000      1.36
+++ dev/acpi/acpireg.h  16 Jul 2016 14:05:43 -0000
@@ -764,6 +764,7 @@ struct acpi_ivrs {
 #define ACPI_DEV_FFB   "FIXEDBUTTON"   /* Fixed Feature Button */
 #define ACPI_DEV_ASUS  "ASUS010"       /* ASUS Hotkeys */
 #define ACPI_DEV_ASUS1 "ATK0100"       /* ASUS Special Device */
+#define ACPI_DEV_ASUS2 "pnp0c14"       /* ASUS Zenbook UX31A Hotkeys */
 #define ACPI_DEV_IBM   "IBM0068"       /* IBM ThinkPad support */
 #define ACPI_DEV_LENOVO        "LEN0068"       /* Lenovo ThinkPad support */
 #define ACPI_DEV_ASUSAIBOOSTER "ATK0110"       /* ASUSTeK AI Booster */

Reply via email to