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: <CAN6tsi4HX1BtR9BG0H3N9c9j1q2iVAvHh4SM=ZLnog52ncqSqg@mail.gmail.com>
Date:   Mon, 4 Dec 2023 13:58:46 +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>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Francesco Dolcini <francesco.dolcini@...adex.com>
Subject: Re: [PATCH v1 3/3] drm/bridge: lt8912b: Add power supplies

On Wed, Nov 15, 2023 at 1:14 PM Francesco Dolcini <francesco@...cini.it> wrote:
>
> From: Stefan Eichenberger <stefan.eichenberger@...adex.com>
>
> Add supplies to the driver that can be used to turn the Lontium lt8912b
> on and off. It can have up to 7 independent supplies, we add them all
> and enable/disable them with bulk_enable/disable.
>
> 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 | 30 ++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 097ab04234b7..273157428c82 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -43,6 +43,8 @@ struct lt8912 {
>
>         struct videomode mode;
>
> +       struct regulator_bulk_data supplies[7];
> +
>         u8 data_lanes;
>         bool is_power_on;
>  };
> @@ -257,6 +259,12 @@ static int lt8912_free_i2c(struct lt8912 *lt)
>
>  static int lt8912_hard_power_on(struct lt8912 *lt)
>  {
> +       int ret;
> +
> +       ret = regulator_bulk_enable(ARRAY_SIZE(lt->supplies), lt->supplies);
> +       if (ret)
> +               return ret;
> +
>         gpiod_set_value_cansleep(lt->gp_reset, 0);
>         msleep(20);
>
> @@ -267,6 +275,9 @@ static void lt8912_hard_power_off(struct lt8912 *lt)
>  {
>         gpiod_set_value_cansleep(lt->gp_reset, 1);
>         msleep(20);
> +
> +       regulator_bulk_disable(ARRAY_SIZE(lt->supplies), lt->supplies);
> +
>         lt->is_power_on = false;
>  }
>
> @@ -661,6 +672,21 @@ static int lt8912_bridge_suspend(struct device *dev)
>
>  static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspend, lt8912_bridge_resume);
>
> +static int lt8912_get_regulators(struct lt8912 *lt)
> +{
> +       unsigned int i;
> +       const char * const supply_names[] = {
> +               "vdd", "vccmipirx", "vccsysclk", "vcclvdstx",
> +               "vcchdmitx", "vcclvdspll", "vcchdmipll"
> +       };
> +
> +       for (i = 0; i < ARRAY_SIZE(lt->supplies); i++)
> +               lt->supplies[i].supply = supply_names[i];
> +
> +       return devm_regulator_bulk_get(lt->dev, ARRAY_SIZE(lt->supplies),
> +                                      lt->supplies);
> +}
> +
>  static int lt8912_parse_dt(struct lt8912 *lt)
>  {
>         struct gpio_desc *gp_reset;
> @@ -712,6 +738,10 @@ static int lt8912_parse_dt(struct lt8912 *lt)
>                 goto err_free_host_node;
>         }
>
> +       ret = lt8912_get_regulators(lt);
> +       if (ret)
> +               goto err_free_host_node;
> +
>         of_node_put(port_node);
>         return 0;
>
> --
> 2.25.1
>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ