diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2008-04-07 12:09:59 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2008-04-07 12:09:59 +0000 |
commit | 9c842efae384fb1df9b19b42a44d8bf5ee077bfb (patch) | |
tree | 04a6d25f0af531d801ac6203a2d061c59717ddfd /sys/dev/asmc | |
parent | aef67c0d53abe10023b22bcdfaeac2448a8c22d5 (diff) | |
download | FreeBSD-src-9c842efae384fb1df9b19b42a44d8bf5ee077bfb.zip FreeBSD-src-9c842efae384fb1df9b19b42a44d8bf5ee077bfb.tar.gz |
* Add missing #else in the #ifdef DEBUG section.
* Fix the login in asmc_init().
* Change the INIT2 constant to reflect the same change in the Linux driver.
Diffstat (limited to 'sys/dev/asmc')
-rw-r--r-- | sys/dev/asmc/asmc.c | 9 | ||||
-rw-r--r-- | sys/dev/asmc/asmcvar.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index d0ce889..058350e 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -219,6 +219,8 @@ static driver_t asmc_driver = { ACPI_MODULE_NAME("ASMC") #ifdef DEBUG #define ASMC_DPRINTF(str) device_printf(dev, str) +#else +#define ASMC_DPRINTF(str) #endif static char *asmc_ids[] = { "APP0001", NULL }; @@ -548,18 +550,17 @@ asmc_init(device_t dev) if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 && (buf[0] != 0x00 || buf[1] != 0x00)) { error = 0; - device_printf(dev, "WARNING: Sudden Motion Sensor " - "not initialized!\n"); - goto nosms; + goto out; } - buf[0] = ASMC_SMS_INIT1; buf[1] = ASMC_SMS_INIT2; ASMC_DPRINTF(("sms key\n")); asmc_key_write(dev, ASMC_KEY_SMS, buf, 2); DELAY(50); } + device_printf(dev, "WARNING: Sudden Motion Sensor not initialized!\n"); +out: asmc_sms_calibrate(dev); nosms: sc->sc_nfan = asmc_fan_count(dev); diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index ee5fbfd..7aaa1a8 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -92,7 +92,7 @@ struct asmc_softc { * Sudden Motion Sensor (SMS). */ #define ASMC_SMS_INIT1 0xe0 -#define ASMC_SMS_INIT2 0xf8 +#define ASMC_SMS_INIT2 0x00 #define ASMC_KEY_SMS "MOCN" /* RW; 2 bytes */ #define ASMC_KEY_SMS_X "MO_X" /* RO; 2 bytes */ #define ASMC_KEY_SMS_Y "MO_Y" /* RO; 2 bytes */ |