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

diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index e61a429538bc0..9914c096ba7fe 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -105,7 +105,7 @@ config TINYDRM_HX8357D
        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 HX8357D panels:
          * YX350HV15-T 3.5" 340x350 TFT (Adafruit 3.5")
diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c
index f942a8d09ff22..c5cfee13b3e99 100644
--- a/drivers/gpu/drm/tiny/hx8357d.c
+++ b/drivers/gpu/drm/tiny/hx8357d.c
@@ -355,6 +355,9 @@ static int hx8357d_probe(struct spi_device *spi)
        if (ret)
                return ret;
        drm_connector_helper_add(connector, &hx8357d_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