Skip to content

Commit 5f18c07

Browse files
6by9mripard
authored andcommitted
drm/panel/raspberrypi-touchscreen: Initialise the bridge in prepare
The panel has a prepare call which is before video starts, and an enable call which is after. The Toshiba bridge should be configured before video, so move the relevant power and initialisation calls to prepare. Fixes: 2f733d6 ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20220415162513.42190-3-stefan.wahren@i2se.com
1 parent f92055a commit 5f18c07

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int rpi_touchscreen_noop(struct drm_panel *panel)
265265
return 0;
266266
}
267267

268-
static int rpi_touchscreen_enable(struct drm_panel *panel)
268+
static int rpi_touchscreen_prepare(struct drm_panel *panel)
269269
{
270270
struct rpi_touchscreen *ts = panel_to_ts(panel);
271271
int i;
@@ -295,6 +295,13 @@ static int rpi_touchscreen_enable(struct drm_panel *panel)
295295
rpi_touchscreen_write(ts, DSI_STARTDSI, 0x01);
296296
msleep(100);
297297

298+
return 0;
299+
}
300+
301+
static int rpi_touchscreen_enable(struct drm_panel *panel)
302+
{
303+
struct rpi_touchscreen *ts = panel_to_ts(panel);
304+
298305
/* Turn on the backlight. */
299306
rpi_touchscreen_i2c_write(ts, REG_PWM, 255);
300307

@@ -349,7 +356,7 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel,
349356
static const struct drm_panel_funcs rpi_touchscreen_funcs = {
350357
.disable = rpi_touchscreen_disable,
351358
.unprepare = rpi_touchscreen_noop,
352-
.prepare = rpi_touchscreen_noop,
359+
.prepare = rpi_touchscreen_prepare,
353360
.enable = rpi_touchscreen_enable,
354361
.get_modes = rpi_touchscreen_get_modes,
355362
};

0 commit comments

Comments
 (0)