diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-09-02 14:34:58 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-12-11 16:45:34 +0100 |
commit | f162eeba5a812789eed128b1f673957dca3e0c8f (patch) | |
tree | 2e108ed01c22c0bc4051f4ce89d4068b105b6345 | |
parent | 86ee4620891f143a70a62dff673159aa64f86e30 (diff) |
s6d16d0 stab
-rw-r--r-- | drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c index e3a0397e953e..1d9de4a384a6 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c @@ -73,6 +73,26 @@ static int s6d16d0_unprepare(struct drm_panel *panel) return 0; } +static int s6d16d0_read_mtp_id(struct s6d16d0 *s6) +{ + struct mipi_dsi_device *dsi = to_mipi_dsi_device(s6->dev); + u8 id[3]; + int ret; + int i; + + for (i = 0; i < ARRAY_SIZE(id); i++) { + ret = mipi_dsi_dcs_read(dsi, 0xd1 + i, &id[i], 1); + if (ret < 0) { + DRM_DEV_ERROR(s6->dev, "failed to read MTP ID\n"); + return ret; + } + } + DRM_DEV_INFO(s6->dev, "MTP 0x%02x, version: 0x%02x, ID: 0x%02x\n", + id[0], id[1], id[2]); + + return 0; +} + static int s6d16d0_prepare(struct drm_panel *panel) { struct s6d16d0 *s6 = panel_to_s6d16d0(panel); @@ -92,6 +112,8 @@ static int s6d16d0_prepare(struct drm_panel *panel) gpiod_set_value_cansleep(s6->reset_gpio, 0); msleep(120); + s6d16d0_read_mtp_id(s6); + /* Enabe tearing mode: send TE (tearing effect) at VBLANK */ ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); |