GNU Linux-libre 4.19.264-gnu1
[releases.git] / drivers / gpu / drm / amd / display / dc / i2caux / dce110 / aux_engine_dce110.h
1 /*
2  * Copyright 2012-15 Advanced Micro Devices, Inc.
3  *
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:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
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.
21  *
22  * Authors: AMD
23  *
24  */
25
26 #ifndef __DAL_AUX_ENGINE_DCE110_H__
27 #define __DAL_AUX_ENGINE_DCE110_H__
28
29 #include "../aux_engine.h"
30
31 #define AUX_COMMON_REG_LIST(id)\
32         SRI(AUX_CONTROL, DP_AUX, id), \
33         SRI(AUX_ARB_CONTROL, DP_AUX, id), \
34         SRI(AUX_SW_DATA, DP_AUX, id), \
35         SRI(AUX_SW_CONTROL, DP_AUX, id), \
36         SRI(AUX_INTERRUPT_CONTROL, DP_AUX, id), \
37         SRI(AUX_SW_STATUS, DP_AUX, id), \
38         SR(AUXN_IMPCAL), \
39         SR(AUXP_IMPCAL)
40
41 struct dce110_aux_registers {
42         uint32_t AUX_CONTROL;
43         uint32_t AUX_ARB_CONTROL;
44         uint32_t AUX_SW_DATA;
45         uint32_t AUX_SW_CONTROL;
46         uint32_t AUX_INTERRUPT_CONTROL;
47         uint32_t AUX_SW_STATUS;
48         uint32_t AUXN_IMPCAL;
49         uint32_t AUXP_IMPCAL;
50
51         uint32_t AUX_RESET_MASK;
52 };
53
54 struct aux_engine_dce110 {
55         struct aux_engine base;
56         const struct dce110_aux_registers *regs;
57         struct {
58                 uint32_t aux_control;
59                 uint32_t aux_arb_control;
60                 uint32_t aux_sw_data;
61                 uint32_t aux_sw_control;
62                 uint32_t aux_interrupt_control;
63                 uint32_t aux_sw_status;
64         } addr;
65         uint32_t timeout_period;
66 };
67
68 struct aux_engine_dce110_init_data {
69         uint32_t engine_id;
70         uint32_t timeout_period;
71         struct dc_context *ctx;
72         const struct dce110_aux_registers *regs;
73 };
74
75 struct aux_engine *dal_aux_engine_dce110_create(
76         const struct aux_engine_dce110_init_data *aux_init_data);
77
78 #endif