Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
exynos_dp_core.h
Go to the documentation of this file.
1 /*
2  * Header file for Samsung DP (Display Port) interface driver.
3  *
4  * Copyright (C) 2012 Samsung Electronics Co., Ltd.
5  * Author: Jingoo Han <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 2 of the License, or (at your
10  * option) any later version.
11  */
12 
13 #ifndef _EXYNOS_DP_CORE_H
14 #define _EXYNOS_DP_CORE_H
15 
16 struct link_train {
17  int eq_loop;
18  int cr_loop[4];
19 
23 
25 };
26 
28  struct device *dev;
29  struct clk *clock;
30  unsigned int irq;
32 
35 };
36 
37 /* exynos_dp_reg.c */
40 void exynos_dp_lane_swap(struct exynos_dp_device *dp, bool enable);
43 void exynos_dp_reset(struct exynos_dp_device *dp);
50  bool enable);
59  unsigned int reg_addr,
60  unsigned char data);
62  unsigned int reg_addr,
63  unsigned char *data);
65  unsigned int reg_addr,
66  unsigned int count,
67  unsigned char data[]);
69  unsigned int reg_addr,
70  unsigned int count,
71  unsigned char data[]);
73  unsigned int device_addr,
74  unsigned int reg_addr);
76  unsigned int device_addr,
77  unsigned int reg_addr,
78  unsigned int *data);
80  unsigned int device_addr,
81  unsigned int reg_addr,
82  unsigned int count,
83  unsigned char edid[]);
90  enum pattern_set pattern);
109 
114  u32 ycbcr_coeff);
118  u32 m_value,
119  u32 n_value);
125  struct video_info *video_info);
128 
129 /* I2C EDID Chip ID, Slave Address */
130 #define I2C_EDID_DEVICE_ADDR 0x50
131 #define I2C_E_EDID_DEVICE_ADDR 0x30
132 
133 #define EDID_BLOCK_LENGTH 0x80
134 #define EDID_HEADER_PATTERN 0x00
135 #define EDID_EXTENSION_FLAG 0x7e
136 #define EDID_CHECKSUM 0x7f
137 
138 /* Definition for DPCD Register */
139 #define DPCD_ADDR_DPCD_REV 0x0000
140 #define DPCD_ADDR_MAX_LINK_RATE 0x0001
141 #define DPCD_ADDR_MAX_LANE_COUNT 0x0002
142 #define DPCD_ADDR_LINK_BW_SET 0x0100
143 #define DPCD_ADDR_LANE_COUNT_SET 0x0101
144 #define DPCD_ADDR_TRAINING_PATTERN_SET 0x0102
145 #define DPCD_ADDR_TRAINING_LANE0_SET 0x0103
146 #define DPCD_ADDR_LANE0_1_STATUS 0x0202
147 #define DPCD_ADDR_LANE_ALIGN_STATUS_UPDATED 0x0204
148 #define DPCD_ADDR_ADJUST_REQUEST_LANE0_1 0x0206
149 #define DPCD_ADDR_ADJUST_REQUEST_LANE2_3 0x0207
150 #define DPCD_ADDR_TEST_REQUEST 0x0218
151 #define DPCD_ADDR_TEST_RESPONSE 0x0260
152 #define DPCD_ADDR_TEST_EDID_CHECKSUM 0x0261
153 #define DPCD_ADDR_SINK_POWER_STATE 0x0600
154 
155 /* DPCD_ADDR_MAX_LANE_COUNT */
156 #define DPCD_ENHANCED_FRAME_CAP(x) (((x) >> 7) & 0x1)
157 #define DPCD_MAX_LANE_COUNT(x) ((x) & 0x1f)
158 
159 /* DPCD_ADDR_LANE_COUNT_SET */
160 #define DPCD_ENHANCED_FRAME_EN (0x1 << 7)
161 #define DPCD_LANE_COUNT_SET(x) ((x) & 0x1f)
162 
163 /* DPCD_ADDR_TRAINING_PATTERN_SET */
164 #define DPCD_SCRAMBLING_DISABLED (0x1 << 5)
165 #define DPCD_SCRAMBLING_ENABLED (0x0 << 5)
166 #define DPCD_TRAINING_PATTERN_2 (0x2 << 0)
167 #define DPCD_TRAINING_PATTERN_1 (0x1 << 0)
168 #define DPCD_TRAINING_PATTERN_DISABLED (0x0 << 0)
169 
170 /* DPCD_ADDR_TRAINING_LANE0_SET */
171 #define DPCD_MAX_PRE_EMPHASIS_REACHED (0x1 << 5)
172 #define DPCD_PRE_EMPHASIS_SET(x) (((x) & 0x3) << 3)
173 #define DPCD_PRE_EMPHASIS_GET(x) (((x) >> 3) & 0x3)
174 #define DPCD_PRE_EMPHASIS_PATTERN2_LEVEL0 (0x0 << 3)
175 #define DPCD_MAX_SWING_REACHED (0x1 << 2)
176 #define DPCD_VOLTAGE_SWING_SET(x) (((x) & 0x3) << 0)
177 #define DPCD_VOLTAGE_SWING_GET(x) (((x) >> 0) & 0x3)
178 #define DPCD_VOLTAGE_SWING_PATTERN1_LEVEL0 (0x0 << 0)
179 
180 /* DPCD_ADDR_LANE0_1_STATUS */
181 #define DPCD_LANE_SYMBOL_LOCKED (0x1 << 2)
182 #define DPCD_LANE_CHANNEL_EQ_DONE (0x1 << 1)
183 #define DPCD_LANE_CR_DONE (0x1 << 0)
184 #define DPCD_CHANNEL_EQ_BITS (DPCD_LANE_CR_DONE| \
185  DPCD_LANE_CHANNEL_EQ_DONE|\
186  DPCD_LANE_SYMBOL_LOCKED)
187 
188 /* DPCD_ADDR_LANE_ALIGN__STATUS_UPDATED */
189 #define DPCD_LINK_STATUS_UPDATED (0x1 << 7)
190 #define DPCD_DOWNSTREAM_PORT_STATUS_CHANGED (0x1 << 6)
191 #define DPCD_INTERLANE_ALIGN_DONE (0x1 << 0)
192 
193 /* DPCD_ADDR_TEST_REQUEST */
194 #define DPCD_TEST_EDID_READ (0x1 << 2)
195 
196 /* DPCD_ADDR_TEST_RESPONSE */
197 #define DPCD_TEST_EDID_CHECKSUM_WRITE (0x1 << 2)
198 
199 /* DPCD_ADDR_SINK_POWER_STATE */
200 #define DPCD_SET_POWER_STATE_D0 (0x1 << 0)
201 #define DPCD_SET_POWER_STATE_D4 (0x2 << 0)
202 
203 #endif /* _EXYNOS_DP_CORE_H */