Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4369410ybe; Mon, 9 Sep 2019 08:19:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpsciDevuFAN7GQ9j4yKcFGNYVIRHOdC88hEFYliXqr5d3hJjd9Vw7B8RI4Y7gi78YLSRp X-Received: by 2002:aa7:df1a:: with SMTP id c26mr24637099edy.106.1568042396824; Mon, 09 Sep 2019 08:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568042396; cv=none; d=google.com; s=arc-20160816; b=rcbwb3n7NxQtOJ1mG97XuueYGu+lEsktVpnpUm5X0s5IYS8c2rZjHjR2HlnbzJmN9s OLiRV9aZB6WF2mi7FmSW41UvmWK9NF7c9rfVi7+jizo5GMCoq8ADTUa3IjNKkUGecBQp MufygNA5WaalyRxj/Fe11IYPzfREiaO5B1DE6mk7ZKhx6+M7sg3eQy8lrI2laUn5A1w1 dchdUF2Lqu/Wu7aU2iqwEth8qjIq32ME5HQt8hlQbo2sdaB1nxWNBDzSEjwxN8+ooCiJ RG7SC/f20PXq9azwGIj1Kx7bu4oi25SHdB2hApGZHogPPJOv25UmcfHy/oTTL45ys8/T HDSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2tHmH1stIAhWci8qIBPtmNf+VD11DJ+UCL9f9Y17abo=; b=OMbo8Nc7jQMiFdyY+gPLuIfn1taivPmwJ9BmmsFxIRoBl2afAk+wrOK6XCH89iwwDa xN+88h0FfTAIpttUVmkoH/PH9yuAnEzQc/Gl10B0++fzDwNFTVWYnGGPxDFg/vKPFKJa SeRp9pji+H9lcWkVz6B/XoR7DitXfvNQ3cayc2so4Z/O+r3oOvzd9IGO5ZeoArfWUnEU gZJKhKl31asWq5hJTqQYafI/L2qXRp+iLe/ojF3UyfYmRnftrHmeeQZjwDY5lnILrUci 4B3nLHrAdvFFz/MNGMAg+MOrD00dNRujXDZ/A1NO0iALLlQN3APVC3rU10Mo6jA3lgwl hQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vrZnv+PS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j46si8926860eda.9.2019.09.09.08.19.31; Mon, 09 Sep 2019 08:19:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b=vrZnv+PS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbfIIJdK (ORCPT + 99 others); Mon, 9 Sep 2019 05:33:10 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:38027 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728390AbfIIJdK (ORCPT ); Mon, 9 Sep 2019 05:33:10 -0400 Received: by mail-qk1-f196.google.com with SMTP id x5so12372570qkh.5 for ; Mon, 09 Sep 2019 02:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=2tHmH1stIAhWci8qIBPtmNf+VD11DJ+UCL9f9Y17abo=; b=vrZnv+PStMf+ECSwAA9EBVmkJ1p3GaWvYFKNeMG3Owov4IHFuOEVR00hBZEXUYgKSh OieKMKPXAWSyeWC/HP+/8QjHPAQdr34fWMdBDb4EyrTrZzcaWm+bFSXF8/i1Qu+HEiyz CKq1XWiDER91AclIs00Rtj003JXkH1Eu9Ku5Gq5DOUvFkeqvW6kHPWF61Px47znWI9K1 S/swfW3z34aw9icDEOL4KLxAVFXkRZCd61hfEJTlf//onBcY4c/nTKxMTOkbTn4T4qAu gUry9EPHH1pj8bML9BWQUN4v2UvpiQKwO3J3lFPxgg0Hq0i2zXZ1H1fYb9CNTHuZvNPo y/0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2tHmH1stIAhWci8qIBPtmNf+VD11DJ+UCL9f9Y17abo=; b=COWxtEvjA0YPKz+70GirymX69Q65pd9NT1Y45CeDZubEP4AMzI4ZqQhMEkogUnJSMi T9mNHp/OzeNoGohaKc6AODmupeNK5admjkFakdXLXZA/SwfjAdUap1ej8AGwsuL6z5gK q9o29H719w4/n2iVZljz1Oc01yP6m7u9Iz8H5zA49YZCgJWO2NLZ8SOJs+jBFE2cYEJg 4LK1yoMsA8p6h5jsMqAz0pK6OxYYmSs9kGIynsG5MLuuBC0zDNFTKcQalIfy9TdbV4bI dGGsBY/QTBofSgPJxdjCPZQAz12/oil35PPHoWL6Sl+75a60xR6WRRIyGLI/bnRFIcxy gfrw== X-Gm-Message-State: APjAAAUH3kqU7nRnvsuDxL6afyntt5Ij11V4KXMkfl4BXEWGZ0EcJjoE hNJXWZUoMkZc5fM7CICF5C530rWXDrNVPb/C3AOycg== X-Received: by 2002:ae9:dd81:: with SMTP id r123mr6813864qkf.103.1568021588009; Mon, 09 Sep 2019 02:33:08 -0700 (PDT) MIME-Version: 1.0 References: <1567761708-31777-1-git-send-email-yannick.fertre@st.com> In-Reply-To: <1567761708-31777-1-git-send-email-yannick.fertre@st.com> From: Benjamin Gaignard Date: Mon, 9 Sep 2019 11:32:57 +0200 Message-ID: Subject: Re: [PATCH] drm/stm: ltdc: add pinctrl for DPI encoder mode To: =?UTF-8?Q?Yannick_Fertr=C3=A9?= Cc: Philippe Cornu , Benjamin Gaignard , Vincent Abriou , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , ML dri-devel , linux-stm32@st-md-mailman.stormreply.com, Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le ven. 6 sept. 2019 =C3=A0 11:22, Yannick Fertr=C3=A9 a =C3=A9crit : > > The implementation of functions encoder_enable and encoder_disable > make possible to control the pinctrl according to the encoder type. > The pinctrl must be activated only if the encoder type is DPI. > This helps to move the DPI-related pinctrl configuration from > all the panel or bridge to the LTDC dt node. > > Reviewed-by: Philippe Cornu > > Signed-off-by: Yannick Fertr=C3=A9 Applied on drm-misc-next, Thanks, Benjamin > --- > drivers/gpu/drm/stm/ltdc.c | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c > index 3ab4fbf..1c4fde0 100644 > --- a/drivers/gpu/drm/stm/ltdc.c > +++ b/drivers/gpu/drm/stm/ltdc.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1040,6 +1041,36 @@ static const struct drm_encoder_funcs ltdc_encoder= _funcs =3D { > .destroy =3D drm_encoder_cleanup, > }; > > +static void ltdc_encoder_disable(struct drm_encoder *encoder) > +{ > + struct drm_device *ddev =3D encoder->dev; > + > + DRM_DEBUG_DRIVER("\n"); > + > + /* Set to sleep state the pinctrl whatever type of encoder */ > + pinctrl_pm_select_sleep_state(ddev->dev); > +} > + > +static void ltdc_encoder_enable(struct drm_encoder *encoder) > +{ > + struct drm_device *ddev =3D encoder->dev; > + > + DRM_DEBUG_DRIVER("\n"); > + > + /* > + * Set to default state the pinctrl only with DPI type. > + * Others types like DSI, don't need pinctrl due to > + * internal bridge (the signals do not come out of the chipset). > + */ > + if (encoder->encoder_type =3D=3D DRM_MODE_ENCODER_DPI) > + pinctrl_pm_select_default_state(ddev->dev); > +} > + > +static const struct drm_encoder_helper_funcs ltdc_encoder_helper_funcs = =3D { > + .disable =3D ltdc_encoder_disable, > + .enable =3D ltdc_encoder_enable, > +}; > + > static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge = *bridge) > { > struct drm_encoder *encoder; > @@ -1055,6 +1086,8 @@ static int ltdc_encoder_init(struct drm_device *dde= v, struct drm_bridge *bridge) > drm_encoder_init(ddev, encoder, <dc_encoder_funcs, > DRM_MODE_ENCODER_DPI, NULL); > > + drm_encoder_helper_add(encoder, <dc_encoder_helper_funcs); > + > ret =3D drm_bridge_attach(encoder, bridge, NULL); > if (ret) { > drm_encoder_cleanup(encoder); > @@ -1280,6 +1313,8 @@ int ltdc_load(struct drm_device *ddev) > > clk_disable_unprepare(ldev->pixel_clk); > > + pinctrl_pm_select_sleep_state(ddev->dev); > + > pm_runtime_enable(ddev->dev); > > return 0; > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel