diff options
-rw-r--r-- | drivers/video/mxsfb.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 0ddb7b8..5e77024 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -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, ®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); @@ -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); |