Attach the connector LUMINANCE property for MIPI DBI compatible panels
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/panel-mipi-dbi.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index f0e72d4b6a470..e61a429538bc0 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -73,7 +73,7 @@ config DRM_PANEL_MIPI_DBI
        select DRM_KMS_HELPER
        select DRM_GEM_DMA_HELPER
        select DRM_MIPI_DBI
-       select BACKLIGHT_CLASS_DEVICE
+       select BACKLIGHT_CLASS_DEVICE if !DRM_LUMINANCE
        select VIDEOMODE_HELPERS
        help
          Say Y here if you want to enable support for MIPI DBI compatible
diff --git a/drivers/gpu/drm/tiny/panel-mipi-dbi.c 
b/drivers/gpu/drm/tiny/panel-mipi-dbi.c
index 60cd65cae41d8..730f1b219fdec 100644
--- a/drivers/gpu/drm/tiny/panel-mipi-dbi.c
+++ b/drivers/gpu/drm/tiny/panel-mipi-dbi.c
@@ -485,6 +485,9 @@ static int panel_mipi_dbi_spi_probe(struct spi_device *spi)
        if (ret)
                return ret;
        drm_connector_helper_add(connector, 
&panel_mipi_dbi_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