mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-17 19:30:26 +00:00
Added utility function i2c_delay(1), to replace various "do_pause"
(mmh) functions in bus drivers. Backported from the 2.6 work of Greg KH. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1936 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
e49b5486aa
commit
e035136982
11 files changed
+18
-101
No files matched your search
@@ -112,9 +112,6 @@ struct nforce2_smbus {
|
||||
static s32 nforce2_access(struct i2c_adapter *adap, u16 addr,
|
||||
unsigned short flags, char read_write,
|
||||
u8 command, int size, union i2c_smbus_data *data);
|
||||
#if 0
|
||||
static void nforce2_do_pause(unsigned int amount);
|
||||
#endif
|
||||
/*
|
||||
static int nforce2_block_transaction(union i2c_smbus_data *data,
|
||||
char read_write, int i2c_enable);
|
||||
@@ -129,17 +126,6 @@ static struct i2c_algorithm smbus_algorithm = {
|
||||
.functionality = nforce2_func,
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
/* Internally used pause function */
|
||||
void nforce2_do_pause(unsigned int amount)
|
||||
{
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
schedule_timeout(amount);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return -1 on error. See smbus.h for more information */
|
||||
s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags,
|
||||
char read_write, u8 command, int size,
|
||||
@@ -250,7 +236,7 @@ s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags,
|
||||
|
||||
#if 0
|
||||
do {
|
||||
nforce2_do_pause(1);
|
||||
i2c_delay(1);
|
||||
temp = inb_p(NVIDIA_SMB_STS);
|
||||
} while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT));
|
||||
#endif
|
||||
@@ -259,8 +245,7 @@ s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags,
|
||||
temp = inb_p(NVIDIA_SMB_STS);
|
||||
}
|
||||
if (~temp & NVIDIA_SMB_STS_DONE) {
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
schedule_timeout(HZ/100);
|
||||
i2c_delay(HZ/100);
|
||||
temp = inb_p(NVIDIA_SMB_STS);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user