#include <linux/backlight.h>
#include <linux/kernel.h>
#include <linux/pwm.h>
#include <linux/string_helpers.h>
#include <acpi/video.h>
#include "i915_reg.h"
#include "intel_backlight.h"
#include "intel_backlight_regs.h"
#include "intel_connector.h"
#include "intel_de.h"
#include "intel_display_types.h"
#include "intel_dp_aux_backlight.h"
#include "intel_dsi_dcs_backlight.h"
#include "intel_panel.h"
#include "intel_pci_config.h"
#include "intel_pps.h"
#include "intel_quirks.h"
static u32 scale(u32 source_val,
u32 source_min, u32 source_max,
u32 target_min, u32 target_max)
{ … }
static u32 clamp_user_to_hw(struct intel_connector *connector,
u32 user_level, u32 user_max)
{ … }
static u32 scale_hw_to_user(struct intel_connector *connector,
u32 hw_level, u32 user_max)
{ … }
u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 val)
{ … }
void intel_backlight_set_pwm_level(const struct drm_connector_state *conn_state, u32 val)
{ … }
u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 val)
{ … }
u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val)
{ … }
static u32 lpt_get_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static u32 pch_get_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static u32 i9xx_get_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static u32 vlv_get_backlight(struct intel_connector *connector, enum pipe pipe)
{ … }
static u32 bxt_get_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static u32 ext_pwm_get_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static void lpt_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static void pch_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static void vlv_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static void bxt_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static void ext_pwm_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static void
intel_panel_actually_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
void intel_backlight_set_acpi(const struct drm_connector_state *conn_state,
u32 user_level, u32 user_max)
{ … }
static void lpt_disable_backlight(const struct drm_connector_state *old_conn_state, u32 level)
{ … }
static void pch_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val)
{ … }
static void i9xx_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val)
{ … }
static void i965_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val)
{ … }
static void vlv_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val)
{ … }
static void bxt_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val)
{ … }
static void cnp_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val)
{ … }
static void ext_pwm_disable_backlight(const struct drm_connector_state *old_conn_state, u32 level)
{ … }
void intel_backlight_disable(const struct drm_connector_state *old_conn_state)
{ … }
static void lpt_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void pch_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void i9xx_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void i965_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void vlv_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void bxt_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void cnp_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void ext_pwm_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void __intel_backlight_enable(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
{ … }
void intel_backlight_enable(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
{ … }
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
static u32 intel_panel_get_backlight(struct intel_connector *connector)
{ … }
static u32 scale_user_to_hw(struct intel_connector *connector,
u32 user_level, u32 user_max)
{ … }
static void intel_panel_set_backlight(const struct drm_connector_state *conn_state,
u32 user_level, u32 user_max)
{ … }
static int intel_backlight_device_update_status(struct backlight_device *bd)
{ … }
static int intel_backlight_device_get_brightness(struct backlight_device *bd)
{ … }
static const struct backlight_ops intel_backlight_device_ops = …;
int intel_backlight_device_register(struct intel_connector *connector)
{ … }
void intel_backlight_device_unregister(struct intel_connector *connector)
{ … }
#endif
static u32 cnp_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 bxt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 spt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
{ … }
static u16 get_vbt_pwm_freq(struct intel_connector *connector)
{ … }
static u32 get_backlight_max_vbt(struct intel_connector *connector)
{ … }
static u32 get_backlight_min_vbt(struct intel_connector *connector)
{ … }
static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static int pch_setup_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static int i965_setup_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe)
{ … }
static int
bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static int cnp_num_backlight_controllers(struct drm_i915_private *i915)
{ … }
static bool cnp_backlight_controller_is_valid(struct drm_i915_private *i915, int controller)
{ … }
static int
cnp_setup_backlight(struct intel_connector *connector, enum pipe unused)
{ … }
static int ext_pwm_setup_backlight(struct intel_connector *connector,
enum pipe pipe)
{ … }
static void intel_pwm_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static u32 intel_pwm_get_backlight(struct intel_connector *connector, enum pipe pipe)
{ … }
static void intel_pwm_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state, u32 level)
{ … }
static void intel_pwm_disable_backlight(const struct drm_connector_state *conn_state, u32 level)
{ … }
static int intel_pwm_setup_backlight(struct intel_connector *connector, enum pipe pipe)
{ … }
void intel_backlight_update(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
{ … }
int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe)
{ … }
void intel_backlight_destroy(struct intel_panel *panel)
{ … }
static const struct intel_panel_bl_funcs bxt_pwm_funcs = …;
static const struct intel_panel_bl_funcs cnp_pwm_funcs = …;
static const struct intel_panel_bl_funcs lpt_pwm_funcs = …;
static const struct intel_panel_bl_funcs spt_pwm_funcs = …;
static const struct intel_panel_bl_funcs pch_pwm_funcs = …;
static const struct intel_panel_bl_funcs ext_pwm_funcs = …;
static const struct intel_panel_bl_funcs vlv_pwm_funcs = …;
static const struct intel_panel_bl_funcs i965_pwm_funcs = …;
static const struct intel_panel_bl_funcs i9xx_pwm_funcs = …;
static const struct intel_panel_bl_funcs pwm_bl_funcs = …;
void intel_backlight_init_funcs(struct intel_panel *panel)
{ … }