| 1 | /* SPDX-License-Identifier: MIT */ |
| 2 | /* |
| 3 | * Copyright © 2020 Intel Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef __INTEL_PPS_H__ |
| 7 | #define __INTEL_PPS_H__ |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | |
| 11 | #include "intel_wakeref.h" |
| 12 | |
| 13 | enum pipe; |
| 14 | struct intel_connector; |
| 15 | struct intel_crtc_state; |
| 16 | struct intel_display; |
| 17 | struct intel_dp; |
| 18 | struct intel_encoder; |
| 19 | |
| 20 | intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp); |
| 21 | intel_wakeref_t intel_pps_unlock(struct intel_dp *intel_dp, intel_wakeref_t wakeref); |
| 22 | |
| 23 | #define with_intel_pps_lock(dp, wf) \ |
| 24 | for ((wf) = intel_pps_lock(dp); (wf); (wf) = intel_pps_unlock((dp), (wf))) |
| 25 | |
| 26 | void intel_pps_backlight_on(struct intel_dp *intel_dp); |
| 27 | void intel_pps_backlight_off(struct intel_dp *intel_dp); |
| 28 | void intel_pps_backlight_power(struct intel_connector *connector, bool enable); |
| 29 | |
| 30 | bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp); |
| 31 | void intel_pps_vdd_off_unlocked(struct intel_dp *intel_dp, bool sync); |
| 32 | void intel_pps_on_unlocked(struct intel_dp *intel_dp); |
| 33 | void intel_pps_off_unlocked(struct intel_dp *intel_dp); |
| 34 | void intel_pps_check_power_unlocked(struct intel_dp *intel_dp); |
| 35 | |
| 36 | void intel_pps_vdd_on(struct intel_dp *intel_dp); |
| 37 | void intel_pps_vdd_off(struct intel_dp *intel_dp); |
| 38 | void intel_pps_on(struct intel_dp *intel_dp); |
| 39 | void intel_pps_off(struct intel_dp *intel_dp); |
| 40 | void intel_pps_vdd_off_sync(struct intel_dp *intel_dp); |
| 41 | bool intel_pps_have_panel_power_or_vdd(struct intel_dp *intel_dp); |
| 42 | void intel_pps_wait_power_cycle(struct intel_dp *intel_dp); |
| 43 | |
| 44 | bool intel_pps_init(struct intel_dp *intel_dp); |
| 45 | void intel_pps_init_late(struct intel_dp *intel_dp); |
| 46 | void intel_pps_encoder_reset(struct intel_dp *intel_dp); |
| 47 | |
| 48 | void vlv_pps_pipe_init(struct intel_dp *intel_dp); |
| 49 | void vlv_pps_pipe_reset(struct intel_dp *intel_dp); |
| 50 | enum pipe vlv_pps_backlight_initial_pipe(struct intel_dp *intel_dp); |
| 51 | void vlv_pps_port_enable_unlocked(struct intel_encoder *encoder, |
| 52 | const struct intel_crtc_state *crtc_state); |
| 53 | void vlv_pps_port_disable(struct intel_encoder *encoder, |
| 54 | const struct intel_crtc_state *crtc_state); |
| 55 | void vlv_pps_reset_all(struct intel_display *display); |
| 56 | void bxt_pps_reset_all(struct intel_display *display); |
| 57 | |
| 58 | void intel_pps_unlock_regs_wa(struct intel_display *display); |
| 59 | void intel_pps_setup(struct intel_display *display); |
| 60 | |
| 61 | void intel_pps_connector_debugfs_add(struct intel_connector *connector); |
| 62 | |
| 63 | void assert_pps_unlocked(struct intel_display *display, enum pipe pipe); |
| 64 | |
| 65 | #endif /* __INTEL_PPS_H__ */ |
| 66 | |