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:
Mark M. Hoffman committed 2003-08-03 05:11:58 +00:00
1 parent e49b5486aa
commit e035136982
11 files changed
+18 -101

No files matched your search

+3 -10
View File
@@ -110,7 +110,6 @@ MODULE_PARM_DESC(force_addr,
"Forcibly enable the I801 at the given address. "
"EXTREMELY DANGEROUS!");
static void i801_do_pause(unsigned int amount);
static int i801_transaction(void);
static int i801_block_transaction(union i2c_smbus_data *data,
char read_write, int command);
@@ -186,12 +185,6 @@ END:
}
static void i801_do_pause(unsigned int amount)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(amount);
}
static int i801_transaction(void)
{
int temp;
@@ -221,7 +214,7 @@ static int i801_transaction(void)
/* We will always wait for a fraction of a second! */
do {
i801_do_pause(1);
i2c_delay(1);
temp = inb_p(SMBHSTSTS);
} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
@@ -349,7 +342,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
timeout = 0;
do {
temp = inb_p(SMBHSTSTS);
i801_do_pause(1);
i2c_delay(1);
}
while ((!(temp & 0x80))
&& (timeout++ < MAX_TIMEOUT));
@@ -409,7 +402,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
timeout = 0;
do {
temp = inb_p(SMBHSTSTS);
i801_do_pause(1);
i2c_delay(1);
} while ((!(temp & 0x02))
&& (timeout++ < MAX_TIMEOUT));