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/ili9225.c | |
parent | drm/tinydrm: Rename remaining variable mipi -> dbidev (diff) | |
download | linux-84137b866e834ac937582b04ae9bed0a72356a6a.tar.xz linux-84137b866e834ac937582b04ae9bed0a72356a6a.zip |
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/ili9225.c')
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9225.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c index 209a75dab7ce..33766fc21b2b 100644 --- a/drivers/gpu/drm/tinydrm/ili9225.c +++ b/drivers/gpu/drm/tinydrm/ili9225.c @@ -78,10 +78,10 @@ static inline int ili9225_command(struct mipi_dbi *dbi, u8 cmd, u16 data) static void ili9225_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) { struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); - struct mipi_dbi *dbidev = drm_to_mipi_dbi(fb->dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); unsigned int height = rect->y2 - rect->y1; unsigned int width = rect->x2 - rect->x1; - struct mipi_dbi *dbi = dbidev; + struct mipi_dbi *dbi = &dbidev->dbi; bool swap = dbi->swap_bytes; u16 x_start, y_start; u16 x1, x2, y1, y2; @@ -183,10 +183,10 @@ static void ili9225_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 device *dev = pipe->crtc.dev->dev; - struct mipi_dbi *dbi = dbidev; + struct mipi_dbi *dbi = &dbidev->dbi; struct drm_rect rect = { .x1 = 0, .x2 = fb->width, @@ -291,8 +291,8 @@ out_exit: static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); - struct mipi_dbi *dbi = dbidev; + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi *dbi = &dbidev->dbi; DRM_DEBUG_KMS("\n"); @@ -378,7 +378,7 @@ MODULE_DEVICE_TABLE(spi, ili9225_id); static int ili9225_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 *rs; @@ -389,7 +389,7 @@ static int ili9225_probe(struct spi_device *spi) if (!dbidev) return -ENOMEM; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret = devm_drm_dev_init(dev, drm, &ili9225_driver); if (ret) { @@ -420,7 +420,7 @@ static int ili9225_probe(struct spi_device *spi) /* override the command function set in mipi_dbi_spi_init() */ dbi->command = ili9225_dbi_command; - ret = mipi_dbi_init(dbidev, &ili9225_pipe_funcs, &ili9225_mode, rotation); + ret = mipi_dbi_dev_init(dbidev, &ili9225_pipe_funcs, &ili9225_mode, rotation); if (ret) return ret; |