#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/sched.h>
+#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/i2c.h>
#include <linux/init.h>
/* We will always wait for a fraction of a second! */
timeout = 0;
do {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
} while (((temp & ALI1535_STS_BUSY) && !(temp & ALI1535_STS_IDLE))
&& (timeout++ < MAX_TIMEOUT));
for (timeout = 0;
(timeout < MAX_TIMEOUT) && !(temp & ALI1535_STS_IDLE);
timeout++) {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
}
if (timeout >= MAX_TIMEOUT)
*/
#include <linux/module.h>
+#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/pci.h>
#include <linux/init.h>
timeout = ALI1563_MAX_TIMEOUT;
do
- i2c_delay(1);
+ msleep(1);
while (((data = inb_p(SMB_HST_STS)) & HST_STS_BUSY) && --timeout);
dev_dbg(&a->dev, "Transaction (post): STS=%02x, CNTL1=%02x, "
timeout = ALI1563_MAX_TIMEOUT;
do
- i2c_delay(1);
+ msleep(1);
while (!((data = inb_p(SMB_HST_STS)) & HST_STS_DONE) && --timeout);
dev_dbg(&a->dev, "Block (post): STS=%02x, CNTL1=%02x, "
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/ioport.h>
+#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <asm/io.h>
/* We will always wait for a fraction of a second! */
timeout = 0;
do {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
} while ((!(temp & (ALI15X3_STS_ERR | ALI15X3_STS_DONE)))
&& (timeout++ < MAX_TIMEOUT));
for (timeout = 0;
(timeout < MAX_TIMEOUT) && !(temp & ALI15X3_STS_IDLE);
timeout++) {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
}
if (timeout >= MAX_TIMEOUT) {
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
+#include <linux/delay.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/ioport.h>
if ((temp = inw_p(SMB_GLOBAL_STATUS)) & (GS_HST_STS | GS_SMB_STS)) {
dev_dbg(&adap->dev, ": SMBus busy (%04x). Waiting... \n", temp);
do {
- i2c_delay(1);
+ msleep(1);
temp = inw_p(SMB_GLOBAL_STATUS);
} while ((temp & (GS_HST_STS | GS_SMB_STS)) &&
(timeout++ < MAX_TIMEOUT));
/* We will always wait for a fraction of a second! */
do {
- i2c_delay(1);
+ msleep(1);
temp = inw_p(SMB_GLOBAL_STATUS);
} while ((temp & GS_HST_STS) && (timeout++ < MAX_TIMEOUT));
abort:
dev_warn(&adap->dev, ": Sending abort.\n");
outw_p(inw(SMB_GLOBAL_ENABLE) | GE_ABORT, SMB_GLOBAL_ENABLE);
- i2c_delay(100);
+ msleep(100);
outw_p(GS_CLEAR_STS, SMB_GLOBAL_STATUS);
return -1;
}
}
if (~temp[0] & AMD_SMB_STS_DONE) {
- i2c_delay(HZ/100);
+ msleep(1);
amd_ec_read(smbus, AMD_SMB_STS, temp + 0);
}
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
+#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/init.h>
/* We will always wait for a fraction of a second! */
do {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
timeout = 0;
do {
temp = inb_p(SMBHSTSTS);
- i2c_delay(1);
+ msleep(1);
}
while ((!(temp & 0x80))
&& (timeout++ < MAX_TIMEOUT));
timeout = 0;
do {
temp = inb_p(SMBHSTSTS);
- i2c_delay(1);
+ msleep(1);
} while ((!(temp & 0x02))
&& (timeout++ < MAX_TIMEOUT));
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/kernel.h>
+#include <linux/delay.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/ioport.h>
/* We will always wait for a fraction of a second! (See PIIX4 docs errata) */
do {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
/* We will always wait for a fraction of a second! */
do {
- i2c_delay(1);
+ msleep(1);
temp = sis5595_read(SMB_STS_LO);
} while (!(temp & 0x40) && (timeout++ < MAX_TIMEOUT));
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
/* We will always wait for a fraction of a second! */
do {
- i2c_delay(1);
+ msleep(1);
temp = sis630_read(SMB_STS);
/* check if block transmitted */
if (size == SIS630_BLOCK_DATA && (temp & 0x10))
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
+#include <linux/delay.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/ioport.h>
/* We will always wait for a fraction of a second! */
do {
- i2c_delay(1);
+ msleep(1);
temp = sis96x_read(SMB_STS);
} while (!(temp & 0x0e) && (timeout++ < MAX_TIMEOUT));
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
/* We will always wait for a fraction of a second!
I don't know if VIA needs this, Intel did */
do {
- i2c_delay(1);
+ msleep(1);
temp = inb_p(SMBHSTSTS);
} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/delay.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
if (value >= 0)
return value;
dev_dbg(&client->dev, "Read failed, will retry in %d.\n", i);
- i2c_delay(i);
+ msleep(i);
}
dev_err(&client->dev, "Couldn't read value from register. "
#define i2c_is_isa_adapter(adapptr) \
((adapptr)->algo->id == I2C_ALGO_ISA)
-/* Tiny delay function used by the i2c bus drivers */
-static inline void i2c_delay(signed long timeout)
-{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(timeout);
-}
-
#endif /* _LINUX_I2C_H */