From patchwork Mon Feb 13 15:38:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Matuszczyk X-Patchwork-Id: 13138609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDA8FC636CC for ; Mon, 13 Feb 2023 15:38:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3280010E04B; Mon, 13 Feb 2023 15:38:31 +0000 (UTC) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33EC910E04B for ; Mon, 13 Feb 2023 15:38:29 +0000 (UTC) Received: by mail-ej1-x632.google.com with SMTP id k16so1332655ejv.10 for ; Mon, 13 Feb 2023 07:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q86xsnFvfvmah1G0eGQOi1KV205lT5RC6i71PTaiGzo=; b=YNfKzAtIz72gcYaG7XV4PSq2NEXvrAgcCMjnPsI91+HELi7EmCHFa3h4v/3A9zLFQn eiH1eheI31WtpJif3x+2OOK8Xz4DoEkCcRuLK59lss1ztdCoMu8sFoOHteG1OD6KSrbL Ev8MEuIShNtQosDwH5de/OQhc61gNDKH73GvL/OKOWXAORkRh/yTwQGIKVUjJhYeMUYn DqYHQ1dZewnMIWm3Kbr8D2rRW1OUeE8IEB2dQtF0EkHYPu+q10gnQBajelD4xPxvZA1p kAXt7QQv6YugLjFyGT9tpF7eClkhCylEdqWoohIOa1EZ3SG724LY168OA+5zHKy/KARI c4xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q86xsnFvfvmah1G0eGQOi1KV205lT5RC6i71PTaiGzo=; b=1KJV53OSmMl2LwY2qyYYq9pX1diHZJTaldtqp+x8yfhpYt2cJEG99rYsJDHiNioSqI vVAUrgz6NS6PQr7CJ9T4k7TtWPX2NojvSkFSC/LfcvBF+WROqDgWlUbaDULMuFs2VdXM 3KuTfT7bMEi2sIbyCEFhJZmNHruo1VkEWAIxYljTjRdiLyU+9gGq37sHeW1yT2QXBzyn uc8iJqZkuyioRKzisDRwfjM39zSOdw5zmPJlfJw+t9yuED87EL1V4o7JF84tqXmjK4Mr IXqqfaORAotmIJkwWo5D0/ZXc904RQn8dOmBnsck53/ds4FL6h8i0CsiVhuBTKSD04d6 2l7Q== X-Gm-Message-State: AO0yUKVyKmvfex5sOZ4lMOPmazXrb+YdoiBlftlda+ygMliV4c2Bn60f puAuKtuxL9gpoqIGWcruBII= X-Google-Smtp-Source: AK7set9rpu4uOTlLBDoMG+BkveHrcsEYP70PEWPeRWFby5VyriFa/6JKgxhk4Nenhc+awLxNZsP00A== X-Received: by 2002:a17:906:6a1b:b0:8af:b63:b4bf with SMTP id qw27-20020a1709066a1b00b008af0b63b4bfmr23256890ejc.27.1676302707637; Mon, 13 Feb 2023 07:38:27 -0800 (PST) Received: from localhost.localdomain (83.24.145.108.ipv4.supernova.orange.pl. [83.24.145.108]) by smtp.gmail.com with ESMTPSA id gf17-20020a170906e21100b008b12614ee06sm115901ejb.161.2023.02.13.07.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 07:38:27 -0800 (PST) From: Maya Matuszczyk To: heiko@sntech.de, Jagan Teki , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v2 1/4] dt-bindings: display: panel: sitronix, st7701: Add Elida KD50T048A Panel Date: Mon, 13 Feb 2023 16:38:13 +0100 Message-Id: <20230213153816.213526-2-maccraft123mc@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213153816.213526-1-maccraft123mc@gmail.com> References: <20230213153816.213526-1-maccraft123mc@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Maya Matuszczyk Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add compatible for 854x480 Elida KD50T048A panel, found in Odroid Go Super and Odroid Go Ultra Signed-off-by: Maya Matuszczyk Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/display/panel/sitronix,st7701.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml b/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml index 34d5e20c6cb3..83d30eadf7d9 100644 --- a/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml +++ b/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml @@ -28,6 +28,7 @@ properties: items: - enum: - densitron,dmt028vghmcmi-1a + - elida,kd50t048a - techstar,ts8550b - const: sitronix,st7701 From patchwork Mon Feb 13 15:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Matuszczyk X-Patchwork-Id: 13138610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF751C678D4 for ; Mon, 13 Feb 2023 15:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D50C10E061; Mon, 13 Feb 2023 15:38:32 +0000 (UTC) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D1C410E04B for ; Mon, 13 Feb 2023 15:38:30 +0000 (UTC) Received: by mail-ej1-x62a.google.com with SMTP id lf10so1015226ejc.5 for ; Mon, 13 Feb 2023 07:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h9M5VRC01DAZPfI0s5I19MARMALNHk/O6/g2Mh8se6M=; b=qkMhLPhzCZRP+Kg8axvET9mrQ237GB/fcdTwnPTNJN4EA6Fr3uLo0nY646HWldsNT4 WXqk7xo+zqsTd3X9Oai9oDgtK9joKgh3E11UvqB4dnFcGiNTvRo7VH1t11+WYNw8RmYk v94I8VoF+u4CZBag1ftBsrZHGCDZ1yGAKfe0VP20LdABlipG17eaZmp7rbF3Zjn7+gkW A3YNMFRtV7f7L4Rjm1MqMDO3rjS8TXLgmBvdhEV3rHoQR+9KVKDDwjiQY8zwI5REAiFN IFZvhaqMrIzGng4C4pOstGicZzenNLAS+W/ZWp7JQ/u+eDDoACw1G/CcHEnpHWWr1GEp 1FWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h9M5VRC01DAZPfI0s5I19MARMALNHk/O6/g2Mh8se6M=; b=wS0/1xW/FT/CYXp6r1Fk2CgW0TjAUvyC56MS0wN3oHq8HUTB8sFQTNqCj6K1XwZfIW 0gBxcnZiBUbioIpzS1DA+GJVLDYTtB2JMHebfCrXlLOZD/WW/UeAYiQUZVdPqF/eEE4E M2AX8yBwqPWcuh+KkW/sCl1OBl8vHZ4zDS3H5kT10hMWn7uQeOlHVhySzUM5LR6/qaEJ 1+9wFJwEqzd0L/zXiolNC4nOglkURXVs1pSnSbPvOJJXNWNmuXSu9rv9M3ltSJTS1aB1 5Cz4TaZXMBWDug2BnrSoBiNyLkZUAT3Npo7IbrMzlsuwhohYRBK7lqOnXTcG/PbJt3F6 BOpg== X-Gm-Message-State: AO0yUKWlba2VNsaT+bcCO1xOail64ERjLYQWgpJS3hjuhk8kYrHOzH87 ZpG5Yg39tR3MhX4nIcGn9uw= X-Google-Smtp-Source: AK7set+0pvPDwSKeSvc4z5iKWPYmf8jb9T8DhubJY/8Y5VbUp9JLiMw2FgmaOcmpf6bdBIPMuY9TdA== X-Received: by 2002:a17:906:f74b:b0:8b1:22af:b39f with SMTP id jp11-20020a170906f74b00b008b122afb39fmr613157ejb.13.1676302708753; Mon, 13 Feb 2023 07:38:28 -0800 (PST) Received: from localhost.localdomain (83.24.145.108.ipv4.supernova.orange.pl. [83.24.145.108]) by smtp.gmail.com with ESMTPSA id gf17-20020a170906e21100b008b12614ee06sm115901ejb.161.2023.02.13.07.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 07:38:28 -0800 (PST) From: Maya Matuszczyk To: heiko@sntech.de, Jagan Teki , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter Subject: [PATCH v2 2/4] drm: panel: Add Elida KD50T048A to Sitronix ST7701 driver Date: Mon, 13 Feb 2023 16:38:14 +0100 Message-Id: <20230213153816.213526-3-maccraft123mc@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213153816.213526-1-maccraft123mc@gmail.com> References: <20230213153816.213526-1-maccraft123mc@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Maya Matuszczyk Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add KD50T048A MIPI-DSI panel, which is based on ST7701 chip. Not sure what else to add to this commit message. Signed-off-by: Maya Matuszczyk --- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 0b8cf65172ff..660c3f435008 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -397,6 +397,31 @@ static void dmt028vghmcmi_1a_gip_sequence(struct st7701 *st7701) ST7701_DSI(st7701, 0x3A, 0x70); } +static void kd50t048a_gip_sequence(struct st7701 *st7701) +{ + /** + * ST7701_SPEC_V1.2 is unable to provide enough information above this + * specific command sequence, so grab the same from vendor BSP driver. + */ + ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); + ST7701_DSI(st7701, 0xE1, 0x08, 0x00, 0x0A, 0x00, 0x07, 0x00, 0x09, + 0x00, 0x00, 0x33, 0x33); + ST7701_DSI(st7701, 0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33); + ST7701_DSI(st7701, 0xE4, 0x44, 0x44); + ST7701_DSI(st7701, 0xE5, 0x0E, 0x60, 0xA0, 0xA0, 0x10, 0x60, 0xA0, + 0xA0, 0x0A, 0x60, 0xA0, 0xA0, 0x0C, 0x60, 0xA0, 0xA0); + ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33); + ST7701_DSI(st7701, 0xE7, 0x44, 0x44); + ST7701_DSI(st7701, 0xE8, 0x0D, 0x60, 0xA0, 0xA0, 0x0F, 0x60, 0xA0, + 0xA0, 0x09, 0x60, 0xA0, 0xA0, 0x0B, 0x60, 0xA0, 0xA0); + ST7701_DSI(st7701, 0xEB, 0x02, 0x01, 0xE4, 0xE4, 0x44, 0x00, 0x40); + ST7701_DSI(st7701, 0xEC, 0x02, 0x01); + ST7701_DSI(st7701, 0xED, 0xAB, 0x89, 0x76, 0x54, 0x01, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x45, 0x67, 0x98, 0xBA); +} + static int st7701_prepare(struct drm_panel *panel) { struct st7701 *st7701 = panel_to_st7701(panel); @@ -700,6 +725,105 @@ static const struct st7701_panel_desc dmt028vghmcmi_1a_desc = { .gip_sequence = dmt028vghmcmi_1a_gip_sequence, }; +static const struct drm_display_mode kd50t048a_mode = { + .clock = 27500, + + .hdisplay = 480, + .hsync_start = 480 + 2, + .hsync_end = 480 + 2 + 10, + .htotal = 480 + 2 + 10 + 2, + + .vdisplay = 854, // was: 854 12 2 60 + .vsync_start = 854 + 2, + .vsync_end = 854 + 2 + 2, + .vtotal = 854 + 2 + 2 + 17, + + .width_mm = 69, + .height_mm = 139, + + .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, +}; + +static const struct st7701_panel_desc kd50t048a_desc = { + .mode = &kd50t048a_mode, + .lanes = 2, + .format = MIPI_DSI_FMT_RGB888, + .panel_sleep_delay = 0, + + .pv_gamma = { + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xd), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xd), + + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x10), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x5), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x2), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8), + + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x8), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x1e), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13), + + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x11), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 2) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x23), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x29), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x18) + }, + .nv_gamma = { + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xc), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xc), + + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x10), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x5), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x3), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8), + + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x7), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x20), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13), + + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x11), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 2) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x24), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x29), + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | + CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x18) + }, + .nlinv = 1, + .vop_uv = 4887500, + .vcom_uv = 937500, + .vgh_mv = 15000, + .vgl_mv = -9510, + .avdd_mv = 6600, + .avcl_mv = -4400, + .gamma_op_bias = OP_BIAS_MIDDLE, + .input_op_bias = OP_BIAS_MIN, + .output_op_bias = OP_BIAS_MIN, + .t2d_ns = 1600, + .t3d_ns = 10400, + .eot_en = true, + .gip_sequence = kd50t048a_gip_sequence, +}; + static int st7701_dsi_probe(struct mipi_dsi_device *dsi) { const struct st7701_panel_desc *desc; @@ -776,6 +900,7 @@ static void st7701_dsi_remove(struct mipi_dsi_device *dsi) static const struct of_device_id st7701_of_match[] = { { .compatible = "densitron,dmt028vghmcmi-1a", .data = &dmt028vghmcmi_1a_desc }, { .compatible = "techstar,ts8550b", .data = &ts8550b_desc }, + { .compatible = "elida,kd50t048a", .data = &kd50t048a_desc }, { } }; MODULE_DEVICE_TABLE(of, st7701_of_match); From patchwork Mon Feb 13 15:38:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Matuszczyk X-Patchwork-Id: 13138611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5BCEC636CC for ; Mon, 13 Feb 2023 15:38:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1A4E10E57F; Mon, 13 Feb 2023 15:38:35 +0000 (UTC) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 416AB10E061 for ; Mon, 13 Feb 2023 15:38:31 +0000 (UTC) Received: by mail-ej1-x62f.google.com with SMTP id lf10so1015345ejc.5 for ; Mon, 13 Feb 2023 07:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aD93lPaEpLbO12AG6KFXUrKcEBNMZrAt4589lIUtesY=; b=IRZIXuNAUAG+0zE/5LfJMJKmXT1wn/RbaM9uAG50k32gEjAAEhoazoB2Opl2+fnT57 M+aRXPU6ZW6qfiik9IlFHU27iWoRN4dPCmJVr6pN5IOxUW9XPKFj8Dp3tOWpDd2gILqN D9APtDR1f6TvcEgbrU0Q39wfiKvclIf8z2BSG8XF1BAF5yFGavdq5ZLeJNYufchdrcey 4I60aGAW5wJ4N6/ntyCFSRkLnkpWG2z59lmkAtuYeOf2D2kUBCqPY62lDjmwtL72UU66 /lyFAoOj8EZ0KKz2d7P3VbcZsIBAsMADZwu72gqC80NE0VsRhCW+kS8fSZFr6dRzk09c ochA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aD93lPaEpLbO12AG6KFXUrKcEBNMZrAt4589lIUtesY=; b=yTJGTmnWp/ZxlG6saH8ZPmrMiVYch2hCruuiSRdJhxVg98kPZ1Ko2qf6FfLzKKg2ee qg5s8t/bxrGBT0uyBXRM1QwuStAz4MXuOXxDPc5GXK5qWVwcWn9q5jwjqGHH+LbF8uD9 8ZBXz4xImfJJfksT+brTIvRCe8IEhMk29JgX9G3M3igu97ynQHIe+M4KtxMxRUTstO9T yyj47XVZUN3R+vM04XbHbM1XpNL9U2XbFkNNmwGuAK0H5LZxLpXRRDEjd7Mlmi3e7HA9 iCcx+wr6HyfE85qzZ1d/JvmcEamaVjuY7oQvBN4kT58Sf29NJNOX60rYQZTTfV6WXcTg 42Sg== X-Gm-Message-State: AO0yUKW9frw0TvqSUKwgiA94zbQwFMsHJxuAB/cPvPE9rVSWTc4cuNVh sy3MybDwHafdj9XeuVbFnFQ= X-Google-Smtp-Source: AK7set8SN3JGKNPB4GtbNHjJ+rOSGFuY4qfwA63W6uys5Z0Dn0pmZkVfBbgeX3yFzqPHGZZrzaMKTA== X-Received: by 2002:a17:906:7704:b0:872:27cb:9436 with SMTP id q4-20020a170906770400b0087227cb9436mr25379952ejm.43.1676302709837; Mon, 13 Feb 2023 07:38:29 -0800 (PST) Received: from localhost.localdomain (83.24.145.108.ipv4.supernova.orange.pl. [83.24.145.108]) by smtp.gmail.com with ESMTPSA id gf17-20020a170906e21100b008b12614ee06sm115901ejb.161.2023.02.13.07.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 07:38:29 -0800 (PST) From: Maya Matuszczyk To: heiko@sntech.de, Jagan Teki , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter Subject: [PATCH v2 3/4] drm: panel: Add orientation support for st7701 Date: Mon, 13 Feb 2023 16:38:15 +0100 Message-Id: <20230213153816.213526-4-maccraft123mc@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213153816.213526-1-maccraft123mc@gmail.com> References: <20230213153816.213526-1-maccraft123mc@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Maya Matuszczyk Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Note that this patch is 'heavily inspired' by orientation support in driver for Elida KD35T133 panel Signed-off-by: Maya Matuszczyk --- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 660c3f435008..c9ae5c456f41 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -135,6 +135,7 @@ struct st7701 { struct regulator_bulk_data supplies[2]; struct gpio_desc *reset; unsigned int sleep_delay; + enum drm_panel_orientation orientation; }; static inline struct st7701 *panel_to_st7701(struct drm_panel *panel) @@ -514,15 +515,29 @@ static int st7701_get_modes(struct drm_panel *panel, connector->display_info.width_mm = desc_mode->width_mm; connector->display_info.height_mm = desc_mode->height_mm; + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ + drm_connector_set_panel_orientation(connector, st7701->orientation); + return 1; } +static enum drm_panel_orientation st7701_get_orientation(struct drm_panel *panel) +{ + struct st7701 *st7701 = panel_to_st7701(panel); + + return st7701->orientation; +} + static const struct drm_panel_funcs st7701_funcs = { .disable = st7701_disable, .unprepare = st7701_unprepare, .prepare = st7701_prepare, .enable = st7701_enable, .get_modes = st7701_get_modes, + .get_orientation = st7701_get_orientation, }; static const struct drm_display_mode ts8550b_mode = { @@ -733,7 +748,7 @@ static const struct drm_display_mode kd50t048a_mode = { .hsync_end = 480 + 2 + 10, .htotal = 480 + 2 + 10 + 2, - .vdisplay = 854, // was: 854 12 2 60 + .vdisplay = 854, .vsync_start = 854 + 2, .vsync_end = 854 + 2 + 2, .vtotal = 854 + 2 + 2 + 17, @@ -854,6 +869,10 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) return PTR_ERR(st7701->reset); } + ret = of_drm_get_panel_orientation(dsi->dev.of_node, &st7701->orientation); + if (ret < 0) + return dev_err_probe(&dsi->dev, ret, "Failed to get orientation\n"); + drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs, DRM_MODE_CONNECTOR_DSI);