From: Markus Burri Date: Tue, 25 Feb 2025 18:59:00 +0000 (-0800) Subject: Input: matrix_keypad - use fsleep for delays after activating columns X-Git-Tag: v6.15-rc1~13^2^2~8 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=e71087ebcd0eb02ca7b4b99c468e1f20435f4bcb;p=linux-block.git Input: matrix_keypad - use fsleep for delays after activating columns The delay is specified in a device property, so the duration can be arbitrarily large. fsleep() determines the best way of delaying (sleep vs spin) based on duration. see Documentation/timers/delay_sleep_functions.rst Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Link: https://lore.kernel.org/r/20250110054906.354296-2-markus.burri@mt.com Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 889505e59f85..e46473cb817c 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -69,7 +69,7 @@ static void activate_col(struct matrix_keypad *keypad, int col, bool on) __activate_col(keypad, col, on); if (on && keypad->col_scan_delay_us) - udelay(keypad->col_scan_delay_us); + fsleep(keypad->col_scan_delay_us); } static void activate_all_cols(struct matrix_keypad *keypad, bool on)