Hello,
this diff adds support for the brightness control function keys of ASUS
Eeepc 1000H -- tested on i386. Might work on other ASUS laptops too.

( based on a diff sent by qgiovanni[at]gmail[dot]com on misc --
  http://marc.info/?l=openbsd-misc&m=134228319425006&w=2 )


Index: acpiasus.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiasus.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 acpiasus.c
--- acpiasus.c  30 Jan 2014 11:51:51 -0000      1.16
+++ acpiasus.c  2 Feb 2014 15:51:41 -0000
@@ -81,6 +81,7 @@ 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_brightness(struct acpiasus_softc *sc, uint8_t);
 
 #if NAUDIO > 0 && NWSKBD > 0
 extern int wskbd_set_mixervolume(long, long);
@@ -147,6 +148,7 @@ acpiasus_notify(struct aml_node *node, i
 
        if (notify >= ASUS_NOTIFY_BRIGHTNESSLOW &&
            notify <= ASUS_NOTIFY_BRIGHTNESSHIGH) {
+               acpiasus_brightness(sc, notify);
 #ifdef ACPIASUS_DEBUG
                printf("%s: brightness %d percent\n", DEVNAME(sc),
                    (notify & 0xf) * 100 / 0xf);
@@ -224,5 +226,17 @@ acpiasus_activate(struct device *self, i
                        aml_freevalue(&ret);
                break;
        }
+       return (0);
+}
+
+int
+acpiasus_brightness(struct acpiasus_softc *sc, uint8_t cmd)
+{
+       struct aml_value arg;
+
+       bzero(&arg, sizeof(arg));
+       arg.type = AML_OBJTYPE_INTEGER;
+       arg.v_integer = cmd;
+       aml_evalname(sc->sc_acpi, sc->sc_devnode, "PBLS", 1, &arg, NULL);
        return (0);
 }

Reply via email to