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

diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index 778e450f381e0..fea8beb8b8ca3 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -175,7 +175,7 @@ config TINYDRM_MI0283QT
        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 Multi-Inno MI0283QT display panel
          If M is selected the module will be called mi0283qt.
diff --git a/drivers/gpu/drm/tiny/mi0283qt.c b/drivers/gpu/drm/tiny/mi0283qt.c
index b0121e89e2dc0..1414ae47dd079 100644
--- a/drivers/gpu/drm/tiny/mi0283qt.c
+++ b/drivers/gpu/drm/tiny/mi0283qt.c
@@ -325,6 +325,9 @@ static int mi0283qt_probe(struct spi_device *spi)
        if (ret)
                return ret;
        drm_connector_helper_add(connector, &mi0283qt_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