Skip to contentSkip to conversation

make sonypi use ec_read/ec_write from ACPI patch

PATCH New Stelian Pop 1 participant 1 message Jan 23, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make sonypi use ec_read/ec_write from ACPI patch

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 =====

drivers/char/sonypi.h +9 -0
@@ -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__ */
 
Signature · 1 line
Stelian Pop <[email protected]>