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; |
| 102 | }; |
| 103 | |
| 104 | struct mipi_panel_info { |
| 105 | char mode; /* video/cmd */ |
| 106 | char interleave_mode; |
| 107 | char crc_check; |
| 108 | char ecc_check; |
| 109 | char dst_format; /* shared by video and command */ |
| 110 | char num_of_lanes; |
| 111 | char data_lane0; |
| 112 | char data_lane1; |
| 113 | char data_lane2; |
| 114 | char data_lane3; |
| 115 | char dlane_swap; /* data lane swap */ |
| 116 | char rgb_swap; |
| 117 | char b_sel; |
| 118 | char g_sel; |
| 119 | char r_sel; |
| 120 | char rx_eot_ignore; |
| 121 | char tx_eot_append; |
| 122 | char t_clk_post; /* 0xc0, DSI_CLKOUT_TIMING_CTRL */ |
| 123 | char t_clk_pre; /* 0xc0, DSI_CLKOUT_TIMING_CTRL */ |
| 124 | char vc; /* virtual channel */ |
| 125 | struct mipi_dsi_phy_ctrl *dsi_phy_db; |
Siddhartha Agrawal | 3e694ea | 2013-01-23 17:01:31 -0800 | [diff] [blame] | 126 | struct mdss_dsi_phy_ctrl *mdss_dsi_phy_db; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 127 | struct mipi_dsi_cmd *panel_cmds; |
| 128 | int num_of_panel_cmds; |
| 129 | /* video mode */ |
| 130 | char pulse_mode_hsa_he; |
| 131 | char hfp_power_stop; |
| 132 | char hbp_power_stop; |
| 133 | char hsa_power_stop; |
| 134 | char eof_bllp_power_stop; |
| 135 | char bllp_power_stop; |
| 136 | char traffic_mode; |
| 137 | char frame_rate; |
| 138 | /* command mode */ |
| 139 | char interleave_max; |
| 140 | char insert_dcs_cmd; |
| 141 | char wr_mem_continue; |
| 142 | char wr_mem_start; |
| 143 | char te_sel; |
| 144 | char stream; /* 0 or 1 */ |
| 145 | char mdp_trigger; |
| 146 | char dma_trigger; |
| 147 | uint32_t dsi_pclk_rate; |
| 148 | /* The packet-size should not bet changed */ |
| 149 | char no_max_pkt_size; |
| 150 | /* Clock required during LP commands */ |
| 151 | char force_clk_lane_hs; |
Channagoud Kadabi | 539ef72 | 2012-03-29 16:02:50 +0530 | [diff] [blame] | 152 | char lane_swap; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 153 | }; |
| 154 | |
| 155 | enum lvds_mode { |
| 156 | LVDS_SINGLE_CHANNEL_MODE, |
| 157 | LVDS_DUAL_CHANNEL_MODE, |
| 158 | }; |
| 159 | |
| 160 | struct lvds_panel_info { |
| 161 | enum lvds_mode channel_mode; |
| 162 | /* Channel swap in dual mode */ |
| 163 | char channel_swap; |
| 164 | }; |
| 165 | |
| 166 | struct msm_panel_info { |
| 167 | uint32_t xres; |
| 168 | uint32_t yres; |
| 169 | uint32_t bpp; |
| 170 | uint32_t type; |
| 171 | uint32_t wait_cycle; |
| 172 | uint32_t clk_rate; |
| 173 | |
| 174 | struct lcd_panel_info lcd; |
| 175 | struct lcdc_panel_info lcdc; |
| 176 | struct mipi_panel_info mipi; |
| 177 | struct lvds_panel_info lvds; |
Ajay Singh Parmar | 7c1cd52 | 2013-02-13 20:33:49 +0530 | [diff] [blame^] | 178 | struct hdmi_panel_info hdmi; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 179 | |
| 180 | int (*on) (void); |
| 181 | int (*off) (void); |
Amir Samuelov | 2d4ba16 | 2012-07-22 11:53:14 +0300 | [diff] [blame] | 182 | int (*early_config) (void *pdata); |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 183 | int (*config) (void *pdata); |
Channagoud Kadabi | 01c9182 | 2012-06-06 15:53:30 +0530 | [diff] [blame] | 184 | int (*rotate) (void); |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 185 | }; |
| 186 | |
| 187 | struct msm_fb_panel_data { |
| 188 | struct msm_panel_info panel_info; |
| 189 | struct fbcon_config fb; |
| 190 | int mdp_rev; |
Channagoud Kadabi | 01c9182 | 2012-06-06 15:53:30 +0530 | [diff] [blame] | 191 | int rotate; |
Shashank Mittal | 4bfb2e3 | 2012-04-16 10:56:27 -0700 | [diff] [blame] | 192 | |
| 193 | /* function entry chain */ |
| 194 | int (*power_func) (int enable); |
| 195 | int (*clk_func) (int enable); |
| 196 | }; |
| 197 | |
| 198 | |
| 199 | int msm_display_init(struct msm_fb_panel_data *pdata); |
| 200 | #endif |