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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAN6tsi7MNdG1Z3RW17gbOvUYbwc3=YrG4NnrW=XLF+GyvHk3MQ@mail.gmail.com>
Date:   Mon, 4 Dec 2023 13:59:16 +0100
From:   Robert Foss <rfoss@...nel.org>
To:     Francesco Dolcini <francesco@...cini.it>
Cc:     Adrien Grassein <adrien.grassein@...il.com>,
        Andrzej Hajda <andrzej.hajda@...el.com>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Jonas Karlman <jonas@...boo.se>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Stefan Eichenberger <stefan.eichenberger@...adex.com>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        Francesco Dolcini <francesco.dolcini@...adex.com>
Subject: Re: [PATCH v1 1/3] drm/bridge: lt8912b: Add suspend/resume support

On Wed, Nov 15, 2023 at 1:14 PM Francesco Dolcini <francesco@...cini.it> wrote:
>
> From: Stefan Eichenberger <stefan.eichenberger@...adex.com>
>
> Add support for suspend and resume. The lt8912b will power off when
> going into suspend and power on when resuming.
>
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@...adex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@...adex.com>
> ---
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 28 ++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 03532efb893b..097ab04234b7 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -634,6 +634,33 @@ static const struct drm_bridge_funcs lt8912_bridge_funcs = {
>         .get_edid = lt8912_bridge_get_edid,
>  };
>
> +static int lt8912_bridge_resume(struct device *dev)
> +{
> +       struct lt8912 *lt = dev_get_drvdata(dev);
> +       int ret;
> +
> +       ret = lt8912_hard_power_on(lt);
> +       if (ret)
> +               return ret;
> +
> +       ret = lt8912_soft_power_on(lt);
> +       if (ret)
> +               return ret;
> +
> +       return lt8912_video_on(lt);
> +}
> +
> +static int lt8912_bridge_suspend(struct device *dev)
> +{
> +       struct lt8912 *lt = dev_get_drvdata(dev);
> +
> +       lt8912_hard_power_off(lt);
> +
> +       return 0;
> +}
> +
> +static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspend, lt8912_bridge_resume);
> +
>  static int lt8912_parse_dt(struct lt8912 *lt)
>  {
>         struct gpio_desc *gp_reset;
> @@ -770,6 +797,7 @@ static struct i2c_driver lt8912_i2c_driver = {
>         .driver = {
>                 .name = "lt8912",
>                 .of_match_table = lt8912_dt_match,
> +               .pm = pm_sleep_ptr(&lt8912_bridge_pm_ops),
>         },
>         .probe = lt8912_probe,
>         .remove = lt8912_remove,
> --
> 2.25.1
>

Reviewed-by: Robert Foss <rfoss@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ