]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/panel: ilitek-ili9881c: Fix warning with GPIO controllers that sleep
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 17 Mar 2024 15:48:39 +0000 (17:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:37:57 +0000 (09:37 +0200)
[ Upstream commit ee7860cd8b5763017f8dc785c2851fecb7a0c565 ]

The ilitek-ili9881c controls the reset GPIO using the non-sleeping
gpiod_set_value() function. This complains loudly when the GPIO
controller needs to sleep. As the caller can sleep, use
gpiod_set_value_cansleep() to fix the issue.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240317154839.21260-1-laurent.pinchart@ideasonboard.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240317154839.21260-1-laurent.pinchart@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c

index 2ffe5f68a89034ea217cfcbe6a0a7f635c302d14..4c8c317191f3ced04b9de5bf7053f49026f84536 100644 (file)
@@ -1080,10 +1080,10 @@ static int ili9881c_prepare(struct drm_panel *panel)
        msleep(5);
 
        /* And reset it */
-       gpiod_set_value(ctx->reset, 1);
+       gpiod_set_value_cansleep(ctx->reset, 1);
        msleep(20);
 
-       gpiod_set_value(ctx->reset, 0);
+       gpiod_set_value_cansleep(ctx->reset, 0);
        msleep(20);
 
        for (i = 0; i < ctx->desc->init_length; i++) {
@@ -1138,7 +1138,7 @@ static int ili9881c_unprepare(struct drm_panel *panel)
 
        mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
        regulator_disable(ctx->power);
-       gpiod_set_value(ctx->reset, 1);
+       gpiod_set_value_cansleep(ctx->reset, 1);
 
        return 0;
 }