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