Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1696845ybm; Thu, 23 May 2019 05:29:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGZzyDf9el+0gI5Qi0SuB/JB2gqlXhv5fCcHmr6bxzzuogUokMaSwtDlAIxaVR5X57913W X-Received: by 2002:a65:528b:: with SMTP id y11mr96694877pgp.341.1558614575261; Thu, 23 May 2019 05:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558614575; cv=none; d=google.com; s=arc-20160816; b=O5TZOLUefsL+iMSCCJw6fs9axLZyr+hAA5HJKsjdc09dZObQ4plM+BmluQXqF/Dr7D fNc3qUkxqnH6TjLxkp/uIe39lZL8kVYTroyFZ+knBMZGGsliYoRBfUWD76UAHSGySh7G 3sjfY/vrW7qcUB/FoxyIHF4a9yGlgZPQ0uIhdAupHb9v2wyOVEqD2nOSrNvt8GD9rk1f ibU89rCT/b6iAZm4EDgPkpbXzMcf/YuHn3p8TyhcLBhGN0+uEjjs6lo0CjKMffunrWQ9 qUghhnKtTKgiP/P7YQW0I65NA3dgoFGSFpD34OCt5pauUyML+vMN2cua4+d2oslf+/7E Elaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date; bh=2WoPsYjFJhNQoyWLLEwjicIMAKKZ7IT91qb9KhAq5ww=; b=HtQCFapngLWjczkV0GggaQhWVNH75u2i2tMOP7m06RTI2c0dqMW1ccpKdUlCun546L 0LOh73F6KjcVdJvPkz9FIfB9uJDHue+RUfWB0RCul17cEpu2wqlNnoDnDZ9IDIG5dn0V BIgo8W+ZwZoUBtwTHYm0nRSeP2Ased4l4kw+K0lP+VKEHOecRuwmuwTzDJ6u7Sj/UUej 396gpLh07p3+mGq8YedeGFudqMF71KvPA8Dums+gAvjM41JIz1Z7vaIHUxdhU528Ukoi kbwH047BwIIbBFB55lEMO5fErTgWHZk2HBDV0KD39KskBuZFnJvILXgddQbtTPbm2PAY exLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p188si31807751pfp.112.2019.05.23.05.29.19; Thu, 23 May 2019 05:29:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730655AbfEWM1P (ORCPT + 99 others); Thu, 23 May 2019 08:27:15 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36787 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728309AbfEWM1O (ORCPT ); Thu, 23 May 2019 08:27:14 -0400 X-Originating-IP: 90.88.22.185 Received: from localhost (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: maxime.ripard@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 8D5E060005; Thu, 23 May 2019 12:27:01 +0000 (UTC) Date: Thu, 23 May 2019 14:27:01 +0200 From: Maxime Ripard To: linux-sunxi@googlegroups.com, Chen-Yu Tsai , Rob Herring , David Airlie , Daniel Vetter , Mark Rutland , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH v5 5/6] drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue Message-ID: <20190523122701.qeuthkrczdzngzod@flea> References: <20190520235009.16734-1-megous@megous.com> <20190520235009.16734-6-megous@megous.com> <20190521114611.ylmbo2oqeanveil4@flea> <20190521121519.k343dgv3cgpewjl2@core.my.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xaediv5ol6nrlghm" Content-Disposition: inline In-Reply-To: <20190521121519.k343dgv3cgpewjl2@core.my.home> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --xaediv5ol6nrlghm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2019 at 02:15:19PM +0200, Ond=C5=99ej Jirman wrote: > Hi Maxime, > > On Tue, May 21, 2019 at 01:46:11PM +0200, Maxime Ripard wrote: > > Hi, > > > > On Tue, May 21, 2019 at 01:50:08AM +0200, megous@megous.com wrote: > > > From: Ondrej Jirman > > > > > > Orange Pi 3 board requires enabling a voltage shifting circuit via GP= IO > > > for the DDC bus to be usable. > > > > > > Add support for hdmi-connector node's optional ddc-en-gpios property = to > > > support this use case. > > > > > > Signed-off-by: Ondrej Jirman > > > --- > > > drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 55 +++++++++++++++++++++++++= -- > > > drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 3 ++ > > > 2 files changed, 55 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/= sun4i/sun8i_dw_hdmi.c > > > index 39d8509d96a0..59b81ba02d96 100644 > > > --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c > > > +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c > > > @@ -98,6 +98,30 @@ static u32 sun8i_dw_hdmi_find_possible_crtcs(struc= t drm_device *drm, > > > return crtcs; > > > } > > > > > > +static int sun8i_dw_hdmi_find_connector_pdev(struct device *dev, > > > + struct platform_device **pdev_out) > > > +{ > > > + struct platform_device *pdev; > > > + struct device_node *remote; > > > + > > > + remote =3D of_graph_get_remote_node(dev->of_node, 1, -1); > > > + if (!remote) > > > + return -ENODEV; > > > + > > > + if (!of_device_is_compatible(remote, "hdmi-connector")) { > > > + of_node_put(remote); > > > + return -ENODEV; > > > + } > > > + > > > + pdev =3D of_find_device_by_node(remote); > > > + of_node_put(remote); > > > + if (!pdev) > > > + return -ENODEV; > > > + > > > + *pdev_out =3D pdev; > > > + return 0; > > > +} > > > + > > > static int sun8i_dw_hdmi_bind(struct device *dev, struct device *mas= ter, > > > void *data) > > > { > > > @@ -151,16 +175,29 @@ static int sun8i_dw_hdmi_bind(struct device *de= v, struct device *master, > > > return PTR_ERR(hdmi->regulator); > > > } > > > > > > + ret =3D sun8i_dw_hdmi_find_connector_pdev(dev, &hdmi->connector_pde= v); > > > + if (!ret) { > > > + hdmi->ddc_en =3D gpiod_get_optional(&hdmi->connector_pdev->dev, > > > + "ddc-en", GPIOD_OUT_HIGH); > > > + if (IS_ERR(hdmi->ddc_en)) { > > > + platform_device_put(hdmi->connector_pdev); > > > + dev_err(dev, "Couldn't get ddc-en gpio\n"); > > > + return PTR_ERR(hdmi->ddc_en); > > > + } > > > + } > > > + > > > ret =3D regulator_enable(hdmi->regulator); > > > if (ret) { > > > dev_err(dev, "Failed to enable regulator\n"); > > > - return ret; > > > + goto err_unref_ddc_en; > > > } > > > > > > + gpiod_set_value(hdmi->ddc_en, 1); > > > + > > > > Do you really need this to be done all the time? I'm guessing you > > would only need this when running .get_modes, right? > > I don't think it hurts anything. Enabled voltage shifting circuit doesn't > draw any current, unless DDC is actually transmitting data. On most boards > I'd imagine this circuit is always on anyway (Orange Pi 3 schematic even = has > an option to tie this signal to VCC-IO instead of GPIO). Ok, it works for me then Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --xaediv5ol6nrlghm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXOaRjgAKCRDj7w1vZxhR xXP8AQDJFrAb2tEeZAxbO0lR5xA3HSBZ1CG8XwnZfh/DVcz7IgD/d1nl6k3ae3tz jt35NpcG3EPiCyUUHN1/ZuAY6YBkHQc= =qe05 -----END PGP SIGNATURE----- --xaediv5ol6nrlghm--