Mario Limonciello <[email protected]> writes:

> Add common helpers for MIPI DBI drivers to attach the connector LUMINANCE
> property and forward updates to their backlight backend when
> CONFIG_DRM_LUMINANCE is enabled.
>
> Signed-off-by: Mario Limonciello <[email protected]>
> ---

[...]

> +int drm_mipi_dbi_connector_attach_luminance_property(struct drm_connector 
> *connector)
> +{
> +     struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(connector->dev);
> +     struct backlight_device *backlight = dbidev->backlight;
> +
> +     if (!IS_ENABLED(CONFIG_DRM_LUMINANCE) || !backlight)
> +             return 0;
> +
> +     return drm_connector_attach_luminance_property(connector, 0,
> +                                     backlight->props.max_brightness,
> +                                     backlight->props.brightness);
> +}
> +EXPORT_SYMBOL(drm_mipi_dbi_connector_attach_luminance_property);
> +

Drivers that call drm_connector_attach_luminance_property(), make it
conditional with if IS_ENABLED(CONFIG_DRM_LUMINANCE). I wonder if
should be the same for drivers calling this helper.

That is, instead of bailing out due !IS_ENABLED(CONFIG_DRM_LUMINANCE),
to make drivers do:

        if (!IS_ENABLED(CONFIG_DRM_LUMINANCE) {
               ret = 
drm_mipi_dbi_connector_attach_luminance_property(connector);
        ...
        }

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat

Reply via email to