xref: /openbmc/linux/drivers/gpu/drm/i915/display/intel_pps.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1abad6805SJani Nikula /* SPDX-License-Identifier: MIT */
2abad6805SJani Nikula /*
3abad6805SJani Nikula  * Copyright © 2020 Intel Corporation
4abad6805SJani Nikula  */
5abad6805SJani Nikula 
6abad6805SJani Nikula #ifndef __INTEL_PPS_H__
7abad6805SJani Nikula #define __INTEL_PPS_H__
8abad6805SJani Nikula 
9abad6805SJani Nikula #include <linux/types.h>
10abad6805SJani Nikula 
11abad6805SJani Nikula #include "intel_wakeref.h"
12abad6805SJani Nikula 
13aa0813b1SJani Nikula enum pipe;
14abad6805SJani Nikula struct drm_i915_private;
15abad6805SJani Nikula struct intel_connector;
16abad6805SJani Nikula struct intel_crtc_state;
17abad6805SJani Nikula struct intel_dp;
18abad6805SJani Nikula struct intel_encoder;
19abad6805SJani Nikula 
207191d9d2SJani Nikula intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp);
217191d9d2SJani Nikula intel_wakeref_t intel_pps_unlock(struct intel_dp *intel_dp, intel_wakeref_t wakeref);
22abad6805SJani Nikula 
237191d9d2SJani Nikula #define with_intel_pps_lock(dp, wf)						\
247191d9d2SJani Nikula 	for ((wf) = intel_pps_lock(dp); (wf); (wf) = intel_pps_unlock((dp), (wf)))
25abad6805SJani Nikula 
26f4249942SJani Nikula void intel_pps_backlight_on(struct intel_dp *intel_dp);
27f4249942SJani Nikula void intel_pps_backlight_off(struct intel_dp *intel_dp);
28f4249942SJani Nikula void intel_pps_backlight_power(struct intel_connector *connector, bool enable);
29abad6805SJani Nikula 
30db7c94f9SJani Nikula bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp);
31db7c94f9SJani Nikula void intel_pps_vdd_off_unlocked(struct intel_dp *intel_dp, bool sync);
32db7c94f9SJani Nikula void intel_pps_on_unlocked(struct intel_dp *intel_dp);
33db7c94f9SJani Nikula void intel_pps_off_unlocked(struct intel_dp *intel_dp);
34c94287f1SJani Nikula void intel_pps_check_power_unlocked(struct intel_dp *intel_dp);
35abad6805SJani Nikula 
36eb46f498SJani Nikula void intel_pps_vdd_on(struct intel_dp *intel_dp);
37eb46f498SJani Nikula void intel_pps_on(struct intel_dp *intel_dp);
38eb46f498SJani Nikula void intel_pps_off(struct intel_dp *intel_dp);
39f033d7ebSJani Nikula void intel_pps_vdd_off_sync(struct intel_dp *intel_dp);
408f0c1c09SJosé Roberto de Souza bool intel_pps_have_panel_power_or_vdd(struct intel_dp *intel_dp);
41572a0d30SJani Nikula void intel_pps_wait_power_cycle(struct intel_dp *intel_dp);
42abad6805SJani Nikula 
43*ba21bb24SVille Syrjälä bool intel_pps_init(struct intel_dp *intel_dp);
448e75e8f5SVille Syrjälä void intel_pps_init_late(struct intel_dp *intel_dp);
4573bb78b5SJani Nikula void intel_pps_encoder_reset(struct intel_dp *intel_dp);
4607eb5b1fSJani Nikula void intel_pps_reset_all(struct drm_i915_private *i915);
47abad6805SJani Nikula 
48bcdf0f71SJani Nikula void vlv_pps_init(struct intel_encoder *encoder,
49abad6805SJani Nikula 		  const struct intel_crtc_state *crtc_state);
50abad6805SJani Nikula 
510bf1e5a8SJani Nikula void intel_pps_unlock_regs_wa(struct drm_i915_private *i915);
520bf1e5a8SJani Nikula void intel_pps_setup(struct drm_i915_private *i915);
530bf1e5a8SJani Nikula 
54aa0813b1SJani Nikula void assert_pps_unlocked(struct drm_i915_private *i915, enum pipe pipe);
55aa0813b1SJani Nikula 
56abad6805SJani Nikula #endif /* __INTEL_PPS_H__ */
57