Index: acpithinkpad.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v
retrieving revision 1.25
diff -u -r1.25 acpithinkpad.c
--- acpithinkpad.c      2 Jan 2011 04:56:57 -0000       1.25
+++ acpithinkpad.c      22 Apr 2011 17:03:45 -0000
@@ -1,4 +1,4 @@
-/*     $OpenBSD: acpithinkpad.c,v 1.25 2011/01/02 04:56:57 jordan Exp $        
*/
+/* $OpenBSD: acpithinkpad.c,v 1.25 2011/01/02 04:56:57 jordan Exp $ */
 /*
  * Copyright (c) 2008 joshua stein <j...@openbsd.org>
  *
@@ -71,21 +71,21 @@
 #define        THINKPAD_POWER_CHANGED          0x6030
 #define        THINKPAD_SWITCH_WIRELESS        0x7000
 
-#define THINKPAD_NSENSORS 9
-#define THINKPAD_NTEMPSENSORS 8
+#define        THINKPAD_NSENSORS               9
+#define        THINKPAD_NTEMPSENSORS           8
 
-#define THINKPAD_ECOFFSET_FANLO                0x84
-#define THINKPAD_ECOFFSET_FANHI                0x85
+#define        THINKPAD_ECOFFSET_FANLO         0x84
+#define        THINKPAD_ECOFFSET_FANHI         0x85
 
 struct acpithinkpad_softc {
-       struct device            sc_dev;
+       struct  device sc_dev;
 
-       struct acpiec_softc     *sc_ec;
-       struct acpi_softc       *sc_acpi;
-       struct aml_node         *sc_devnode;
+       struct  acpiec_softc *sc_ec;
+       struct  acpi_softc *sc_acpi;
+       struct  aml_node *sc_devnode;
 
-       struct ksensor           sc_sens[THINKPAD_NSENSORS];
-       struct ksensordev        sc_sensdev;
+       struct  ksensor sc_sens[THINKPAD_NSENSORS];
+       struct  ksensordev sc_sensdev;
 };
 
 extern void acpiec_read(struct acpiec_softc *, u_int8_t, int, u_int8_t *);
@@ -103,8 +103,8 @@
 int    thinkpad_brightness_up(struct acpithinkpad_softc *);
 int    thinkpad_brightness_down(struct acpithinkpad_softc *);
 
-void    thinkpad_sensor_attach(struct acpithinkpad_softc *sc);
-void    thinkpad_sensor_refresh(void *);
+void   thinkpad_sensor_attach(struct acpithinkpad_softc *);
+void   thinkpad_sensor_refresh(void *);
 
 struct cfattach acpithinkpad_ca = {
        sizeof(struct acpithinkpad_softc), thinkpad_match, thinkpad_attach
@@ -119,9 +119,9 @@
 int
 thinkpad_match(struct device *parent, void *match, void *aux)
 {
-       struct acpi_attach_args *aa = aux;
+       struct acpi_attach_args *aa = aux;
        struct cfdata *cf = match;
-       int64_t res;
+       int64_t res;
 
        if (!acpi_matchhids(aa, acpithinkpad_hids, cf->cf_driver->cd_name))
                return (0);
@@ -148,7 +148,7 @@
        /* Add temperature probes */
        strlcpy(sc->sc_sensdev.xname, DEVNAME(sc),
            sizeof(sc->sc_sensdev.xname));
-       for (i=0; i<THINKPAD_NTEMPSENSORS; i++) {
+       for (i = 0; i < THINKPAD_NTEMPSENSORS; i++) {
                sc->sc_sens[i].type = SENSOR_TEMP;
                sensor_attach(&sc->sc_sensdev, &sc->sc_sens[i]);
        }
@@ -169,7 +169,7 @@
        char sname[5];
 
        /* Refresh sensor readings */
-       for (i=0; i<THINKPAD_NTEMPSENSORS; i++) {
+       for (i = 0; i < THINKPAD_NTEMPSENSORS; i++) {
                snprintf(sname, sizeof(sname), "TMP%d", i);
                aml_evalinteger(sc->sc_acpi, sc->sc_ec->sc_devnode,
                    sname, 0, 0, &tmp);
@@ -188,7 +188,7 @@
 thinkpad_attach(struct device *parent, struct device *self, void *aux)
 {
        struct acpithinkpad_softc *sc = (struct acpithinkpad_softc *)self;
-       struct acpi_attach_args *aa = aux;
+       struct acpi_attach_args *aa = aux;
 
        sc->sc_acpi = (struct acpi_softc *)parent;
        sc->sc_devnode = aa->aaa_node;
@@ -208,7 +208,7 @@
 thinkpad_enable_events(struct acpithinkpad_softc *sc)
 {
        struct aml_value arg, args[2];
-       int64_t mask;
+       int64_t mask;
        int i;
 
        /* Get the supported event mask */
@@ -236,8 +236,7 @@
        bzero(&arg, sizeof(arg));
        arg.type = AML_OBJTYPE_INTEGER;
        arg.v_integer = 1;
-       if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "MHKC",
-           1, &arg, NULL)) {
+       if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "MHKC", 1, &arg, NULL)) {
                printf("%s: couldn't enable hotkeys\n", DEVNAME(sc));
                return (1);
        }
@@ -250,7 +249,7 @@
 {
        struct acpithinkpad_softc *sc = arg;
        int handled = 0;
-       int64_t event;
+       int64_t event;
 
        if (notify_type == 0x00) {
                /* Poll sensors */
@@ -283,8 +282,9 @@
                        break;
                case THINKPAD_BUTTON_SUSPEND:
 #ifndef SMALL_KERNEL
-                       if (acpi_record_event(sc->sc_acpi, 
APM_USER_SUSPEND_REQ))
-                               acpi_addtask(sc->sc_acpi, acpi_sleep_task, 
+                       if (acpi_record_event(sc->sc_acpi,
+                           APM_USER_SUSPEND_REQ))
+                               acpi_addtask(sc->sc_acpi, acpi_sleep_task,
                                    sc->sc_acpi, ACPI_STATE_S3);
 #endif
                        handled = 1;
@@ -345,7 +345,7 @@
 thinkpad_toggle_bluetooth(struct acpithinkpad_softc *sc)
 {
        struct aml_value arg;
-       int64_t bluetooth;
+       int64_t bluetooth;
 
        if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "GBDC",
            0, NULL, &bluetooth))
@@ -357,8 +357,7 @@
        bzero(&arg, sizeof(arg));
        arg.type = AML_OBJTYPE_INTEGER;
        arg.v_integer = bluetooth ^ THINKPAD_BLUETOOTH_ENABLED;
-       if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "SBDC",
-           1, &arg, NULL)) {
+       if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "SBDC", 1, &arg, NULL)) {
                printf("%s: couldn't toggle bluetooth\n", DEVNAME(sc));
                return (1);
        }
@@ -372,8 +371,7 @@
        struct aml_value arg;
        int64_t wan;
 
-       if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "GWAN",
-           0, NULL, &wan))
+       if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "GWAN", 0, NULL, &wan))
                return (1);
 
        if (!(wan & THINKPAD_WAN_PRESENT))
@@ -382,8 +380,7 @@
        bzero(&arg, sizeof(arg));
        arg.type = AML_OBJTYPE_INTEGER;
        arg.v_integer = wan ^ THINKPAD_WAN_ENABLED;
-       if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "SWAN",
-           1, &arg, NULL)) {
+       if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "SWAN", 1, &arg, NULL)) {
                printf("%s: couldn't toggle wan\n", DEVNAME(sc));
                return (1);
        }

Reply via email to