On 01/05/2018 10:55 AM, Noralf Trønnes wrote:
It's better to leave power handling and controller init to the
modesetting machinery using the simple pipe .enable and .disable
callbacks.

Signed-off-by: Noralf Trønnes <nor...@tronnes.org>
---
  drivers/gpu/drm/tinydrm/mi0283qt.c | 51 ++++++++------------------------------
  drivers/gpu/drm/tinydrm/mipi-dbi.c | 14 ++++++-----
  2 files changed, 19 insertions(+), 46 deletions(-)

<snip>

@@ -316,8 +315,8 @@ static void mipi_dbi_blank(struct mipi_dbi *mipi)
   * mipi_dbi_pipe_disable - MIPI DBI pipe disable helper
   * @pipe: Display pipe
   *
- * This function disables backlight if present or if not the
- * display memory is blanked. Drivers can use this as their
+ * This function disables backlight if present, if not the display memory is
+ * blanked. The regulator is disabled if in use. Drivers can use this as their
   * &drm_simple_display_pipe_funcs->disable callback.
   */
  void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe)
@@ -333,6 +332,9 @@ void mipi_dbi_pipe_disable(struct drm_simple_display_pipe 
*pipe)
                tinydrm_disable_backlight(mipi->backlight);
        else
                mipi_dbi_blank(mipi);
+
+       if (mipi->regulator)
+               regulator_disable(mipi->regulator);
  }
  EXPORT_SYMBOL(mipi_dbi_pipe_disable);

If a display physically has a backlight, but it is not controllable (i.e.
mipi->backlight == NULL) and you disable the regulator, would that not cause
the display to be all white instead of blanked?

Also, even if this is OK, it seems like you should call regulator_enable()
in mipi_dbi_pipe_enable() to keep things balanced in the helper functions.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to