diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2019-07-22 12:43:07 +0200 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2019-07-25 10:42:25 +0200 |
commit | 84137b866e834ac937582b04ae9bed0a72356a6a (patch) | |
tree | 11c1a7f5a7169f89c9206e4dc187c9a6c5693c14 /drivers/gpu/drm/tinydrm/st7586.c | |
parent | 440961d20959e8528a86e054b0a762d9ca9c7e91 (diff) |
drm/tinydrm: Split struct mipi_dbi in two
Split struct mipi_dbi into an interface part and a display pipeline part.
The interface part can be used by drivers that need to initialize the
controller, but that won't upload the framebuffer over this interface.
MIPI DBI supports 3 interface types:
- A. Motorola 6800 type parallel bus
- B. Intel 8080 type parallel bus
- C. SPI type with 3 options:
I've embedded the SPI type specifics in the mipi_dbi struct to avoid
adding unnecessary complexity. If more interface types will be supported
in the future, the type specifics might have to be split out.
Rename functions to match the new struct mipi_dbi_dev:
- drm_to_mipi_dbi() -> drm_to_mipi_dbi_dev().
- mipi_dbi_init*() -> mipi_dbi_dev_init*().
Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-5-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/tinydrm/st7586.c')
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7586.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index cf0d7a26009c..51871ee16ef6 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c @@ -114,8 +114,8 @@ static int st7586_buf_copy(void *dst, struct drm_framebuffer *fb, static void st7586_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(fb->dev); - struct mipi_dbi *dbi = dbidev; + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); + struct mipi_dbi *dbi = &dbidev->dbi; int start, end, idx, ret = 0; if (!dbidev->enabled) @@ -177,9 +177,9 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); struct drm_framebuffer *fb = plane_state->fb; - struct mipi_dbi *dbi = dbidev; + struct mipi_dbi *dbi = &dbidev->dbi; struct drm_rect rect = { .x1 = 0, .x2 = fb->width, @@ -255,7 +255,7 @@ out_exit: static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); /* * This callback is not protected by drm_dev_enter/exit since we want to @@ -266,11 +266,11 @@ static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe) DRM_DEBUG_KMS("\n"); - if (!mipi->enabled) + if (!dbidev->enabled) return; - mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_OFF); - mipi->enabled = false; + mipi_dbi_command(&dbidev->dbi, MIPI_DCS_SET_DISPLAY_OFF); + dbidev->enabled = false; } static const u32 st7586_formats[] = { @@ -318,7 +318,7 @@ MODULE_DEVICE_TABLE(spi, st7586_id); static int st7586_probe(struct spi_device *spi) { struct device *dev = &spi->dev; - struct mipi_dbi *dbidev; + struct mipi_dbi_dev *dbidev; struct drm_device *drm; struct mipi_dbi *dbi; struct gpio_desc *a0; @@ -330,7 +330,7 @@ static int st7586_probe(struct spi_device *spi) if (!dbidev) return -ENOMEM; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret = devm_drm_dev_init(dev, drm, &st7586_driver); if (ret) { @@ -363,9 +363,9 @@ static int st7586_probe(struct spi_device *spi) /* Cannot read from this controller via SPI */ dbi->read_commands = NULL; - ret = mipi_dbi_init_with_formats(dbidev, &st7586_pipe_funcs, - st7586_formats, ARRAY_SIZE(st7586_formats), - &st7586_mode, rotation, bufsize); + ret = mipi_dbi_dev_init_with_formats(dbidev, &st7586_pipe_funcs, + st7586_formats, ARRAY_SIZE(st7586_formats), + &st7586_mode, rotation, bufsize); if (ret) return ret; |