difos/target/linux/bcm27xx/patches-6.12/950-0232-drm-panel-jdi-lt070me05000-Use-gpiod_set_value_cansl.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

84 lines
2.7 KiB
Diff

From b8d6afb31201bf6dc9c0683f9d03524506b8ddc2 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 15 Apr 2021 17:30:35 +0100
Subject: [PATCH] drm/panel: jdi-lt070me05000: Use gpiod_set_value_cansleep
There is no reason why the control GPIOs for the panel can not
be connected to I2C or similar GPIO interfaces that may need to
sleep, therefore switch from gpiod_set_value to
gpiod_set_value_cansleep calls to configure them.
Without that you get complaints from gpiolib every time the state
is changed.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drm: panel: jdi-lt070me05000: Add prepare_upstream_first flag
The panel driver wants to send DCS commands from the prepare
hook, therefore the DSI host wants to be pre_enabled first.
Set the flag to achieve this.
https://forums.raspberrypi.com/viewtopic.php?t=354708
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
.../gpu/drm/panel/panel-jdi-lt070me05000.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
--- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
+++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
@@ -190,11 +190,11 @@ static int jdi_panel_unprepare(struct dr
if (ret < 0)
dev_err(dev, "regulator disable failed, %d\n", ret);
- gpiod_set_value(jdi->enable_gpio, 0);
+ gpiod_set_value_cansleep(jdi->enable_gpio, 0);
- gpiod_set_value(jdi->reset_gpio, 1);
+ gpiod_set_value_cansleep(jdi->reset_gpio, 1);
- gpiod_set_value(jdi->dcdc_en_gpio, 0);
+ gpiod_set_value_cansleep(jdi->dcdc_en_gpio, 0);
return 0;
}
@@ -213,13 +213,13 @@ static int jdi_panel_prepare(struct drm_
msleep(20);
- gpiod_set_value(jdi->dcdc_en_gpio, 1);
+ gpiod_set_value_cansleep(jdi->dcdc_en_gpio, 1);
usleep_range(10, 20);
- gpiod_set_value(jdi->reset_gpio, 0);
+ gpiod_set_value_cansleep(jdi->reset_gpio, 0);
usleep_range(10, 20);
- gpiod_set_value(jdi->enable_gpio, 1);
+ gpiod_set_value_cansleep(jdi->enable_gpio, 1);
usleep_range(10, 20);
ret = jdi_panel_init(jdi);
@@ -241,11 +241,11 @@ poweroff:
if (ret < 0)
dev_err(dev, "regulator disable failed, %d\n", ret);
- gpiod_set_value(jdi->enable_gpio, 0);
+ gpiod_set_value_cansleep(jdi->enable_gpio, 0);
- gpiod_set_value(jdi->reset_gpio, 1);
+ gpiod_set_value_cansleep(jdi->reset_gpio, 1);
- gpiod_set_value(jdi->dcdc_en_gpio, 0);
+ gpiod_set_value_cansleep(jdi->dcdc_en_gpio, 0);
return ret;
}
@@ -402,6 +402,7 @@ static int jdi_panel_add(struct jdi_pane
return dev_err_probe(dev, PTR_ERR(jdi->backlight),
"failed to register backlight %d\n", ret);
+ jdi->base.prepare_prev_first = true;
drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs,
DRM_MODE_CONNECTOR_DSI);