diff options
author | Dave Airlie <airlied@redhat.com> | 2020-12-01 07:09:45 +1000 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2020-12-03 10:16:16 +0200 |
commit | 1494a1dec5bfca35a0c1dd777750768a35b2da77 (patch) | |
tree | 631d5217011a658780b24452e763a422ab4cdfab /drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c | |
parent | 829270e4552e9e6a0534d4d195f671363cb39e3e (diff) |
drm/i915: refactor panel backlight control functions. (v2)
This moves the functions into static const instead of having
funcs and data in the same struct.
It leaves the power callback alone, as it is used in a different
manner.
v2: leave power callback alone (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201130210945.31850-1-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c index b53c50372918..5c508d51f526 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c @@ -156,6 +156,14 @@ static int dcs_setup_backlight(struct intel_connector *connector, return 0; } +static const struct intel_panel_bl_funcs dcs_bl_funcs = { + .setup = dcs_setup_backlight, + .enable = dcs_enable_backlight, + .disable = dcs_disable_backlight, + .set = dcs_set_backlight, + .get = dcs_get_backlight, +}; + int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector) { struct drm_device *dev = intel_connector->base.dev; @@ -169,11 +177,7 @@ int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector) if (drm_WARN_ON(dev, encoder->type != INTEL_OUTPUT_DSI)) return -EINVAL; - panel->backlight.setup = dcs_setup_backlight; - panel->backlight.enable = dcs_enable_backlight; - panel->backlight.disable = dcs_disable_backlight; - panel->backlight.set = dcs_set_backlight; - panel->backlight.get = dcs_get_backlight; + panel->backlight.funcs = &dcs_bl_funcs; return 0; } |