aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/exynos
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-04-15 20:33:12 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-04-16 00:19:00 -0400
commit8affaf5c7698c627b133bfcafd9869ef17faff31 (patch)
treeb8bb79b3f8709ec1fb1d99e100c22711a72ffd23 /drivers/video/exynos
parent8f802da33a842bc9e511d2a9c8259fbee8a6d17e (diff)
video: exynos_dp: add analog and pll control setting
This patch adds analog and pll control setting. This control setting is used for DP TX PHY block to set the values as below. It is beneficial to improve analog characteristics. - TX terminal registor is 50 Ohm. - Reference clock of PHY is 24 MHz. - Power source for TX digital logic is 1.0625 V. - Power source for internal clock driver is 1.0625 V. - PLL VCO range setting is 600 uA. - Power down ring osc is turned off. - AUX terminal resistor is 50 Ohm. - AUX channel current is 8 mA and multiplied by 2. - TX channel output amplitude is 400 mV. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/exynos')
-rw-r--r--drivers/video/exynos/exynos_dp_core.h1
-rw-r--r--drivers/video/exynos/exynos_dp_reg.c23
-rw-r--r--drivers/video/exynos/exynos_dp_reg.h29
3 files changed, 53 insertions, 0 deletions
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 90ceaca0fa24..519c3a6a5c58 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -39,6 +39,7 @@ struct exynos_dp_device {
39void exynos_dp_enable_video_mute(struct exynos_dp_device *dp, bool enable); 39void exynos_dp_enable_video_mute(struct exynos_dp_device *dp, bool enable);
40void exynos_dp_stop_video(struct exynos_dp_device *dp); 40void exynos_dp_stop_video(struct exynos_dp_device *dp);
41void exynos_dp_lane_swap(struct exynos_dp_device *dp, bool enable); 41void exynos_dp_lane_swap(struct exynos_dp_device *dp, bool enable);
42void exynos_dp_init_analog_param(struct exynos_dp_device *dp);
42void exynos_dp_init_interrupt(struct exynos_dp_device *dp); 43void exynos_dp_init_interrupt(struct exynos_dp_device *dp);
43void exynos_dp_reset(struct exynos_dp_device *dp); 44void exynos_dp_reset(struct exynos_dp_device *dp);
44void exynos_dp_config_interrupt(struct exynos_dp_device *dp); 45void exynos_dp_config_interrupt(struct exynos_dp_device *dp);
diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
index 169d1810d30c..3863726f5874 100644
--- a/drivers/video/exynos/exynos_dp_reg.c
+++ b/drivers/video/exynos/exynos_dp_reg.c
@@ -65,6 +65,28 @@ void exynos_dp_lane_swap(struct exynos_dp_device *dp, bool enable)
65 writel(reg, dp->reg_base + EXYNOS_DP_LANE_MAP); 65 writel(reg, dp->reg_base + EXYNOS_DP_LANE_MAP);
66} 66}
67 67
68void exynos_dp_init_analog_param(struct exynos_dp_device *dp)
69{
70 u32 reg;
71
72 reg = TX_TERMINAL_CTRL_50_OHM;
73 writel(reg, dp->reg_base + EXYNOS_DP_ANALOG_CTL_1);
74
75 reg = SEL_24M | TX_DVDD_BIT_1_0625V;
76 writel(reg, dp->reg_base + EXYNOS_DP_ANALOG_CTL_2);
77
78 reg = DRIVE_DVDD_BIT_1_0625V | VCO_BIT_600_MICRO;
79 writel(reg, dp->reg_base + EXYNOS_DP_ANALOG_CTL_3);
80
81 reg = PD_RING_OSC | AUX_TERMINAL_CTRL_50_OHM |
82 TX_CUR1_2X | TX_CUR_8_MA;
83 writel(reg, dp->reg_base + EXYNOS_DP_PLL_FILTER_CTL_1);
84
85 reg = CH3_AMP_400_MV | CH2_AMP_400_MV |
86 CH1_AMP_400_MV | CH0_AMP_400_MV;
87 writel(reg, dp->reg_base + EXYNOS_DP_TX_AMP_TUNING_CTL);
88}
89
68void exynos_dp_init_interrupt(struct exynos_dp_device *dp) 90void exynos_dp_init_interrupt(struct exynos_dp_device *dp)
69{ 91{
70 /* Set interrupt pin assertion polarity as high */ 92 /* Set interrupt pin assertion polarity as high */
@@ -131,6 +153,7 @@ void exynos_dp_reset(struct exynos_dp_device *dp)
131 153
132 writel(0x00000101, dp->reg_base + EXYNOS_DP_SOC_GENERAL_CTL); 154 writel(0x00000101, dp->reg_base + EXYNOS_DP_SOC_GENERAL_CTL);
133 155
156 exynos_dp_init_analog_param(dp);
134 exynos_dp_init_interrupt(dp); 157 exynos_dp_init_interrupt(dp);
135} 158}
136 159
diff --git a/drivers/video/exynos/exynos_dp_reg.h b/drivers/video/exynos/exynos_dp_reg.h
index 42f608e2a43e..125b27cd57ae 100644
--- a/drivers/video/exynos/exynos_dp_reg.h
+++ b/drivers/video/exynos/exynos_dp_reg.h
@@ -24,6 +24,12 @@
24 24
25#define EXYNOS_DP_LANE_MAP 0x35C 25#define EXYNOS_DP_LANE_MAP 0x35C
26 26
27#define EXYNOS_DP_ANALOG_CTL_1 0x370
28#define EXYNOS_DP_ANALOG_CTL_2 0x374
29#define EXYNOS_DP_ANALOG_CTL_3 0x378
30#define EXYNOS_DP_PLL_FILTER_CTL_1 0x37C
31#define EXYNOS_DP_TX_AMP_TUNING_CTL 0x380
32
27#define EXYNOS_DP_AUX_HW_RETRY_CTL 0x390 33#define EXYNOS_DP_AUX_HW_RETRY_CTL 0x390
28 34
29#define EXYNOS_DP_COMMON_INT_STA_1 0x3C4 35#define EXYNOS_DP_COMMON_INT_STA_1 0x3C4
@@ -166,6 +172,29 @@
166#define LANE0_MAP_LOGIC_LANE_2 (0x2 << 0) 172#define LANE0_MAP_LOGIC_LANE_2 (0x2 << 0)
167#define LANE0_MAP_LOGIC_LANE_3 (0x3 << 0) 173#define LANE0_MAP_LOGIC_LANE_3 (0x3 << 0)
168 174
175/* EXYNOS_DP_ANALOG_CTL_1 */
176#define TX_TERMINAL_CTRL_50_OHM (0x1 << 4)
177
178/* EXYNOS_DP_ANALOG_CTL_2 */
179#define SEL_24M (0x1 << 3)
180#define TX_DVDD_BIT_1_0625V (0x4 << 0)
181
182/* EXYNOS_DP_ANALOG_CTL_3 */
183#define DRIVE_DVDD_BIT_1_0625V (0x4 << 5)
184#define VCO_BIT_600_MICRO (0x5 << 0)
185
186/* EXYNOS_DP_PLL_FILTER_CTL_1 */
187#define PD_RING_OSC (0x1 << 6)
188#define AUX_TERMINAL_CTRL_50_OHM (0x2 << 4)
189#define TX_CUR1_2X (0x1 << 2)
190#define TX_CUR_8_MA (0x2 << 0)
191
192/* EXYNOS_DP_TX_AMP_TUNING_CTL */
193#define CH3_AMP_400_MV (0x0 << 24)
194#define CH2_AMP_400_MV (0x0 << 16)
195#define CH1_AMP_400_MV (0x0 << 8)
196#define CH0_AMP_400_MV (0x0 << 0)
197
169/* EXYNOS_DP_AUX_HW_RETRY_CTL */ 198/* EXYNOS_DP_AUX_HW_RETRY_CTL */
170#define AUX_BIT_PERIOD_EXPECTED_DELAY(x) (((x) & 0x7) << 8) 199#define AUX_BIT_PERIOD_EXPECTED_DELAY(x) (((x) & 0x7) << 8)
171#define AUX_HW_RETRY_INTERVAL_MASK (0x3 << 3) 200#define AUX_HW_RETRY_INTERVAL_MASK (0x3 << 3)