Changeset 12

Show
Ignore:
Timestamp:
11/23/98 23:34:34 (10 years ago)
Author:
frodo
Message:

isa module added, some bugfixes

'isa.o' is roughly what was called 'sensor.o' in doc/design.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/doc/design

    r8 r12  
    77                 1.1, 19981111. 
    88                 1.2, 19981118. 
     9 
     10--> Never, ever change the driver struct with this technique!  
    911 
    1012 
     
    169171-------- 
    170172 
    171 struct sensor_driver { 
     173struct i2c_driver { 
    172174  char name[32]; 
    173175  int id; 
  • lm-sensors/trunk/kernel/Module.mk

    r11 r12  
    2323# Regrettably, even 'simply expanded variables' will not put their currently 
    2424# defined value verbatim into the command-list of rules... 
    25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o 
     25SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o 
    2626 
    2727# Include all dependency files 
  • lm-sensors/trunk/kernel/include/smbus.h

    r9 r12  
    125125#define SMBUS_PIIX4 1 
    126126 
     127/* Detect whether we are on an SMBus-only bus. Note that if this returns 
     128   false, you can still use the smbus access routines, as these emulate 
     129   the SMBus on I2C. Unless they are undefined on your algorithm, of 
     130   course. */ 
     131#define i2c_is_smbus_client(clientptr) \ 
     132        ((clientptr)->adapter->algo->id == ALGO_SMBUS) 
     133 
    127134/* This union is used within smbus_access routines */ 
    128135union smbus_data {  
     
    256263} 
    257264 
     265 
    258266/* Next: define SMBus variants of registering. */ 
    259 extern int smbus_add_algorithm(struct smbus_algorithm *algorithm); 
    260 extern int smbus_del_algorithm(struct smbus_algorithm *algorithm); 
    261  
    262 extern int smbus_add_adapter(struct smbus_adapter *adapter); 
    263 extern int smbus_del_adapter(struct smbus_adapter *adapter); 
    264  
    265 extern int smbus_add_driver(struct smbus_driver *driver); 
    266 extern int smbus_del_driver(struct smbus_driver *driver); 
    267  
    268 extern int smbus_attach_client(struct smbus_client *client); 
    269 extern int smbus_detach_client(struct smbus_client *client); 
     267 
     268#define smbus_add_algorithm(algoptr) \ 
     269        i2c_add_algorithm((struct i2c_algorithm *) (algoptr)) 
     270#define smbus_del_algorithm(algoptr) \ 
     271        i2c_del_algorithm((struct i2c_algorithm *) (algoptr)) 
     272 
     273#define smbus_add_adapter(adapptr) \ 
     274        i2c_add_adapter((struct i2c_adapter *) (adapptr)) 
     275#define smbus_del_adapter(adapptr) \ 
     276        i2c_del_adapter((struct i2c_adapter *) (adapptr)) 
     277 
     278#define smbus_add_driver(driverptr) \ 
     279        i2c_add_driver((struct i2c_driver *) (driverptr)) 
     280#define smbus_del_driver(driverptr) \ 
     281        i2c_add_driver((struct i2c_driver *) (driverptr)) 
     282 
     283#define smbus_attach_client(clientptr) \ 
     284        i2c_attach_client((struct i2c_client *) (clientptr)) 
     285#define smbus_detach_client(clientptr) \ 
     286        i2c_detach_client((struct i2c_client *) (clientptr)) 
    270287 
    271288 
  • lm-sensors/trunk/kernel/smbus.c

    r11 r12  
    2121#include <linux/kernel.h> 
    2222 
     23#include "i2c.h" 
    2324#ifdef SPINLOCK 
    2425#include <asm/spinlock.h> 
     
    157158} 
    158159 
    159 /* Next: define SMBus variants of registering. Very boring. To make it possible 
    160    to change these definitions in the future without recompiling all modules, 
    161    we do not define them as inline. */ 
    162 int smbus_add_algorithm(struct smbus_algorithm *algorithm) 
    163 { 
    164   return i2c_add_algorithm( (struct i2c_algorithm *) algorithm); 
    165 } 
    166  
    167 int smbus_del_algorithm(struct smbus_algorithm *algorithm) 
    168 { 
    169   return i2c_del_algorithm( (struct i2c_algorithm *) algorithm); 
    170 } 
    171  
    172 int smbus_add_adapter(struct smbus_adapter *adapter) 
    173 { 
    174   return i2c_add_adapter( (struct i2c_adapter *) adapter); 
    175 } 
    176  
    177 int smbus_del_adapter(struct smbus_adapter *adapter) 
    178 { 
    179   return i2c_del_adapter( (struct i2c_adapter *) adapter); 
    180 } 
    181  
    182 int smbus_add_driver(struct smbus_driver *driver) 
    183 { 
    184   return i2c_add_driver( (struct i2c_driver *) driver); 
    185 } 
    186  
    187 int smbus_del_driver(struct smbus_driver *driver) 
    188 { 
    189   return i2c_del_driver( (struct i2c_driver *) driver); 
    190 } 
    191  
    192 int smbus_attach_client(struct smbus_client *client) 
    193 { 
    194   return i2c_attach_client( (struct i2c_client *) client); 
    195 } 
    196  
    197 int smbus_detach_client(struct smbus_client *client) 
    198 { 
    199   return i2c_detach_client( (struct i2c_client *) client); 
    200 } 
    201  
    202160int smbus_init(void) 
    203161{ 
  • lm-sensors/trunk/src/Module.mk

    r11 r12  
    2323# Regrettably, even 'simply expanded variables' will not put their currently 
    2424# defined value verbatim into the command-list of rules... 
    25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o 
     25SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o 
    2626 
    2727# Include all dependency files 
  • lm-sensors/trunk/src/smbus.c

    r11 r12  
    2121#include <linux/kernel.h> 
    2222 
     23#include "i2c.h" 
    2324#ifdef SPINLOCK 
    2425#include <asm/spinlock.h> 
     
    157158} 
    158159 
    159 /* Next: define SMBus variants of registering. Very boring. To make it possible 
    160    to change these definitions in the future without recompiling all modules, 
    161    we do not define them as inline. */ 
    162 int smbus_add_algorithm(struct smbus_algorithm *algorithm) 
    163 { 
    164   return i2c_add_algorithm( (struct i2c_algorithm *) algorithm); 
    165 } 
    166  
    167 int smbus_del_algorithm(struct smbus_algorithm *algorithm) 
    168 { 
    169   return i2c_del_algorithm( (struct i2c_algorithm *) algorithm); 
    170 } 
    171  
    172 int smbus_add_adapter(struct smbus_adapter *adapter) 
    173 { 
    174   return i2c_add_adapter( (struct i2c_adapter *) adapter); 
    175 } 
    176  
    177 int smbus_del_adapter(struct smbus_adapter *adapter) 
    178 { 
    179   return i2c_del_adapter( (struct i2c_adapter *) adapter); 
    180 } 
    181  
    182 int smbus_add_driver(struct smbus_driver *driver) 
    183 { 
    184   return i2c_add_driver( (struct i2c_driver *) driver); 
    185 } 
    186  
    187 int smbus_del_driver(struct smbus_driver *driver) 
    188 { 
    189   return i2c_del_driver( (struct i2c_driver *) driver); 
    190 } 
    191  
    192 int smbus_attach_client(struct smbus_client *client) 
    193 { 
    194   return i2c_attach_client( (struct i2c_client *) client); 
    195 } 
    196  
    197 int smbus_detach_client(struct smbus_client *client) 
    198 { 
    199   return i2c_detach_client( (struct i2c_client *) client); 
    200 } 
    201  
    202160int smbus_init(void) 
    203161{ 
  • lm-sensors/trunk/src/smbus.h

    r9 r12  
    125125#define SMBUS_PIIX4 1 
    126126 
     127/* Detect whether we are on an SMBus-only bus. Note that if this returns 
     128   false, you can still use the smbus access routines, as these emulate 
     129   the SMBus on I2C. Unless they are undefined on your algorithm, of 
     130   course. */ 
     131#define i2c_is_smbus_client(clientptr) \ 
     132        ((clientptr)->adapter->algo->id == ALGO_SMBUS) 
     133 
    127134/* This union is used within smbus_access routines */ 
    128135union smbus_data {  
     
    256263} 
    257264 
     265 
    258266/* Next: define SMBus variants of registering. */ 
    259 extern int smbus_add_algorithm(struct smbus_algorithm *algorithm); 
    260 extern int smbus_del_algorithm(struct smbus_algorithm *algorithm); 
    261  
    262 extern int smbus_add_adapter(struct smbus_adapter *adapter); 
    263 extern int smbus_del_adapter(struct smbus_adapter *adapter); 
    264  
    265 extern int smbus_add_driver(struct smbus_driver *driver); 
    266 extern int smbus_del_driver(struct smbus_driver *driver); 
    267  
    268 extern int smbus_attach_client(struct smbus_client *client); 
    269 extern int smbus_detach_client(struct smbus_client *client); 
     267 
     268#define smbus_add_algorithm(algoptr) \ 
     269        i2c_add_algorithm((struct i2c_algorithm *) (algoptr)) 
     270#define smbus_del_algorithm(algoptr) \ 
     271        i2c_del_algorithm((struct i2c_algorithm *) (algoptr)) 
     272 
     273#define smbus_add_adapter(adapptr) \ 
     274        i2c_add_adapter((struct i2c_adapter *) (adapptr)) 
     275#define smbus_del_adapter(adapptr) \ 
     276        i2c_del_adapter((struct i2c_adapter *) (adapptr)) 
     277 
     278#define smbus_add_driver(driverptr) \ 
     279        i2c_add_driver((struct i2c_driver *) (driverptr)) 
     280#define smbus_del_driver(driverptr) \ 
     281        i2c_add_driver((struct i2c_driver *) (driverptr)) 
     282 
     283#define smbus_attach_client(clientptr) \ 
     284        i2c_attach_client((struct i2c_client *) (clientptr)) 
     285#define smbus_detach_client(clientptr) \ 
     286        i2c_detach_client((struct i2c_client *) (clientptr)) 
    270287 
    271288 
  • lm-sensors/trunk/version.h

    r4 r12  
    1 #define LM_DATE "19981103
    2 #define LM_VERSION "2.0.0pre0
     1#define LM_DATE "19981122
     2#define LM_VERSION "2.0.0pre1