public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: fbtft: fb_tinylcd: replace udelay() with fsleep()
       [not found] <20260219142942.74087-1-tomasz.unger.ref@yahoo.pl>
@ 2026-02-19 14:29 ` tomasz.unger
  2026-02-19 14:55   ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: tomasz.unger @ 2026-02-19 14:29 UTC (permalink / raw)
  To: andy, gregkh
  Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel, Tomasz Unger

From: Tomasz Unger <tomasz.unger@yahoo.pl>

fsleep() is the preferred modern API for flexible sleeping as it
automatically selects the best sleep mechanism based on the duration.
Replace udelay() with fsleep() to improve power efficiency.

init_display() is a driver initialization callback which runs in
sleeping context, so fsleep() is safe to use here.

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
Changes in v2:
- Added sleeping context justification to commit message
- Replaced usleep_range() with fsleep() as suggested by Andy Shevchenko 

 drivers/staging/fbtft/fb_tinylcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fb_tinylcd.c b/drivers/staging/fbtft/fb_tinylcd.c
index 9469248f2c50..3fb15df31592 100644
--- a/drivers/staging/fbtft/fb_tinylcd.c
+++ b/drivers/staging/fbtft/fb_tinylcd.c
@@ -41,7 +41,7 @@ static int init_display(struct fbtft_par *par)
 		       0x00, 0x35, 0x33, 0x00, 0x00, 0x00);
 	write_reg(par, MIPI_DCS_SET_PIXEL_FORMAT, 0x55);
 	write_reg(par, MIPI_DCS_EXIT_SLEEP_MODE);
-	udelay(250);
+	fsleep(250);
 	write_reg(par, MIPI_DCS_SET_DISPLAY_ON);
 
 	return 0;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] staging: fbtft: fb_tinylcd: replace udelay() with fsleep()
  2026-02-19 14:29 ` [PATCH v2] staging: fbtft: fb_tinylcd: replace udelay() with fsleep() tomasz.unger
@ 2026-02-19 14:55   ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-02-19 14:55 UTC (permalink / raw)
  To: tomasz.unger
  Cc: andy, gregkh, dri-devel, linux-fbdev, linux-staging, linux-kernel

On Thu, Feb 19, 2026 at 03:29:42PM +0100, tomasz.unger@yahoo.pl wrote:

> fsleep() is the preferred modern API for flexible sleeping as it
> automatically selects the best sleep mechanism based on the duration.
> Replace udelay() with fsleep() to improve power efficiency.
> 
> init_display() is a driver initialization callback which runs in
> sleeping context, so fsleep() is safe to use here.

OK.
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-19 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260219142942.74087-1-tomasz.unger.ref@yahoo.pl>
2026-02-19 14:29 ` [PATCH v2] staging: fbtft: fb_tinylcd: replace udelay() with fsleep() tomasz.unger
2026-02-19 14:55   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox