Padmanabhan Komanduru | c570f30 | 2018-04-30 09:32:31 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2013-2015, 2018, 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_DISPLAY_H_ |
| 31 | #define _PANEL_DISPLAY_H_ |
| 32 | |
| 33 | /*---------------------------------------------------------------------------*/ |
| 34 | /* MACRO definition */ |
| 35 | /*---------------------------------------------------------------------------*/ |
| 36 | |
| 37 | #define BPP_16 16 |
| 38 | #define BPP_18 18 |
| 39 | #define BPP_24 24 |
| 40 | |
| 41 | #define TIMING_SIZE 48 |
Padmanabhan Komanduru | c570f30 | 2018-04-30 09:32:31 +0530 | [diff] [blame] | 42 | #define TIMING_SIZE_12NM 32 |
Padmanabhan Komanduru | b088f92 | 2014-10-28 23:55:20 +0530 | [diff] [blame] | 43 | #define REGULATOR_SIZE 28 |
Dhaval Patel | ee8675a | 2013-10-25 10:07:57 -0700 | [diff] [blame] | 44 | |
| 45 | #define DUAL_DSI_FLAG 0x1 |
| 46 | #define DUAL_PIPE_FLAG 0x2 |
| 47 | #define PIPE_SWAP_FLAG 0x4 |
| 48 | #define SPLIT_DISPLAY_FLAG 0x8 |
Vineet Bajaj | 4effb13 | 2014-07-24 16:55:41 +0530 | [diff] [blame] | 49 | #define DST_SPLIT_FLAG 0x10 |
Padmanabhan Komanduru | c0766c8 | 2015-04-27 16:39:15 -0700 | [diff] [blame] | 50 | #define USE_DSI1_PLL_FLAG 0x20 |
Dhaval Patel | 551f7f6 | 2014-02-18 17:13:00 -0800 | [diff] [blame] | 51 | |
| 52 | #define MAX_PANEL_ID_LEN 64 |
Siddhartha Agrawal | fe64dcb | 2014-10-07 12:41:01 -0700 | [diff] [blame] | 53 | #include "panel.h" |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 54 | /*---------------------------------------------------------------------------*/ |
| 55 | /* struct definition */ |
| 56 | /*---------------------------------------------------------------------------*/ |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 57 | struct panel_struct { |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 58 | struct panel_config *paneldata; |
| 59 | struct panel_resolution *panelres; |
| 60 | struct color_info *color; |
| 61 | struct videopanel_info *videopanel; |
| 62 | struct commandpanel_info *commandpanel; |
| 63 | struct command_state *state; |
| 64 | struct lane_configuration *laneconfig; |
| 65 | struct panel_timing *paneltiminginfo; |
| 66 | struct panel_reset_sequence *panelresetseq; |
| 67 | struct backlight *backlightinfo; |
Siddhartha Agrawal | fe64dcb | 2014-10-07 12:41:01 -0700 | [diff] [blame] | 68 | struct fb_compression fbcinfo; |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 69 | struct topology_config *config; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 70 | }; |
| 71 | |
Dhaval Patel | 551f7f6 | 2014-02-18 17:13:00 -0800 | [diff] [blame] | 72 | struct panel_list { |
| 73 | char name[MAX_PANEL_ID_LEN]; |
| 74 | uint32_t id; |
| 75 | }; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 76 | |
| 77 | /*---------------------------------------------------------------------------*/ |
| 78 | /* API */ |
| 79 | /*---------------------------------------------------------------------------*/ |
| 80 | int dsi_panel_init(struct msm_panel_info *pinfo, |
| 81 | struct panel_struct *pstruct); |
| 82 | |
Dhaval Patel | b22f1bc | 2013-10-25 13:56:26 -0700 | [diff] [blame] | 83 | int dsi_panel_pre_on(); |
| 84 | int dsi_panel_post_on(); |
| 85 | int dsi_panel_pre_off(); |
| 86 | int dsi_panel_post_off(); |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 87 | int dsi_panel_rotation(); |
| 88 | int dsi_panel_config(void *); |
| 89 | |
| 90 | /* This should be implemented by oem */ |
| 91 | int oem_panel_rotation(); |
| 92 | int oem_panel_on(); |
| 93 | int oem_panel_off(); |
| 94 | |
Dhaval Patel | 551f7f6 | 2014-02-18 17:13:00 -0800 | [diff] [blame] | 95 | /* OEM support API */ |
| 96 | int32_t panel_name_to_id(struct panel_list supp_panels[], |
| 97 | uint32_t supp_panels_size, const char *panel_name); |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 98 | #endif /*_PLATFORM_DISPLAY_H_ */ |