diff options
Diffstat (limited to 'drivers/gpu/drm/tinydrm/ili9225.c')
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9225.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c index c837d1423362..209a75dab7ce 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 *mipi = drm_to_mipi_dbi(fb->dev); + struct mipi_dbi *dbidev = drm_to_mipi_dbi(fb->dev); unsigned int height = rect->y2 - rect->y1; unsigned int width = rect->x2 - rect->x1; - struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbi = dbidev; bool swap = dbi->swap_bytes; u16 x_start, y_start; u16 x1, x2, y1, y2; @@ -89,7 +89,7 @@ static void ili9225_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) bool full; void *tr; - if (!mipi->enabled) + if (!dbidev->enabled) return; if (!drm_dev_enter(fb->dev, &idx)) @@ -101,15 +101,15 @@ static void ili9225_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) if (!dbi->dc || !full || swap || fb->format->format == DRM_FORMAT_XRGB8888) { - tr = mipi->tx_buf; - ret = mipi_dbi_buf_copy(mipi->tx_buf, fb, rect, swap); + tr = dbidev->tx_buf; + ret = mipi_dbi_buf_copy(dbidev->tx_buf, fb, rect, swap); if (ret) goto err_msg; } else { tr = cma_obj->vaddr; } - switch (mipi->rotation) { + switch (dbidev->rotation) { default: x1 = rect->x1; x2 = rect->x2 - 1; @@ -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 *mipi = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); struct drm_framebuffer *fb = plane_state->fb; struct device *dev = pipe->crtc.dev->dev; - struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbi = dbidev; struct drm_rect rect = { .x1 = 0, .x2 = fb->width, @@ -233,7 +233,7 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, msleep(50); - switch (mipi->rotation) { + switch (dbidev->rotation) { default: am_id = 0x30; break; @@ -283,7 +283,7 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, ili9225_command(dbi, ILI9225_DISPLAY_CONTROL_1, 0x1017); - mipi->enabled = true; + dbidev->enabled = true; ili9225_fb_dirty(fb, &rect); out_exit: drm_dev_exit(idx); @@ -291,8 +291,8 @@ out_exit: static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); - struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi *dbi = dbidev; DRM_DEBUG_KMS("\n"); @@ -303,7 +303,7 @@ static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) * unplug. */ - if (!mipi->enabled) + if (!dbidev->enabled) return; ili9225_command(dbi, ILI9225_DISPLAY_CONTROL_1, 0x0000); @@ -312,7 +312,7 @@ static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) msleep(50); ili9225_command(dbi, ILI9225_POWER_CONTROL_1, 0x0a02); - mipi->enabled = false; + dbidev->enabled = false; } static int ili9225_dbi_command(struct mipi_dbi *dbi, u8 *cmd, u8 *par, @@ -378,22 +378,22 @@ MODULE_DEVICE_TABLE(spi, ili9225_id); static int ili9225_probe(struct spi_device *spi) { struct device *dev = &spi->dev; + struct mipi_dbi *dbidev; struct drm_device *drm; - struct mipi_dbi *mipi; struct mipi_dbi *dbi; struct gpio_desc *rs; u32 rotation = 0; int ret; - mipi = kzalloc(sizeof(*mipi), GFP_KERNEL); - if (!mipi) + dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL); + if (!dbidev) return -ENOMEM; - dbi = mipi; - drm = &mipi->drm; + dbi = dbidev; + drm = &dbidev->drm; ret = devm_drm_dev_init(dev, drm, &ili9225_driver); if (ret) { - kfree(mipi); + kfree(dbidev); return 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(mipi, &ili9225_pipe_funcs, &ili9225_mode, rotation); + ret = mipi_dbi_init(dbidev, &ili9225_pipe_funcs, &ili9225_mode, rotation); if (ret) return ret; |