Aravind Venkateswaran | 3111984 | 2015-01-13 14:46:04 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -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 |
| 5 | * are 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 copyright |
| 9 | * notice, this list of conditions and the following disclaimer in |
| 10 | * the documentation and/or other materials provided with the |
| 11 | * distribution. |
| 12 | * * Neither the name of The Linux Foundation nor the names of its |
| 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 19 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 20 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 22 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 23 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 24 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 26 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 | * SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | #ifndef _PANEL_H_ |
| 31 | #define _PANEL_H_ |
| 32 | |
| 33 | /*---------------------------------------------------------------------------*/ |
| 34 | /* HEADER files */ |
| 35 | /*---------------------------------------------------------------------------*/ |
| 36 | #include <debug.h> |
| 37 | #include <smem.h> |
| 38 | |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 39 | #define TOTAL_RESET_GPIO_CTRL 5 |
| 40 | |
Vineet Bajaj | feef0a9 | 2015-04-29 17:09:44 +0530 | [diff] [blame] | 41 | #define ADV7533_MAIN (0x39) |
| 42 | #define ADV7533_CEC_DSI (0x3c) |
| 43 | |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 44 | /*---------------------------------------------------------------------------*/ |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 45 | /* panel type */ |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 46 | /*---------------------------------------------------------------------------*/ |
| 47 | enum { |
| 48 | PANEL_TYPE_UNKNOWN, |
| 49 | PANEL_TYPE_DSI, |
| 50 | PANEL_TYPE_EDP, |
| 51 | PANEL_TYPE_HDMI |
| 52 | }; |
| 53 | |
| 54 | /*---------------------------------------------------------------------------*/ |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 55 | /* Structure definition */ |
| 56 | /*---------------------------------------------------------------------------*/ |
| 57 | |
| 58 | /*Panel Configuration */ |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 59 | struct panel_config{ |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 60 | |
Dhaval Patel | 9f61f13 | 2013-07-18 14:45:11 -0700 | [diff] [blame] | 61 | char *panel_node_id; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 62 | char *panel_controller; |
| 63 | char *panel_compatible; |
| 64 | uint16_t panel_interface; |
| 65 | uint16_t panel_type; |
| 66 | char *panel_destination; |
| 67 | uint32_t panel_orientation; |
Aravind Venkateswaran | 3111984 | 2015-01-13 14:46:04 -0800 | [diff] [blame] | 68 | /* panel_clockrate is deprecated in favor of panel_bitclock_freq */ |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 69 | uint32_t panel_clockrate; |
| 70 | uint16_t panel_framerate; |
| 71 | uint16_t panel_channelid; |
| 72 | uint16_t dsi_virtualchannel_id; |
| 73 | uint16_t panel_broadcast_mode; |
Dhaval Patel | 729aa97 | 2014-01-06 15:20:01 -0800 | [diff] [blame] | 74 | uint16_t panel_lp11_init; |
| 75 | uint16_t panel_init_delay; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 76 | uint16_t dsi_stream; |
| 77 | uint8_t interleave_mode; |
| 78 | uint32_t panel_bitclock_freq; |
| 79 | uint32_t panel_operating_mode; |
| 80 | uint32_t panel_with_enable_gpio; |
Dhaval Patel | 29f2449 | 2013-08-08 20:45:42 -0700 | [diff] [blame] | 81 | uint8_t mode_gpio_state; |
Dhaval Patel | 3f4876a | 2014-01-03 13:33:20 -0800 | [diff] [blame] | 82 | char *slave_panel_node_id; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 83 | }; |
| 84 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 85 | struct panel_resolution{ |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 86 | |
| 87 | uint16_t panel_width; |
| 88 | uint16_t panel_height; |
| 89 | uint16_t hfront_porch; |
| 90 | uint16_t hback_porch; |
| 91 | uint16_t hpulse_width; |
| 92 | uint16_t hsync_skew; |
| 93 | uint16_t vfront_porch; |
| 94 | uint16_t vback_porch; |
| 95 | uint16_t vpulse_width; |
| 96 | uint16_t hleft_border; |
| 97 | uint16_t hright_border; |
| 98 | uint16_t vtop_border; |
| 99 | uint16_t vbottom_border; |
| 100 | uint16_t hactive_res; |
| 101 | uint16_t vactive_res; |
| 102 | uint16_t invert_data_polarity; |
| 103 | uint16_t invert_vsync_polarity; |
| 104 | uint16_t invert_hsync_polarity; |
| 105 | }; |
| 106 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 107 | struct color_info{ |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 108 | uint8_t color_format; |
| 109 | uint8_t color_order; |
| 110 | uint8_t underflow_color; |
| 111 | uint8_t border_color; |
| 112 | uint8_t pixel_packing; |
| 113 | uint8_t pixel_alignment; |
| 114 | }; |
| 115 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 116 | struct command_state { |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 117 | uint8_t oncommand_state; |
| 118 | uint8_t offcommand_state; |
| 119 | }; |
| 120 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 121 | struct videopanel_info { |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 122 | uint8_t hsync_pulse; |
| 123 | uint8_t hfp_power_mode; |
| 124 | uint8_t hbp_power_mode; |
| 125 | uint8_t hsa_power_mode; |
| 126 | uint8_t bllp_eof_power_mode; |
| 127 | uint8_t bllp_power_mode; |
| 128 | uint8_t traffic_mode; |
| 129 | uint8_t dma_delayafter_vsync; |
| 130 | uint32_t bllp_eof_power; |
| 131 | }; |
| 132 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 133 | struct commandpanel_info { |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 134 | uint8_t techeck_enable; |
| 135 | uint8_t tepin_select; |
| 136 | uint8_t teusing_tepin; |
| 137 | uint8_t autorefresh_enable; |
| 138 | uint32_t autorefresh_framenumdiv; |
| 139 | uint32_t tevsync_rdptr_irqline; |
| 140 | uint32_t tevsync_continue_lines; |
| 141 | uint32_t tevsync_startline_divisor; |
| 142 | uint32_t tepercent_variance; |
| 143 | uint8_t tedcs_command; |
| 144 | uint8_t disable_eotafter_hsxfer; |
| 145 | uint32_t cmdmode_idletime; |
| 146 | }; |
| 147 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 148 | struct lane_configuration { |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 149 | uint8_t dsi_lanes; |
| 150 | uint8_t dsi_lanemap; |
| 151 | uint8_t lane0_state; |
| 152 | uint8_t lane1_state; |
| 153 | uint8_t lane2_state; |
| 154 | uint8_t lane3_state; |
Ray Zhang | 0d303af | 2015-01-21 10:17:02 +0800 | [diff] [blame] | 155 | uint8_t force_clk_lane_hs; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 156 | }; |
| 157 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 158 | struct panel_timing { |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 159 | uint8_t dsi_mdp_trigger; |
| 160 | uint8_t dsi_dma_trigger; |
| 161 | uint8_t tclk_post; |
| 162 | uint8_t tclk_pre; |
| 163 | }; |
| 164 | |
rayz | 3c988f0 | 2013-08-13 18:06:39 +0800 | [diff] [blame] | 165 | enum { |
| 166 | BL_PWM = 0, |
| 167 | BL_WLED, |
| 168 | BL_DCS, |
rayz | 3c988f0 | 2013-08-13 18:06:39 +0800 | [diff] [blame] | 169 | }; |
| 170 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 171 | struct panel_reset_sequence { |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 172 | uint8_t pin_state[TOTAL_RESET_GPIO_CTRL]; |
| 173 | uint32_t sleep[TOTAL_RESET_GPIO_CTRL]; |
| 174 | uint8_t pin_direction; |
| 175 | }; |
| 176 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 177 | struct backlight { |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 178 | uint16_t bl_interface_type; |
| 179 | uint16_t bl_min_level; |
| 180 | uint16_t bl_max_level; |
| 181 | uint16_t bl_step; |
| 182 | uint16_t bl_pmic_controltype; |
| 183 | char *bl_pmic_model; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 184 | }; |
| 185 | |
Veera Sundaram Sankaran | 824e6fa | 2014-12-09 11:32:58 -0800 | [diff] [blame] | 186 | struct fb_compression { |
Siddhartha Agrawal | fe64dcb | 2014-10-07 12:41:01 -0700 | [diff] [blame] | 187 | uint32_t enabled; |
| 188 | uint32_t comp_ratio; |
| 189 | uint32_t comp_mode; |
| 190 | uint32_t qerr_enable; |
| 191 | uint32_t cd_bias; |
| 192 | uint32_t pat_enable; |
| 193 | uint32_t vlc_enable; |
| 194 | uint32_t bflc_enable; |
| 195 | |
| 196 | uint32_t line_x_budget; |
| 197 | uint32_t block_x_budget; |
| 198 | uint32_t block_budget; |
| 199 | |
| 200 | uint32_t lossless_mode_thd; |
| 201 | uint32_t lossy_mode_thd; |
| 202 | uint32_t lossy_rgb_thd; |
| 203 | uint32_t lossy_mode_idx; |
Jeevan Shriram | 1b07e37 | 2014-11-30 22:03:50 -0800 | [diff] [blame] | 204 | |
| 205 | uint32_t slice_height; |
| 206 | uint32_t pred_mode; |
| 207 | uint32_t max_pred_err; |
Siddhartha Agrawal | fe64dcb | 2014-10-07 12:41:01 -0700 | [diff] [blame] | 208 | }; |
| 209 | |
Kuogee Hsieh | e0fbc02 | 2015-07-07 10:26:58 -0700 | [diff] [blame] | 210 | struct dsc_parameters { |
| 211 | uint32_t major; |
| 212 | uint32_t minor; |
| 213 | uint32_t pps_id; |
| 214 | uint32_t slice_height; |
| 215 | uint32_t slice_width; |
| 216 | uint32_t bpp; /* target bpp */ |
| 217 | uint32_t bpc; /* target bpc, byte per component */ |
| 218 | uint32_t slice_per_pkt; |
| 219 | uint32_t block_prediction; |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 220 | }; |
| 221 | |
| 222 | struct topology_config { |
| 223 | char *config_name; /* matches with kernel cmdline */ |
| 224 | /* |
| 225 | * lm_split: -ve value means that lm_split is not used. |
| 226 | * If lm_split is used then DUAL_PIPE flag will be added. |
| 227 | */ |
| 228 | int lm_split[2]; |
| 229 | int num_dsc_enc; /* how many encoder to use */ |
| 230 | struct dsc_parameters *dsc; |
Ujwal Patel | 5c3227b | 2015-08-12 14:48:02 -0700 | [diff] [blame] | 231 | int use_pingpong_split; |
Kuogee Hsieh | e0fbc02 | 2015-07-07 10:26:58 -0700 | [diff] [blame] | 232 | }; |
| 233 | |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 234 | #endif /*_PANEL_H_ */ |