mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-23 20:11:42 +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
@@ -94,13 +94,6 @@ static unsigned short amd756_ioport = 0;
|
||||
|
||||
*/
|
||||
|
||||
/* Internally used pause function */
|
||||
static void amd756_do_pause(unsigned int amount)
|
||||
{
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
schedule_timeout(amount);
|
||||
}
|
||||
|
||||
#define GS_ABRT_STS (1 << 0)
|
||||
#define GS_COL_STS (1 << 1)
|
||||
#define GS_PRERR_STS (1 << 2)
|
||||
@@ -132,7 +125,7 @@ static int amd756_transaction(void)
|
||||
if ((temp = inw_p(SMB_GLOBAL_STATUS)) & (GS_HST_STS | GS_SMB_STS)) {
|
||||
pr_debug(DRV_NAME ": SMBus busy (%04x). Waiting... \n", temp);
|
||||
do {
|
||||
amd756_do_pause(1);
|
||||
i2c_delay(1);
|
||||
temp = inw_p(SMB_GLOBAL_STATUS);
|
||||
} while ((temp & (GS_HST_STS | GS_SMB_STS)) &&
|
||||
(timeout++ < MAX_TIMEOUT));
|
||||
@@ -149,7 +142,7 @@ static int amd756_transaction(void)
|
||||
|
||||
/* We will always wait for a fraction of a second! */
|
||||
do {
|
||||
amd756_do_pause(1);
|
||||
i2c_delay(1);
|
||||
temp = inw_p(SMB_GLOBAL_STATUS);
|
||||
} while ((temp & GS_HST_STS) && (timeout++ < MAX_TIMEOUT));
|
||||
|
||||
@@ -196,7 +189,7 @@ static int amd756_transaction(void)
|
||||
abort:
|
||||
printk(KERN_WARNING DRV_NAME ": Sending abort.\n");
|
||||
outw_p(inw(SMB_GLOBAL_ENABLE) | GE_ABORT, SMB_GLOBAL_ENABLE);
|
||||
amd756_do_pause(100);
|
||||
i2c_delay(100);
|
||||
outw_p(GS_CLEAR_STS, SMB_GLOBAL_STATUS);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user