summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-08-10 00:51:03 +0300
committerLinus Walleij <linus.walleij@linaro.org>2020-09-05 02:24:26 +0300
commit91867ac7d6724c31f32c3a63e2bb5db978893eaf (patch)
treefe74aa328935fcca5446aa09f28416a935f63f75 /drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
parent435e06c06cb2e3bd2f650a52641ddb13a95a1624 (diff)
downloadlinux-91867ac7d6724c31f32c3a63e2bb5db978893eaf.tar.xz
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-spi.c')
-rw-r--r--drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
index 0587eac52f2a..3b1a2a3a44ea 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
@@ -11,6 +11,17 @@
#define DATA_MASK 0x100
+static int s6e63m0_spi_dcs_read(struct device *dev, const u8 cmd, u8 *data)
+{
+ /*
+ * FIXME: implement reading DCS commands over SPI so we can
+ * properly identify which physical panel is connected.
+ */
+ *data = 0;
+
+ return 0;
+}
+
static int s6e63m0_spi_write_word(struct device *dev, u16 data)
{
struct spi_device *spi = to_spi_device(dev);
@@ -60,7 +71,8 @@ static int s6e63m0_spi_probe(struct spi_device *spi)
DRM_DEV_ERROR(dev, "spi setup failed.\n");
return ret;
}
- return s6e63m0_probe(dev, s6e63m0_spi_dcs_write, false);
+ return s6e63m0_probe(dev, s6e63m0_spi_dcs_read, s6e63m0_spi_dcs_write,
+ false);
}
static int s6e63m0_spi_remove(struct spi_device *spi)