aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-08-09 23:51:03 +0200
committerLinus Walleij <linus.walleij@linaro.org>2020-09-05 01:24:26 +0200
commit91867ac7d6724c31f32c3a63e2bb5db978893eaf (patch)
treefe74aa328935fcca5446aa09f28416a935f63f75 /drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
parentdrm/panel: s6e63m0: Add DSI transport (diff)
downloadlinux-dev-91867ac7d6724c31f32c3a63e2bb5db978893eaf.tar.xz
linux-dev-91867ac7d6724c31f32c3a63e2bb5db978893eaf.zip
drm/panel: s6e63m0: Add reading functionality
This adds code to send read commands to read a single byte from the display, in order to perform MTP ID look-up of the mounted panel on the s6e63m0 controller. This is needed for proper biasing on the DSI variants. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Stephan Gerhold <stephan@gerhold.net> Cc: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> Acked-by: Paul Cercueil <paul@crapouillou.net> Link: https://patchwork.freedesktop.org/patch/msgid/20200809215104.1830206-4-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c')
-rw-r--r--drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
index f4927a6ce26d..2ec9e7900791 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
@@ -16,6 +16,22 @@
#define MCS_GLOBAL_PARAM 0xb0
#define S6E63M0_DSI_MAX_CHUNK 15 /* CMD + 15 bytes max */
+static int s6e63m0_dsi_dcs_read(struct device *dev, const u8 cmd, u8 *data)
+{
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
+ int ret;
+
+ ret = mipi_dsi_dcs_read(dsi, cmd, data, 1);
+ if (ret < 0) {
+ DRM_DEV_ERROR(dev, "could not read DCS CMD %02x\n", cmd);
+ return ret;
+ }
+
+ DRM_DEV_INFO(dev, "DSI read CMD %02x = %02x\n", cmd, *data);
+
+ return 0;
+}
+
static int s6e63m0_dsi_dcs_write(struct device *dev, const u8 *data, size_t len)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
@@ -90,7 +106,8 @@ static int s6e63m0_dsi_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_MODE_EOT_PACKET |
MIPI_DSI_MODE_VIDEO_BURST;
- ret = s6e63m0_probe(dev, s6e63m0_dsi_dcs_write, true);
+ ret = s6e63m0_probe(dev, s6e63m0_dsi_dcs_read, s6e63m0_dsi_dcs_write,
+ true);
if (ret)
return ret;