1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/6.6/target/linux/bcm27xx/patches-6.6/0520-drm-panel-raspberrypi-touchscreen-Insert-more-delays.patch

44 lines
1.8 KiB
Diff
Raw Normal View History

2024-04-05 18:55:33 +00:00
From 658258e64e5436f86a9cbe2582e51f8edb9361b2 Mon Sep 17 00:00:00 2001
From: Nick Hollinghurst <nick.hollinghurst@raspberrypi.org>
Date: Wed, 1 Dec 2021 19:43:08 +0000
Subject: [PATCH 0520/1002] drm/panel/raspberrypi-touchscreen: Insert more
delays.
This avoids failures in cases where the panel is enabled
or re-probed very soon after being disabled or probed.
These can occur because the Atmel device can mis-behave
over I2C for a few ms after any write to the POWERON register.
---
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 12f6961c9268..4c418962aa9b 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -297,6 +297,13 @@ static int rpi_touchscreen_prepare(struct drm_panel *panel)
struct rpi_touchscreen *ts = panel_to_ts(panel);
int i, data;
+ /*
+ * Power up the Toshiba bridge. The Atmel device can misbehave
+ * over I2C for a few ms after writes to REG_POWERON (including the
+ * write in rpi_touchscreen_disable()), so sleep before and after.
+ * Also to ensure that the bridge has been off for at least 100ms.
+ */
+ msleep(100);
rpi_touchscreen_i2c_write(ts, REG_POWERON, 1);
usleep_range(20000, 25000);
/* Wait for nPWRDWN to go low to indicate poweron is done. */
@@ -428,6 +435,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
/* Turn off at boot, so we can cleanly sequence powering on. */
rpi_touchscreen_i2c_write(ts, REG_POWERON, 0);
+ usleep_range(20000, 25000);
/* Look up the DSI host. It needs to probe before we do. */
endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
--
2.44.0