Commit 3dfcc8ac authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Some more misc wait_ms() conversions to use msleep()

parent e1a929af
......@@ -146,13 +146,6 @@ static struct i2c_driver therm_pm72_driver =
.detach_adapter = therm_pm72_detach,
};
static inline void wait_ms(unsigned int ms)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1 + (ms * HZ + 999) / 1000);
}
/*
* Utility function to create an i2c_client structure and
* attach it to one of u3 adapters
......@@ -251,7 +244,7 @@ static int read_smon_adc(struct cpu_pid_state *state, int chan)
if (rc <= 0)
goto error;
/* Wait for convertion */
wait_ms(1);
msleep(1);
/* Switch to data register */
buf[0] = 4;
rc = i2c_master_send(state->monitor, buf, 1);
......@@ -269,7 +262,7 @@ static int read_smon_adc(struct cpu_pid_state *state, int chan)
printk(KERN_ERR "therm_pm72: Error reading ADC !\n");
return -1;
}
wait_ms(10);
msleep(10);
}
}
......@@ -283,7 +276,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb)
nw = i2c_master_send(fcu, buf, 1);
if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
break;
wait_ms(10);
msleep(10);
++tries;
}
if (nw <= 0) {
......@@ -295,7 +288,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb)
nr = i2c_master_recv(fcu, buf, nb);
if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
break;
wait_ms(10);
msleep(10);
++tries;
}
if (nr <= 0)
......@@ -316,7 +309,7 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
nw = i2c_master_send(fcu, buf, nb);
if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
break;
wait_ms(10);
msleep(10);
++tries;
}
if (nw < 0)
......
......@@ -48,6 +48,7 @@
#include <linux/netdevice.h>
#include <linux/suspend.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/usb.h>
#include <linux/crc32.h>
#include <net/irda/irda.h>
......@@ -652,7 +653,7 @@ static int fifo_txwait(struct stir_cb *stir, int space)
return 0;
/* estimate transfer time for remaining chars */
wait_ms((count * 8000) / stir->speed);
msleep((count * 8000) / stir->speed);
}
err = write_reg(stir, REG_FIFOCTL, FIFOCTL_CLR);
......@@ -810,7 +811,7 @@ static int stir_transmit_thread(void *arg)
info("%s: receive usb submit failed",
stir->netdev->name);
stir->receiving = 0;
wait_ms(10);
msleep(10);
continue;
}
}
......
......@@ -1184,7 +1184,7 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
~(PPLL_RESET | PPLL_SLEEP | PPLL_ATOMIC_UPDATE_EN | PPLL_VGA_ATOMIC_UPDATE_EN));
/* We may want some locking ... oh well */
wait_ms(5);
msleep(5);
/* Switch back VCLK source to PPLL */
OUTPLLP(VCLK_ECP_CNTL, VCLK_SRC_SEL_PPLLCLK, ~VCLK_SRC_SEL_MASK);
......
......@@ -189,12 +189,12 @@ int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 **out_e
*/
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
wait_ms(13);
msleep(13);
OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
for (j = 0; j < 5; j++) {
wait_ms(10);
msleep(10);
if (INREG(reg) & VGA_DDC_CLK_INPUT)
break;
}
......@@ -203,13 +203,13 @@ int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 **out_e
OUTREG(reg, INREG(reg) | VGA_DDC_DATA_OUT_EN);
(void)INREG(reg);
wait_ms(15);
msleep(15);
OUTREG(reg, INREG(reg) | VGA_DDC_CLK_OUT_EN);
(void)INREG(reg);
wait_ms(15);
msleep(15);
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
wait_ms(15);
msleep(15);
/* Do the real work */
edid = radeon_do_probe_i2c_edid(&rinfo->i2c[conn-1]);
......@@ -217,19 +217,19 @@ int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 **out_e
OUTREG(reg, INREG(reg) |
(VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
wait_ms(15);
msleep(15);
OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
for (j = 0; j < 10; j++) {
wait_ms(10);
msleep(10);
if (INREG(reg) & VGA_DDC_CLK_INPUT)
break;
}
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
wait_ms(15);
msleep(15);
OUTREG(reg, INREG(reg) |
(VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
......
......@@ -438,15 +438,6 @@ static inline u32 _INPLL(struct radeonfb_info *rinfo, u32 addr)
/*
* Inline utilities
*/
static inline void wait_ms(unsigned long ms)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((ms * HZ + 999) / 1000);
}
static inline int round_div(int num, int den)
{
return (num + (den / 2)) / den;
......
......@@ -9,6 +9,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <linux/sysctl.h>
......@@ -97,14 +98,14 @@ int daca_leave_sleep(void)
/* Do a short sleep, just to make sure I2C bus is awake and paying
* attention to us
*/
wait_ms(20);
msleep(20);
/* Write the sample rate reg the value it needs */
i2c_smbus_write_byte_data(daca_client, 1, 8);
daca_set_volume(cur_left_vol >> 5, cur_right_vol >> 5);
/* Another short delay, just to make sure the other I2C bus writes
* have taken...
*/
wait_ms(20);
msleep(20);
/* Write the global config reg - invert right power amp,
* DAC on, use 5-volt mode */
i2c_smbus_write_byte_data(daca_client, 3, 0x45);
......
......@@ -267,12 +267,6 @@ extern int dmasound_catchRadius;
*/
#define BS_VAL 1
static inline void wait_ms(unsigned int ms)
{
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(1 + ms * HZ / 1000);
}
#define SW_INPUT_VOLUME_SCALE 4
#define SW_INPUT_VOLUME_DEFAULT (128 / SW_INPUT_VOLUME_SCALE)
......
......@@ -457,9 +457,9 @@ tas_dmasound_init(void)
&gpio_headphone_detect_pol);
write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
wait_ms(100);
msleep(100);
write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
wait_ms(100);
msleep(100);
if (gpio_headphone_irq) {
if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",0) < 0) {
printk(KERN_ERR "tumbler: Can't request headphone interrupt\n");
......@@ -653,7 +653,7 @@ static void PMacIrqCleanup(void)
machine_is_compatible("PowerBook3,2")) && awacs) {
awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
awacs_write(MASK_ADDR1 | awacs_reg[1]);
wait_ms(200);
msleep(200);
}
if (awacs)
free_irq(awacs_irq, 0);
......@@ -775,10 +775,10 @@ awacs_recalibrate(void)
/* Sorry for the horrible delays... I hope to get that improved
* by making the whole PM process asynchronous in a future version
*/
wait_ms(750);
msleep(750);
awacs_reg[1] |= MASK_CMUTE | MASK_AMUTE;
awacs_write(awacs_reg[1] | MASK_RECALIBRATE | MASK_ADDR1);
wait_ms(1000);
msleep(1000);
awacs_write(awacs_reg[1] | MASK_ADDR1);
}
......@@ -1405,9 +1405,9 @@ load_awacs(void)
if (awacs_revision == AWACS_SCREAMER) {
awacs_write(awacs_reg[5] + MASK_ADDR5);
wait_ms(100);
msleep(100);
awacs_write(awacs_reg[6] + MASK_ADDR6);
wait_ms(2);
msleep(2);
awacs_write(awacs_reg[1] + MASK_ADDR1);
awacs_write(awacs_reg[7] + MASK_ADDR7);
}
......@@ -1479,7 +1479,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
machine_is_compatible("PowerBook3,2")) && awacs) {
awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
awacs_write(MASK_ADDR1 | awacs_reg[1]);
wait_ms(200);
msleep(200);
}
break;
case PBOOK_WAKE:
......@@ -1487,12 +1487,12 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, awacs_node, 0, 1);
if ((machine_is_compatible("PowerBook3,1") ||
machine_is_compatible("PowerBook3,2")) && awacs) {
wait_ms(100);
msleep(100);
awacs_reg[1] &= ~(MASK_PAROUT0 | MASK_PAROUT1);
awacs_write(MASK_ADDR1 | awacs_reg[1]);
wait_ms(300);
msleep(300);
} else
wait_ms(1000);
msleep(1000);
/* restore settings */
switch (awacs_revision) {
case AWACS_TUMBLER:
......@@ -1500,14 +1500,14 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
wait_ms(100);
msleep(100);
write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
wait_ms(150);
msleep(150);
tas_leave_sleep(); /* Stub for now */
headphone_intr(0,0,0);
break;
case AWACS_DACA:
wait_ms(10); /* Check this !!! */
msleep(10); /* Check this !!! */
daca_leave_sleep();
break ; /* dont know how yet */
case AWACS_BURGUNDY:
......@@ -2432,7 +2432,7 @@ static void PMacAbortRead(void)
* release the memory.
*/
wait_ms(100) ; /* give it a (small) chance to act */
msleep(100) ; /* give it a (small) chance to act */
/* apply the sledgehammer approach - just stop it now */
......
......@@ -4294,7 +4294,7 @@ trident_game_open(struct gameport *gameport, int mode)
switch (mode) {
case GAMEPORT_MODE_COOKED:
outb(0x80, TRID_REG(card, T4D_GAME_CR));
wait_ms(20);
msleep(20);
return 0;
case GAMEPORT_MODE_RAW:
outb(0x00, TRID_REG(card, T4D_GAME_CR));
......
......@@ -32,6 +32,7 @@
#include <sound/driver.h>
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <sound/core.h>
#include "au88x0.h"
......@@ -81,7 +82,7 @@ static int vortex_game_open(struct gameport *gameport, int mode)
hwwrite(vortex->mmio, VORTEX_CTRL2,
hwread(vortex->mmio,
VORTEX_CTRL2) | CTRL2_GAME_ADCMODE);
wait_ms(VORTEX_GAME_DWAIT);
msleep(VORTEX_GAME_DWAIT);
return 0;
case GAMEPORT_MODE_RAW:
hwwrite(vortex->mmio, VORTEX_CTRL2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment