Siddhartha Agrawal | 3e694ea | 2013-01-23 17:01:31 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 2 | * |
| 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 Agrawal | 3e694ea | 2013-01-23 17:01:31 -0800 | [diff] [blame] | 12 | * * Neither the name of The Linux Foundation nor the names of its |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 13 | * 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 | |
| 53 | enum 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 Agrawal | 7e2e215 | 2013-01-23 17:06:58 -0800 | [diff] [blame] | 64 | MDP_REV_50, |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | /* panel info type */ |
| 68 | struct 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 Parmar | 7c1cd52 | 2013-02-13 20:33:49 +0530 | [diff] [blame] | 79 | struct 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 Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 88 | struct 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 Agrawal | 547ce4a | 2013-05-23 14:10:43 -0700 | [diff] [blame] | 102 | uint8_t dual_pipe; |
Siddhartha Agrawal | 6ef1e22 | 2013-06-12 18:24:58 -0700 | [diff] [blame] | 103 | uint8_t pipe_swap; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | struct mipi_panel_info { |
| 107 | char mode; /* video/cmd */ |
| 108 | char interleave_mode; |
Arpita Banerjee | f1a8ac9 | 2013-05-21 10:09:35 -0700 | [diff] [blame^] | 109 | int eof_bllp_power; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 110 | 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 Agrawal | 3e694ea | 2013-01-23 17:01:31 -0800 | [diff] [blame] | 129 | struct mdss_dsi_phy_ctrl *mdss_dsi_phy_db; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 130 | 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 Kadabi | 539ef72 | 2012-03-29 16:02:50 +0530 | [diff] [blame] | 155 | char lane_swap; |
Siddhartha Agrawal | 547ce4a | 2013-05-23 14:10:43 -0700 | [diff] [blame] | 156 | uint8_t dual_dsi; |
| 157 | uint8_t broadcast; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 158 | }; |
| 159 | |
| 160 | enum lvds_mode { |
| 161 | LVDS_SINGLE_CHANNEL_MODE, |
| 162 | LVDS_DUAL_CHANNEL_MODE, |
| 163 | }; |
| 164 | |
| 165 | struct lvds_panel_info { |
| 166 | enum lvds_mode channel_mode; |
| 167 | /* Channel swap in dual mode */ |
| 168 | char channel_swap; |
| 169 | }; |
| 170 | |
| 171 | struct 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 Banerjee | f1a8ac9 | 2013-05-21 10:09:35 -0700 | [diff] [blame^] | 178 | uint32_t rotation; |
| 179 | uint32_t broadcastmode; |
| 180 | char lowpowerstop; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 181 | |
| 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 Parmar | 7c1cd52 | 2013-02-13 20:33:49 +0530 | [diff] [blame] | 186 | struct hdmi_panel_info hdmi; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 187 | |
| 188 | int (*on) (void); |
| 189 | int (*off) (void); |
Amir Samuelov | 2d4ba16 | 2012-07-22 11:53:14 +0300 | [diff] [blame] | 190 | int (*early_config) (void *pdata); |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 191 | int (*config) (void *pdata); |
Channagoud Kadabi | 01c9182 | 2012-06-06 15:53:30 +0530 | [diff] [blame] | 192 | int (*rotate) (void); |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 193 | }; |
| 194 | |
| 195 | struct msm_fb_panel_data { |
| 196 | struct msm_panel_info panel_info; |
| 197 | struct fbcon_config fb; |
| 198 | int mdp_rev; |
Channagoud Kadabi | 01c9182 | 2012-06-06 15:53:30 +0530 | [diff] [blame] | 199 | int rotate; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 200 | |
| 201 | /* function entry chain */ |
| 202 | int (*power_func) (int enable); |
| 203 | int (*clk_func) (int enable); |
| 204 | }; |
| 205 | |
| 206 | |
| 207 | int msm_display_init(struct msm_fb_panel_data *pdata); |
| 208 | #endif |