From nobody Tue Dec 30 13:07:20 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED38FC47072 for ; Wed, 15 Nov 2023 12:14:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343738AbjKOMOE (ORCPT ); Wed, 15 Nov 2023 07:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234924AbjKOMNz (ORCPT ); Wed, 15 Nov 2023 07:13:55 -0500 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21D7C121 for ; Wed, 15 Nov 2023 04:13:46 -0800 (PST) Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id F22302070A; Wed, 15 Nov 2023 13:13:42 +0100 (CET) From: Francesco Dolcini To: Adrien Grassein , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Stefan Eichenberger , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: [PATCH v1 1/3] drm/bridge: lt8912b: Add suspend/resume support Date: Wed, 15 Nov 2023 13:13:36 +0100 Message-Id: <20231115121338.22959-2-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115121338.22959-1-francesco@dolcini.it> References: <20231115121338.22959-1-francesco@dolcini.it> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stefan Eichenberger Add support for suspend and resume. The lt8912b will power off when going into suspend and power on when resuming. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss --- drivers/gpu/drm/bridge/lontium-lt8912b.c | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bri= dge/lontium-lt8912b.c index 03532efb893b..097ab04234b7 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -634,6 +634,33 @@ static const struct drm_bridge_funcs lt8912_bridge_fun= cs =3D { .get_edid =3D lt8912_bridge_get_edid, }; =20 +static int lt8912_bridge_resume(struct device *dev) +{ + struct lt8912 *lt =3D dev_get_drvdata(dev); + int ret; + + ret =3D lt8912_hard_power_on(lt); + if (ret) + return ret; + + ret =3D lt8912_soft_power_on(lt); + if (ret) + return ret; + + return lt8912_video_on(lt); +} + +static int lt8912_bridge_suspend(struct device *dev) +{ + struct lt8912 *lt =3D dev_get_drvdata(dev); + + lt8912_hard_power_off(lt); + + return 0; +} + +static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspen= d, lt8912_bridge_resume); + static int lt8912_parse_dt(struct lt8912 *lt) { struct gpio_desc *gp_reset; @@ -770,6 +797,7 @@ static struct i2c_driver lt8912_i2c_driver =3D { .driver =3D { .name =3D "lt8912", .of_match_table =3D lt8912_dt_match, + .pm =3D pm_sleep_ptr(<8912_bridge_pm_ops), }, .probe =3D lt8912_probe, .remove =3D lt8912_remove, --=20 2.25.1 From nobody Tue Dec 30 13:07:20 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32DBEC07548 for ; Wed, 15 Nov 2023 12:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343728AbjKOMOB (ORCPT ); Wed, 15 Nov 2023 07:14:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234922AbjKOMNz (ORCPT ); Wed, 15 Nov 2023 07:13:55 -0500 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 223B4123; Wed, 15 Nov 2023 04:13:46 -0800 (PST) Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id 8881020718; Wed, 15 Nov 2023 13:13:43 +0100 (CET) From: Francesco Dolcini To: Adrien Grassein , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Stefan Eichenberger , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: [PATCH v1 2/3] dt-bindings: display: bridge: lt8912b: Add power supplies Date: Wed, 15 Nov 2023 13:13:37 +0100 Message-Id: <20231115121338.22959-3-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115121338.22959-1-francesco@dolcini.it> References: <20231115121338.22959-1-francesco@dolcini.it> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stefan Eichenberger Add Lontium lt8912b power supplies. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Acked-by: Conor Dooley --- .../display/bridge/lontium,lt8912b.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/lontium,lt891= 2b.yaml b/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.= yaml index f201ae4af4fb..2cef25215798 100644 --- a/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml @@ -55,6 +55,27 @@ properties: - port@0 - port@1 =20 + vcchdmipll-supply: + description: A 1.8V supply that powers the HDMI PLL. + + vcchdmitx-supply: + description: A 1.8V supply that powers the HDMI TX part. + + vcclvdspll-supply: + description: A 1.8V supply that powers the LVDS PLL. + + vcclvdstx-supply: + description: A 1.8V supply that powers the LVDS TX part. + + vccmipirx-supply: + description: A 1.8V supply that powers the MIPI RX part. + + vccsysclk-supply: + description: A 1.8V supply that powers the SYSCLK. + + vdd-supply: + description: A 1.8V supply that powers the digital part. + required: - compatible - reg --=20 2.25.1 From nobody Tue Dec 30 13:07:20 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2022DC07548 for ; Wed, 15 Nov 2023 12:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343703AbjKOMN6 (ORCPT ); Wed, 15 Nov 2023 07:13:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234945AbjKOMNz (ORCPT ); Wed, 15 Nov 2023 07:13:55 -0500 Received: from mail11.truemail.it (mail11.truemail.it [IPv6:2001:4b7e:0:8::81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2216C122 for ; Wed, 15 Nov 2023 04:13:46 -0800 (PST) Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id 3F5762072F; Wed, 15 Nov 2023 13:13:44 +0100 (CET) From: Francesco Dolcini To: Adrien Grassein , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Stefan Eichenberger , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: [PATCH v1 3/3] drm/bridge: lt8912b: Add power supplies Date: Wed, 15 Nov 2023 13:13:38 +0100 Message-Id: <20231115121338.22959-4-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115121338.22959-1-francesco@dolcini.it> References: <20231115121338.22959-1-francesco@dolcini.it> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stefan Eichenberger Add supplies to the driver that can be used to turn the Lontium lt8912b on and off. It can have up to 7 independent supplies, we add them all and enable/disable them with bulk_enable/disable. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss --- drivers/gpu/drm/bridge/lontium-lt8912b.c | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bri= dge/lontium-lt8912b.c index 097ab04234b7..273157428c82 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -43,6 +43,8 @@ struct lt8912 { =20 struct videomode mode; =20 + struct regulator_bulk_data supplies[7]; + u8 data_lanes; bool is_power_on; }; @@ -257,6 +259,12 @@ static int lt8912_free_i2c(struct lt8912 *lt) =20 static int lt8912_hard_power_on(struct lt8912 *lt) { + int ret; + + ret =3D regulator_bulk_enable(ARRAY_SIZE(lt->supplies), lt->supplies); + if (ret) + return ret; + gpiod_set_value_cansleep(lt->gp_reset, 0); msleep(20); =20 @@ -267,6 +275,9 @@ static void lt8912_hard_power_off(struct lt8912 *lt) { gpiod_set_value_cansleep(lt->gp_reset, 1); msleep(20); + + regulator_bulk_disable(ARRAY_SIZE(lt->supplies), lt->supplies); + lt->is_power_on =3D false; } =20 @@ -661,6 +672,21 @@ static int lt8912_bridge_suspend(struct device *dev) =20 static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspen= d, lt8912_bridge_resume); =20 +static int lt8912_get_regulators(struct lt8912 *lt) +{ + unsigned int i; + const char * const supply_names[] =3D { + "vdd", "vccmipirx", "vccsysclk", "vcclvdstx", + "vcchdmitx", "vcclvdspll", "vcchdmipll" + }; + + for (i =3D 0; i < ARRAY_SIZE(lt->supplies); i++) + lt->supplies[i].supply =3D supply_names[i]; + + return devm_regulator_bulk_get(lt->dev, ARRAY_SIZE(lt->supplies), + lt->supplies); +} + static int lt8912_parse_dt(struct lt8912 *lt) { struct gpio_desc *gp_reset; @@ -712,6 +738,10 @@ static int lt8912_parse_dt(struct lt8912 *lt) goto err_free_host_node; } =20 + ret =3D lt8912_get_regulators(lt); + if (ret) + goto err_free_host_node; + of_node_put(port_node); return 0; =20 --=20 2.25.1