1 /*
2  * Copyright (C) 2012 Samsung Electronics
3  *
4  * Author: Donghwa Lee <dh09.lee@samsung.com>
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #ifndef _EXYNOS_EDP_LOWLEVEL_H
10 #define _EXYNOS_EDP_LOWLEVEL_H
11 
12 void exynos_dp_enable_video_bist(struct exynos_dp *dp_regs,
13 				 unsigned int enable);
14 void exynos_dp_enable_video_mute(struct exynos_dp *dp_regs,
15 				 unsigned int enable);
16 void exynos_dp_reset(struct exynos_dp *dp_regs);
17 void exynos_dp_enable_sw_func(struct exynos_dp *dp_regs, unsigned int enable);
18 unsigned int exynos_dp_set_analog_power_down(struct exynos_dp *dp_regs,
19 					     unsigned int block, u32 enable);
20 unsigned int exynos_dp_get_pll_lock_status(struct exynos_dp *dp_regs);
21 int exynos_dp_init_analog_func(struct exynos_dp *dp_regs);
22 void exynos_dp_init_hpd(struct exynos_dp *dp_regs);
23 void exynos_dp_init_aux(struct exynos_dp *dp_regs);
24 void exynos_dp_config_interrupt(struct exynos_dp *dp_regs);
25 unsigned int exynos_dp_get_plug_in_status(struct exynos_dp *dp_regs);
26 unsigned int exynos_dp_detect_hpd(struct exynos_dp *dp_regs);
27 unsigned int exynos_dp_start_aux_transaction(struct exynos_dp *dp_regs);
28 unsigned int exynos_dp_write_byte_to_dpcd(struct exynos_dp *dp_regs,
29 					  unsigned int reg_addr,
30 					  unsigned char data);
31 unsigned int exynos_dp_read_byte_from_dpcd(struct exynos_dp *dp_regs,
32 					   unsigned int reg_addr,
33 					   unsigned char *data);
34 unsigned int exynos_dp_write_bytes_to_dpcd(struct exynos_dp *dp_regs,
35 					   unsigned int reg_addr,
36 					   unsigned int count,
37 					   unsigned char data[]);
38 unsigned int exynos_dp_read_bytes_from_dpcd(struct exynos_dp *dp_regs,
39 					    unsigned int reg_addr,
40 					    unsigned int count,
41 					    unsigned char data[]);
42 int exynos_dp_select_i2c_device(struct exynos_dp *dp_regs,
43 				unsigned int device_addr,
44 				unsigned int reg_addr);
45 int exynos_dp_read_byte_from_i2c(struct exynos_dp *dp_regs,
46 				 unsigned int device_addr,
47 				 unsigned int reg_addr, unsigned int *data);
48 int exynos_dp_read_bytes_from_i2c(struct exynos_dp *dp_regs,
49 				  unsigned int device_addr,
50 				  unsigned int reg_addr, unsigned int count,
51 				  unsigned char edid[]);
52 void exynos_dp_reset_macro(struct exynos_dp *dp_regs);
53 void exynos_dp_set_link_bandwidth(struct exynos_dp *dp_regs,
54 				  unsigned char bwtype);
55 unsigned char exynos_dp_get_link_bandwidth(struct exynos_dp *dp_regs);
56 void exynos_dp_set_lane_count(struct exynos_dp *dp_regs, unsigned char count);
57 unsigned int exynos_dp_get_lane_count(struct exynos_dp *dp_regs);
58 unsigned char exynos_dp_get_lanex_pre_emphasis(struct exynos_dp *dp_regs,
59 					       unsigned char lanecnt);
60 void exynos_dp_set_lane_pre_emphasis(struct exynos_dp *dp_regs,
61 				     unsigned int level, unsigned char lanecnt);
62 void exynos_dp_set_lanex_pre_emphasis(struct exynos_dp *dp_regs,
63 				      unsigned char request_val,
64 				      unsigned char lanecnt);
65 void exynos_dp_set_training_pattern(struct exynos_dp *dp_regs,
66 				    unsigned int pattern);
67 void exynos_dp_enable_enhanced_mode(struct exynos_dp *dp_regs,
68 				    unsigned char enable);
69 void exynos_dp_enable_scrambling(struct exynos_dp *dp_regs,
70 				 unsigned int enable);
71 int exynos_dp_init_video(struct exynos_dp *dp_regs);
72 void exynos_dp_config_video_slave_mode(struct exynos_dp *dp_regs,
73 				       struct edp_video_info *video_info);
74 void exynos_dp_set_video_color_format(struct exynos_dp *dp_regs,
75 				      struct edp_video_info *video_info);
76 int exynos_dp_config_video_bist(struct exynos_dp *dp_regs,
77 				struct exynos_dp_priv *priv);
78 unsigned int exynos_dp_is_slave_video_stream_clock_on(
79 					struct exynos_dp *dp_regs);
80 void exynos_dp_set_video_cr_mn(struct exynos_dp *dp_regs, unsigned int type,
81 			       unsigned int m_value, unsigned int n_value);
82 void exynos_dp_set_video_timing_mode(struct exynos_dp *dp_regs,
83 				     unsigned int type);
84 void exynos_dp_enable_video_master(struct exynos_dp *dp_regs,
85 				   unsigned int enable);
86 void exynos_dp_start_video(struct exynos_dp *dp_regs);
87 unsigned int exynos_dp_is_video_stream_on(struct exynos_dp *dp_regs);
88 
89 #endif /* _EXYNOS_DP_LOWLEVEL_H */
90