summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tinydrm/mipi-dbi.c
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2018-01-10 19:59:36 +0100
committerNoralf Trønnes <noralf@tronnes.org>2018-01-15 15:10:28 +0100
commit22edc8d38ba5e912d0fd0d4d23ed268ae152c5ee (patch)
tree3643c47c3aefd92e20f1b3cfa9fe52f90b1bad28 /drivers/gpu/drm/tinydrm/mipi-dbi.c
parent24e05e7a82454019fbf3b20c3006c19939571acd (diff)
drm/tinydrm/mipi-dbi: Add mipi_dbi_enable_flush()
Add and use a function for enabling, flushing and turning on backlight. Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: David Lechner <david@lechnology.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-4-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/tinydrm/mipi-dbi.c')
-rw-r--r--drivers/gpu/drm/tinydrm/mipi-dbi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index aa6b6ce56891..1c8ef0c4d6d4 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -271,6 +271,26 @@ static const struct drm_framebuffer_funcs mipi_dbi_fb_funcs = {
};
/**
+ * mipi_dbi_enable_flush - MIPI DBI enable helper
+ * @mipi: MIPI DBI structure
+ *
+ * This function sets &mipi_dbi->enabled, flushes the whole framebuffer and
+ * enables the backlight. Drivers can use this in their
+ * &drm_simple_display_pipe_funcs->enable callback.
+ */
+void mipi_dbi_enable_flush(struct mipi_dbi *mipi)
+{
+ struct drm_framebuffer *fb = mipi->tinydrm.pipe.plane.fb;
+
+ mipi->enabled = true;
+ if (fb)
+ fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0);
+
+ tinydrm_enable_backlight(mipi->backlight);
+}
+EXPORT_SYMBOL(mipi_dbi_enable_flush);
+
+/**
* mipi_dbi_pipe_enable - MIPI DBI pipe enable helper
* @pipe: Display pipe
* @crtc_state: CRTC state