From patchwork Tue Mar 14 11:17:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13174113 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 BA064C6FD1C for ; Tue, 14 Mar 2023 11:26:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1F9F10E77B; Tue, 14 Mar 2023 11:26:36 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id D896310E77B for ; Tue, 14 Mar 2023 11:26:32 +0000 (UTC) Received: from fabio-Precision-3551.. (unknown [IPv6:2804:14c:485:4b69:d086:7d15:2ce3:1a1b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 64D8F85B17; Tue, 14 Mar 2023 12:17:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1678792656; bh=ef9/+7LCdE2/mEAxSGXL9tBEYCf12iQaIsndD1dicjI=; h=From:To:Cc:Subject:Date:From; b=LbcmUStRAERbIOQZyqU8ERdrjFYfuS9hGZh4rg6s47BdmeNAG3pu6OU/+G95eqdr+ j+m3CH9X/+J+YF/ydT9Qq1HduYyTaNF+JlKSAH8S4dDEI7YGyGGbpGWL84TLmcK5Ek Y3IxHN3f4ZqYKQHieYuvkbEjgDmXJfQkCIzkH1CpNRam9AO6aDgzgfwtQsLdwVV6aj CuRpryME+41hFMhIxah0KHOPBqXdOD6ng6dVshFQffXIpKekP4/qdcwI3KSrY3bUHb wZagFXUHVpMnW1u9RhgyRk2gxLXq7Hm2KiPa9QaITl43yE9hz0penlPUVKjpPIcSi0 htKQwd3bCdwrQ== From: Fabio Estevam To: neil.armstrong@linaro.org Subject: [PATCH 1/2] dt-bindings: display: seiko, 43wvf1g: Add the 'enable-gpios' property Date: Tue, 14 Mar 2023 08:17:23 -0300 Message-Id: <20230314111724.1520178-1-festevam@denx.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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, Fabio Estevam , dri-devel@lists.freedesktop.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sam@ravnborg.org, CPHEALY@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add an optional 'enable-gpios' property that can be used to turn on/off the display. Signed-off-by: Fabio Estevam Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/display/panel/seiko,43wvf1g.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/seiko,43wvf1g.yaml b/Documentation/devicetree/bindings/display/panel/seiko,43wvf1g.yaml index cfaa50cf5f5d..496a39561db0 100644 --- a/Documentation/devicetree/bindings/display/panel/seiko,43wvf1g.yaml +++ b/Documentation/devicetree/bindings/display/panel/seiko,43wvf1g.yaml @@ -25,6 +25,8 @@ properties: avdd-supply: description: 5v analog regulator + enable-gpios: true + required: - compatible - dvdd-supply From patchwork Tue Mar 14 11:17:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13174112 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 ACC2DC6FD1C for ; Tue, 14 Mar 2023 11:26:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F188410E0D2; Tue, 14 Mar 2023 11:26:33 +0000 (UTC) X-Greylist: delayed 534 seconds by postgrey-1.36 at gabe; Tue, 14 Mar 2023 11:26:31 UTC Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id C61A610E0D2 for ; Tue, 14 Mar 2023 11:26:31 +0000 (UTC) Received: from fabio-Precision-3551.. (unknown [IPv6:2804:14c:485:4b69:d086:7d15:2ce3:1a1b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 84D16861C5; Tue, 14 Mar 2023 12:17:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1678792659; bh=5UVq9kWaDSvkl4Rfih2050+zoQO8g2q290YPZ7fsYME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8zxERBlTl6EmELJFG3+3NTNt64GsbVFwAGSB1AwaSC8vCWbffiPnTxxqB0UOBSrO EytfrsQaDut3BNujxc+ImPBrhiMgmW0/sHYf8V13HNaabMyim9Faspi271jeAuun34 eH6ilSOtiXXpF/T0bWNCBYWHanBkWi9rQ7bmK0XzKLD+xN7Htgm1qM1Imwki+vjIsL bTuAP++WCZud8uv/ts7B7hmDXgHHNYQYlzhm41IhGv1SJV1uXY/qZvEVifCCVv/iXv 7nKq8GzmqAOOAJP7VMqGK5tAVWH4/cHDQh8JIqSMMBzuSx7SxVFY22ofcMH0ahVyqL 7RyJNHaXaO0Ig== From: Fabio Estevam To: neil.armstrong@linaro.org Subject: [PATCH 2/2] drm/panel: seiko-43wvf1g: Add the 'enable-gpios' property Date: Tue, 14 Mar 2023 08:17:24 -0300 Message-Id: <20230314111724.1520178-2-festevam@denx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314111724.1520178-1-festevam@denx.de> References: <20230314111724.1520178-1-festevam@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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, Fabio Estevam , dri-devel@lists.freedesktop.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sam@ravnborg.org, CPHEALY@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Sometimes a GPIO is needed to turn on/off the display. Add support for this usecase by introducing the optional 'enable-gpios' property. Tested on a imx53qsb board. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c index 76160e5d43bd..c250ca36a5b3 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -48,6 +49,7 @@ struct seiko_panel { const struct seiko_panel_desc *desc; struct regulator *dvdd; struct regulator *avdd; + struct gpio_desc *enable_gpio; }; static inline struct seiko_panel *to_seiko_panel(struct drm_panel *panel) @@ -139,6 +141,8 @@ static int seiko_panel_unprepare(struct drm_panel *panel) if (!p->prepared) return 0; + gpiod_set_value_cansleep(p->enable_gpio, 0); + regulator_disable(p->avdd); /* Add a 100ms delay as per the panel datasheet */ @@ -174,6 +178,8 @@ static int seiko_panel_prepare(struct drm_panel *panel) goto disable_dvdd; } + gpiod_set_value_cansleep(p->enable_gpio, 1); + p->prepared = true; return 0; @@ -252,6 +258,12 @@ static int seiko_panel_probe(struct device *dev, if (IS_ERR(panel->avdd)) return PTR_ERR(panel->avdd); + panel->enable_gpio = devm_gpiod_get_optional(dev, "enable", + GPIOD_OUT_LOW); + if (IS_ERR(panel->enable_gpio)) + return dev_err_probe(dev, PTR_ERR(panel->enable_gpio), + "failed to request GPIO\n"); + drm_panel_init(&panel->base, dev, &seiko_panel_funcs, DRM_MODE_CONNECTOR_DPI);