Re: [PATCH v2 1/2] drivers: gpu: drm: add driver for samsung s6e3fc2x01 cmd mode panel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nia,

On Fri, Oct 7, 2022 at 8:16 AM Nia Espera <a5b6@xxxxxxxxxx> wrote:

> +static int samsung_s6e3fc2x01_prepare(struct drm_panel *panel)
> +{
> +       struct samsung_s6e3fc2x01 *ctx = to_samsung_s6e3fc2x01(panel);
> +       struct device *dev = &ctx->dsi->dev;
> +       int ret;
> +
> +       if (ctx->prepared)
> +               return 0;
> +
> +       ret = regulator_enable(ctx->supply);
> +       if (ret < 0) {
> +               dev_err(dev, "Failed to enable regulator: %d\n", ret);
> +               return ret;
> +       }
> +
> +       samsung_s6e3fc2x01_reset(ctx);
> +
> +       ret = samsung_s6e3fc2x01_on(ctx);
> +       if (ret < 0) {
> +               dev_err(dev, "Failed to initialize panel: %d\n", ret);
> +               gpiod_set_value_cansleep(ctx->reset_gpio, 1);

You should also call regulator_disable() here in the case of failure.

> +static int samsung_s6e3fc2x01_unprepare(struct drm_panel *panel)
> +{
> +       struct samsung_s6e3fc2x01 *ctx = to_samsung_s6e3fc2x01(panel);
> +       struct device *dev = &ctx->dsi->dev;
> +       int ret;
> +
> +       if (!ctx->prepared)
> +               return 0;
> +
> +       ret = samsung_s6e3fc2x01_off(ctx);
> +       if (ret < 0)
> +               dev_err(dev, "Failed to un-initialize panel: %d\n", ret);
> +
> +       gpiod_set_value_cansleep(ctx->reset_gpio, 1);

regulator_disable() should be called here as well.



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux