staging: wfx: use more power-efficient sleep for reset
Replace udelay() with usleep_range() as all uses are in a sleepable context. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/59e1e4e5bd80c1879ef36eaa59916e47005dbb04.1581416843.git.mirq-linux@rere.qmqm.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
40a97d55a6
Коммит
d2bdc49291
|
@ -26,7 +26,7 @@ static void device_wakeup(struct wfx_dev *wdev)
|
||||||
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
|
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
|
||||||
if (wfx_api_older_than(wdev, 1, 4)) {
|
if (wfx_api_older_than(wdev, 1, 4)) {
|
||||||
if (!completion_done(&wdev->hif.ctrl_ready))
|
if (!completion_done(&wdev->hif.ctrl_ready))
|
||||||
udelay(2000);
|
usleep_range(2000, 2500);
|
||||||
} else {
|
} else {
|
||||||
// completion.h does not provide any function to wait
|
// completion.h does not provide any function to wait
|
||||||
// completion without consume it (a kind of
|
// completion without consume it (a kind of
|
||||||
|
|
|
@ -211,9 +211,9 @@ static int wfx_spi_probe(struct spi_device *func)
|
||||||
if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
|
if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
|
||||||
gpiod_toggle_active_low(bus->gpio_reset);
|
gpiod_toggle_active_low(bus->gpio_reset);
|
||||||
gpiod_set_value_cansleep(bus->gpio_reset, 1);
|
gpiod_set_value_cansleep(bus->gpio_reset, 1);
|
||||||
udelay(100);
|
usleep_range(100, 150);
|
||||||
gpiod_set_value_cansleep(bus->gpio_reset, 0);
|
gpiod_set_value_cansleep(bus->gpio_reset, 0);
|
||||||
udelay(2000);
|
usleep_range(2000, 2500);
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_WORK(&bus->request_rx, wfx_spi_request_rx);
|
INIT_WORK(&bus->request_rx, wfx_spi_request_rx);
|
||||||
|
|
|
@ -142,7 +142,7 @@ static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr, void *buf,
|
||||||
goto err;
|
goto err;
|
||||||
if (!(cfg & prefetch))
|
if (!(cfg & prefetch))
|
||||||
break;
|
break;
|
||||||
udelay(200);
|
usleep_range(200, 250);
|
||||||
}
|
}
|
||||||
if (i == 20) {
|
if (i == 20) {
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче