blob: b5361c5bdb534b1a74d9cbc4040b4551879c276a [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/*---------------------------------------------------------------------------*/
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 Patel729aa972014-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;
Arpita Banerjee841fa062013-05-24 14:59:51 -070068};
69
70typedef struct panel_resolution{
71
72 uint16_t panel_width;
73 uint16_t panel_height;
74 uint16_t hfront_porch;
75 uint16_t hback_porch;
76 uint16_t hpulse_width;
77 uint16_t hsync_skew;
78 uint16_t vfront_porch;
79 uint16_t vback_porch;
80 uint16_t vpulse_width;
81 uint16_t hleft_border;
82 uint16_t hright_border;
83 uint16_t vtop_border;
84 uint16_t vbottom_border;
85 uint16_t hactive_res;
86 uint16_t vactive_res;
87 uint16_t invert_data_polarity;
88 uint16_t invert_vsync_polarity;
89 uint16_t invert_hsync_polarity;
90};
91
92typedef struct color_info{
93 uint8_t color_format;
94 uint8_t color_order;
95 uint8_t underflow_color;
96 uint8_t border_color;
97 uint8_t pixel_packing;
98 uint8_t pixel_alignment;
99};
100
101typedef struct command_state {
102 uint8_t oncommand_state;
103 uint8_t offcommand_state;
104};
105
106typedef struct videopanel_info {
107 uint8_t hsync_pulse;
108 uint8_t hfp_power_mode;
109 uint8_t hbp_power_mode;
110 uint8_t hsa_power_mode;
111 uint8_t bllp_eof_power_mode;
112 uint8_t bllp_power_mode;
113 uint8_t traffic_mode;
114 uint8_t dma_delayafter_vsync;
115 uint32_t bllp_eof_power;
116};
117
118typedef struct commandpanel_info {
119 uint8_t techeck_enable;
120 uint8_t tepin_select;
121 uint8_t teusing_tepin;
122 uint8_t autorefresh_enable;
123 uint32_t autorefresh_framenumdiv;
124 uint32_t tevsync_rdptr_irqline;
125 uint32_t tevsync_continue_lines;
126 uint32_t tevsync_startline_divisor;
127 uint32_t tepercent_variance;
128 uint8_t tedcs_command;
129 uint8_t disable_eotafter_hsxfer;
130 uint32_t cmdmode_idletime;
131};
132
133typedef struct lane_configuration {
134 uint8_t dsi_lanes;
135 uint8_t dsi_lanemap;
136 uint8_t lane0_state;
137 uint8_t lane1_state;
138 uint8_t lane2_state;
139 uint8_t lane3_state;
140};
141
142typedef struct panel_timing {
143 uint8_t dsi_mdp_trigger;
144 uint8_t dsi_dma_trigger;
145 uint8_t tclk_post;
146 uint8_t tclk_pre;
147};
148
rayz3c988f02013-08-13 18:06:39 +0800149enum {
150 BL_PWM = 0,
151 BL_WLED,
152 BL_DCS,
rayz3c988f02013-08-13 18:06:39 +0800153};
154
Casey Piper5197f932013-08-14 17:27:29 -0700155typedef struct panel_reset_sequence {
156 uint8_t pin_state[TOTAL_RESET_GPIO_CTRL];
157 uint32_t sleep[TOTAL_RESET_GPIO_CTRL];
158 uint8_t pin_direction;
159};
160
Arpita Banerjee841fa062013-05-24 14:59:51 -0700161typedef struct backlight {
162 uint16_t bl_interface_type;
163 uint16_t bl_min_level;
164 uint16_t bl_max_level;
165 uint16_t bl_step;
166 uint16_t bl_pmic_controltype;
167 char *bl_pmic_model;
Dhaval Patel3870b862014-01-02 15:26:00 -0800168 uint16_t bl_pwm_gpio_num;
169 uint16_t bl_lpg_chan_id;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700170};
171
172#endif /*_PANEL_H_ */