From e7523b153d4c85eb90e9869e1eef95896102cdcd Mon Sep 17 00:00:00 2001 From: Konrad Dybcio Date: Sat, 18 Jul 2020 18:41:17 +0200 Subject: [PATCH] drm/panel-simple: Add nt36672a Tianma FHD+ panel This adds support for nt36672a Tianma FHD+ (2520x1080) video mode panel as found on Sony Xperia 10 Plus (mermaid) devices. Due to the nature of phone manufacturing, it is impossible to retrieve the actual panel name, hence the replacement one, detailing the device it's used on. Signed-off-by: Konrad Dybcio --- .../display/panel/panel-simple-dsi.yaml | 2 ++ drivers/gpu/drm/panel/panel-simple.c | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple-dsi.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple-dsi.yaml index ed6f96ab6aa5..358969aab60a 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-simple-dsi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-simple-dsi.yaml @@ -57,6 +57,8 @@ properties: - tdo,tl070wsh30 # Sony Kirin nt36672a Truly FHD+ IPS LCD panel - sony,kirin-nt36672a-truly + # Sony mermaid nt36672a Tianma FHD+ IPS LCD panel + - sony,mermaid-nt36672a-tianma reg: maxItems: 1 diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 1ab6bd9ae171..29597db4e25f 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -5188,6 +5188,36 @@ static const struct panel_desc_dsi sony_kirin_nt36672a_truly = { .lanes = 4, }; +static const struct drm_display_mode sony_mermaid_nt36672a_tianma_mode = { + .clock = (1080 + 102 + 20 + 40) * (2520 + 10 + 2 + 8) * 60 / 1000, + .hdisplay = 1080, + .hsync_start = 1080 + 102, + .hsync_end = 1080 + 102 + 20, + .htotal = 1080 + 102 + 20 + 40, + .vdisplay = 2520, + .vsync_start = 2520 + 10, + .vsync_end = 2520 + 10 + 2, + .vtotal = 2520 + 10 + 2 + 8, + .width_mm = 65, + .height_mm = 151, +}; + +static const struct panel_desc_dsi sony_mermaid_nt36672a_tianma = { + .desc = { + .modes = &sony_mermaid_nt36672a_tianma_mode, + .num_modes = 1, + .bpc = 8, + .size = { + .width = 65, + .height = 151, + }, + }, + .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_CLOCK_NON_CONTINUOUS, + .format = MIPI_DSI_FMT_RGB888, + .lanes = 4, +}; + static const struct of_device_id dsi_of_match[] = { { .compatible = "auo,b080uan01", @@ -5213,6 +5243,9 @@ static const struct of_device_id dsi_of_match[] = { }, { .compatible = "sony,kirin-nt36672a-truly", .data = &sony_kirin_nt36672a_truly + }, { + .compatible = "sony,mermaid-nt36672a-tianma", + .data = &sony_mermaid_nt36672a_tianma }, { /* sentinel */ }