blob: c2a158d7282852bbd227f71a74f2e6695401ad84 [file] [log] [blame]
/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "msm_fb.h"
#include "mipi_dsi.h"
#include "mipi_orise.h"
static struct msm_panel_info pinfo;
static struct mipi_dsi_phy_ctrl dsi_cmd_mode_phy_db = {
/* DSI_BIT_CLK at 507MHz, 4 lane, RGB888 */
{0x03, 0x0a, 0x04, 0x00, 0x20},
/* timing */
{0x8c, 0x34, 0x15, 0x00, 0x46, 0x50, 0x1a, 0x38,
0x24, 0x03, 0x04, 0xa0},
/* phy ctrl */
{0x5f, 0x00, 0x00, 0x10},
/* strength */
{0xff, 0x00, 0x06, 0x00},
/* pll control */
{0x0, 0xf9, 0x30, 0xda, 0x00, 0x40, 0x03, 0x62,
0x40, 0x07, 0x03,
0x00, 0x1a, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x01 },
};
static int __init mipi_cmd_orise_720p_pt_init(void)
{
int ret;
if (msm_fb_detect_client("mipi_cmd_orise_720p"))
return 0;
pinfo.xres = 720;
pinfo.yres = 1280;
pinfo.type = MIPI_CMD_PANEL;
pinfo.pdest = DISPLAY_1;
pinfo.wait_cycle = 0;
pinfo.bpp = 24;
pinfo.lcdc.h_back_porch = 160;
pinfo.lcdc.h_front_porch = 160;
pinfo.lcdc.h_pulse_width = 8;
pinfo.lcdc.v_back_porch = 32;
pinfo.lcdc.v_front_porch = 32;
pinfo.lcdc.v_pulse_width = 1;
pinfo.lcdc.border_clr = 0; /* blk */
pinfo.lcdc.underflow_clr = 0xff; /* blue */
pinfo.lcdc.hsync_skew = 0;
pinfo.bl_max = 200;
pinfo.bl_min = 1;
pinfo.fb_num = 2;
pinfo.clk_rate = 507000000;
pinfo.lcd.vsync_enable = TRUE;
pinfo.lcd.hw_vsync_mode = TRUE;
pinfo.lcd.refx100 = 6000; /* adjust refx100 to prevent tearing */
pinfo.lcd.v_back_porch = 32;
pinfo.lcd.v_front_porch = 32;
pinfo.lcd.v_pulse_width = 1;
pinfo.mipi.mode = DSI_CMD_MODE;
pinfo.mipi.dst_format = DSI_CMD_DST_FORMAT_RGB888;
pinfo.mipi.vc = 0;
pinfo.mipi.data_lane0 = TRUE;
pinfo.mipi.data_lane1 = TRUE;
pinfo.mipi.data_lane2 = TRUE;
pinfo.mipi.data_lane3 = TRUE;
pinfo.mipi.t_clk_post = 0x04;
pinfo.mipi.t_clk_pre = 0x1e;
pinfo.mipi.stream = 0; /* dma_p */
pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_NONE;
pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
pinfo.mipi.te_sel = 1; /* TE from vsycn gpio */
pinfo.mipi.interleave_max = 1;
pinfo.mipi.insert_dcs_cmd = TRUE;
pinfo.mipi.wr_mem_continue = 0x3c;
pinfo.mipi.wr_mem_start = 0x2c;
pinfo.mipi.dsi_phy_db = &dsi_cmd_mode_phy_db;
ret = mipi_orise_device_register(&pinfo, MIPI_DSI_PRIM,
MIPI_DSI_PANEL_720P_PT);
if (ret)
pr_err("%s: failed to register device!\n", __func__);
return ret;
}
module_init(mipi_cmd_orise_720p_pt_init);