tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / drivers / video / sprdfb / dsi_1_21a / mipi_dsih_api.h
1 /**\r
2  * @file mipi_dsih_api.h\r
3  *\r
4  *  Synopsys Inc.\r
5  *  SG DWC PT02\r
6  */\r
7 /*\r
8         The Synopsys Software Driver and documentation (hereinafter "Software")\r
9         is an unsupported proprietary work of Synopsys, Inc. unless otherwise\r
10         expressly agreed to in writing between  Synopsys and you.\r
11 \r
12         The Software IS NOT an item of Licensed Software or Licensed Product under\r
13         any End User Software License Agreement or Agreement for Licensed Product\r
14         with Synopsys or any supplement thereto.  Permission is hereby granted,\r
15         free of charge, to any person obtaining a copy of this software annotated\r
16         with this license and the Software, to deal in the Software without\r
17         restriction, including without limitation the rights to use, copy, modify,\r
18         merge, publish, distribute, sublicense, and/or sell copies of the Software,\r
19         and to permit persons to whom the Software is furnished to do so, subject\r
20         to the following conditions:\r
21 \r
22         The above copyright notice and this permission notice shall be included in\r
23         all copies or substantial portions of the Software.\r
24 \r
25         THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS\r
26         AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
27         IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
28         ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,\r
29         INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
30         (INCLUDING, BUT NOT     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
31         SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
32         CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
33         LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
34         OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\r
35         DAMAGE.\r
36  */\r
37 #ifndef MIPI_DSIH_API_H_\r
38 #define MIPI_DSIH_API_H_\r
39 \r
40 #include "mipi_dsih_local.h"\r
41 \r
42 /* general configuration functions */\r
43 \r
44 dsih_error_t mipi_dsih_open(dsih_ctrl_t * instance);\r
45 \r
46 dsih_error_t mipi_dsih_close(dsih_ctrl_t * instance);\r
47 \r
48 void mipi_dsih_reset_controller(dsih_ctrl_t * instance);\r
49 \r
50 void mipi_dsih_shutdown_controller(dsih_ctrl_t * instance, int shutdown);\r
51 \r
52 void mipi_dsih_reset_phy(dsih_ctrl_t * instance);\r
53 \r
54 void mipi_dsih_shutdown_phy(dsih_ctrl_t * instance, int shutdown);\r
55 \r
56 /* packet handling */\r
57 \r
58 dsih_error_t mipi_dsih_enable_rx(dsih_ctrl_t * instance, int enable);\r
59 \r
60 dsih_error_t mipi_dsih_peripheral_ack(dsih_ctrl_t * instance, int enable);\r
61 \r
62 dsih_error_t mipi_dsih_tear_effect_ack(dsih_ctrl_t * instance, int enable);\r
63 \r
64 dsih_error_t mipi_dsih_eotp_rx(dsih_ctrl_t * instance, int enable);\r
65 \r
66 dsih_error_t mipi_dsih_ecc_rx(dsih_ctrl_t * instance, int enable);\r
67 \r
68 \r
69 dsih_error_t mipi_dsih_eotp_tx(dsih_ctrl_t * instance, int enable);\r
70 \r
71 /* video mode functions */\r
72 \r
73 dsih_error_t mipi_dsih_dpi_video(dsih_ctrl_t * instance, dsih_dpi_video_t * video_params);\r
74 \r
75 void mipi_dsih_allow_return_to_lp(dsih_ctrl_t * instance, int hfp, int hbp, int vactive, int vfp, int vbp, int vsync);\r
76 \r
77 void mipi_dsih_video_mode(dsih_ctrl_t * instance, int en);\r
78 \r
79 /* command mode functions */\r
80 \r
81 dsih_error_t mipi_dsih_dcs_wr_cmd(dsih_ctrl_t * instance, uint8_t vc, uint8_t* params, uint16_t param_length);\r
82 \r
83 dsih_error_t mipi_dsih_gen_wr_cmd(dsih_ctrl_t * instance, uint8_t vc, uint8_t* params, uint16_t param_length);\r
84 \r
85 dsih_error_t mipi_dsih_gen_wr_packet(dsih_ctrl_t * instance, uint8_t vc, uint8_t data_type, uint8_t* params, uint16_t param_length);\r
86 \r
87 uint16_t mipi_dsih_dcs_rd_cmd(dsih_ctrl_t * instance, uint8_t vc, uint8_t command, uint8_t bytes_to_read, uint8_t* read_buffer);\r
88 \r
89 uint16_t mipi_dsih_gen_rd_cmd(dsih_ctrl_t * instance, uint8_t vc, uint8_t* params, uint16_t param_length, uint8_t bytes_to_read, uint8_t* read_buffer);\r
90 \r
91 uint16_t mipi_dsih_gen_rd_packet(dsih_ctrl_t * instance, uint8_t vc, uint8_t data_type, uint8_t msb_byte, uint8_t lsb_byte, uint8_t bytes_to_read, uint8_t* read_buffer);\r
92 \r
93 void mipi_dsih_cmd_mode(dsih_ctrl_t * instance, int en);\r
94 \r
95 int mipi_dsih_active_mode(dsih_ctrl_t * instance);\r
96 \r
97 void mipi_dsih_dcs_cmd_lp_transmission(dsih_ctrl_t * instance, int long_write, int short_write, int short_read);\r
98 \r
99 void mipi_dsih_gen_cmd_lp_transmission(dsih_ctrl_t * instance, int long_write, int short_write, int short_read);\r
100 \r
101 dsih_error_t mipi_dsih_edpi_video(dsih_ctrl_t * instance, dsih_cmd_mode_video_t *video_params, int send_setup_packets);\r
102 \r
103 /* event handling functions */\r
104 \r
105 dsih_error_t mipi_dsih_register_event(dsih_ctrl_t * instance, dsih_event_t event, void (*handler)(dsih_ctrl_t *, void *));\r
106 \r
107 dsih_error_t mipi_dsih_unregister_event(dsih_ctrl_t * instance, dsih_event_t event);\r
108 \r
109 dsih_error_t mipi_dsih_unregister_all_events(dsih_ctrl_t * instance);\r
110 \r
111 void mipi_dsih_event_handler(void * param);\r
112 \r
113 /* PRESP Time outs */\r
114 void mipi_dsih_presp_timeout_low_power_write(dsih_ctrl_t * instance, uint16_t no_of_byte_cycles);\r
115 \r
116 void mipi_dsih_presp_timeout_low_power_read(dsih_ctrl_t * instance, uint16_t no_of_byte_cycles);\r
117 \r
118 void mipi_dsih_presp_timeout_high_speed_write(dsih_ctrl_t * instance, uint16_t no_of_byte_cycles);\r
119 \r
120 void mipi_dsih_presp_timeout_high_speed_read(dsih_ctrl_t * instance, uint16_t no_of_byte_cycles);\r
121 \r
122 void mipi_dsih_presp_timeout_bta(dsih_ctrl_t * instance, uint16_t no_of_byte_cycles);\r
123 \r
124 /* read/write register functions */\r
125 uint32_t mipi_dsih_dump_register_configuration(dsih_ctrl_t * instance, int all, register_config_t *config, uint16_t config_length);\r
126 \r
127 uint32_t mipi_dsih_write_register_configuration(dsih_ctrl_t * instance, register_config_t *config, uint16_t config_length);\r
128 \r
129 uint16_t mipi_dsih_check_dbi_fifos_state(dsih_ctrl_t * instance);\r
130 \r
131 uint16_t mipi_dsih_check_ulpm_mode(dsih_ctrl_t * instance);\r
132 \r
133 #endif /* MIPI_DSIH_API_H_ */\r