2 * Copyright 2012-15 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef __DAL_DDC_SERVICE_H__
27 #define __DAL_DDC_SERVICE_H__
29 #include "include/ddc_service_types.h"
30 #include "include/i2caux_interface.h"
32 #define EDID_SEGMENT_SIZE 256
34 /* Address range from 0x00 to 0x1F.*/
35 #define DP_ADAPTOR_TYPE2_SIZE 0x20
36 #define DP_ADAPTOR_TYPE2_REG_ID 0x10
37 #define DP_ADAPTOR_TYPE2_REG_MAX_TMDS_CLK 0x1D
38 /* Identifies adaptor as Dual-mode adaptor */
39 #define DP_ADAPTOR_TYPE2_ID 0xA0
41 #define DP_ADAPTOR_TYPE2_MAX_TMDS_CLK 600
43 #define DP_ADAPTOR_TYPE2_MIN_TMDS_CLK 25
45 #define DP_ADAPTOR_DVI_MAX_TMDS_CLK 165000
47 #define DP_ADAPTOR_HDMI_SAFE_MAX_TMDS_CLK 165000
49 #define DDC_I2C_COMMAND_ENGINE I2C_COMMAND_ENGINE_SW
52 struct graphics_object_id
;
55 struct dp_receiver_id_info
;
60 void dal_ddc_i2c_payloads_add(
61 struct i2c_payloads
*payloads
,
67 struct ddc_service_init_data
{
68 struct graphics_object_id id
;
69 struct dc_context
*ctx
;
73 struct ddc_service
*dal_ddc_service_create(
74 struct ddc_service_init_data
*ddc_init_data
);
76 void dal_ddc_service_destroy(struct ddc_service
**ddc
);
78 enum ddc_service_type
dal_ddc_service_get_type(struct ddc_service
*ddc
);
80 void dal_ddc_service_set_transaction_type(
81 struct ddc_service
*ddc
,
82 enum ddc_transaction_type type
);
84 bool dal_ddc_service_is_in_aux_transaction_mode(struct ddc_service
*ddc
);
86 void dal_ddc_service_i2c_query_dp_dual_mode_adaptor(
87 struct ddc_service
*ddc
,
88 struct display_sink_capability
*sink_cap
);
90 bool dal_ddc_service_query_ddc_data(
91 struct ddc_service
*ddc
,
98 bool dal_ddc_submit_aux_command(struct ddc_service
*ddc
,
99 struct aux_payload
*payload
);
101 int dc_link_aux_transfer_raw(struct ddc_service
*ddc
,
102 struct aux_payload
*payload
,
103 enum aux_channel_operation_result
*operation_result
);
105 bool dc_link_aux_transfer_with_retries(struct ddc_service
*ddc
,
106 struct aux_payload
*payload
);
108 bool dc_link_aux_try_to_configure_timeout(struct ddc_service
*ddc
,
111 void dal_ddc_service_write_scdc_data(
112 struct ddc_service
*ddc_service
,
114 bool lte_340_scramble
);
116 void dal_ddc_service_read_scdc_data(
117 struct ddc_service
*ddc_service
);
119 void ddc_service_set_dongle_type(struct ddc_service
*ddc
,
120 enum display_dongle_type dongle_type
);
122 void dal_ddc_service_set_ddc_pin(
123 struct ddc_service
*ddc_service
,
126 struct ddc
*dal_ddc_service_get_ddc_pin(struct ddc_service
*ddc_service
);
128 uint32_t get_defer_delay(struct ddc_service
*ddc
);
130 #endif /* __DAL_DDC_SERVICE_H__ */