summaryrefslogtreecommitdiff
path: root/include/mipi_dsi_northwest.h
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-02-15 16:34:50 +0800
committerYe Li <ye.li@nxp.com>2018-04-27 02:30:51 -0700
commita4f1e8b67658d4b828d792d5b28cbcf4e7600479 (patch)
tree12b366eb3059476b077a85e67bad2da1e7c0d0f4 /include/mipi_dsi_northwest.h
parent23144983d3347f8f91695cea73aab8558cc66629 (diff)
MLK-13929-1 video: Add MIPI DSI host controller driver for i.MX7ULP
Add the host driver base from kernel for MIPI DSI controller on i.MX7ULP. The controller provides a DPI-2 interface for LCDIF video stream, and a APB interface for packet transmission. The driver provides APIs to register a MIPI panel device and its driver. The panel driver can use the write packet function provided by the host driver to send control packets to panel device via APB interface. MIPI DSI has its PHY and dedicated PLL. The driver will setup them when enabling the DSI host. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit e02115dd1c5d36ec06eabcb5a0b8e09aaf0f29a0) (cherry picked from commit 1e984bba8cd961daa4c5bf994a6a90a72cc2f114)
Diffstat (limited to 'include/mipi_dsi_northwest.h')
-rw-r--r--include/mipi_dsi_northwest.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/include/mipi_dsi_northwest.h b/include/mipi_dsi_northwest.h
new file mode 100644
index 0000000000..8795ede1ef
--- /dev/null
+++ b/include/mipi_dsi_northwest.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+
+#ifndef __MIPI_DSI_NORTHWEST_H
+#define __MIPI_DSI_NORTHWEST_H
+
+#include <linux/fb.h>
+
+#define DSI_CMD_BUF_MAXSIZE (128)
+
+/*
+ * device structure for mipi-dsi based lcd panel.
+ *
+ * @name: name of the device to use with this device,
+ * the name will be used for binding driver.
+ * @mode: video mode parameters for the panel.
+ * @bpp: bits per pixel. only 24 bits is supported.
+ * @virtual_ch_id: virtual channel id for this dsi device.
+ * @data_lane_num: the data lane number, max is 2.
+ * @host: pointer to the host driver instance, will be setup
+ * during register device.
+ */
+struct mipi_dsi_northwest_panel_device {
+ const char *name;
+ struct fb_videomode mode;
+ int bpp;
+ u32 virtual_ch_id;
+ u32 data_lane_num;
+
+ struct mipi_dsi_northwest_info *host;
+};
+
+
+/*
+ * driver structure for mipi-dsi based lcd panel.
+ *
+ * this structure should be registered by lcd panel driver.
+ * mipi-dsi driver seeks lcd panel registered through name field
+ * and calls these callback functions in appropriate time.
+ *
+ * @name: name of the driver to use with this device, or an
+ * alias for that name.
+ * @mipi_panel_setup: callback pointer for initializing lcd panel based on mipi
+ * dsi interface.
+ */
+struct mipi_dsi_northwest_panel_driver {
+ const char *name;
+
+ int (*mipi_panel_setup)(struct mipi_dsi_northwest_panel_device *panel_dev);
+};
+
+/*
+ * mipi-dsi northwest driver information structure, holds useful data for the driver.
+ */
+struct mipi_dsi_northwest_info {
+ u32 mmio_base;
+ u32 sim_base;
+ int enabled;
+ struct mipi_dsi_northwest_panel_device *dsi_panel_dev;
+ struct mipi_dsi_northwest_panel_driver *dsi_panel_drv;
+
+ int (*mipi_dsi_pkt_write)(struct mipi_dsi_northwest_info *mipi_dsi,
+ u8 data_type, const u32 *buf, int len);
+};
+
+/* Setup mipi dsi host driver instance, with base address and SIM address provided */
+int mipi_dsi_northwest_setup(u32 base_addr, u32 sim_addr);
+
+/* Create a LCD panel device, will search the panel driver to bind with them */
+int mipi_dsi_northwest_register_panel_device(struct mipi_dsi_northwest_panel_device *panel_dev);
+
+/* Register a LCD panel driver, will search the panel device to bind with them */
+int mipi_dsi_northwest_register_panel_driver(struct mipi_dsi_northwest_panel_driver *panel_drv);
+
+/* Enable the mipi dsi display */
+int mipi_dsi_northwest_enable(void);
+
+/* Disable and shutdown the mipi dsi display */
+int mipi_dsi_northwest_shutdown(void);
+
+void hx8363_init(void);
+
+#endif