From 7ef1d78154fef4f799dbf7de0f3d9679911ffa39 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 15 Feb 2017 17:27:31 +0800 Subject: 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 (cherry picked from commit 85659ea5ee975fa2d5fa7215e17a01f7006c39bf) --- drivers/video/mxsfb.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index fae9d75..4390eda 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -4,6 +4,7 @@ * Copyright (C) 2011-2013 Marek Vasut * * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -29,6 +30,10 @@ #include #endif +#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST +#include +#endif + #define PS2KHZ(ps) (1000000000UL / (ps)) static GraphicDevice panel; @@ -178,6 +183,10 @@ void lcdif_power_down(void) if (!panel.frameAdrs) return; +#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST + mipi_dsi_northwest_shutdown(); +#endif + writel(panel.frameAdrs, ®s->hw_lcdif_cur_buf_reg); writel(panel.frameAdrs, ®s->hw_lcdif_next_buf_reg); writel(LCDIF_CTRL1_VSYNC_EDGE_IRQ, ®s->hw_lcdif_ctrl1_clr); @@ -278,6 +287,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); -- cgit v1.1