[PATCH 2.4-bk] make sonypi use ec_read/ec_write from ACPI patch

From: Stelian Pop (stelian@popies.net)
Date: Thu Jan 23 2003 - 08:29:14 EST


Hi,

This patch avoids a conflict between the sonypi driver and the
latest ACPI patch, by letting sonypi use the ACPI provided
functions ec_read/ec_write.

A variant of this patch (without the conditional testing of the
ACPI version) is already used in the 2.5 kernel.

Credits for the patch go to Ducrot Bruno.

Marcelo, Alan, please apply this to your trees.

Thanks,

Stelian.

===== drivers/char/sonypi.h 1.13 vs edited =====
--- 1.13/drivers/char/sonypi.h Thu Jan 9 13:46:12 2003
+++ edited/drivers/char/sonypi.h Thu Jan 23 14:19:57 2003
@@ -363,6 +363,14 @@
                 printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __FUNCTION__, __LINE__); \
 }
 
+#ifdef CONFIG_ACPI
+#include <linux/acpi.h>
+#if (ACPI_CA_VERSION > 0x20021121)
+#define USE_ACPI
+#endif
+#endif /* CONFIG_ACPI */
+
+#ifndef USE_ACPI
 extern int verbose;
 
 static inline int ec_write(u8 addr, u8 value) {
@@ -385,6 +393,7 @@
         *value = inb_p(SONYPI_DATA_IOPORT);
         return 0;
 }
+#endif /* ! USE_ACPI */
 
 #endif /* __KERNEL__ */
 

-- 
Stelian Pop <stelian@popies.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:31 EST