From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9707BC433F5 for ; Mon, 11 Oct 2021 20:18:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5CA8A60720 for ; Mon, 11 Oct 2021 20:18:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5CA8A60720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91F808957B; Mon, 11 Oct 2021 20:18:21 +0000 (UTC) Received: from mx2.smtp.larsendata.com (mx2.smtp.larsendata.com [91.221.196.228]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3262E8957B for ; Mon, 11 Oct 2021 20:18:20 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id 57607a65-2ad0-11ec-ac3c-0050568cd888; Mon, 11 Oct 2021 20:18:04 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id F3290194B69; Mon, 11 Oct 2021 22:18:04 +0200 (CEST) Date: Mon, 11 Oct 2021 22:18:15 +0200 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Alexander Stein Cc: David Airlie , Daniel Vetter , Rob Herring , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: Re: [PATCH 1/3] drm/bridge: ti-sn65dsi83: Add vcc supply regulator support Message-ID: References: <20211006074713.1094396-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211006074713.1094396-1-alexander.stein@ew.tq-group.com> 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Alexander, On Wed, Oct 06, 2021 at 09:47:11AM +0200, Alexander Stein wrote: > VCC needs to be enabled before releasing the enable GPIO. > > Signed-off-by: Alexander Stein > --- > drivers/gpu/drm/bridge/ti-sn65dsi83.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c > index a32f70bc68ea..5fab0fabcd15 100644 > --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c > @@ -33,6 +33,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -143,6 +144,7 @@ struct sn65dsi83 { > struct mipi_dsi_device *dsi; > struct drm_bridge *panel_bridge; > struct gpio_desc *enable_gpio; > + struct regulator *vcc; > int dsi_lanes; > bool lvds_dual_link; > bool lvds_dual_link_even_odd_swap; > @@ -647,6 +649,12 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model) > > ctx->panel_bridge = panel_bridge; > > + ctx->vcc = devm_regulator_get(dev, "vcc"); > + if (IS_ERR(ctx->vcc)) > + return dev_err_probe(dev, PTR_ERR(ctx->vcc), > + "Failed to get supply 'vcc': %pe\n", > + ERR_PTR(ret)); The use of ERR_PTR(ret) is wrong here as ret do not include the return result. Just use ctx->vcc instead as this is what %pe expects. > + > return 0; > } > > @@ -690,7 +698,11 @@ static int sn65dsi83_probe(struct i2c_client *client, > ctx->bridge.of_node = dev->of_node; > drm_bridge_add(&ctx->bridge); > > - return 0; > + ret = regulator_enable(ctx->vcc); > + if (ret) > + dev_err(dev, "Failed to enable vcc\n"); Print the return code too? With the two things fixed you can add my: Reviewed-by: Sam Ravnborg > + > + return ret; > } > > static int sn65dsi83_remove(struct i2c_client *client) > @@ -701,6 +713,7 @@ static int sn65dsi83_remove(struct i2c_client *client) > mipi_dsi_device_unregister(ctx->dsi); > drm_bridge_remove(&ctx->bridge); > of_node_put(ctx->host_node); > + regulator_disable(ctx->vcc); > > return 0; > } > -- > 2.25.1