drm/bridge: panel: Name an associated backlight device

Pass the DRM connector name to any configured backlight
device so that userspace can associate the two items.

Ideally this should be in drm_panel, but it is bridge/panel
that creates the drm_connector and therefore knows the name.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2024-05-17 17:37:33 +01:00
committed by Phil Elwell
parent 1e0dc5254a
commit 573f8fd0ab

View File

@@ -14,6 +14,7 @@
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_print.h> #include <drm/drm_print.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include <linux/backlight.h>
struct panel_bridge { struct panel_bridge {
struct drm_bridge bridge; struct drm_bridge bridge;
@@ -86,6 +87,9 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
drm_connector_attach_encoder(&panel_bridge->connector, drm_connector_attach_encoder(&panel_bridge->connector,
bridge->encoder); bridge->encoder);
backlight_set_display_name(panel_bridge->panel->backlight,
panel_bridge->connector.name);
if (bridge->dev->registered) { if (bridge->dev->registered) {
if (connector->funcs->reset) if (connector->funcs->reset)
connector->funcs->reset(connector); connector->funcs->reset(connector);