blob: 52c06e9fdefb00d537fecd1df5af9e854f4ebb8b [file] [log] [blame]
Duy Truongf3ac7b32013-02-13 01:07:28 -08001/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
Channagoud Kadabi10189fd2012-05-25 13:33:39 +05302 *
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
Channagoud Kadabi10189fd2012-05-25 13:33:39 +053013 * 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 */
29
30#include "mipi_renesas.h"
31
32int mipi_renesas_cmd_fwvga_config(void *pdata)
33{
34 int ret = NO_ERROR;
35
36 struct msm_panel_info *pinfo = (struct msm_panel_info *) pdata;
37
38 if (pinfo == NULL)
39 return ERR_INVALID_ARGS;
40
41 ret = mipi_dsi_cmd_mode_config((pinfo->xres),
42 (pinfo->yres),
43 (pinfo->xres),
44 (pinfo->yres),
45 pinfo->mipi.dst_format,
46 pinfo->mipi.traffic_mode);
47 return ret;
48}
49
50int mipi_renesas_cmd_fwvga_on()
51{
52 int ret = NO_ERROR;
53 return ret;
54}
55
56int mipi_renesas_cmd_fwvga_off()
57{
58 int ret = NO_ERROR;
59 return ret;
60}
61
62static struct mipi_dsi_phy_ctrl dsi_cmd_mode_phy_db = {
63 /* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */
64 {0x03, 0x01, 0x01, 0x00}, /* regulator */
65 /* timing */
66 {0xb9, 0x8e, 0x1f, 0x00, 0x98, 0x9c, 0x22,
67 0x90, 0x18, 0x03, 0x04},
68 {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */
69 {0xbb, 0x02, 0x06, 0x00}, /* strength */
70 /* pll control */
71 {0x00, 0xec, 0x31, 0xd2, 0x00, 0x40, 0x37, 0x62,
72 0x01, 0x0f, 0x07, /* --> Two lane configuration */
73 0x05, 0x14, 0x03, 0x0, 0x0, 0x0, 0x20, 0x0, 0x02, 0x0},
74};
75
76void mipi_renesas_cmd_fwvga_init(struct msm_panel_info *pinfo)
77{
78 if (!pinfo)
79 return;
80
81 pinfo->xres = REN_MIPI_FB_WIDTH;
82 pinfo->yres = REN_MIPI_FB_HEIGHT;
83 pinfo->mipi.num_of_lanes = 2;
84
85 pinfo->type = MIPI_CMD_PANEL;
86 pinfo->wait_cycle = 0;
87 pinfo->bpp = 24;
88
89 pinfo->mipi.mode = DSI_CMD_MODE;
90 pinfo->mipi.traffic_mode = 0;
91 pinfo->mipi.dst_format = 0;
92 pinfo->mipi.dsi_phy_db = &dsi_cmd_mode_phy_db;
93 pinfo->mipi.tx_eot_append = TRUE;
94
95 pinfo->mipi.lane_swap = 1;
96 pinfo->mipi.panel_cmds = renesas_panel_video_mode_cmds;
97 pinfo->mipi.num_of_panel_cmds = ARRAY_SIZE(renesas_panel_video_mode_cmds);
98
99 pinfo->on = mipi_renesas_cmd_fwvga_on;
100 pinfo->off = mipi_renesas_cmd_fwvga_off;
101 pinfo->config = mipi_renesas_cmd_fwvga_config;
102
103 return;
104}
105
106void mipi_renesas_cmd_hvga_init(struct msm_panel_info *pinfo)
107{
108 if (!pinfo)
109 return;
110
111 pinfo->xres = REN_MIPI_FB_WIDTH_HVGA;
112 pinfo->yres = REN_MIPI_FB_HEIGHT_HVGA;
113 pinfo->mipi.num_of_lanes = 1;
114
115 pinfo->type = MIPI_CMD_PANEL;
116 pinfo->wait_cycle = 0;
117 pinfo->bpp = 24;
Channagoud Kadabiebbca342012-06-29 18:14:31 +0530118 pinfo->clk_rate = 499000000;
Channagoud Kadabi10189fd2012-05-25 13:33:39 +0530119
120 pinfo->mipi.mode = DSI_CMD_MODE;
121 pinfo->mipi.traffic_mode = 0;
122 pinfo->mipi.dst_format = 0;
123 pinfo->mipi.dsi_phy_db = &dsi_cmd_mode_phy_db;
124 pinfo->mipi.tx_eot_append = TRUE;
125
126 pinfo->mipi.lane_swap = 1;
127 pinfo->mipi.panel_cmds = renesas_panel_video_mode_cmds;
128 pinfo->mipi.num_of_panel_cmds = ARRAY_SIZE(renesas_panel_video_mode_cmds);
129
130 pinfo->on = mipi_renesas_cmd_fwvga_on;
131 pinfo->off = mipi_renesas_cmd_fwvga_off;
132 pinfo->config = mipi_renesas_cmd_fwvga_config;
133
134 return;
135}