blob: 1a328f5cca4d2be0f000b15ae4f92737c5a05266 [file] [log] [blame]
Dhaval Patel3870b862014-01-02 15:26:00 -08001/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Arpita Banerjee841fa062013-05-24 14:59:51 -07002 *
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 Piper5197f932013-08-14 17:27:29 -070039#define TOTAL_RESET_GPIO_CTRL 5
40
Arpita Banerjee841fa062013-05-24 14:59:51 -070041/*---------------------------------------------------------------------------*/
Kuogee Hsieh80b8a6c2014-06-09 17:25:38 -070042/* panel type
43/*---------------------------------------------------------------------------*/
44enum {
45 PANEL_TYPE_UNKNOWN,
46 PANEL_TYPE_DSI,
47 PANEL_TYPE_EDP,
48 PANEL_TYPE_HDMI
49};
50
51/*---------------------------------------------------------------------------*/
Arpita Banerjee841fa062013-05-24 14:59:51 -070052/* Structure definition */
53/*---------------------------------------------------------------------------*/
54
55/*Panel Configuration */
56typedef struct panel_config{
57
Dhaval Patel9f61f132013-07-18 14:45:11 -070058 char *panel_node_id;
Arpita Banerjee841fa062013-05-24 14:59:51 -070059 char *panel_controller;
60 char *panel_compatible;
61 uint16_t panel_interface;
62 uint16_t panel_type;
63 char *panel_destination;
64 uint32_t panel_orientation;
65 uint32_t panel_clockrate;
66 uint16_t panel_framerate;
67 uint16_t panel_channelid;
68 uint16_t dsi_virtualchannel_id;
69 uint16_t panel_broadcast_mode;
Dhaval Patel729aa972014-01-06 15:20:01 -080070 uint16_t panel_lp11_init;
71 uint16_t panel_init_delay;
Arpita Banerjee841fa062013-05-24 14:59:51 -070072 uint16_t dsi_stream;
73 uint8_t interleave_mode;
74 uint32_t panel_bitclock_freq;
75 uint32_t panel_operating_mode;
76 uint32_t panel_with_enable_gpio;
Dhaval Patel29f24492013-08-08 20:45:42 -070077 uint8_t mode_gpio_state;
Dhaval Patel3f4876a2014-01-03 13:33:20 -080078 char *slave_panel_node_id;
Arpita Banerjee841fa062013-05-24 14:59:51 -070079};
80
81typedef struct panel_resolution{
82
83 uint16_t panel_width;
84 uint16_t panel_height;
85 uint16_t hfront_porch;
86 uint16_t hback_porch;
87 uint16_t hpulse_width;
88 uint16_t hsync_skew;
89 uint16_t vfront_porch;
90 uint16_t vback_porch;
91 uint16_t vpulse_width;
92 uint16_t hleft_border;
93 uint16_t hright_border;
94 uint16_t vtop_border;
95 uint16_t vbottom_border;
96 uint16_t hactive_res;
97 uint16_t vactive_res;
98 uint16_t invert_data_polarity;
99 uint16_t invert_vsync_polarity;
100 uint16_t invert_hsync_polarity;
101};
102
103typedef struct color_info{
104 uint8_t color_format;
105 uint8_t color_order;
106 uint8_t underflow_color;
107 uint8_t border_color;
108 uint8_t pixel_packing;
109 uint8_t pixel_alignment;
110};
111
112typedef struct command_state {
113 uint8_t oncommand_state;
114 uint8_t offcommand_state;
115};
116
117typedef struct videopanel_info {
118 uint8_t hsync_pulse;
119 uint8_t hfp_power_mode;
120 uint8_t hbp_power_mode;
121 uint8_t hsa_power_mode;
122 uint8_t bllp_eof_power_mode;
123 uint8_t bllp_power_mode;
124 uint8_t traffic_mode;
125 uint8_t dma_delayafter_vsync;
126 uint32_t bllp_eof_power;
127};
128
129typedef struct commandpanel_info {
130 uint8_t techeck_enable;
131 uint8_t tepin_select;
132 uint8_t teusing_tepin;
133 uint8_t autorefresh_enable;
134 uint32_t autorefresh_framenumdiv;
135 uint32_t tevsync_rdptr_irqline;
136 uint32_t tevsync_continue_lines;
137 uint32_t tevsync_startline_divisor;
138 uint32_t tepercent_variance;
139 uint8_t tedcs_command;
140 uint8_t disable_eotafter_hsxfer;
141 uint32_t cmdmode_idletime;
142};
143
144typedef struct lane_configuration {
145 uint8_t dsi_lanes;
146 uint8_t dsi_lanemap;
147 uint8_t lane0_state;
148 uint8_t lane1_state;
149 uint8_t lane2_state;
150 uint8_t lane3_state;
151};
152
153typedef struct panel_timing {
154 uint8_t dsi_mdp_trigger;
155 uint8_t dsi_dma_trigger;
156 uint8_t tclk_post;
157 uint8_t tclk_pre;
158};
159
rayz3c988f02013-08-13 18:06:39 +0800160enum {
161 BL_PWM = 0,
162 BL_WLED,
163 BL_DCS,
rayz3c988f02013-08-13 18:06:39 +0800164};
165
Casey Piper5197f932013-08-14 17:27:29 -0700166typedef struct panel_reset_sequence {
167 uint8_t pin_state[TOTAL_RESET_GPIO_CTRL];
168 uint32_t sleep[TOTAL_RESET_GPIO_CTRL];
169 uint8_t pin_direction;
170};
171
Arpita Banerjee841fa062013-05-24 14:59:51 -0700172typedef struct backlight {
173 uint16_t bl_interface_type;
174 uint16_t bl_min_level;
175 uint16_t bl_max_level;
176 uint16_t bl_step;
177 uint16_t bl_pmic_controltype;
178 char *bl_pmic_model;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700179};
180
181#endif /*_PANEL_H_ */