This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MIPI DSI Driver Porting on Android 4.2.1

Hi~

Anybody can help me to port MIPI DSI Hardware driver on Android 4.2.1?

Any porting guide can be reference for me?

I used Pandaboard ES REV B3.

The board is running Android 4.2.1,i refer from http://blog.sola-dolphin-1.net/archives/4334161.html.

The board can display from DVI/HDMI. I can change the LCD display resolution by modify "panel-generic-dpi.c"

Currently i need to light on the Panel with MIPI I/F.

I refer panel-taal.c to create a new driver.

Below is hardware setting for new driver in board-omap4panda.c .

I used menuconfig to add new driver.

Please help to check anything wrong in the setting. I also attach the error log and register dump for your reference. Thanks.

static struct nokia_dsi_panel_data dsi1_panel = {
.name = "MIPI",
.reset_gpio = 102,
.use_ext_te = false,
.ext_te_gpio = 101,
.esd_interval = 0,
//.set_backlight = dsi1_panel_set_backlight,
};

static struct omap_dss_device sdp4430_lcd_device = {
.name = "lcd",
.driver_name = "MIPI",
.type = OMAP_DISPLAY_TYPE_DSI,
.data = &dsi1_panel,
.phy.dsi = {
.clk_lane = 1,
.clk_pol = 0,
.data1_lane = 2,
.data1_pol = 0,
.data2_lane = 3,
.data2_pol = 0,
.data3_lane = 4,
.data3_pol = 0,
.data4_lane = 5,
.data4_pol = 0,
},

.clocks = {
.dispc = {
.channel = {
.lck_div = 1, /* Logic Clock =  MHz */
.pck_div = 2, /* Pixel Clock =  MHz */
.lcd_clk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
},
.dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,

},

.dsi = {
.regn = 32, /* Fint =  MHz */
.regm = 325, /* DDR Clock =  MHz */
.regm_dispc = 6, /* PLL1_CLK1 =  MHz */
.regm_dsi = 6, /* PLL1_CLK2 =  MHz */

.lp_clk_div = 10, /* LP Clock =  MHz *
.dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,
},
},
.ctrl = {
.pixel_size = 24,
},

.channel = OMAP_DSS_CHANNEL_LCD,
};

static void sdp4430_lcd_init(void)
{
u32 reg;
int status;

/* Enable 5 lanes in DSI1 module, disable pull down */
reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
reg &= ~OMAP4_DSI1_LANEENABLE_MASK;
//reg |= 0x7 << OMAP4_DSI1_LANEENABLE_SHIFT;
reg |= 0x1f << OMAP4_DSI1_LANEENABLE_SHIFT;
reg &= ~OMAP4_DSI1_PIPD_MASK;
//reg |= 0x7 << OMAP4_DSI1_PIPD_SHIFT;
reg |= 0x1f << OMAP4_DSI1_PIPD_SHIFT;
omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);

/* Panel Taal reset and backlight GPIO init */
status = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT,
"lcd_reset_gpio");
if (status)
pr_err("%s: Could not get lcd_reset_gpio\n", __func__);

if (dsi1_panel.use_ext_te) {
status = omap_mux_init_signal("gpmc_ncs4.gpio_101",
OMAP_PIN_INPUT_PULLUP);
if (status)
pr_err("%s: Could not get ext_te gpio\n", __func__);
}

status = gpio_request_one(LCD_BL_GPIO, GPIOF_DIR_OUT, "lcd_bl_gpio");
if (status)
pr_err("%s: Could not get lcd_bl_gpio\n", __func__);

gpio_set_value(LCD_BL_GPIO, 0);
}

static struct omap_dss_device *omap4_panda_dss_devices[] = {
 &sdp4430_lcd_device,
&omap4_panda_hdmi_device,
};

static struct omap_dss_board_info omap4_panda_dss_data = {
.num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
.devices = omap4_panda_dss_devices,
 .default_device = &sdp4430_lcd_device,
};

void omap4_panda_display_init(void)
{

sdp4430_lcd_init(); //new for mipi

omap4_panda_hdmi_mux_init();
omap_display_init(&omap4_panda_dss_data);


omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
}