Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp386534ybe; Mon, 2 Sep 2019 03:16:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5iaGZAAgyKqtvG61rkG6F+kfkahNAd6+KWGZUlhiO0Y7dsxzUVWwPHCXvNqG0uZ5bG2Xg X-Received: by 2002:a62:7684:: with SMTP id r126mr2096671pfc.26.1567419415473; Mon, 02 Sep 2019 03:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567419415; cv=none; d=google.com; s=arc-20160816; b=lu6TBb0huoG5fliDJ0Rd0CUwsklXLavrNjee9YxQFs/sRJcWvCbIgRAiREo2UFRLeW NaJ5FFBpoIhbm82livT18MJk7Ru+h7DLXxXrhQ2sCdpDr4tlY6tkz1RBWeph74VxXNqx dOWKVfCEMeGv0BgcdtZbYJc+BUtpTQWq6LtVMuI266rd/6NjB+TMOTuzPPYr1OJ1ENVT BA5usW9iO+Jw6REDYAyakZYvtZ3DIdeaXKd+9zShjhAFEkSl3fcCxUMh+X9jE264SRW+ CRmnPPPzyOZGb4GYeV3Q7TqJwLodQ2Dvbp9E/TWDxIFyeAnVjNY5Hu1Ps6JAUr7054So u3GA== 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=38YIQw9rYXVcXSnz01ylMn1XuQgT2tKgepHXTvRAlmI=; b=fIP7WtBCHTdwDMkqMf+MqiP6RaoztZen1+zch9z+H6Sz40ul3xR67wdsrdMChvNHVO fFo8OptMEFNinC5oIKS24cEQzSUb+Q2vZ2HGfI/Pdtb3S0nR2cY9PdXiVLpZeisTXd+V 32Ut+yKKRowHG2ZKPWcaFOOSw5sRd0OGnZxehW25tNJ+KdXdDw9JCcGSfFzYYmH7+XtR 7zEgQIALgc6UFGSuVTMN0kTdZmgInS+ZUtV0T19iLUGTYWLNpZ4z0nSlX9iRLISDbJ61 98n15riVw+aZkX0bduESgza4dln0MaEi6GLhS9AAMtmi0oa+vb89E0hUQiaCSYe3v3Jr p5ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MrtEnvsP; 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 t132si6944222pgc.288.2019.09.02.03.16.39; Mon, 02 Sep 2019 03:16:55 -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=MrtEnvsP; 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 S1731145AbfIBJfU (ORCPT + 99 others); Mon, 2 Sep 2019 05:35:20 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40377 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729882AbfIBJfT (ORCPT ); Mon, 2 Sep 2019 05:35:19 -0400 Received: by mail-qk1-f196.google.com with SMTP id f10so11974816qkg.7 for ; Mon, 02 Sep 2019 02:35:19 -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=38YIQw9rYXVcXSnz01ylMn1XuQgT2tKgepHXTvRAlmI=; b=MrtEnvsPeKbpdEE6n4t+yRTgqlactOV8g1SI+5jk0ZIyXDWGDbTrfXIz12VxRvYixu SI8Ls/by2Tn0tT31+NYhrzpSyE5Qa9YGGnyhVIPRyvIcUhdZeF3bi3rdJehdc0tDmz98 CTP/uleQTCSkAmNWdqVCC0BkzhNBysidHkm9VFiK2EhUzjY3+sHD3BjBFcGIETlSLr27 i6Qiijo8rqb36DwmQYlzWbmf2lxeJ2FOYX04K4zDuxcziu8LoskVWRvp4bG8nMy1wfVs bPt6NY0feBStC430sECK7fDZ4b8hOSs4S7Lbxq8HXiYsTdy5BQedyRMgkTk2AqWIjazR 8/Vw== 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=38YIQw9rYXVcXSnz01ylMn1XuQgT2tKgepHXTvRAlmI=; b=DW7ALPRlNYHdqZihmUsWZwrhOEdLnoWxVpHQpre0FpVWAtXaxVPIoUEdaGMXKARW6v S0Y5yEn6d4xKVovIjQ4u8Mre6Un6IlXW/SClcqmfpOF1BtWfmJBnuiGUtdZHKGBP8119 U44L9ruFH1F7K8tU+fFFzprgVb6mB5iW+9ROVhNiRjXZdAyN1BpaZaIQbdtfcxODFCl2 5ZIMhcni2eGjzSHiAoQjK28OqpchSY2d867T41Zt8VHoODMCivHolp5PelKuP6DpoGO3 mLUdH+QWJj9PWqUN0VdVSKeEODGtm1ck0TwKpvTrV5CbOcuXuPBOaymT/X/BWf7/IOmb 9DsQ== X-Gm-Message-State: APjAAAWQoQmM7Oe/zMkY8SqDsR8X4asH21EUct265eFE1MWffOukrCKr MGX8IbAD0oYX0Sey6Nh/B+V3e1CwVrb1pM6Muk85Ydk4 X-Received: by 2002:a37:8547:: with SMTP id h68mr6152302qkd.219.1567416918785; Mon, 02 Sep 2019 02:35:18 -0700 (PDT) MIME-Version: 1.0 References: <1564757262-6166-1-git-send-email-yannick.fertre@st.com> In-Reply-To: From: Benjamin Gaignard Date: Mon, 2 Sep 2019 11:35:07 +0200 Message-ID: Subject: Re: [PATCH] drm/stm: ltdc: add pinctrl for DPI encoder mode To: Philippe CORNU Cc: Yannick FERTRE , Maxime Coquelin , Alexandre TORGUE , Rob Herring , Mark Rutland , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Benjamin GAIGNARD , Fabrice GASNIER , ML dri-devel 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 +dri-devel mailing list Le lun. 2 sept. 2019 =C3=A0 10:47, Philippe CORNU a= =C3=A9crit : > > Hi Yannick, > > On 8/2/19 4:47 PM, Yannick Fertr=C3=A9 wrote: > > 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. > > > > Signed-off-by: Yannick Fertr=C3=A9 > > --- > > 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_encod= er_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_brid= ge *bridge) > > { > > struct drm_encoder *encoder; > > @@ -1055,6 +1086,8 @@ static int ltdc_encoder_init(struct drm_device *d= dev, 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); > > + > > Reviewed-by: Philippe Cornu > > Thanks > Philippe :) > > > pm_runtime_enable(ddev->dev); > > > > return 0; > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel