Attach the connector LUMINANCE property for ILI9486 displays and retain
the legacy backlight class interface only when DRM_LUMINANCE is disabled.

Signed-off-by: Mario Limonciello <[email protected]>
---
 drivers/gpu/drm/tiny/Kconfig   | 2 +-
 drivers/gpu/drm/tiny/ili9486.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index 85b166b659388..778e450f381e0 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -160,7 +160,7 @@ config TINYDRM_ILI9486
        select DRM_KMS_HELPER
        select DRM_GEM_DMA_HELPER
        select DRM_MIPI_DBI
-       select BACKLIGHT_CLASS_DEVICE
+       select BACKLIGHT_CLASS_DEVICE if !DRM_LUMINANCE
        help
          DRM driver for the following Ilitek ILI9486 panels:
          * PISCREEN 3.5" 320x480 TFT (Ozzmaker 3.5")
diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c
index c945a91443158..480f14bb3bfb0 100644
--- a/drivers/gpu/drm/tiny/ili9486.c
+++ b/drivers/gpu/drm/tiny/ili9486.c
@@ -345,6 +345,9 @@ static int ili9486_probe(struct spi_device *spi)
        if (ret)
                return ret;
        drm_connector_helper_add(connector, &ili9486_connector_helper_funcs);
+       ret = drm_mipi_dbi_connector_attach_luminance_property(connector);
+       if (ret)
+               return ret;
 
        ret = drm_connector_attach_encoder(connector, encoder);
        if (ret)
-- 
2.43.0

Reply via email to