From 29a33cac357bd59e9c4843b389259ac06c8454e7 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Wed, 9 Jun 1999 17:26:32 +0000 Subject: [PATCH] Several small patches to make everything compile against all 2.0.x kernels, even early ones. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@477 7894878c-1315-0410-8ee3-d5d059ff63e0 --- i2c/MODIFICATIONS | 3 +++ i2c/i2c.h | 4 ++++ kernel/busses/i2c-isa.c | 6 ++++++ kernel/include/compat.h | 8 +++++++- kernel/include/i2c-isa.h | 4 ++++ kernel/include/smbus.h | 4 ++++ kernel/smbus.c | 6 ++++++ 7 files changed, 34 insertions(+), 1 deletion(-) diff --git a/i2c/MODIFICATIONS b/i2c/MODIFICATIONS index d055b0e4..106bc971 100644 --- a/i2c/MODIFICATIONS +++ b/i2c/MODIFICATIONS @@ -19,6 +19,9 @@ Here come the changes: ! Changed to init_MUTEX and a compatibility line in i2c-core.c +! i2c.h now includes instead of for old + 2.0 kernels + * Algo-bit now scans the bus before registering the adapter. * Bit-lp and bit-velle don't increase module usage counts diff --git a/i2c/i2c.h b/i2c/i2c.h index e654a7ad..3e060004 100644 --- a/i2c/i2c.h +++ b/i2c/i2c.h @@ -31,8 +31,12 @@ #include /* for spinlock_t */ #else #include /* Needed for 2.2 kernels */ +#if LINUX_VERSION_CODE < 0x020019 +#include +#else #include #endif +#endif /* --- General options ------------------------------------------------ */ #define I2C_ALGO_MAX 4 /* control memory consumption */ diff --git a/kernel/busses/i2c-isa.c b/kernel/busses/i2c-isa.c index 68f05c4d..f0d96b9c 100644 --- a/kernel/busses/i2c-isa.c +++ b/kernel/busses/i2c-isa.c @@ -27,12 +27,18 @@ #include #include +#include "compat.h" + #include "i2c.h" #ifdef I2C_SPINLOCK #include #else +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,19) +#include +#else #include #endif +#endif #include "version.h" #include "i2c-isa.h" diff --git a/kernel/include/compat.h b/kernel/include/compat.h index a5ee8532..6ffb4ab5 100644 --- a/kernel/include/compat.h +++ b/kernel/include/compat.h @@ -94,8 +94,14 @@ #endif /* For old 2.0 kernels */ -#ifndef PCI_DEVICE_ID_VIA_82C586_3 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,34)) #define PCI_DEVICE_ID_VIA_82C586_3 0x3040 +#define PCI_DEVICE_ID_AL_M7101 0x7101 +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,31)) +#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e #endif #endif /* SENSORS_COMPAT_H */ diff --git a/kernel/include/i2c-isa.h b/kernel/include/i2c-isa.h index 8a8496dd..e81b72fc 100644 --- a/kernel/include/i2c-isa.h +++ b/kernel/include/i2c-isa.h @@ -39,8 +39,12 @@ #ifdef I2C_SPINLOCK #include #else +#if LINUX_VERSION_CODE < 0x020019 +#include +#else #include #endif +#endif #ifdef LM_SENSORS /* TBD */ #include "i2c.h" /* TBD */ diff --git a/kernel/include/smbus.h b/kernel/include/smbus.h index cea52d66..cf788292 100644 --- a/kernel/include/smbus.h +++ b/kernel/include/smbus.h @@ -58,8 +58,12 @@ union smbus_data { #ifdef I2C_SPINLOCK #include #else +#if LINUX_VERSION_CODE < 0x020019 +#include +#else #include #endif +#endif #ifdef LM_SENSORS /* TBD */ #include "i2c.h" /* TBD */ diff --git a/kernel/smbus.c b/kernel/smbus.c index 5bf8c41a..de780cbb 100644 --- a/kernel/smbus.c +++ b/kernel/smbus.c @@ -23,12 +23,18 @@ #include #include +#include "compat.h" + #include "i2c.h" #ifdef I2C_SPINLOCK #include #else +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,19) +#include +#else #include #endif +#endif #include "version.h" #include "smbus.h"