blob: 676bd690e0293c86a10ce8b35aa0411707b6b74f [file] [log] [blame]
Dhaval Patel920d9182014-02-18 17:13: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_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
Dhaval Patelad152092013-10-25 10:07:57 -070042
43#define DUAL_DSI_FLAG 0x1
44#define DUAL_PIPE_FLAG 0x2
45#define PIPE_SWAP_FLAG 0x4
46#define SPLIT_DISPLAY_FLAG 0x8
Dhaval Patel920d9182014-02-18 17:13:00 -080047
48#define MAX_PANEL_ID_LEN 64
Arpita Banerjee841fa062013-05-24 14:59:51 -070049/*---------------------------------------------------------------------------*/
50/* struct definition */
51/*---------------------------------------------------------------------------*/
52typedef struct panel_struct{
Casey Piper5197f932013-08-14 17:27:29 -070053 struct panel_config *paneldata;
54 struct panel_resolution *panelres;
55 struct color_info *color;
56 struct videopanel_info *videopanel;
57 struct commandpanel_info *commandpanel;
58 struct command_state *state;
59 struct lane_configuration *laneconfig;
60 struct panel_timing *paneltiminginfo;
61 struct panel_reset_sequence *panelresetseq;
62 struct backlight *backlightinfo;
Arpita Banerjee841fa062013-05-24 14:59:51 -070063};
64
Dhaval Patel920d9182014-02-18 17:13:00 -080065struct panel_list {
66 char name[MAX_PANEL_ID_LEN];
67 uint32_t id;
68};
Arpita Banerjee841fa062013-05-24 14:59:51 -070069
70/*---------------------------------------------------------------------------*/
71/* API */
72/*---------------------------------------------------------------------------*/
73int dsi_panel_init(struct msm_panel_info *pinfo,
74 struct panel_struct *pstruct);
75
Dhaval Patel430f8ec2013-10-25 13:56:26 -070076int dsi_panel_pre_on();
77int dsi_panel_post_on();
78int dsi_panel_pre_off();
79int dsi_panel_post_off();
Arpita Banerjee841fa062013-05-24 14:59:51 -070080int dsi_panel_rotation();
81int dsi_panel_config(void *);
82
83/* This should be implemented by oem */
84int oem_panel_rotation();
85int oem_panel_on();
86int oem_panel_off();
87
Dhaval Patel920d9182014-02-18 17:13:00 -080088/* OEM support API */
89int32_t panel_name_to_id(struct panel_list supp_panels[],
90 uint32_t supp_panels_size, const char *panel_name);
Arpita Banerjee841fa062013-05-24 14:59:51 -070091#endif /*_PLATFORM_DISPLAY_H_ */