From cc431212710860143b13877a0aa9d11a42598f49 Mon Sep 17 00:00:00 2001 From: Noralf Trønnes Date: Fri, 19 Jul 2019 17:59:15 +0200 Subject: drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MIPI DBI standard support more pixel formats than what this helper supports. Add an init function that lets the driver use different format(s). This avoids open coding mipi_dbi_init() in st7586. st7586 sets preferred_depth but this is not necessary since it only supports one format. v2: Forgot to remove the mipi->rotation assignment in st7586, mipi_dbi_init_with_formats() handles it. Cc: David Lechner Acked-by: David Lechner Signed-off-by: Noralf Trønnes Tested-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-11-noralf@tronnes.org --- include/drm/tinydrm/mipi-dbi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/drm') diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h index 35a1413f2122..c4b04789bf84 100644 --- a/include/drm/tinydrm/mipi-dbi.h +++ b/include/drm/tinydrm/mipi-dbi.h @@ -69,6 +69,11 @@ static inline struct mipi_dbi *drm_to_mipi_dbi(struct drm_device *drm) int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, struct gpio_desc *dc); +int mipi_dbi_init_with_formats(struct mipi_dbi *mipi, + const struct drm_simple_display_pipe_funcs *funcs, + const uint32_t *formats, unsigned int format_count, + const struct drm_display_mode *mode, + unsigned int rotation, size_t tx_buf_size); int mipi_dbi_init(struct mipi_dbi *mipi, const struct drm_simple_display_pipe_funcs *funcs, const struct drm_display_mode *mode, unsigned int rotation); -- cgit v1.2.3