drm/tinydrm: Convert tinydrm_enable/disable_backlight to backlight_enable/disable
authorMeghana Madhyastha <meghana.madhyastha@gmail.com>
Wed, 24 Jan 2018 16:34:48 +0000 (16:34 +0000)
committerSean Paul <seanpaul@chromium.org>
Tue, 20 Feb 2018 16:07:22 +0000 (11:07 -0500)
Remove tinydrm_enable/disable_backlight and let the callers call the
more generic backlight_enable/disable helpers

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/ec700724e47814e6426966e093bd32b2364ba147.1516810725.git.meghana.madhyastha@gmail.com
drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
drivers/gpu/drm/tinydrm/mipi-dbi.c
include/drm/tinydrm/tinydrm-helpers.h

index bf96072d1b9709a11d356bc8d1e25fb6adba1d22..7326e1758bac562dd204687893a244e760012695 100644 (file)
@@ -276,61 +276,6 @@ struct backlight_device *tinydrm_of_find_backlight(struct device *dev)
 }
 EXPORT_SYMBOL(tinydrm_of_find_backlight);
 
-/**
- * tinydrm_enable_backlight - Enable backlight helper
- * @backlight: Backlight device
- *
- * Returns:
- * Zero on success, negative error code on failure.
- */
-int tinydrm_enable_backlight(struct backlight_device *backlight)
-{
-       unsigned int old_state;
-       int ret;
-
-       if (!backlight)
-               return 0;
-
-       old_state = backlight->props.state;
-       backlight->props.state &= ~BL_CORE_FBBLANK;
-       DRM_DEBUG_KMS("Backlight state: 0x%x -> 0x%x\n", old_state,
-                     backlight->props.state);
-
-       ret = backlight_update_status(backlight);
-       if (ret)
-               DRM_ERROR("Failed to enable backlight %d\n", ret);
-
-       return ret;
-}
-EXPORT_SYMBOL(tinydrm_enable_backlight);
-
-/**
- * tinydrm_disable_backlight - Disable backlight helper
- * @backlight: Backlight device
- *
- * Returns:
- * Zero on success, negative error code on failure.
- */
-int tinydrm_disable_backlight(struct backlight_device *backlight)
-{
-       unsigned int old_state;
-       int ret;
-
-       if (!backlight)
-               return 0;
-
-       old_state = backlight->props.state;
-       backlight->props.state |= BL_CORE_FBBLANK;
-       DRM_DEBUG_KMS("Backlight state: 0x%x -> 0x%x\n", old_state,
-                     backlight->props.state);
-       ret = backlight_update_status(backlight);
-       if (ret)
-               DRM_ERROR("Failed to disable backlight %d\n", ret);
-
-       return ret;
-}
-EXPORT_SYMBOL(tinydrm_disable_backlight);
-
 #if IS_ENABLED(CONFIG_SPI)
 
 /**
index 75dd65c57e74be09804157b087484635b6fd8692..9e903812b573185f6cf96b8779b5c7acc90ac760 100644 (file)
@@ -286,7 +286,7 @@ void mipi_dbi_enable_flush(struct mipi_dbi *mipi)
        if (fb)
                fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0);
 
-       tinydrm_enable_backlight(mipi->backlight);
+       backlight_enable(mipi->backlight);
 }
 EXPORT_SYMBOL(mipi_dbi_enable_flush);
 
@@ -325,7 +325,7 @@ void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe)
        mipi->enabled = false;
 
        if (mipi->backlight)
-               tinydrm_disable_backlight(mipi->backlight);
+               backlight_disable(mipi->backlight);
        else
                mipi_dbi_blank(mipi);
 
index d554ded60ee989a087fe16b6cef5b636d18e9174..f54fae03e34e505954307ca3a3a49cea3258c72f 100644 (file)
@@ -47,8 +47,6 @@ void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb,
                               struct drm_clip_rect *clip);
 
 struct backlight_device *tinydrm_of_find_backlight(struct device *dev);
-int tinydrm_enable_backlight(struct backlight_device *backlight);
-int tinydrm_disable_backlight(struct backlight_device *backlight);
 
 size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len);
 bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw);