blob: 0350885a43519c4c4802640afe1cdce8a635a326 [file] [log] [blame]
Dhaval Patel0f0c5e62014-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/*---------------------------------------------------------------------------*/
42/* Structure definition */
43/*---------------------------------------------------------------------------*/
44
45/*Panel Configuration */
46typedef struct panel_config{
47
Dhaval Patel9f61f132013-07-18 14:45:11 -070048 char *panel_node_id;
Arpita Banerjee841fa062013-05-24 14:59:51 -070049 char *panel_controller;
50 char *panel_compatible;
51 uint16_t panel_interface;
52 uint16_t panel_type;
53 char *panel_destination;
54 uint32_t panel_orientation;
55 uint32_t panel_clockrate;
56 uint16_t panel_framerate;
57 uint16_t panel_channelid;
58 uint16_t dsi_virtualchannel_id;
59 uint16_t panel_broadcast_mode;
Dhaval Patel72cc1932014-01-06 15:20:01 -080060 uint16_t panel_lp11_init;
61 uint16_t panel_init_delay;
Arpita Banerjee841fa062013-05-24 14:59:51 -070062 uint16_t dsi_stream;
63 uint8_t interleave_mode;
64 uint32_t panel_bitclock_freq;
65 uint32_t panel_operating_mode;
66 uint32_t panel_with_enable_gpio;
Dhaval Patel29f24492013-08-08 20:45:42 -070067 uint8_t mode_gpio_state;
Dhaval Patel75c8dd22014-01-03 13:33:20 -080068 char *slave_panel_node_id;
Arpita Banerjee841fa062013-05-24 14:59:51 -070069};
70
71typedef struct panel_resolution{
72
73 uint16_t panel_width;
74 uint16_t panel_height;
75 uint16_t hfront_porch;
76 uint16_t hback_porch;
77 uint16_t hpulse_width;
78 uint16_t hsync_skew;
79 uint16_t vfront_porch;
80 uint16_t vback_porch;
81 uint16_t vpulse_width;
82 uint16_t hleft_border;
83 uint16_t hright_border;
84 uint16_t vtop_border;
85 uint16_t vbottom_border;
86 uint16_t hactive_res;
87 uint16_t vactive_res;
88 uint16_t invert_data_polarity;
89 uint16_t invert_vsync_polarity;
90 uint16_t invert_hsync_polarity;
91};
92
93typedef struct color_info{
94 uint8_t color_format;
95 uint8_t color_order;
96 uint8_t underflow_color;
97 uint8_t border_color;
98 uint8_t pixel_packing;
99 uint8_t pixel_alignment;
100};
101
102typedef struct command_state {
103 uint8_t oncommand_state;
104 uint8_t offcommand_state;
105};
106
107typedef struct videopanel_info {
108 uint8_t hsync_pulse;
109 uint8_t hfp_power_mode;
110 uint8_t hbp_power_mode;
111 uint8_t hsa_power_mode;
112 uint8_t bllp_eof_power_mode;
113 uint8_t bllp_power_mode;
114 uint8_t traffic_mode;
115 uint8_t dma_delayafter_vsync;
116 uint32_t bllp_eof_power;
117};
118
119typedef struct commandpanel_info {
120 uint8_t techeck_enable;
121 uint8_t tepin_select;
122 uint8_t teusing_tepin;
123 uint8_t autorefresh_enable;
124 uint32_t autorefresh_framenumdiv;
125 uint32_t tevsync_rdptr_irqline;
126 uint32_t tevsync_continue_lines;
127 uint32_t tevsync_startline_divisor;
128 uint32_t tepercent_variance;
129 uint8_t tedcs_command;
130 uint8_t disable_eotafter_hsxfer;
131 uint32_t cmdmode_idletime;
132};
133
134typedef struct lane_configuration {
135 uint8_t dsi_lanes;
136 uint8_t dsi_lanemap;
137 uint8_t lane0_state;
138 uint8_t lane1_state;
139 uint8_t lane2_state;
140 uint8_t lane3_state;
141};
142
143typedef struct panel_timing {
144 uint8_t dsi_mdp_trigger;
145 uint8_t dsi_dma_trigger;
146 uint8_t tclk_post;
147 uint8_t tclk_pre;
148};
149
rayz3c988f02013-08-13 18:06:39 +0800150enum {
151 BL_PWM = 0,
152 BL_WLED,
153 BL_DCS,
rayz3c988f02013-08-13 18:06:39 +0800154};
155
Casey Piper5197f932013-08-14 17:27:29 -0700156typedef struct panel_reset_sequence {
157 uint8_t pin_state[TOTAL_RESET_GPIO_CTRL];
158 uint32_t sleep[TOTAL_RESET_GPIO_CTRL];
159 uint8_t pin_direction;
160};
161
Arpita Banerjee841fa062013-05-24 14:59:51 -0700162typedef struct backlight {
163 uint16_t bl_interface_type;
164 uint16_t bl_min_level;
165 uint16_t bl_max_level;
166 uint16_t bl_step;
167 uint16_t bl_pmic_controltype;
168 char *bl_pmic_model;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700169};
170
171#endif /*_PANEL_H_ */