Browse Source

MLK-13929-3 video: Update LCDIF driver to support MIPI-DSI

The LCDIF provides video source for MIPI DSI host at DPI-2 interface.
When the LCDIF Framebuffer driver is enabled, it uses the panel
parameters setup by environments to create a panel device and register
it to DSI host driver and then enable the DSI host.

Signed-off-by: Ye Li <ye.li@nxp.com>
imx_v2016.03_4.1.33_7ulp_beta
Ye Li 4 years ago
parent
commit
85659ea5ee
1 changed files with 44 additions and 0 deletions
  1. +44
    -0
      drivers/video/mxsfb.c

+ 44
- 0
drivers/video/mxsfb.c View File

@ -4,6 +4,7 @@
* Copyright (C) 2011-2013 Marek Vasut <marex@denx.de>
*
* Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
* Copyright 2017 NXP
*
* SPDX-License-Identifier: GPL-2.0+
*/
@ -29,6 +30,10 @@
#include <gis.h>
#endif
#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST
#include <mipi_dsi_northwest.h>
#endif
#define PS2KHZ(ps) (1000000000UL / (ps))
static GraphicDevice panel;
@ -175,6 +180,11 @@ void lcdif_power_down(void)
if (check_module_fused(MX6_MODULE_LCDIF))
return;
#endif
#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST
mipi_dsi_northwest_shutdown();
#endif
writel(panel.frameAdrs, &regs->hw_lcdif_cur_buf_reg);
writel(panel.frameAdrs, &regs->hw_lcdif_next_buf_reg);
writel(LCDIF_CTRL1_VSYNC_EDGE_IRQ, &regs->hw_lcdif_ctrl1_clr);
@ -275,6 +285,40 @@ void *video_hw_init(void)
printf("%s\n", panel.modeIdent);
#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST
struct mipi_dsi_northwest_panel_device *pdevice;
/* Setup DSI host driver */
mipi_dsi_northwest_setup(DSI_RBASE, SIM0_RBASE);
#ifdef CONFIG_HX8363
/* Setup hx8363 panel driver */
hx8363_init();
#endif
pdevice = (struct mipi_dsi_northwest_panel_device *)malloc(sizeof(struct mipi_dsi_northwest_panel_device));
if (!pdevice) {
printf("Error allocating MIPI panel device!\n");
free(fb);
return NULL;
}
/* Using the panel parameters to create a DSI panel device */
pdevice->bpp = bpp;
pdevice->data_lane_num = 2;
pdevice->mode = fbmode;
pdevice->name = fbmode.name;
pdevice->virtual_ch_id = 0;
pdevice->host = NULL;
/* Register a panel device */
mipi_dsi_northwest_register_panel_device(pdevice);
/* Enable the MIPI DSI host to work */
mipi_dsi_northwest_enable();
#endif
/* Start framebuffer */
mxs_lcd_init(&panel, &mode, bpp);


Loading…
Cancel
Save