mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-06 15:51:34 +00:00
Removal of kernel 2.1 and 2.2 compatibility: pass one
Removed many #if statements git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@704 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
7e0cd89eec
commit
9480bb5988
27 files changed
+4
-381
No files matched your search
@@ -72,16 +72,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
#undef FORCE_ALI15X3_ENABLE
|
||||
|
||||
@@ -194,12 +185,7 @@ int ali15x3_setup(void)
|
||||
int error_return=0;
|
||||
unsigned char temp;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *ALI15X3_dev;
|
||||
#else
|
||||
unsigned char ALI15X3_bus, ALI15X3_devfn = 0;
|
||||
int res;
|
||||
#endif
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
if (pci_present() == 0) {
|
||||
@@ -209,18 +195,10 @@ int ali15x3_setup(void)
|
||||
}
|
||||
|
||||
/* Look for the ALI15X3, M7101 device */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
ALI15X3_dev = NULL;
|
||||
ALI15X3_dev = pci_find_device(PCI_VENDOR_ID_AL,
|
||||
PCI_DEVICE_ID_AL_M7101, ALI15X3_dev);
|
||||
if(ALI15X3_dev == NULL) {
|
||||
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
|
||||
res = pcibios_find_device(PCI_VENDOR_ID_AL,
|
||||
PCI_DEVICE_ID_AL_M7101,
|
||||
0,&ALI15X3_bus, &ALI15X3_devfn);
|
||||
|
||||
if (res) {
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
|
||||
printk("i2c-ali15x3.o: Error: Can't detect ali15x3!\n");
|
||||
error_return=-ENODEV;
|
||||
goto END;
|
||||
|
||||
@@ -38,16 +38,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* AMD756 SMBus address offsets */
|
||||
#define SMB_GLOBAL_STATUS (0xE0 + amd756_smba)
|
||||
@@ -144,12 +135,7 @@ int amd756_setup(void)
|
||||
int error_return=0;
|
||||
unsigned char temp;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *AMD756_dev;
|
||||
#else
|
||||
unsigned char AMD756_bus, AMD756_devfn;
|
||||
int i,res;
|
||||
#endif
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
if (pci_present() == 0) {
|
||||
@@ -159,7 +145,6 @@ int amd756_setup(void)
|
||||
}
|
||||
|
||||
/* Look for the AMD756, function 3 */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
/* Note: we keep on searching until we have found 'function 3' */
|
||||
AMD756_dev = NULL;
|
||||
do
|
||||
@@ -167,16 +152,6 @@ int amd756_setup(void)
|
||||
PCI_DEVICE_ID_AMD_756, AMD756_dev);
|
||||
while (AMD756_dev && (PCI_FUNC(AMD756_dev->devfn) != 3));
|
||||
if(AMD756_dev == NULL) {
|
||||
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
|
||||
for (i = 0;
|
||||
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82371AB_3,
|
||||
i,&AMD756_bus, &AMD756_devfn)) &&
|
||||
PCI_FUNC(AMD756_devfn) != 3;
|
||||
i++);
|
||||
|
||||
if (res) {
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
|
||||
printk("i2c-amd756.o: Error: Can't detect AMD756, function 3!\n");
|
||||
error_return=-ENODEV;
|
||||
goto END;
|
||||
|
||||
@@ -36,16 +36,7 @@
|
||||
#include <linux/i2c-algo-bit.h>
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* PCI device */
|
||||
#define VENDOR PCI_VENDOR_ID_APPLE
|
||||
@@ -145,24 +136,14 @@ struct i2c_adapter bit_hydra_ops = {
|
||||
|
||||
static int find_hydra(void)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *dev;
|
||||
#else
|
||||
unsigned char bus, devfn;
|
||||
int res;
|
||||
#endif
|
||||
unsigned int base_addr;
|
||||
|
||||
if (!pci_present())
|
||||
return -ENODEV;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)
|
||||
dev = pci_find_device(VENDOR, DEVICE, NULL);
|
||||
if (!dev) {
|
||||
#else
|
||||
res = pcibios_find_device(VENDOR,DEVICE,0,&bus, &devfn);
|
||||
if (res) {
|
||||
#endif
|
||||
printk("Hydra not found\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -170,10 +151,8 @@ static int find_hydra(void)
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13)
|
||||
base_addr = dev->resource[0].start;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
base_addr = dev->base_address[0];
|
||||
#else
|
||||
pcibios_read_config_dword(bus, devfn,PCI_BASE_ADDRESS_0,&base_addr);
|
||||
base_addr = dev->base_address[0];
|
||||
#endif
|
||||
hydra_base = (unsigned long)ioremap(base_addr, 0x100);
|
||||
|
||||
|
||||
@@ -39,10 +39,6 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
/* I801 SMBus address offsets */
|
||||
#define SMBHSTSTS (0 + i801_smba)
|
||||
#define SMBHSTCNT (2 + i801_smba)
|
||||
@@ -138,12 +134,7 @@ int i801_setup(void)
|
||||
int error_return=0;
|
||||
unsigned char temp;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *I801_dev;
|
||||
#else
|
||||
unsigned char I801_bus, I801_devfn;
|
||||
int i,res;
|
||||
#endif
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
if (pci_present() == 0) {
|
||||
@@ -154,7 +145,6 @@ int i801_setup(void)
|
||||
|
||||
/* Look for the I801, function 3 */
|
||||
/* Have to check for both the 82801AA and 82801AB */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
/* Note: we keep on searching until we have found 'function 3' */
|
||||
I801_dev = NULL;
|
||||
do
|
||||
@@ -168,23 +158,6 @@ int i801_setup(void)
|
||||
while(I801_dev && (PCI_FUNC(I801_dev->devfn) != 3));
|
||||
}
|
||||
if(I801_dev == NULL) {
|
||||
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
|
||||
for (i = 0;
|
||||
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82801AA_3,
|
||||
i,&I801_bus, &I801_devfn)) &&
|
||||
PCI_FUNC(I801_devfn) != 3;
|
||||
i++);
|
||||
if (res) {
|
||||
for (i = 0;
|
||||
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82801AB_3,
|
||||
i,&I801_bus, &I801_devfn)) &&
|
||||
PCI_FUNC(I801_devfn) != 3;
|
||||
i++);
|
||||
}
|
||||
if (res) {
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
|
||||
printk("i2c-i801.o: Error: Can't detect I801, function 3!\n");
|
||||
error_return=-ENODEV;
|
||||
goto END;
|
||||
|
||||
@@ -32,12 +32,7 @@
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "i2c-isa.h"
|
||||
|
||||
@@ -33,16 +33,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* PIIX4 SMBus address offsets */
|
||||
#define SMBHSTSTS (0 + piix4_smba)
|
||||
@@ -149,12 +140,7 @@ int piix4_setup(void)
|
||||
int error_return=0;
|
||||
unsigned char temp;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *PIIX4_dev;
|
||||
#else
|
||||
unsigned char PIIX4_bus, PIIX4_devfn;
|
||||
int i,res;
|
||||
#endif
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
if (pci_present() == 0) {
|
||||
@@ -164,7 +150,6 @@ int piix4_setup(void)
|
||||
}
|
||||
|
||||
/* Look for the PIIX4, function 3 */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
/* Note: we keep on searching until we have found 'function 3' */
|
||||
PIIX4_dev = NULL;
|
||||
do
|
||||
@@ -172,16 +157,6 @@ int piix4_setup(void)
|
||||
PCI_DEVICE_ID_INTEL_82371AB_3, PIIX4_dev);
|
||||
while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3));
|
||||
if(PIIX4_dev == NULL) {
|
||||
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
|
||||
for (i = 0;
|
||||
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82371AB_3,
|
||||
i,&PIIX4_bus, &PIIX4_devfn)) &&
|
||||
PCI_FUNC(PIIX4_devfn) != 3;
|
||||
i++);
|
||||
|
||||
if (res) {
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
|
||||
printk("i2c-piix4.o: Error: Can't detect PIIX4, function 3!\n");
|
||||
error_return=-ENODEV;
|
||||
goto END;
|
||||
|
||||
@@ -38,16 +38,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* SIS5595 SMBus registers */
|
||||
#define SMB_STS_LO 0x00
|
||||
@@ -150,12 +141,7 @@ int sis5595_setup(void)
|
||||
{
|
||||
int error_return=0;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *SIS5595_dev;
|
||||
#else
|
||||
unsigned char SIS5595_bus, SIS5595_devfn;
|
||||
int i,res;
|
||||
#endif
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
if (pci_present() == 0) {
|
||||
@@ -165,15 +151,9 @@ int sis5595_setup(void)
|
||||
}
|
||||
|
||||
/* Look for the SIS5595, function 3 */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
SIS5595_dev = NULL;
|
||||
if (!(SIS5595_dev = pci_find_device(PCI_VENDOR_ID_SI,
|
||||
PCI_DEVICE_ID_SI_503, SIS5595_dev))) {
|
||||
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
|
||||
if ((res = pcibios_find_device(PCI_VENDOR_ID_SI,
|
||||
PCI_DEVICE_ID_SI_503,
|
||||
i,&SIS5595_bus, &SIS5595_devfn))) {
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
|
||||
printk("i2c-sis5595.o: Error: Can't detect SIS5595!\n");
|
||||
error_return=-ENODEV;
|
||||
goto END;
|
||||
|
||||
@@ -29,20 +29,11 @@
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < 0x020136 /* 2.1.54 */
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/i2c-algo-bit.h>
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* PCI device */
|
||||
#define VENDOR PCI_VENDOR_ID_VIA
|
||||
@@ -127,7 +118,6 @@ static struct i2c_adapter bit_via_ops = {
|
||||
|
||||
|
||||
/* When exactly was the new pci interface introduced? */
|
||||
#if LINUX_VERSION_CODE >= 0x020136 /* 2.1.54 */
|
||||
static int find_via(void)
|
||||
{
|
||||
struct pci_dev *s_bridge;
|
||||
@@ -168,49 +158,6 @@ static int find_via(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int find_via(void)
|
||||
{
|
||||
unsigned char VIA_bus, VIA_devfn;
|
||||
u16 base;
|
||||
u8 rev;
|
||||
|
||||
if (! pcibios_present())
|
||||
return -ENODEV;
|
||||
|
||||
if(pcibios_find_device(VENDOR, DEVICE, 0, &VIA_bus, &VIA_devfn))
|
||||
{
|
||||
printk("vt82c586b not found\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if ( PCIBIOS_SUCCESSFUL !=
|
||||
pcibios_read_config_byte(VIA_bus, VIA_devfn,
|
||||
PM_CFG_REVID, &rev))
|
||||
return -ENODEV;
|
||||
|
||||
switch(rev)
|
||||
{
|
||||
case 0x00: base = PM_CFG_IOBASE0;
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x10: base = PM_CFG_IOBASE1;
|
||||
break;
|
||||
|
||||
default : base = PM_CFG_IOBASE1;
|
||||
/* later revision */
|
||||
}
|
||||
|
||||
if ( PCIBIOS_SUCCESSFUL !=
|
||||
pcibios_read_config_word(VIA_bus, VIA_devfn, base, &pm_io_base))
|
||||
return -ENODEV;
|
||||
|
||||
pm_io_base &= (0xff<<8);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MODULE
|
||||
static
|
||||
#else
|
||||
|
||||
@@ -33,17 +33,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef PCI_DEVICE_ID_VIA_82C596_3
|
||||
#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
|
||||
@@ -166,12 +156,7 @@ int vt596_setup(void)
|
||||
int error_return=0;
|
||||
unsigned char temp;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *VT596_dev;
|
||||
#else
|
||||
unsigned char VT596_bus, VT596_devfn;
|
||||
int i,res;
|
||||
#endif
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
if (pci_present() == 0) {
|
||||
@@ -181,7 +166,6 @@ int vt596_setup(void)
|
||||
}
|
||||
|
||||
/* Look for the VT596 function 3 _or_ VT686 function 4 */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
VT596_dev = NULL;
|
||||
VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA,
|
||||
PCI_DEVICE_ID_VIA_82C596_3, VT596_dev);
|
||||
@@ -190,24 +174,6 @@ int vt596_setup(void)
|
||||
PCI_DEVICE_ID_VIA_82C686_4, VT596_dev);
|
||||
|
||||
if (VT596_dev == NULL) {
|
||||
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
|
||||
for (i = 0;
|
||||
! (res = pcibios_find_device(PCI_VENDOR_ID_VIA,
|
||||
PCI_DEVICE_ID_VIA_82C596_3,
|
||||
i,&VT596_bus, &VT596_devfn)) &&
|
||||
PCI_FUNC(VT596_devfn) != 3;
|
||||
i++);
|
||||
|
||||
if (res)
|
||||
for (i = 0;
|
||||
! (res = pcibios_find_device(PCI_VENDOR_ID_VIA,
|
||||
PCI_DEVICE_ID_VIA_82C686_4,
|
||||
i,&VT596_bus, &VT596_devfn)) &&
|
||||
PCI_FUNC(VT596_devfn) != 4;
|
||||
i++);
|
||||
|
||||
if (res) {
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
|
||||
printk("i2c-viapro.o: Error: Can't detect vt82c596 or vt82c686");
|
||||
error_return=-ENODEV;
|
||||
goto END;
|
||||
|
||||
@@ -42,27 +42,12 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* 3DFX defines */
|
||||
#ifndef PCI_VENDOR_ID_3DFX
|
||||
#define PCI_VENDOR_ID_3DFX 0x121a
|
||||
#endif
|
||||
#ifndef PCI_DEVICE_ID_3DFX_VOODOO3
|
||||
#define PCI_DEVICE_ID_3DFX_VOODOO3 0x05
|
||||
#endif
|
||||
#ifndef PCI_DEVICE_ID_3DFX_BANSHEE
|
||||
#define PCI_DEVICE_ID_3DFX_BANSHEE 0x03
|
||||
#endif
|
||||
|
||||
#ifdef MODULE
|
||||
static
|
||||
@@ -680,11 +665,8 @@ void config_v3(struct pci_dev *dev)
|
||||
/* map Voodoo3 memory */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13)
|
||||
cadr = dev->resource[0].start;
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)
|
||||
cadr = dev->base_address[0];
|
||||
#else
|
||||
pcibios_read_config_dword(dev->bus->number, dev->devfn,
|
||||
PCI_BASE_ADDRESS_0,&cadr);
|
||||
cadr = dev->base_address[0];
|
||||
#endif
|
||||
cadr&=PCI_BASE_ADDRESS_MEM_MASK;
|
||||
mem=ioremap(cadr, 0x1000);
|
||||
|
||||
@@ -28,12 +28,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -62,12 +62,7 @@
|
||||
#include "i2c-isa.h"
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
|
||||
@@ -29,12 +29,7 @@
|
||||
#include "i2c-isa.h"
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
|
||||
@@ -28,13 +28,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -29,12 +29,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
#ifdef __SMP__
|
||||
#include <linux/smp_lock.h>
|
||||
@@ -156,10 +151,8 @@ struct gl518_data {
|
||||
struct semaphore update_lock;
|
||||
|
||||
int iterate_lock;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
int quit_thread;
|
||||
struct task_struct *thread;
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)
|
||||
wait_queue_head_t wq;
|
||||
#else
|
||||
@@ -406,10 +399,8 @@ static int gl518_detect(struct i2c_adapter *adapter, int address,
|
||||
/* Initialize the GL518SM chip */
|
||||
data->iterate = 0;
|
||||
data->iterate_lock = 0;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
data->quit_thread = 0;
|
||||
data->thread = NULL;
|
||||
#endif
|
||||
data->alarm_mask = 0xff;
|
||||
gl518_init_client((struct i2c_client *) new_client);
|
||||
return 0;
|
||||
@@ -492,12 +483,10 @@ int gl518_detach_client(struct i2c_client *client)
|
||||
}
|
||||
gl518_list[i] = NULL;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
if (data->thread) {
|
||||
data->quit_thread = 1;
|
||||
wake_up_interruptible(&data->wq);
|
||||
}
|
||||
#endif
|
||||
|
||||
kfree(client);
|
||||
|
||||
@@ -651,7 +640,6 @@ void gl518_update_client_rev00(struct i2c_client *client)
|
||||
}
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
int gl518_update_thread(void *c)
|
||||
{
|
||||
struct i2c_client *client = c;
|
||||
@@ -694,7 +682,6 @@ int gl518_update_thread(void *c)
|
||||
data->quit_thread = 0;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This updates vdd, vin1, vin2 values by doing slow and multiple
|
||||
comparisons for the GL518SM rev 00 that lacks support for direct
|
||||
@@ -734,11 +721,9 @@ void gl518_update_iterate(struct i2c_client *client)
|
||||
for (i=0; i<3; i++)
|
||||
gl518_write_value(client, VIN_REG(i), max[i] << 8 | min[i]);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
if ((data->thread) &&
|
||||
((data->quit_thread) || signal_pending(current)))
|
||||
goto finish;
|
||||
#endif
|
||||
|
||||
/* we wait now 1.5 seconds before comparing */
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
@@ -1007,7 +992,6 @@ void gl518_iterate(struct i2c_client *client, int operation, int ctl_name,
|
||||
}
|
||||
data->valid=0;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
if ((data->iterate != 2) && (data->thread)) {
|
||||
data->quit_thread = 1;
|
||||
wake_up_interruptible(&data->wq);
|
||||
@@ -1019,7 +1003,6 @@ void gl518_iterate(struct i2c_client *client, int operation, int ctl_name,
|
||||
#endif
|
||||
kernel_thread(gl518_update_thread, (void*) client, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {0x2c,0x2d,SENSORS_I2C_END};
|
||||
|
||||
@@ -35,12 +35,7 @@
|
||||
#include "sensors.h"
|
||||
#include "i2c-isa.h"
|
||||
#include "version.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Many constants specified below */
|
||||
|
||||
@@ -27,13 +27,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -33,13 +33,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -34,13 +34,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -50,13 +50,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -31,13 +31,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {0x2E,SENSORS_I2C_END};
|
||||
|
||||
@@ -53,13 +53,7 @@ static const char *version_str = "1.00 25/2/99 Fons Rademakers";
|
||||
#include "i2c-isa.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#undef AUTODETECT /* try to autodetect MaxiLife version */
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/pci.h>
|
||||
#if LINUX_VERSION_CODE < 0x020136 /* 2.1.54 */
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
#include <asm/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
@@ -39,13 +36,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan.
|
||||
Note that we can't determine the ISA address until we have initialized
|
||||
@@ -274,25 +265,15 @@ int sis5595_attach_adapter(struct i2c_adapter *adapter)
|
||||
/* Locate SiS bridge and correct base address for SIS5595 */
|
||||
int sis5595_find_sis(int *address)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *s_bridge;
|
||||
#else
|
||||
unsigned char SIS_bus, SIS_devfn;
|
||||
#endif
|
||||
u16 val;
|
||||
|
||||
if (! pci_present())
|
||||
return -ENODEV;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
if (! (s_bridge = pci_find_device(
|
||||
PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, NULL)))
|
||||
|
||||
#else
|
||||
if(pcibios_find_device(
|
||||
PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, 0,
|
||||
&SIS_bus, &SIS_devfn))
|
||||
#endif
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
|
||||
@@ -30,13 +30,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -47,12 +47,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* RT Table support #defined so we can take it out if it gets bothersome */
|
||||
#define W83781D_RT 1
|
||||
|
||||
+2
-14
@@ -33,11 +33,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#endif
|
||||
|
||||
#ifdef MODULE
|
||||
extern int init_module(void);
|
||||
@@ -62,14 +58,12 @@ static int __init sensors_init(void);
|
||||
#define SENSORS_ENTRY_MAX 20
|
||||
static struct ctl_table_header *sensors_entries[SENSORS_ENTRY_MAX];
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))
|
||||
static struct i2c_client *sensors_clients[SENSORS_ENTRY_MAX];
|
||||
static unsigned short sensors_inodes[SENSORS_ENTRY_MAX];
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)
|
||||
static void sensors_fill_inode(struct inode *inode, int fill);
|
||||
static void sensors_dir_fill_inode(struct inode *inode, int fill);
|
||||
#endif
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) */
|
||||
|
||||
static ctl_table sysctl_table[] = {
|
||||
{ CTL_DEV, "dev", NULL, 0, 0555 },
|
||||
@@ -183,7 +177,6 @@ int sensors_register_entry(struct i2c_client *client ,const char *prefix,
|
||||
|
||||
sensors_entries[id-256] = new_header;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))
|
||||
sensors_clients[id-256] = client;
|
||||
#ifdef DEBUG
|
||||
if (!new_header || !new_header->ctl_table ||
|
||||
@@ -200,7 +193,6 @@ int sensors_register_entry(struct i2c_client *client ,const char *prefix,
|
||||
#else
|
||||
new_header->ctl_table->child->child->de->fill_inode = &sensors_dir_fill_inode;
|
||||
#endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
|
||||
#endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))
|
||||
|
||||
return id;
|
||||
}
|
||||
@@ -218,13 +210,10 @@ void sensors_deregister_entry(int id)
|
||||
kfree(temp);
|
||||
kfree(table);
|
||||
sensors_entries[id] = NULL;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))
|
||||
sensors_clients[id] = NULL;
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
|
||||
}
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))
|
||||
/* Monitor access for /proc/sys/dev/sensors; make unloading sensors.o
|
||||
impossible if some process still uses it or some file in it */
|
||||
void sensors_fill_inode(struct inode *inode, int fill)
|
||||
@@ -266,7 +255,6 @@ void sensors_dir_fill_inode(struct inode *inode, int fill)
|
||||
else
|
||||
client->driver->dec_use(client);
|
||||
}
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
|
||||
|
||||
int sensors_proc_chips(ctl_table *ctl, int write, struct file * filp,
|
||||
void *buffer, size_t *lenp)
|
||||
@@ -777,7 +765,7 @@ int __init sensors_init(void)
|
||||
return -ENOMEM;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1))
|
||||
sensors_proc_header->ctl_table->child->de->owner = THIS_MODULE;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58))
|
||||
#else
|
||||
sensors_proc_header->ctl_table->child->de->fill_inode = &sensors_fill_inode;
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) */
|
||||
sensors_initialized ++;
|
||||
|
||||
Reference in new issue
Block a user