From patchwork Fri Jul 14 01:37:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312822 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 AA1F1C04E69 for ; Fri, 14 Jul 2023 01:38:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6FD510E7AC; Fri, 14 Jul 2023 01:38:05 +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 21ECB10E094 for ; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6D96C61BA9; Fri, 14 Jul 2023 01:38:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A59EBC433C9; Fri, 14 Jul 2023 01:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298681; bh=LPOwEiLDba7WqkS5e6PMVWcf9bxL4V+UFMcte4xKN7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENVvj5nN3emsfKqKyx1iWqHLTmxPBlBu+UBlk0CVbM6eJB/AHK4ulqq1AzPz8MdzK uaG9auED1JyG44KGnoZ6PwzjBU5bhT7wEnGxyzqy3mm0eH1y/sEdtVTervd51DMX+C uUKloTsfhMRbg56oFkfgCIO6cbtDj/Bg/EsDQxp/JavFzFKXqbbN2zyV+qZzclTz5t XusvMJVYrSr8P09hBrOAwGVbaArjdEeGiri2m2oEkgrEA0HzOKGkjAQFtr44HLiaOQ 7Z14321ihJoc6BmI6UFH9OVI5Oi19HRB2dScVTqP7ByUhvUVoW26YyiaxYhfwBb4Z5 SJBtmL7mSEzbA== Received: by mercury (Postfix, from userid 1000) id CAE161067666; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 01/19] dt-bindings: vendor-prefixes: add Inanbo Date: Fri, 14 Jul 2023 03:37:38 +0200 Message-Id: <20230714013756.1546769-2-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Shenzhen INANBO Electronic Technology Co., Ltd. manufacturers TFT/OLED LCD panels. Reviewed-by: Michael Riesch 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 af60bf1a6664..1e2e51401dc5 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -617,6 +617,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 "^indiedroid,.*": From patchwork Fri Jul 14 01:37:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312840 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 D96D2C001DD for ; Fri, 14 Jul 2023 01:38:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0077910E7BC; Fri, 14 Jul 2023 01:38:46 +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 3016710E0C8 for ; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 70EC161BB2; Fri, 14 Jul 2023 01:38:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA4F8C433CA; Fri, 14 Jul 2023 01:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298681; bh=ZCtk/JiU9swJ+bePtmvtWrQdxyBhpSeCtAN3ecv4HUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A0K+HtJDDCdq80eVoRo+GkyLE+/9F6xazEDDQC2KTgSI7y2DWuOi7c/y3FAz0g8A8 kLPIeeyFWCAv8DzyjQENzBj0jH5InVUpWg/d+sC/8Qjc+dYnT+3EjOtivMZrvheFkG e/snkUhNmISUVLLUUIAslN/CGdwcAPI4a4DJ/B9HuC/K0hzoSVem9Au6ctjdgGPOsZ 6rH6J2Sg4m/70vWF6wiUNd3erF7w8EGF2Ipt8/pcav6VQjzcpS5Sz97aUdN5vt6ouI 5lfWHL8Ba6YwdZe8RvioFzhBq8R25nk86SivsZtR9wS28qJcMnYdXnQorjCJhjsw5s kkqyhECfAng0w== Received: by mercury (Postfix, from userid 1000) id CDBC61067680; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 02/19] dt-bindings: display: st7789v: add Inanbo T28CP45TN89 Date: Fri, 14 Jul 2023 03:37:39 +0200 Message-Id: <20230714013756.1546769-3-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch Acked-by: Rob Herring Signed-off-by: Sebastian Reichel --- .../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 fa6556363cca..75e935f0547b 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 @@ -33,7 +35,6 @@ properties: required: - compatible - reg - - reset-gpios - power-supply unevaluatedProperties: false From patchwork Fri Jul 14 01:37:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312830 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 22A10C001DD for ; Fri, 14 Jul 2023 01:38:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47A2C10E7B2; Fri, 14 Jul 2023 01:38:12 +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 38EB910E0DA for ; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7929161BB5; Fri, 14 Jul 2023 01:38:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC4B0C433CB; Fri, 14 Jul 2023 01:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298681; bh=4DZEdPQyybkjFKpYx7JH1MF+hEoS/Ylm1gHH8AEdVbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=liu/NMt3SYEYvgfv+ioHuHjSrql38lpoNaOr3m7FAeLxqLO7Q7JxPIHcj8vRe3xdC CNKGVyUE2/Wfvb7qEzfugxeXHKpeBRZRRLmoNjC2Y3EO9i3mvEjctAPMpJhc3L5cSw bBjFKAwu/ULMxmLO7lkmH+SwIyxvvge+MURbw1F2W2x26kqSgvL7lO9evxp+PFsTxg vtTe7OFcQXjzZr/F9nU6YSYg+EicDDGD0TKaBh/SBAedlCVRWUDfFF/rS9j8E6BvBH llk8N9PxQJdbW0I/B7DrJQzF/iX7/AyIiyrrdB/CADE0dAPnguULEVmjLTV9BCSACt yI9W20pZLRUuw== Received: by mercury (Postfix, from userid 1000) id D04991067687; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 03/19] drm/panel: sitronix-st7789v: add SPI ID table Date: Fri, 14 Jul 2023 03:37:40 +0200 Message-Id: <20230714013756.1546769-4-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" SPI device drivers should also have a SPI ID table. Reviewed-by: Michael Riesch 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 Fri Jul 14 01:37:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312827 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 9A435C001DD for ; Fri, 14 Jul 2023 01:38:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0636010E7B1; Fri, 14 Jul 2023 01:38:12 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 94A9C10E094 for ; Fri, 14 Jul 2023 01:38:03 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7171561BB3; Fri, 14 Jul 2023 01:38:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3ACCC433C8; Fri, 14 Jul 2023 01:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298681; bh=VliKl8yRFl/vxHPSCbMcCRDElBFtRJGleu5OKQBvOiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kgVwOrcINvGcwjIf2mECWMFJg6P/gWNuuZRLGQxB/xJYE76Sqo8bdcPi9FxasDtSh JjtiuQeRFj951kk7RXJfFBcPKkEKut5rRwP0qprsGB82sjPrWivTTdy6XUdGzcx0se GCsqPjF/OzktqndI4WUbBmqTpstc8Ur4vDQfL31B8XQlziOtyrXGBTbxuK/WomV/WO +LLzzwVLsNYiRnnZ8OvtRdQu8+4wN6ZC7sk7ZQ6Y+GdXXLu3dB+Esj9cyFu2b2ZmpR aStiUMWSfnw2/qXH8s72QaDxqw+ctMTHnZ5H5ksCxAH2P2DnR+8y9N953HgRcYg17h fQsAo0sTi2HTA== Received: by mercury (Postfix, from userid 1000) id D2BB01067694; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 04/19] drm/panel: sitronix-st7789v: remove unused constants Date: Fri, 14 Jul 2023 03:37:41 +0200 Message-Id: <20230714013756.1546769-5-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch 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 Fri Jul 14 01:37:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312832 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 8F02DC001DF for ; Fri, 14 Jul 2023 01:38:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A62610E7B8; Fri, 14 Jul 2023 01:38:13 +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 5F55810E7AB for ; Fri, 14 Jul 2023 01:38:08 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 535A661BE7; Fri, 14 Jul 2023 01:38:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E25CC43391; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298684; bh=Yz2WLdihy2cH3NLgwzal4tjdyU5OuV1nw3L8ogj7TNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ElmvuO0AzQAHTExm1eL3Pr0z3ijuwCOvIz3Wso7OgiIp4JteopEROMpZ1ysINuHjx d4tBmsHove9QJEAjJA3rJzIF3t5wwRjaadgAgMdfsoJfSjhkTDEv+81FAGqTS2nt0w DBCMDnKaJnSjH835aAow1Mdyf98wtOj3lVdoIfLPXdrnKasyfNkTvbJmTTIE0gJndg kaW+hZZgK470Od+3X5YB5tMsG+/q8WBCjv/lDYVPrRy4BTg1/f8ML9tv1IZ7wTJCtE Hcr8SBEkvJS338SFyaEisMDm7UXqKAXRSBnvuR8viair8BTjvaRLLOhCc2iaeZgSZt plus0XsmLz5Vw== Received: by mercury (Postfix, from userid 1000) id D58DE1067695; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 05/19] drm/panel: sitronix-st7789v: make reset GPIO optional Date: Fri, 14 Jul 2023 03:37:42 +0200 Message-Id: <20230714013756.1546769-6-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch 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 Fri Jul 14 01:37:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312828 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 93F33C0015E for ; Fri, 14 Jul 2023 01:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CD2210E7B3; Fri, 14 Jul 2023 01:38:12 +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 43FFC10E0C8 for ; Fri, 14 Jul 2023 01:38:06 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B867161BC4; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58042C433CA; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298684; bh=BWX8AXPfJ5gQEAV6Gfsqwd1FF8WXCoKoYTywoJ22YAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JQzQ13H+HlDBwkhGckSx6+UVsUTgf01rN2VxwEfLMhsxfJGPZLGnBuvfOxvWSxQks wt91ai0vjK/Pr0I7lWxhituUXXkHgRO12rL0GZn9l+Tlj67Osv4QOkuKXGO9dEUWVG A3vJGVPYi1pHSnDFHLxRxYUCMRAJcAYdGvbveGn1ENNQNNxlWqV+w1fRvE8cR4SVaU UxMc/R6KmA1KYHwtLhDuWXj1J3bAywXFGfyW9wbBfnEbKnDQV81wRveWWhOqXyQB8/ Mue7M4xbPx9oH0g5OLt671GIFyUpkCXnxMpWP7g8yRoCinZ7hLT6D2s5w1ltqRlwVq r6NojQosdpfMA== Received: by mercury (Postfix, from userid 1000) id D82FB1067696; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 06/19] drm/panel: sitronix-st7789v: simplify st7789v_spi_write Date: Fri, 14 Jul 2023 03:37:43 +0200 Message-Id: <20230714013756.1546769-7-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch 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 Fri Jul 14 01:37:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312833 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 E67B0C0015E for ; Fri, 14 Jul 2023 01:38:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08DA210E7B7; Fri, 14 Jul 2023 01:38:13 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 372C910E0AD for ; Fri, 14 Jul 2023 01:38:06 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B469361BBE; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F6E6C433D9; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298684; bh=EyFDzV4ddqw1sjwHBTSR4kWEp2hOqnAjhUV748qVmZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HysJGfs/dIwxuKwN3vBYM0JpBWVvtSNxLGpwu9TNJpI3Ie6yITYRQ5ZlzvdRFhAV1 sm0BCuMYOalW0M3sx5jvgtizhq9QiQYD1KBjGWpnJvah4OAPEUrnCWSo+FZrM8eHtt mxDXBSfDJvl9+GWOBH34u+2mo7sJMRHvPyDI8DlQ37YPjm1AxXoIxejrxJ0sCcjZNN u1TMZUeL6nmsrSwibZ/p6SqMifWqJ+L2YO4lQliO9ludKlt/vbAUvZjpB+VuWnFT87 TDW/iTkCWoikzVAeaLfzkVCAOoFRm6YF6+0jqyp21w+zYH/UQ0snemsabIGtoR1NVx kSZvCf/n4GTSg== Received: by mercury (Postfix, from userid 1000) id DAB131067697; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 07/19] drm/panel: sitronix-st7789v: improve error handling Date: Fri, 14 Jul 2023 03:37:44 +0200 Message-Id: <20230714013756.1546769-8-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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 Reviewed-by: Michael Riesch 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 Fri Jul 14 01:37:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312838 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 64B24C001E0 for ; Fri, 14 Jul 2023 01:38:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18CB910E7A9; Fri, 14 Jul 2023 01:38:46 +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 B2DD010E7A9 for ; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F20D61BB5; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583B5C433CC; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298684; bh=i3ZrSSDxreDrHnbdzjRZb/TFVdFo15zQGfDgEtGHAcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P/KHAdAtEeObqX6VWEDk0ol/pRePLLW+O8wxczMFSV9tDyruFPRh8YIAYg/BOBWMm zQZoMi7hqMriC9HuMMsg4zqjCgcE1JLo2PzoXW17KBWwcTa6aTbKxbd2Kp3nst/n7y TYQlDs8Ih5PVu2M0hMXxZQ67BDEt2yF/mdtXL9fpq4CFSH5RkE7HUNRFj3Hx+lP5U4 IQJVkYeTWW8FCHKSwVZV1vl81N+kRGL9ktzm3u9Kb1YsaxLzPqrF9egRnkDlmbAcXM KE66/6bAfqQZNYB63TLXcat4LNM5OvgQqbh89l2EZrWHRLqybOUOdf8Y4yADPY7hU2 YClOTMMf8/wHQ== Received: by mercury (Postfix, from userid 1000) id DD676106769A; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 08/19] drm/panel: sitronix-st7789v: avoid hardcoding mode info Date: Fri, 14 Jul 2023 03:37:45 +0200 Message-Id: <20230714013756.1546769-9-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch Signed-off-by: Sebastian Reichel --- .../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..24c5bec6ce31 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, }; +static const 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 Fri Jul 14 01:37:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312826 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 891C0C001E0 for ; Fri, 14 Jul 2023 01:38:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91EC710E7B0; Fri, 14 Jul 2023 01:38:11 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9DFE510E0AD for ; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2798C61BA9; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57E31C433C8; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298684; bh=9ICj2srZUkHSM8Oenv3/OJ/dpUwH5604BWTzaI6ATYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dIch2TxBnNHsz+EJC/0LWNpKTydIiP8kB+DqKl4Jhc0oaYZRA2/2p5hqGrB3Wb/Yw rrzK/1MLSqstwk+3l6N3BYx9AgeHDM5vbm+7ktU1Sgz6FbTTcYxGEsydMWKDozWkbr lpmafKMRSdARDvcQlVYGPY0pBjHJ0a7xe81Sv2W0bN1ZviC6ZaHzG27YeDN7eDVFQn /3f5G8E2XJXYAU9WMylKRqQBekReQM3ot5/x6ZYByhCyG4veVzKZo/ennEDWVvkYAU xp2dSWjOcKA9GBfAhRGnd6RGyKc5vxsYJ+/PyWEV7miJhtT5MQtobAqhWJ7wKFukq4 mR19+FbLKrxoA== Received: by mercury (Postfix, from userid 1000) id DFC3110676F1; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 09/19] drm/panel: sitronix-st7789v: avoid hardcoding panel size Date: Fri, 14 Jul 2023 03:37:46 +0200 Message-Id: <20230714013756.1546769-10-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch 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 24c5bec6ce31..aa11a1dc0752 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, }; static const 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 Fri Jul 14 01:37:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13312834 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 5D04CC001DD for ; Fri, 14 Jul 2023 01:38:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE14710E7AE; Fri, 14 Jul 2023 01:38:13 +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 B61BD10E7AB for ; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2DF8B61BA2; Fri, 14 Jul 2023 01:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 581D1C433CB; Fri, 14 Jul 2023 01:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298684; bh=pHG+mTF3Sqq4Dyhp7e3fM2xvT8KCo3Hc4liBMTVZVOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jcobtyHoeNyuILr2XEO5I4hFwKoTCvji/RQFFN4rJXcJn8ldgZrRtumRdxsmLzDAl TF3fWQFpUhlCtRfrI8NSYv7VHedxNEz6gAHWN5o7A2XFWwrckHcIctWvEhXjDGHfhR P/l1czEkG1foF2ESTVmjPtnLrbetDqZ1d3fmBPgb2w6ZUTbS4UqibPz25ye8E/27rj 87CAO8XzMhJUo/yciroYpWw3s16fQO+VRNlBe7CHLDtedEciSv+Xx9Lbmb0pD3z9Yg sj4+cTkOpOcbQAHgsms06lQ4praeRHvGBVCPWXDc6+JyhyWi2bMslRc7Aisrm5YQhF 8Rnho0zq6hUlg== Received: by mercury (Postfix, from userid 1000) id E249B10676F2; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Subject: [PATCH v3 10/19] drm/panel: sitronix-st7789v: add media bus format Date: Fri, 14 Jul 2023 03:37:47 +0200 Message-Id: <20230714013756.1546769-11-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-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 , Miquel Raynal 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. Reviewed-by: Michael Riesch 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 aa11a1dc0752..d05d7a9caefc 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