blob: d979645abd8780d1235fa56933d8c166f0fa2938 [file] [log] [blame]
Jayant Shekhar3ecc0f82014-03-27 13:30:41 +05301/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
Kinson Chikfe931032011-07-21 10:01:34 -07002 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * 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
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
Duy Truongf3ac7b32013-02-13 01:07:28 -080012 * * Neither the name of The Linux Foundation nor the names of its
Kinson Chikfe931032011-07-21 10:01:34 -070013 * 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 "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070029#ifndef _PLATFORM_MSM_SHARED_MDP_4_H_
30#define _PLATFORM_MSM_SHARED_MDP_4_H_
31
Kinson Chikfe931032011-07-21 10:01:34 -070032#include <dev/fbcon.h>
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070033#include <msm_panel.h>
Kinson Chikfe931032011-07-21 10:01:34 -070034
35//TODO: Make a global PASS / FAIL define
36#define PASS 0
37#define FAIL 1
38
39#define MDP_OVERLAYPROC0_START REG_MDP(0x00004)
40#define MDP_DMA_P_START REG_MDP(0x0000C)
41#define MDP_DMA_S_START REG_MDP(0x00010)
42#define MDP_AXI_RDMASTER_CONFIG REG_MDP(0x00028)
43#define MDP_AXI_WRMASTER_CONFIG REG_MDP(0x00030)
44#define MDP_DISP_INTF_SEL REG_MDP(0x00038)
45#define MDP_MAX_RD_PENDING_CMD_CONFIG REG_MDP(0x0004C)
46#define MDP_INTR_ENABLE REG_MDP(0x00050)
47#define MDP_DSI_CMD_MODE_ID_MAP REG_MDP(0x000A0)
48#define MDP_DSI_CMD_MODE_TRIGGER_EN REG_MDP(0x000A4)
49#define MDP_OVERLAYPROC0_CFG REG_MDP(0x10004)
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070050#define MDP_OVERLAYPROC0_OPMODE REG_MDP(0x10014)
51#define MDP_LAYERMIXER_IN_CFG REG_MDP(0x10100)
52#define MDP_OVERLAY_REG_FLUSH REG_MDP(0x18000)
53
54#define MDP_RGB1_SRC_SIZE REG_MDP(0x40000)
55#define MDP_RGB1_SRC_XY REG_MDP(0x40004)
56#define MDP_RGB1_OUT_SIZE REG_MDP(0x40008)
57#define MDP_RGB1_OUT_XY REG_MDP(0x4000C)
58#define MDP_RGB1_SRCP0_ADDR REG_MDP(0x40010)
59#define MDP_RGB1_SRCP0_ADDR_1 REG_MDP(0x40014)
60#define MDP_RGB1_SRCP0_ADDR_2 REG_MDP(0x40018)
61#define MDP_RGB1_SRC_YSTRIDE1 REG_MDP(0x40040)
62#define MDP_RGB1_SRC_FORMAT REG_MDP(0x40050)
63#define MDP_RGB1_CONSTANT_COLOR REG_MDP(0x41008)
64
Kinson Chikfe931032011-07-21 10:01:34 -070065#define MDP_DSI_VIDEO_EN REG_MDP(0xE0000)
66#define MDP_DSI_VIDEO_HSYNC_CTL REG_MDP(0xE0004)
67#define MDP_DSI_VIDEO_VSYNC_PERIOD REG_MDP(0xE0008)
68#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH REG_MDP(0xE000C)
69#define MDP_DSI_VIDEO_DISPLAY_HCTL REG_MDP(0xE0010)
70#define MDP_DSI_VIDEO_DISPLAY_V_START REG_MDP(0xE0014)
71#define MDP_DSI_VIDEO_DISPLAY_V_END REG_MDP(0xE0018)
72#define MDP_DSI_VIDEO_ACTIVE_HCTL REG_MDP(0xE001C)
73#define MDP_DSI_VIDEO_BORDER_CLR REG_MDP(0xE0028)
74#define MDP_DSI_VIDEO_HSYNC_SKEW REG_MDP(0xE0030)
75#define MDP_DSI_VIDEO_CTL_POLARITY REG_MDP(0xE0038)
76#define MDP_DSI_VIDEO_TEST_CTL REG_MDP(0xE0034)
77
78#define MDP_TEST_MODE_CLK REG_MDP(0xF0000)
79#define MDP_INTR_STATUS REG_MDP(0x00054)
80
81void mdp_setup_dma_p_video_config(unsigned short pack_pattern,
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070082 unsigned short img_width,
83 unsigned short img_height,
84 unsigned long input_img_addr,
85 unsigned short img_width_full_size,
86 unsigned char ystride);
Kinson Chikfe931032011-07-21 10:01:34 -070087int mdp_setup_dma_p_video_mode(unsigned short disp_width,
Shashank Mittal4bfb2e32012-04-16 10:56:27 -070088 unsigned short disp_height,
89 unsigned short img_width,
90 unsigned short img_height,
91 unsigned short hsync_porch0_fp,
92 unsigned short hsync_porch0_bp,
93 unsigned short vsync_porch0_fp,
94 unsigned short vsync_porch0_bp,
95 unsigned short hsync_width,
96 unsigned short vsync_width,
97 unsigned long input_img_addr,
98 unsigned short img_width_full_size,
99 unsigned short pack_pattern,
100 unsigned char ystride);
Ajay Dudanib01e5062011-12-03 23:23:42 -0800101int mipi_dsi_cmd_config(struct fbcon_config mipi_fb_cfg,
102 unsigned short num_of_lanes);
Kinson Chikfe931032011-07-21 10:01:34 -0700103void mdp_shutdown(void);
104void mdp_disable(void);
105void mdp_start_dma(void);
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700106int mdp_dsi_video_off();
Jayant Shekhar3ecc0f82014-03-27 13:30:41 +0530107int mdp_dsi_video_on(struct msm_panel_info *pinfo);
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700108int mdp_dsi_video_config(struct msm_panel_info *pinfo, struct fbcon_config *fb);
109int mdp_lcdc_config(struct msm_panel_info *pinfo, struct fbcon_config *fb);
110int mdp_lcdc_on();
111int mdp_lcdc_off();
112void mdp_set_revision(int rev);
113int mdp_get_revision();
Asaf Penso6c58a6b2013-07-14 19:57:29 +0300114
115/* defining no-op functions that are implemented only for mdp5 */
116int mdp_edp_config(struct msm_panel_info *pinfo, struct fbcon_config *fb);
Jayant Shekhar3ecc0f82014-03-27 13:30:41 +0530117int mdp_edp_on(struct msm_panel_info *pinfo);
Asaf Penso6c58a6b2013-07-14 19:57:29 +0300118int mdp_edp_off(void);
119
Shashank Mittal4bfb2e32012-04-16 10:56:27 -0700120#endif