From patchwork Sat Apr 22 20:50:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221103 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 4404BC7618E for ; Sat, 22 Apr 2023 20:50:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0540910E1A3; Sat, 22 Apr 2023 20:50:33 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id A297C10E181 for ; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1E1F561548; Sat, 22 Apr 2023 20:50:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D114DC433A0; Sat, 22 Apr 2023 20:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196628; bh=PUQCKwZnGVDUiojPXOs7mXeeN6nrWGsi+ffulJh2jzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TJ/PCE6VMqtkdLmrKvX/mN8uXAMMCurbr2XU1A0mTWg+SZ25EC4YGBB8HzDCYqQ6V v/GhWqb9mBo6YEbohP0sGUuh+Z7cDVTvmSY4CSikYgyfrhspoWioqmwZsiv/Cm1QmU 16UbSfX6rjE+ZL3LtoDR/fb0iEcrLntDDBbyBFGLwGrh69zVHKRxHFRTDkxUlgVPoG DDdpvf/ZDCdDgZpKsSimIARhRcgTCWTgQMn3zYzr6mVb+1svnUhUQXAhw5UPsgpIw7 XcR0nDPRob8AuYwkSoapGBexN+aMPFDZXiYluZ4eocdSp6BVSIhdleRgJTqaOMtDu7 fBaAl+0xkSmgg== Received: by mercury (Postfix, from userid 1000) id 0BD691066CBF; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 01/13] dt-bindings: vendor-prefixes: add Inanbo Date: Sat, 22 Apr 2023 22:50:00 +0200 Message-Id: <20230422205012.2464933-2-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Shenzhen INANBO Electronic Technology Co., Ltd. manufacturers TFT/OLED LCD panels. Acked-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index ed64e06ecca4..33e1d65cf4b2 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -609,6 +609,8 @@ patternProperties: description: Imagination Technologies Ltd. "^imi,.*": description: Integrated Micro-Electronics Inc. + "^inanbo,.*": + description: Shenzhen INANBO Electronic Technology Co., Ltd. "^incircuit,.*": description: In-Circuit GmbH "^inet-tek,.*": From patchwork Sat Apr 22 20:50:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221107 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 6CEDAC77B7E for ; Sat, 22 Apr 2023 20:50:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E1AF10E1A7; Sat, 22 Apr 2023 20:50:45 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id B7BEB10E19D for ; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1657061537; Sat, 22 Apr 2023 20:50:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A9CC4339C; Sat, 22 Apr 2023 20:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196627; bh=5pTEe5QNmuiGBfjEiv1SzkhBlJWy5vnpGmBzGZ3koYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dh80RwQo8vfVEPI+IA2p9L5NZm4T/GXu9XE2tY7tOJdaGChTl6PHPzut+66Ax7YKH oQccGTdqxBJV5rDK7tLK3eiXgJkTT28pIPuapmLbd+1Zmmf0DGlbfzBT+SDi039Cw5 tRzB3B/XMnWshCLDCp+IkTi8qlRDGj1Rv7JYkYQ6BEA2XTckACLBGX8oJsvySu3ceH TLA3s/chdLMilu/IVaEfdw5/T+mf7IUxrWoB8zMhEzq6p5X3J64tqalki6nxJvXNte 1yZ5ErUg7Rt9qxOTunmFg1z1s0fw8mLR4E8GbRfz5DJJuJiRnSKPOInmOfms/g14cL y/9jm/nimUFBw== Received: by mercury (Postfix, from userid 1000) id 0B5A11066CB7; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 02/13] dt-bindings: display: st7789v: add Inanbo T28CP45TN89 Date: Sat, 22 Apr 2023 22:50:01 +0200 Message-Id: <20230422205012.2464933-3-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add compatible value for Inanbo t28cp45tn89 and make reset GPIO non mandatory, since it might not be connected to the CPU. Signed-off-by: Sebastian Reichel Acked-by: Rob Herring --- .../devicetree/bindings/display/panel/sitronix,st7789v.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml b/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml index d984b59daa4a..7c5e4313db1d 100644 --- a/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml +++ b/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml @@ -15,7 +15,9 @@ allOf: properties: compatible: - const: sitronix,st7789v + enum: + - inanbo,t28cp45tn89-v17 + - sitronix,st7789v reg: true reset-gpios: true @@ -29,7 +31,6 @@ properties: required: - compatible - reg - - reset-gpios - power-supply unevaluatedProperties: false From patchwork Sat Apr 22 20:50:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221102 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 A99BEC77B7D for ; Sat, 22 Apr 2023 20:50:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7A7910E19D; Sat, 22 Apr 2023 20:50:32 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id C1D8010E18F for ; Sat, 22 Apr 2023 20:50:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D6BC61543; Sat, 22 Apr 2023 20:50:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB110C433D2; Sat, 22 Apr 2023 20:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196628; bh=a2pmQKhWvqek1TX2Y5M9kp9YI0QTZuxBZ8Pn1du4Q14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTdf1W/fhgUsR36kxaQSiJtoiR0FUIqR3aEKF1oR7hKnc5ccdAN/vjXf/171iKs8S /IUpoe7vueYk3sl2ueUv2v4kwD4JDp7HNTN8AIMjYXVCFQFx200rUzXx/cswDw3S5T Cs0n4GQHE8ONmawLjvCHehhC88dpXxqvVokRDX0zkzJ9iGb9+lRe6IFdjyl99ZwIqg F5yM99O8cGdls2LnruIVq5sgXLacc6Mnk2SVhyEetE3+TKfozolG7jEf+oIqlUZ0Kx XFEcjpEZr6X11UBcABurU+9vvVOB96bryMOC3rrKgLa5sJregtRzpcUu6MIcpwX5kh Q0zeFG0IzG7cw== Received: by mercury (Postfix, from userid 1000) id 0DE791066CC1; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 03/13] drm/panel: sitronix-st7789v: add SPI ID table Date: Sat, 22 Apr 2023 22:50:02 +0200 Message-Id: <20230422205012.2464933-4-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" SPI device drivers should also have a SPI ID table. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index bbc4569cbcdc..e4d8dea1db36 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -394,6 +394,12 @@ static void st7789v_remove(struct spi_device *spi) drm_panel_remove(&ctx->panel); } +static const struct spi_device_id st7789v_spi_id[] = { + { "st7789v" }, + { } +}; +MODULE_DEVICE_TABLE(spi, st7789v_spi_id); + static const struct of_device_id st7789v_of_match[] = { { .compatible = "sitronix,st7789v" }, { } @@ -403,6 +409,7 @@ MODULE_DEVICE_TABLE(of, st7789v_of_match); static struct spi_driver st7789v_driver = { .probe = st7789v_probe, .remove = st7789v_remove, + .id_table = st7789v_spi_id, .driver = { .name = "st7789v", .of_match_table = st7789v_of_match, From patchwork Sat Apr 22 20:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221104 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 68653C77B7D for ; Sat, 22 Apr 2023 20:50:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8916710E1A0; Sat, 22 Apr 2023 20:50:44 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF23D10E18F for ; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7716361376; Sat, 22 Apr 2023 20:50:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0297C4339B; Sat, 22 Apr 2023 20:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196627; bh=7zeW/xv++SWINuXHU/MUsAajCSk6VKuZ5VI+UwjVzBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YizmBtL0rRsM3d+Df6GBDq/V9QiNOcl0Xv1c43rft7AAu2fuqHImyp63WRVLj44xk iSPwrBtUCVY3O0368OleeeyNlnKWBbikBoVMEgLDWAaprOuQv7E2xUDZMEdiwbph+1 wBbSZjfd1U1KanoouNkBIWr6xNO6owrq8YSXK7zLfjsoC3BQ8v9/lt8GapL7dcguZt TPH3pePHTaaJfDIEABArHMG1alA2fZ131vqH0anad/I1cLstX3P4lHmBPUpAmqt9Rw 3Ys+5GJ/JYyBb0MoHb6QAfrJ7+y0QFi524ePijpUos1ksTrvfsyW7/EaLghMxJOt6z BEf8/b49KE8vw== Received: by mercury (Postfix, from userid 1000) id 0FEDC1066CC3; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 04/13] drm/panel: sitronix-st7789v: remove unused constants Date: Sat, 22 Apr 2023 22:50:03 +0200 Message-Id: <20230422205012.2464933-5-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" ST7789V_COLMOD_RGB_FMT_18BITS and ST7789V_COLMOD_CTRL_FMT_18BITS are unused in favour of MIPI_DCS_PIXEL_FMT_18BIT, remove them. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index e4d8dea1db36..f7566551b5e2 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -15,9 +15,6 @@ #include #include -#define ST7789V_COLMOD_RGB_FMT_18BITS (6 << 4) -#define ST7789V_COLMOD_CTRL_FMT_18BITS (6 << 0) - #define ST7789V_RAMCTRL_CMD 0xb0 #define ST7789V_RAMCTRL_RM_RGB BIT(4) #define ST7789V_RAMCTRL_DM_RGB BIT(0) From patchwork Sat Apr 22 20:50:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221110 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 31939C7618E for ; Sat, 22 Apr 2023 20:51:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1DC410E201; Sat, 22 Apr 2023 20:51:09 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id E408D10E181 for ; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 74D7D6146B; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48683C4339E; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=qSwlGWERs1iLO9M6K70WivJnuxc3M3Ft0dJO8xZoQJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WR0Y2Gkj8T3l8/g3V/e8fiXBUxcANbDupyE0B/Q659iKEKhTAQUZcsnarxo5od6si znbRTZLKLRJAY5+pyhzFutqtes/QWu1HbVXTrVIaEgsVq6n7tXtQLu+etq43fEJBEM j19RBI4qH8lknwNqM591bJGsClcnCr2TegH22VkgvW6XapB62heg1dP1UDQSvVT0wO bFAR2HdF67wIHIJoL51AWnF6UDK1EoCj6pGHTAopcp/DejPJL/sI3PkO3guXoDC9y8 nrwUDxYkCjCkGClsi6Boyau1iv5tCPXkOIKOWACSf2pOCbVMaETq0qk4ZTXqbdzYPS tcAO0YLp6nSyA== Received: by mercury (Postfix, from userid 1000) id 127C91066CC4; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 05/13] drm/panel: sitronix-st7789v: make reset GPIO optional Date: Sat, 22 Apr 2023 22:50:04 +0200 Message-Id: <20230422205012.2464933-6-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The reset pin might not be software controllable from the SoC, so make it optional. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index f7566551b5e2..1d43b8cc1647 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -369,7 +369,7 @@ static int st7789v_probe(struct spi_device *spi) if (IS_ERR(ctx->power)) return PTR_ERR(ctx->power); - ctx->reset = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW); + ctx->reset = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ctx->reset)) { dev_err(&spi->dev, "Couldn't get our reset line\n"); return PTR_ERR(ctx->reset); From patchwork Sat Apr 22 20:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221112 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 ED6BDC7618E for ; Sat, 22 Apr 2023 20:51:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CD4F10E1EE; Sat, 22 Apr 2023 20:51:20 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 653A310E181 for ; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E25B660DD8; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22B98C433D2; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=qucudSlPchI3svnOIhdFV9BiouDXG/kOilDZtzG2V8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AdtXJEch7BT8FPzNbIzVkdDmmBN2p3kL10NBU5moWj61DTwmx15WvtMOgLtFRT4Nc j0NuC+dNOZghYWBXTiRsfswdEwu0zp8Q2YkSOVlLuspQsRBQ8KKWMV1sNGbIjESE0+ shqLCVXQfdjzEH/fZgLTNBa3ehTuZ/F0WEr2MVBkpyCE+8xxl1gM4PerEry/t4qg2F k7MzN7tQw+uf+0qt9q9RdI3zZUkPy0l2k4smddLZe8UquDZWV5NopOLJdn3bKFPSzi JHQPQeXcgWQQm510KcncwLOFQ7A6x1ZubWPp5nVkNkb2mlz2XHJZ4pdH5dvwJJkVWl GHz6/Og4WB9uA== Received: by mercury (Postfix, from userid 1000) id 14A471066CC6; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 06/13] drm/panel: sitronix-st7789v: simplify st7789v_spi_write Date: Sat, 22 Apr 2023 22:50:05 +0200 Message-Id: <20230422205012.2464933-7-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" st7789v_spi_write initializes a message with just a single transfer, spi_sync_transfer can be used for that. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 1d43b8cc1647..6290bd49d055 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -129,17 +129,13 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix, u8 data) { struct spi_transfer xfer = { }; - struct spi_message msg; u16 txbuf = ((prefix & 1) << 8) | data; - spi_message_init(&msg); - xfer.tx_buf = &txbuf; xfer.bits_per_word = 9; xfer.len = sizeof(txbuf); - spi_message_add_tail(&xfer, &msg); - return spi_sync(ctx->spi, &msg); + return spi_sync_transfer(ctx->spi, &xfer, 1); } static int st7789v_write_command(struct st7789v *ctx, u8 cmd) From patchwork Sat Apr 22 20:50:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221111 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 AA02EC77B7E for ; Sat, 22 Apr 2023 20:51:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEC5110E1F8; Sat, 22 Apr 2023 20:51:09 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27B2C10E19D for ; Sat, 22 Apr 2023 20:50:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8FF3761557; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55A6BC433EF; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=gS1hH+6UfTG4eAU2Lxy6lXpSl2LKEs6U01Sva2NM8K0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BFSTdmqxktXIhqaVQuxoxZIM99nWNCOVwcoGznR4cprKjkzJO5pg2Q/268AbMmxBu irvc/NwAS/hJVW4jFaRR+t/GheZ26xD7a1cKXRGMOqA9SOOW2o3JGCpCP+2HHOTBdN zfNT9leHiGN7ynDEGUpS22IvgOJZREPxVKvTESL5wZGibVElapgIfTa61nNvsRaBGD kw4OZ4aOZS50isJpiHTuhS7E/pnjYJRX22z0F6IltRv9Kq+Dwbzz/exHrw1dEaTNiX FMAA39WWEh0uSIV8vEirYQlIpo43mWxUocvEXg7DiZnEvjPGiwoI593lSqkCu03T5k v4NKC3zOgkqTg== Received: by mercury (Postfix, from userid 1000) id 173BA1066CC8; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 07/13] drm/panel: sitronix-st7789v: improve error handling Date: Sat, 22 Apr 2023 22:50:06 +0200 Message-Id: <20230422205012.2464933-8-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Improve error handling in the probe routine, so that probe defer errors are captured in /sys/kernel/debug/devices_deferred Signed-off-by: Sebastian Reichel --- .../gpu/drm/panel/panel-sitronix-st7789v.c | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 6290bd49d055..a6d6155ef45c 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -348,32 +348,33 @@ static const struct drm_panel_funcs st7789v_drm_funcs = { static int st7789v_probe(struct spi_device *spi) { + struct device *dev = &spi->dev; struct st7789v *ctx; int ret; - ctx = devm_kzalloc(&spi->dev, sizeof(*ctx), GFP_KERNEL); + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; spi_set_drvdata(spi, ctx); ctx->spi = spi; - drm_panel_init(&ctx->panel, &spi->dev, &st7789v_drm_funcs, + drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs, DRM_MODE_CONNECTOR_DPI); - ctx->power = devm_regulator_get(&spi->dev, "power"); - if (IS_ERR(ctx->power)) - return PTR_ERR(ctx->power); + ctx->power = devm_regulator_get(dev, "power"); + ret = PTR_ERR_OR_ZERO(ctx->power); + if (ret) + return dev_err_probe(dev, ret, "Failed to get regulator\n"); - ctx->reset = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(ctx->reset)) { - dev_err(&spi->dev, "Couldn't get our reset line\n"); - return PTR_ERR(ctx->reset); - } + ctx->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); + ret = PTR_ERR_OR_ZERO(ctx->reset); + if (ret) + return dev_err_probe(dev, ret, "Failed to get reset line\n"); ret = drm_panel_of_backlight(&ctx->panel); if (ret) - return ret; + return dev_err_probe(dev, ret, "Failed to get backlight\n"); drm_panel_add(&ctx->panel); From patchwork Sat Apr 22 20:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221105 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 A813FC7618E for ; Sat, 22 Apr 2023 20:50:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE70A10E18F; Sat, 22 Apr 2023 20:50:44 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7355F10E18F for ; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 033976153B; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BEE8C4339B; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=ZrSzAKT5X1qtuWqGc1AQT6QLsxNN39iNlyDA0bBrxEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gU10iYtYgERZESv2GA4e8IkehEsjbKGvjwA7nPTjXIWpBy0icLsltwMxw3RLpSZtV lTc17MwNTDNb/Og093KxQZTqVlkUcP4sUcIOyhizVY5DjDsnUaimR7KXrW74/rRlVO f4O8uFbPrTfAoYSuVpYisxlAhuyObtcdYIhpaHI3DsGJEFVrNXvpNNcHpI++IWC9wU OO76J2VS5vfppQnqsSb1HlJK9BktaoB0d+//LuTRF9MQtS+8mr1EX0BvVdomvUte/g NeZbB8pKovmFx8cnv/sZeeSalbdOvlSK0pIFBbipY9qIfVt15xdyjSppAChLyJqajT JHDOqITJVhnwg== Received: by mercury (Postfix, from userid 1000) id 197051066CCA; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 08/13] drm/panel: sitronix-st7789v: avoid hardcoding mode info Date: Sat, 22 Apr 2023 22:50:07 +0200 Message-Id: <20230422205012.2464933-9-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Avoid hard-coding the default_mode and supply it from match data. One additional layer of abstraction has been introduced, which will be needed for specifying other panel information (e.g. bus flags) in the next steps. Signed-off-by: Sebastian Reichel Reviewed-by: Michael Riesch --- .../gpu/drm/panel/panel-sitronix-st7789v.c | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index a6d6155ef45c..29c2a91f8299 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -108,8 +108,13 @@ return val; \ } while (0) +struct st7789_panel_info { + const struct drm_display_mode *mode; +}; + struct st7789v { struct drm_panel panel; + const struct st7789_panel_info *info; struct spi_device *spi; struct gpio_desc *reset; struct regulator *power; @@ -160,16 +165,21 @@ static const struct drm_display_mode default_mode = { .vtotal = 320 + 8 + 4 + 4, }; +struct st7789_panel_info default_panel = { + .mode = &default_mode, +}; + static int st7789v_get_modes(struct drm_panel *panel, struct drm_connector *connector) { + struct st7789v *ctx = panel_to_st7789v(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->dev, ctx->info->mode); if (!mode) { - dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", - default_mode.hdisplay, default_mode.vdisplay, - drm_mode_vrefresh(&default_mode)); + dev_err(panel->dev, "failed to add mode %ux%u@%u\n", + ctx->info->mode->hdisplay, ctx->info->mode->vdisplay, + drm_mode_vrefresh(ctx->info->mode)); return -ENOMEM; } @@ -359,6 +369,8 @@ static int st7789v_probe(struct spi_device *spi) spi_set_drvdata(spi, ctx); ctx->spi = spi; + ctx->info = device_get_match_data(&spi->dev); + drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs, DRM_MODE_CONNECTOR_DPI); @@ -389,13 +401,13 @@ static void st7789v_remove(struct spi_device *spi) } static const struct spi_device_id st7789v_spi_id[] = { - { "st7789v" }, + { "st7789v", (unsigned long) &default_panel }, { } }; MODULE_DEVICE_TABLE(spi, st7789v_spi_id); static const struct of_device_id st7789v_of_match[] = { - { .compatible = "sitronix,st7789v" }, + { .compatible = "sitronix,st7789v", .data = &default_panel }, { } }; MODULE_DEVICE_TABLE(of, st7789v_of_match); From patchwork Sat Apr 22 20:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221114 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 514CFC77B7D for ; Sat, 22 Apr 2023 20:51:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B6D810E20A; Sat, 22 Apr 2023 20:51:21 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4192A10E1A3 for ; Sat, 22 Apr 2023 20:50:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 198F761476; Sat, 22 Apr 2023 20:50:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72B5BC433AA; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=WgattwYxV8wos1xLo0sZNXqqbXSW7bNExVNy4EwvZ+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2OqDKLpTNcdniuIt+/N4U3htRrNisGdIHm5JIiz1TJ6n46Amrm2Cdiz3EPkT+4Zx ZzSqoOCmfm9JEmwwR9JZ+rIV2P4ZC2X4dPT7TruGSXTBjaSIIfWX3fkax4ADm+KMyJ RfICR8cGE7SE+FKvJODvoODp7OVoZ1T3QvMmsQifirIEoTk8nBvWtD1DTVVLagETQo fzgiiDBGh3v6FLn0ueSfpV4NajCCrIJucOgc1HXZH8ooEVD4kcDn5gW2U4u6vkXu8b 7q6Gd9elq12dL83q06OzmKWijJsQdUEH24o8AmhcHMz0rsQlibQdqmgR4aBCKupAxP eYmMEfiRAAKeQ== Received: by mercury (Postfix, from userid 1000) id 1BA381066CCC; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 09/13] drm/panel: sitronix-st7789v: avoid hardcoding panel size Date: Sat, 22 Apr 2023 22:50:08 +0200 Message-Id: <20230422205012.2464933-10-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the panel size information to the mode struct, so that different panel sizes can be specified depending on the panel type. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 29c2a91f8299..0e1839e6da73 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -163,6 +163,8 @@ static const struct drm_display_mode default_mode = { .vsync_start = 320 + 8, .vsync_end = 320 + 8 + 4, .vtotal = 320 + 8 + 4 + 4, + .width_mm = 61, + .height_mm = 103, }; struct st7789_panel_info default_panel = { @@ -188,8 +190,8 @@ static int st7789v_get_modes(struct drm_panel *panel, mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); - connector->display_info.width_mm = 61; - connector->display_info.height_mm = 103; + connector->display_info.width_mm = ctx->info->mode->width_mm; + connector->display_info.height_mm = ctx->info->mode->height_mm; return 1; } From patchwork Sat Apr 22 20:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13221109 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 335F7C77B78 for ; Sat, 22 Apr 2023 20:50:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B492610E1DE; Sat, 22 Apr 2023 20:50:45 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0253010E18F for ; Sat, 22 Apr 2023 20:50:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F1256154E; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48601C4339C; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=frBJetfUTJQ9t9MCTXEIjpCIg2Rlk2lsxz9rtmvkfDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=engI0zZoV4o/Oo47xVRlDL5cyd+XfMUBscHRs9wH817eu7N/7P0mO9BiNgFMUqnrM 5JHryNGg6ZCETV5l9Lxp3BfXYV+J/uGsHfGfv5ktZ27M9SuvWvhWWVs09U0s0MO+95 TPgmYGqRb/1Qpm1QP41KsvSCyaQv/c2jlXn0YkNi/Q2WtjKgUAzz+plKpK+7Slyf/Y cBUNYD4K+E4I/b/BeecFLUYyaiU7K5fnDVeJtY0kJlLjrli6NdQZ9VyKvXJNGh6Zne qYcIBZ1eCmo0viCMQ50zDFuVuX3+tShYMGzzViNHQ99Xk9f75ttEgfdo2ElDI9SmcY Q8bgCTl6dXN3w== Received: by mercury (Postfix, from userid 1000) id 1E25B1066CCD; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v2 10/13] drm/panel: sitronix-st7789v: add media bus format Date: Sat, 22 Apr 2023 22:50:09 +0200 Message-Id: <20230422205012.2464933-11-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> 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: devicetree@vger.kernel.org, Krzysztof Kozlowski , Gerald Loacker , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Michael Riesch Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add support for describing the media bus format in the panel configuration and expose that to userspace. Since both supported formats (RGB565 and RGB666) are using 6 bits per color also hardcode that information. Signed-off-by: Sebastian Reichel --- .../gpu/drm/panel/panel-sitronix-st7789v.c | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 0e1839e6da73..6d155c6262f3 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -10,6 +10,7 @@ #include #include