lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+M3ks6MurXFitY24Cm9jCVx8h+VxTDFARxKuqg7MmhUk58X7w@mail.gmail.com>
Date:   Mon, 2 Sep 2019 11:35:07 +0200
From:   Benjamin Gaignard <benjamin.gaignard@...aro.org>
To:     Philippe CORNU <philippe.cornu@...com>
Cc:     Yannick FERTRE <yannick.fertre@...com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre TORGUE <alexandre.torgue@...com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        "linux-stm32@...md-mailman.stormreply.com" 
        <linux-stm32@...md-mailman.stormreply.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Benjamin GAIGNARD <benjamin.gaignard@...com>,
        Fabrice GASNIER <fabrice.gasnier@...com>,
        ML dri-devel <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH] drm/stm: ltdc: add pinctrl for DPI encoder mode

+dri-devel mailing list

Le lun. 2 sept. 2019 à 10:47, Philippe CORNU <philippe.cornu@...com> a écrit :
>
> Hi Yannick,
>
> On 8/2/19 4:47 PM, Yannick Fertré 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é <yannick.fertre@...com>
> > ---
> >   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 <linux/module.h>
> >   #include <linux/of_address.h>
> >   #include <linux/of_graph.h>
> > +#include <linux/pinctrl/consumer.h>
> >   #include <linux/platform_device.h>
> >   #include <linux/pm_runtime.h>
> >   #include <linux/reset.h>
> > @@ -1040,6 +1041,36 @@ static const struct drm_encoder_funcs ltdc_encoder_funcs = {
> >       .destroy = drm_encoder_cleanup,
> >   };
> >
> > +static void ltdc_encoder_disable(struct drm_encoder *encoder)
> > +{
> > +     struct drm_device *ddev = 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 = 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 == DRM_MODE_ENCODER_DPI)
> > +             pinctrl_pm_select_default_state(ddev->dev);
> > +}
> > +
> > +static const struct drm_encoder_helper_funcs ltdc_encoder_helper_funcs = {
> > +     .disable = ltdc_encoder_disable,
> > +     .enable = 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 *ddev, struct drm_bridge *bridge)
> >       drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs,
> >                        DRM_MODE_ENCODER_DPI, NULL);
> >
> > +     drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);
> > +
> >       ret = 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 <philippe.cornu@...com>
>
> Thanks
> Philippe :)
>
> >       pm_runtime_enable(ddev->dev);
> >
> >       return 0;
> >
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ