Attach the connector LUMINANCE property for ILI9341 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/ili9341.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index e553b0aaa7571..85b166b659388 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -146,7 +146,7 @@ config TINYDRM_ILI9341
        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 ILI9341 panels:
          * YX240QV29-T 2.4" 240x320 TFT (Adafruit 2.4")
diff --git a/drivers/gpu/drm/tiny/ili9341.c b/drivers/gpu/drm/tiny/ili9341.c
index 003381aa22ea4..3a5c8b39ec7dc 100644
--- a/drivers/gpu/drm/tiny/ili9341.c
+++ b/drivers/gpu/drm/tiny/ili9341.c
@@ -317,6 +317,9 @@ static int ili9341_probe(struct spi_device *spi)
        if (ret)
                return ret;
        drm_connector_helper_add(connector, &ili9341_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