mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-30 21:18:20 +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
@@ -136,7 +136,6 @@
|
||||
/* -> Read = 1 */
|
||||
#define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */
|
||||
|
||||
static void ali1535_do_pause(unsigned int amount);
|
||||
static int ali1535_transaction(void);
|
||||
|
||||
static unsigned short ali1535_smba = 0;
|
||||
@@ -222,13 +221,6 @@ int ali1535_setup(struct pci_dev *ALI1535_dev)
|
||||
}
|
||||
|
||||
|
||||
/* Internally used pause function */
|
||||
void ali1535_do_pause(unsigned int amount)
|
||||
{
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
schedule_timeout(amount);
|
||||
}
|
||||
|
||||
/* Another internally used function */
|
||||
int ali1535_transaction(void)
|
||||
{
|
||||
@@ -315,7 +307,7 @@ int ali1535_transaction(void)
|
||||
/* We will always wait for a fraction of a second! */
|
||||
timeout = 0;
|
||||
do {
|
||||
ali1535_do_pause(1);
|
||||
i2c_delay(1);
|
||||
temp = inb_p(SMBHSTSTS);
|
||||
} while (((temp & ALI1535_STS_BUSY) && !(temp & ALI1535_STS_IDLE))
|
||||
&& (timeout++ < MAX_TIMEOUT));
|
||||
@@ -401,7 +393,7 @@ s32 ali1535_access(struct i2c_adapter * adap, u16 addr,
|
||||
for (timeout = 0;
|
||||
(timeout < MAX_TIMEOUT) && !(temp & ALI1535_STS_IDLE);
|
||||
timeout++) {
|
||||
ali1535_do_pause(1);
|
||||
i2c_delay(1);
|
||||
temp = inb_p(SMBHSTSTS);
|
||||
}
|
||||
if (timeout >= MAX_TIMEOUT) {
|
||||
|
||||
Reference in new issue
Block a user