blob: 7d6d1e5dfb9941ff7bfc77be730f324f0c6ae7bb [file] [log] [blame]
Siddhartha Agrawal3e694ea2013-01-23 17:01:31 -08001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Shashank Mittal4bfb2e32012-04-16 10:56:27 -07002 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
Siddhartha Agrawal3e694ea2013-01-23 17:01:31 -080012 * * Neither the name of The Linux Foundation nor the names of its
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070013 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29
30#ifndef _PLATFORM_MSM_SHARED_MSM_PANEL_H_
31#define _PLATFORM_MSM_SHARED_MSM_PANEL_H_
32
33#include <stdint.h>
34#include <dev/fbcon.h>
35
36#define TRUE 1
37#define FALSE 0
38
39/* panel type list */
40#define NO_PANEL 0xffff /* No Panel */
41#define MDDI_PANEL 1 /* MDDI */
42#define EBI2_PANEL 2 /* EBI2 */
43#define LCDC_PANEL 3 /* internal LCDC type */
44#define EXT_MDDI_PANEL 4 /* Ext.MDDI */
45#define TV_PANEL 5 /* TV */
46#define HDMI_PANEL 6 /* HDMI TV */
47#define DTV_PANEL 7 /* DTV */
48#define MIPI_VIDEO_PANEL 8 /* MIPI */
49#define MIPI_CMD_PANEL 9 /* MIPI */
50#define WRITEBACK_PANEL 10 /* Wifi display */
51#define LVDS_PANEL 11 /* LVDS */
52
53enum msm_mdp_hw_revision {
54 MDP_REV_20 = 1,
55 MDP_REV_22,
56 MDP_REV_30,
57 MDP_REV_303,
58 MDP_REV_31,
59 MDP_REV_40,
60 MDP_REV_41,
61 MDP_REV_42,
62 MDP_REV_43,
63 MDP_REV_44,
Siddhartha Agrawal7e2e2152013-01-23 17:06:58 -080064 MDP_REV_50,
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070065};
66
67/* panel info type */
68struct lcd_panel_info {
69 uint32_t vsync_enable;
70 uint32_t refx100;
71 uint32_t v_back_porch;
72 uint32_t v_front_porch;
73 uint32_t v_pulse_width;
74 uint32_t hw_vsync_mode;
75 uint32_t vsync_notifier_period;
76 uint32_t rev;
77};
78
Ajay Singh Parmar7c1cd522013-02-13 20:33:49 +053079struct hdmi_panel_info {
80 uint32_t h_back_porch;
81 uint32_t h_front_porch;
82 uint32_t h_pulse_width;
83 uint32_t v_back_porch;
84 uint32_t v_front_porch;
85 uint32_t v_pulse_width;
86};
87
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070088struct lcdc_panel_info {
89 uint32_t h_back_porch;
90 uint32_t h_front_porch;
91 uint32_t h_pulse_width;
92 uint32_t v_back_porch;
93 uint32_t v_front_porch;
94 uint32_t v_pulse_width;
95 uint32_t border_clr;
96 uint32_t underflow_clr;
97 uint32_t hsync_skew;
98 /* Pad width */
99 uint32_t xres_pad;
100 /* Pad height */
101 uint32_t yres_pad;
Siddhartha Agrawal547ce4a2013-05-23 14:10:43 -0700102 uint8_t dual_pipe;
Siddhartha Agrawal6ef1e222013-06-12 18:24:58 -0700103 uint8_t pipe_swap;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700104};
105
106struct mipi_panel_info {
107 char mode; /* video/cmd */
108 char interleave_mode;
Arpita Banerjeef1a8ac92013-05-21 10:09:35 -0700109 int eof_bllp_power;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700110 char crc_check;
111 char ecc_check;
112 char dst_format; /* shared by video and command */
113 char num_of_lanes;
114 char data_lane0;
115 char data_lane1;
116 char data_lane2;
117 char data_lane3;
118 char dlane_swap; /* data lane swap */
119 char rgb_swap;
120 char b_sel;
121 char g_sel;
122 char r_sel;
123 char rx_eot_ignore;
124 char tx_eot_append;
125 char t_clk_post; /* 0xc0, DSI_CLKOUT_TIMING_CTRL */
126 char t_clk_pre; /* 0xc0, DSI_CLKOUT_TIMING_CTRL */
127 char vc; /* virtual channel */
128 struct mipi_dsi_phy_ctrl *dsi_phy_db;
Siddhartha Agrawal3e694ea2013-01-23 17:01:31 -0800129 struct mdss_dsi_phy_ctrl *mdss_dsi_phy_db;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700130 struct mipi_dsi_cmd *panel_cmds;
131 int num_of_panel_cmds;
132 /* video mode */
133 char pulse_mode_hsa_he;
134 char hfp_power_stop;
135 char hbp_power_stop;
136 char hsa_power_stop;
137 char eof_bllp_power_stop;
138 char bllp_power_stop;
139 char traffic_mode;
140 char frame_rate;
141 /* command mode */
142 char interleave_max;
143 char insert_dcs_cmd;
144 char wr_mem_continue;
145 char wr_mem_start;
146 char te_sel;
147 char stream; /* 0 or 1 */
148 char mdp_trigger;
149 char dma_trigger;
150 uint32_t dsi_pclk_rate;
151 /* The packet-size should not bet changed */
152 char no_max_pkt_size;
153 /* Clock required during LP commands */
154 char force_clk_lane_hs;
Channagoud Kadabi539ef722012-03-29 16:02:50 +0530155 char lane_swap;
Siddhartha Agrawal547ce4a2013-05-23 14:10:43 -0700156 uint8_t dual_dsi;
157 uint8_t broadcast;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700158};
159
160enum lvds_mode {
161 LVDS_SINGLE_CHANNEL_MODE,
162 LVDS_DUAL_CHANNEL_MODE,
163};
164
165struct lvds_panel_info {
166 enum lvds_mode channel_mode;
167 /* Channel swap in dual mode */
168 char channel_swap;
169};
170
171struct msm_panel_info {
172 uint32_t xres;
173 uint32_t yres;
174 uint32_t bpp;
175 uint32_t type;
176 uint32_t wait_cycle;
177 uint32_t clk_rate;
Arpita Banerjeef1a8ac92013-05-21 10:09:35 -0700178 uint32_t rotation;
179 uint32_t broadcastmode;
180 char lowpowerstop;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700181
182 struct lcd_panel_info lcd;
183 struct lcdc_panel_info lcdc;
184 struct mipi_panel_info mipi;
185 struct lvds_panel_info lvds;
Ajay Singh Parmar7c1cd522013-02-13 20:33:49 +0530186 struct hdmi_panel_info hdmi;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700187
188 int (*on) (void);
189 int (*off) (void);
Amir Samuelov2d4ba162012-07-22 11:53:14 +0300190 int (*early_config) (void *pdata);
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700191 int (*config) (void *pdata);
Channagoud Kadabi01c91822012-06-06 15:53:30 +0530192 int (*rotate) (void);
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700193};
194
195struct msm_fb_panel_data {
196 struct msm_panel_info panel_info;
197 struct fbcon_config fb;
198 int mdp_rev;
Channagoud Kadabi01c91822012-06-06 15:53:30 +0530199 int rotate;
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700200
201 /* function entry chain */
202 int (*power_func) (int enable);
203 int (*clk_func) (int enable);
204};
205
206
207int msm_display_init(struct msm_fb_panel_data *pdata);
208#endif