Changeset 12
- Timestamp:
- 11/23/98 23:34:34 (10 years ago)
- Files:
-
- lm-sensors/trunk/doc/design (modified) (2 diffs)
- lm-sensors/trunk/kernel/Module.mk (modified) (1 diff)
- lm-sensors/trunk/kernel/busses/i2c-isa.c (added)
- lm-sensors/trunk/kernel/include/i2c-isa.h (added)
- lm-sensors/trunk/kernel/include/isa.h (added)
- lm-sensors/trunk/kernel/include/smbus.h (modified) (2 diffs)
- lm-sensors/trunk/kernel/smbus.c (modified) (2 diffs)
- lm-sensors/trunk/src/Module.mk (modified) (1 diff)
- lm-sensors/trunk/src/isa.c (added)
- lm-sensors/trunk/src/isa.h (added)
- lm-sensors/trunk/src/smbus.c (modified) (2 diffs)
- lm-sensors/trunk/src/smbus.h (modified) (2 diffs)
- lm-sensors/trunk/version.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/doc/design
r8 r12 7 7 1.1, 19981111. 8 8 1.2, 19981118. 9 10 --> Never, ever change the driver struct with this technique! 9 11 10 12 … … 169 171 -------- 170 172 171 struct sensor_driver {173 struct i2c_driver { 172 174 char name[32]; 173 175 int id; lm-sensors/trunk/kernel/Module.mk
r11 r12 23 23 # Regrettably, even 'simply expanded variables' will not put their currently 24 24 # defined value verbatim into the command-list of rules... 25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o 25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o 26 26 27 27 # Include all dependency files lm-sensors/trunk/kernel/include/smbus.h
r9 r12 125 125 #define SMBUS_PIIX4 1 126 126 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 127 134 /* This union is used within smbus_access routines */ 128 135 union smbus_data { … … 256 263 } 257 264 265 258 266 /* 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)) 270 287 271 288 lm-sensors/trunk/kernel/smbus.c
r11 r12 21 21 #include <linux/kernel.h> 22 22 23 #include "i2c.h" 23 24 #ifdef SPINLOCK 24 25 #include <asm/spinlock.h> … … 157 158 } 158 159 159 /* Next: define SMBus variants of registering. Very boring. To make it possible160 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 202 160 int smbus_init(void) 203 161 { lm-sensors/trunk/src/Module.mk
r11 r12 23 23 # Regrettably, even 'simply expanded variables' will not put their currently 24 24 # defined value verbatim into the command-list of rules... 25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o 25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o 26 26 27 27 # Include all dependency files lm-sensors/trunk/src/smbus.c
r11 r12 21 21 #include <linux/kernel.h> 22 22 23 #include "i2c.h" 23 24 #ifdef SPINLOCK 24 25 #include <asm/spinlock.h> … … 157 158 } 158 159 159 /* Next: define SMBus variants of registering. Very boring. To make it possible160 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 202 160 int smbus_init(void) 203 161 { lm-sensors/trunk/src/smbus.h
r9 r12 125 125 #define SMBUS_PIIX4 1 126 126 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 127 134 /* This union is used within smbus_access routines */ 128 135 union smbus_data { … … 256 263 } 257 264 265 258 266 /* 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)) 270 287 271 288 lm-sensors/trunk/version.h
r4 r12 1 #define LM_DATE "199811 03"2 #define LM_VERSION "2.0.0pre 0"1 #define LM_DATE "19981122" 2 #define LM_VERSION "2.0.0pre1"
