Changeset 13
- Timestamp:
- 11/26/98 11:16:08 (14 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 12 modified
-
TODO (modified) (1 diff)
-
kernel/Module.mk (modified) (1 diff)
-
kernel/busses/i2c-piix4.c (modified) (2 diffs)
-
kernel/include/i2c-isa.h (modified) (2 diffs)
-
kernel/include/isa.h (modified) (2 diffs)
-
kernel/include/smbus.h (modified) (12 diffs)
-
kernel/smbus.c (modified) (4 diffs)
-
src/Module.mk (modified) (1 diff)
-
src/isa.h (modified) (2 diffs)
-
src/piix4.c (modified) (2 diffs)
-
src/smbus.c (modified) (4 diffs)
-
src/smbus.h (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/TODO
r8 r13 1 1 Many, many things. Most notably: 2 2 3 * Write s32 smbus_access_i2c in smbus.c 4 * Check out whether we can use the dev interface for smbus (like i2c) 5 * Write all other modules 3 * Write smbus_access_i2c in smbus.c 4 * Write piix4_* in piix4.c 5 * Complete lm78 driver 6 * Extend dev interface for SMBus 7 * Create entries in /proc/bus: a list of all registered busses, and for 8 each bus, a file with registered clients. 9 * Write all other drivers 10 * How to make drivers detect thing *not*; for example, if a Winbond is 11 present, the LM75 driver should not try to access its simulated 12 LM75 chips! 13 * Write a userland-library for SMBus/i2c access (through the /dev interface) 14 * Write a userland detection program for busses (clients are less important; 15 but perhaps needed too). 16 * Bring doc/design up-to-date (it is horribly out of date right now) -
lm-sensors/trunk/kernel/Module.mk
r12 r13 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 $(MODULE_DIR)/isa.o 25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o \ 26 $(MODULE_DIR)/lm78.o 26 27 27 28 # Include all dependency files -
lm-sensors/trunk/kernel/busses/i2c-piix4.c
r11 r13 50 50 { 51 51 /* TO BE WRITTEN! */ 52 return -1; 52 53 } 53 54 … … 90 91 { 91 92 if ((res = smbus_del_adapter(&piix4_adapter))) { 92 printk("piix4.o: smbus_del_adapter failed, module not removed ");93 printk("piix4.o: smbus_del_adapter failed, module not removed\n"); 93 94 return res; 94 } 95 else 95 } else 96 96 piix4_initialized--; 97 97 } -
lm-sensors/trunk/kernel/include/i2c-isa.h
r12 r13 78 78 79 79 /* Here ended i2c_client */ 80 unsigned int full_address;80 unsigned int isa_addr; 81 81 }; 82 82 … … 128 128 #define i2c_is_isa_client(clientptr) \ 129 129 ((clientptr)->adapter->algo->id == ALGO_ISA) 130 #define i2c_is_isa_adapter(adapptr) \ 131 ((adapptr)->algo->id == ALGO_ISA) 130 132 131 133 /* Next: define ISA variants of registering. */ -
lm-sensors/trunk/kernel/include/isa.h
r12 r13 78 78 79 79 /* Here ended i2c_client */ 80 unsigned int full_address;80 unsigned int isa_addr; 81 81 }; 82 82 … … 128 128 #define i2c_is_isa_client(clientptr) \ 129 129 ((clientptr)->adapter->algo->id == ALGO_ISA) 130 #define i2c_is_isa_adapter(adapptr) \ 131 ((adapptr)->algo->id == ALGO_ISA) 130 132 131 133 /* Next: define ISA variants of registering. */ -
lm-sensors/trunk/kernel/include/smbus.h
r12 r13 131 131 #define i2c_is_smbus_client(clientptr) \ 132 132 ((clientptr)->adapter->algo->id == ALGO_SMBUS) 133 #define i2c_is_smbus_adapter(adapptr) \ 134 ((adapptr)->algo->id == ALGO_SMBUS) 133 135 134 136 /* This union is used within smbus_access routines */ … … 158 160 /* This is the very generalized SMBus access routine. You probably do not 159 161 want to use this, though; one of the functions below may be much easier, 160 and probably just as fast. */ 161 extern s32 smbus_access (struct smbus_adapter * adapter, u8 addr, 162 and probably just as fast. 163 Note that we use i2c_adapter here, because you do not need a specific 164 smbus adapter to call this function. */ 165 extern s32 smbus_access (struct i2c_adapter * adapter, u8 addr, 162 166 char read_write, u8 command, int size, 163 167 union smbus_data * data); … … 166 170 conventions of smbus_access. */ 167 171 168 extern inline s32 smbus_write_quick(struct smbus_adapter * adapter, u8 addr,172 extern inline s32 smbus_write_quick(struct i2c_adapter * adapter, u8 addr, 169 173 u8 value) 170 174 { … … 172 176 } 173 177 174 extern inline s32 smbus_read_byte(struct smbus_adapter * adapter,u8 addr)178 extern inline s32 smbus_read_byte(struct i2c_adapter * adapter,u8 addr) 175 179 { 176 180 union smbus_data data; … … 181 185 } 182 186 183 extern inline s32 smbus_write_byte(struct smbus_adapter * adapter, u8 addr,187 extern inline s32 smbus_write_byte(struct i2c_adapter * adapter, u8 addr, 184 188 u8 value) 185 189 { … … 187 191 } 188 192 189 extern inline s32 smbus_read_byte_data(struct smbus_adapter * adapter,193 extern inline s32 smbus_read_byte_data(struct i2c_adapter * adapter, 190 194 u8 addr, u8 command) 191 195 { … … 197 201 } 198 202 199 extern inline s32 smbus_write_byte_data(struct smbus_adapter * adapter,203 extern inline s32 smbus_write_byte_data(struct i2c_adapter * adapter, 200 204 u8 addr, u8 command, u8 value) 201 205 { … … 205 209 } 206 210 207 extern inline s32 smbus_read_word_data(struct smbus_adapter * adapter,211 extern inline s32 smbus_read_word_data(struct i2c_adapter * adapter, 208 212 u8 addr, u8 command) 209 213 { … … 215 219 } 216 220 217 extern inline s32 smbus_write_word_data(struct smbus_adapter * adapter,221 extern inline s32 smbus_write_word_data(struct i2c_adapter * adapter, 218 222 u8 addr, u8 command, u16 value) 219 223 { … … 223 227 } 224 228 225 extern inline s32 smbus_process_call(struct smbus_adapter * adapter,229 extern inline s32 smbus_process_call(struct i2c_adapter * adapter, 226 230 u8 addr, u8 command, u16 value) 227 231 { … … 235 239 236 240 /* Returns the number of read bytes */ 237 extern inline s32 smbus_read_block_data(struct smbus_adapter * adapter,241 extern inline s32 smbus_read_block_data(struct i2c_adapter * adapter, 238 242 u8 addr, u8 command, u8 *values) 239 243 { … … 249 253 } 250 254 251 extern inline int smbus_write_block_data(struct smbus_adapter * adapter,255 extern inline int smbus_write_block_data(struct i2c_adapter * adapter, 252 256 u8 addr, u8 command, u8 length, 253 257 u8 *values) -
lm-sensors/trunk/kernel/smbus.c
r12 r13 31 31 #include "smbus.h" 32 32 33 static s32 smbus_access_i2c (struct smbus_adapter * adapter, u8 addr,33 static s32 smbus_access_i2c (struct i2c_adapter * adapter, u8 addr, 34 34 char read_write, u8 command, int size, 35 35 union smbus_data * data); … … 70 70 We do all locking here, so you can ignore that in the adapter-specific 71 71 smbus_accesss routine. */ 72 s32 smbus_access (struct smbus_adapter * adapter, u8 addr, char read_write,72 s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, 73 73 u8 command, int size, union smbus_data * data) 74 74 { … … 80 80 #endif 81 81 if (adapter->id & ALGO_SMBUS) 82 res = adapter->smbus_access(addr,read_write,command,size,data); 82 res = ((struct smbus_adapter *) adapter) -> 83 smbus_access(addr,read_write,command,size,data); 83 84 else 84 85 res = smbus_access_i2c(adapter,addr,read_write,command,size,data); … … 96 97 For SMBUS_BYTE: Use addr, read_write, command 97 98 .... */ 98 s32 smbus_access_i2c(struct smbus_adapter * adapter, u8 addr, char read_write,99 s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, 99 100 u8 command, int size, union smbus_data * data) 100 101 { -
lm-sensors/trunk/src/Module.mk
r12 r13 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 $(MODULE_DIR)/isa.o 25 SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o \ 26 $(MODULE_DIR)/lm78.o 26 27 27 28 # Include all dependency files -
lm-sensors/trunk/src/isa.h
r12 r13 78 78 79 79 /* Here ended i2c_client */ 80 unsigned int full_address;80 unsigned int isa_addr; 81 81 }; 82 82 … … 128 128 #define i2c_is_isa_client(clientptr) \ 129 129 ((clientptr)->adapter->algo->id == ALGO_ISA) 130 #define i2c_is_isa_adapter(adapptr) \ 131 ((adapptr)->algo->id == ALGO_ISA) 130 132 131 133 /* Next: define ISA variants of registering. */ -
lm-sensors/trunk/src/piix4.c
r11 r13 50 50 { 51 51 /* TO BE WRITTEN! */ 52 return -1; 52 53 } 53 54 … … 90 91 { 91 92 if ((res = smbus_del_adapter(&piix4_adapter))) { 92 printk("piix4.o: smbus_del_adapter failed, module not removed ");93 printk("piix4.o: smbus_del_adapter failed, module not removed\n"); 93 94 return res; 94 } 95 else 95 } else 96 96 piix4_initialized--; 97 97 } -
lm-sensors/trunk/src/smbus.c
r12 r13 31 31 #include "smbus.h" 32 32 33 static s32 smbus_access_i2c (struct smbus_adapter * adapter, u8 addr,33 static s32 smbus_access_i2c (struct i2c_adapter * adapter, u8 addr, 34 34 char read_write, u8 command, int size, 35 35 union smbus_data * data); … … 70 70 We do all locking here, so you can ignore that in the adapter-specific 71 71 smbus_accesss routine. */ 72 s32 smbus_access (struct smbus_adapter * adapter, u8 addr, char read_write,72 s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, 73 73 u8 command, int size, union smbus_data * data) 74 74 { … … 80 80 #endif 81 81 if (adapter->id & ALGO_SMBUS) 82 res = adapter->smbus_access(addr,read_write,command,size,data); 82 res = ((struct smbus_adapter *) adapter) -> 83 smbus_access(addr,read_write,command,size,data); 83 84 else 84 85 res = smbus_access_i2c(adapter,addr,read_write,command,size,data); … … 96 97 For SMBUS_BYTE: Use addr, read_write, command 97 98 .... */ 98 s32 smbus_access_i2c(struct smbus_adapter * adapter, u8 addr, char read_write,99 s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, 99 100 u8 command, int size, union smbus_data * data) 100 101 { -
lm-sensors/trunk/src/smbus.h
r12 r13 131 131 #define i2c_is_smbus_client(clientptr) \ 132 132 ((clientptr)->adapter->algo->id == ALGO_SMBUS) 133 #define i2c_is_smbus_adapter(adapptr) \ 134 ((adapptr)->algo->id == ALGO_SMBUS) 133 135 134 136 /* This union is used within smbus_access routines */ … … 158 160 /* This is the very generalized SMBus access routine. You probably do not 159 161 want to use this, though; one of the functions below may be much easier, 160 and probably just as fast. */ 161 extern s32 smbus_access (struct smbus_adapter * adapter, u8 addr, 162 and probably just as fast. 163 Note that we use i2c_adapter here, because you do not need a specific 164 smbus adapter to call this function. */ 165 extern s32 smbus_access (struct i2c_adapter * adapter, u8 addr, 162 166 char read_write, u8 command, int size, 163 167 union smbus_data * data); … … 166 170 conventions of smbus_access. */ 167 171 168 extern inline s32 smbus_write_quick(struct smbus_adapter * adapter, u8 addr,172 extern inline s32 smbus_write_quick(struct i2c_adapter * adapter, u8 addr, 169 173 u8 value) 170 174 { … … 172 176 } 173 177 174 extern inline s32 smbus_read_byte(struct smbus_adapter * adapter,u8 addr)178 extern inline s32 smbus_read_byte(struct i2c_adapter * adapter,u8 addr) 175 179 { 176 180 union smbus_data data; … … 181 185 } 182 186 183 extern inline s32 smbus_write_byte(struct smbus_adapter * adapter, u8 addr,187 extern inline s32 smbus_write_byte(struct i2c_adapter * adapter, u8 addr, 184 188 u8 value) 185 189 { … … 187 191 } 188 192 189 extern inline s32 smbus_read_byte_data(struct smbus_adapter * adapter,193 extern inline s32 smbus_read_byte_data(struct i2c_adapter * adapter, 190 194 u8 addr, u8 command) 191 195 { … … 197 201 } 198 202 199 extern inline s32 smbus_write_byte_data(struct smbus_adapter * adapter,203 extern inline s32 smbus_write_byte_data(struct i2c_adapter * adapter, 200 204 u8 addr, u8 command, u8 value) 201 205 { … … 205 209 } 206 210 207 extern inline s32 smbus_read_word_data(struct smbus_adapter * adapter,211 extern inline s32 smbus_read_word_data(struct i2c_adapter * adapter, 208 212 u8 addr, u8 command) 209 213 { … … 215 219 } 216 220 217 extern inline s32 smbus_write_word_data(struct smbus_adapter * adapter,221 extern inline s32 smbus_write_word_data(struct i2c_adapter * adapter, 218 222 u8 addr, u8 command, u16 value) 219 223 { … … 223 227 } 224 228 225 extern inline s32 smbus_process_call(struct smbus_adapter * adapter,229 extern inline s32 smbus_process_call(struct i2c_adapter * adapter, 226 230 u8 addr, u8 command, u16 value) 227 231 { … … 235 239 236 240 /* Returns the number of read bytes */ 237 extern inline s32 smbus_read_block_data(struct smbus_adapter * adapter,241 extern inline s32 smbus_read_block_data(struct i2c_adapter * adapter, 238 242 u8 addr, u8 command, u8 *values) 239 243 { … … 249 253 } 250 254 251 extern inline int smbus_write_block_data(struct smbus_adapter * adapter,255 extern inline int smbus_write_block_data(struct i2c_adapter * adapter, 252 256 u8 addr, u8 command, u8 length, 253 257 u8 *values)
