Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 /*
0003  * Copyright © 2021 Intel Corporation
0004  */
0005 
0006 #ifndef __INTEL_BACKLIGHT_H__
0007 #define __INTEL_BACKLIGHT_H__
0008 
0009 #include <linux/types.h>
0010 
0011 struct drm_connector_state;
0012 struct intel_atomic_state;
0013 struct intel_connector;
0014 struct intel_crtc_state;
0015 struct intel_encoder;
0016 struct intel_panel;
0017 enum pipe;
0018 
0019 void intel_backlight_init_funcs(struct intel_panel *panel);
0020 int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe);
0021 void intel_backlight_destroy(struct intel_panel *panel);
0022 
0023 void intel_backlight_enable(const struct intel_crtc_state *crtc_state,
0024                 const struct drm_connector_state *conn_state);
0025 void intel_backlight_update(struct intel_atomic_state *state,
0026                 struct intel_encoder *encoder,
0027                 const struct intel_crtc_state *crtc_state,
0028                 const struct drm_connector_state *conn_state);
0029 void intel_backlight_disable(const struct drm_connector_state *old_conn_state);
0030 
0031 void intel_backlight_set_acpi(const struct drm_connector_state *conn_state,
0032                   u32 level, u32 max);
0033 void intel_backlight_set_pwm_level(const struct drm_connector_state *conn_state,
0034                    u32 level);
0035 u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 level);
0036 u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 level);
0037 u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val);
0038 
0039 #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
0040 int intel_backlight_device_register(struct intel_connector *connector);
0041 void intel_backlight_device_unregister(struct intel_connector *connector);
0042 #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
0043 static inline int intel_backlight_device_register(struct intel_connector *connector)
0044 {
0045     return 0;
0046 }
0047 static inline void intel_backlight_device_unregister(struct intel_connector *connector)
0048 {
0049 }
0050 #endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
0051 
0052 #endif /* __INTEL_BACKLIGHT_H__ */