Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2684525rdb; Mon, 4 Dec 2023 04:59:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHK1kfZqRxkn80WaoPcRH9VREsVk0+ypMPSLOsmixOVMqX0iabtApbQ0qhrogVRH1DlYjuG X-Received: by 2002:a05:6358:5e03:b0:16e:3874:c1e2 with SMTP id q3-20020a0563585e0300b0016e3874c1e2mr1853746rwn.12.1701694752003; Mon, 04 Dec 2023 04:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701694751; cv=none; d=google.com; s=arc-20160816; b=XfA/mYJFb7XKbv0/pCYF0hdIgz+TQm/JKVhF482Vna7chC3rgb6gTpsTKBhI2LnxGV fvPXaZq5WxMQdbeQqfenCcOoKB0jY+HxSTDrd2kJdiGOvUqiYfBTt5brInItc6ZaKBKN IAIOWk89Bd4llMcaZ/TjkVKC6ukrSYuEjapO4ogqH9IkLhfmgWHnloL52YXifEs8bwVM 2eSNK2i7Y1rzdHL+Ur7ZyTSdItxplHzquD8Ei44bdLwz2yS08zs/OFhdvYBSu5J+oI8r QSF5kN323Fv1X4WxCeVRo7FJ8vgnHOnXF4oDc8j21vho5X7T+FVgP6cdffU5lzhabFgy MF9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4Zw5eqWVbr1JhMwgNd+YgrijQZ64eS7dc2MuqdHE9s4=; fh=sQOLoXPuMak8Efp3UMDD6v1UURou8FV+OMweYq8NBjA=; b=jkDp545px65p5bfU5ogp5sLfBqk5bQrJrxuBrlSHRniMB+X7AHksyoi2p/W+HNn0rn YXhIqRes26Rr+llYNMcfEDX4qW1Q7/jpcXV11y64mYkrgw2LQzRXv5HJcPFq+hFj9Z3b WjwtJrw/STRt/jImOvm7gAVAv8IbvUQnyKuyPRK/p7PrSkFCNuAOzF0bs9MhSawIyCdW Y71YArRmvBhirm2Zt9s+54rtl34Xkd3PqgDxee5x5OdpkJ+UdYu+7QvtavkR3lsmYMfq gB0H0337MJi0n3e4aOoSdloF/2yfJrXHpIF/Mv6xuVO5qhlg/Arw2wltXgNUD8/c4btb 8ZbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uRjmfRsC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 12-20020a63154c000000b005859c255ce9si7877794pgv.861.2023.12.04.04.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:59:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uRjmfRsC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 534908095834; Mon, 4 Dec 2023 04:59:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233500AbjLDM6z (ORCPT + 99 others); Mon, 4 Dec 2023 07:58:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233529AbjLDM6y (ORCPT ); Mon, 4 Dec 2023 07:58:54 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2796CD7 for ; Mon, 4 Dec 2023 04:59:00 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8394C433D9 for ; Mon, 4 Dec 2023 12:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701694739; bh=7dgUCGHzMoPBZl2tDe1rIHvMaAhMu3JQbSWiCGiui6E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uRjmfRsC3a+igtsBpD6wf5ipmviGpCi/X/y4EC8fnnn0KDS6QiRjhTVBv+heaOafa ytOJXaa0MD7qIclVnbi7svyejzbTUEB+lBpzKX/f2qgQlI1uz/ekb4od/loEVlngg+ +DOAjizYQPEkeUKenEv5olTi9RppfTS7ORPmUg2V8TKtCrau+bf5geO1DufNA0b5hv 63UUho/A80UG5ZLHm1D3h8gMSqA3MQlZNgdVepA7Wi3S7RSKmqVM8nuBqn4yuMWDGn /kAExOeNTqE0g9xrikgDRGh8GO86aAxhkXgqHYPVkN9tOyr48oAFl4zNyus3Rj+wK6 IX83cJGXu1Axw== Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-5b9a456798eso1173549a12.3 for ; Mon, 04 Dec 2023 04:58:59 -0800 (PST) X-Gm-Message-State: AOJu0YyQlmzIJQajzJYpXoBe9MgFXQr6QTvarweZR+uMwVjQVOs0SGGs /EAtInJKgB5VCfHcdsAc3LScrevSrAQWt6KxeacW5Q== X-Received: by 2002:a17:90b:4f44:b0:285:9ec0:892a with SMTP id pj4-20020a17090b4f4400b002859ec0892amr1119686pjb.33.1701694739111; Mon, 04 Dec 2023 04:58:59 -0800 (PST) MIME-Version: 1.0 References: <20231115121338.22959-1-francesco@dolcini.it> <20231115121338.22959-4-francesco@dolcini.it> In-Reply-To: <20231115121338.22959-4-francesco@dolcini.it> From: Robert Foss Date: Mon, 4 Dec 2023 13:58:46 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 3/3] drm/bridge: lt8912b: Add power supplies To: Francesco Dolcini Cc: Adrien Grassein , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Stefan Eichenberger , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Francesco Dolcini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 04:59:09 -0800 (PST) On Wed, Nov 15, 2023 at 1:14=E2=80=AFPM Francesco Dolcini wrote: > > 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 > --- > 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/b= ridge/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 { > > struct videomode mode; > > + 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) > > static int lt8912_hard_power_on(struct lt8912 *lt) > { > + int ret; > + > + ret =3D regulator_bulk_enable(ARRAY_SIZE(lt->supplies), lt->suppl= ies); > + if (ret) > + return ret; > + > gpiod_set_value_cansleep(lt->gp_reset, 0); > msleep(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; > } > > @@ -661,6 +672,21 @@ static int lt8912_bridge_suspend(struct device *dev) > > static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_susp= end, lt8912_bridge_resume); > > +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; > } > > + ret =3D lt8912_get_regulators(lt); > + if (ret) > + goto err_free_host_node; > + > of_node_put(port_node); > return 0; > > -- > 2.25.1 > Reviewed-by: Robert Foss