1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
11 #define DS_PORT_STATUS_CHANGED 0x200
12 #define DP_TEST_BIT_DEPTH_UNKNOWN 0xFFFFFFFF
13 #define DP_LINK_CAP_ENHANCED_FRAMING (1 << 0)
15 struct msm_dp_link_info {
16 unsigned char revision;
18 unsigned int num_lanes;
19 unsigned long capabilities;
22 #define DP_TRAIN_LEVEL_MAX 3
24 struct msm_dp_link_test_video {
25 u32 test_video_pattern;
42 struct msm_dp_link_test_audio {
43 u32 test_audio_sampling_rate;
44 u32 test_audio_channel_count;
45 u32 test_audio_pattern_type;
46 u32 test_audio_period_ch_1;
47 u32 test_audio_period_ch_2;
48 u32 test_audio_period_ch_3;
49 u32 test_audio_period_ch_4;
50 u32 test_audio_period_ch_5;
51 u32 test_audio_period_ch_6;
52 u32 test_audio_period_ch_7;
53 u32 test_audio_period_ch_8;
56 struct msm_dp_link_phy_params {
57 u32 phy_test_pattern_sel;
67 struct msm_dp_link_test_video test_video;
68 struct msm_dp_link_test_audio test_audio;
69 struct msm_dp_link_phy_params phy_params;
70 struct msm_dp_link_info link_params;
74 * mdss_dp_test_bit_depth_to_bpp() - convert test bit depth to bpp
75 * @tbd: test bit depth
77 * Returns the bits per pixel (bpp) to be used corresponding to the
78 * git bit depth value. This function assumes that bit depth has
79 * already been validated.
81 static inline u32 msm_dp_link_bit_depth_to_bpp(u32 tbd)
84 * Few simplistic rules and assumptions made here:
85 * 1. Bit depth is per color component
86 * 2. If bit depth is unknown return 0
87 * 3. Assume 3 color components
90 case DP_TEST_BIT_DEPTH_6:
92 case DP_TEST_BIT_DEPTH_8:
94 case DP_TEST_BIT_DEPTH_10:
96 case DP_TEST_BIT_DEPTH_UNKNOWN:
102 void msm_dp_link_reset_phy_params_vx_px(struct msm_dp_link *msm_dp_link);
103 u32 msm_dp_link_get_test_bits_depth(struct msm_dp_link *msm_dp_link, u32 bpp);
104 int msm_dp_link_process_request(struct msm_dp_link *msm_dp_link);
105 int msm_dp_link_get_colorimetry_config(struct msm_dp_link *msm_dp_link);
106 int msm_dp_link_adjust_levels(struct msm_dp_link *msm_dp_link, u8 *link_status);
107 bool msm_dp_link_send_test_response(struct msm_dp_link *msm_dp_link);
108 int msm_dp_link_psm_config(struct msm_dp_link *msm_dp_link,
109 struct msm_dp_link_info *link_info, bool enable);
110 bool msm_dp_link_send_edid_checksum(struct msm_dp_link *msm_dp_link, u8 checksum);
113 * msm_dp_link_get() - get the functionalities of dp test module
116 * return: a pointer to msm_dp_link struct
118 struct msm_dp_link *msm_dp_link_get(struct device *dev, struct drm_dp_aux *aux);
120 #endif /* _DP_LINK_H_ */