get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/778607/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 778607,
    "url": "http://patchwork.ozlabs.org/api/patches/778607/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1498015234-12919-3-git-send-email-eric.gao@rock-chips.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1498015234-12919-3-git-send-email-eric.gao@rock-chips.com>",
    "list_archive_url": null,
    "date": "2017-06-21T03:20:33",
    "name": "[U-Boot,v3,2/3] rockchip: video: mipi: Split mipi driver into common and specific parts",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e4531b56608469c9aaa4b2040d10f022f347d230",
    "submitter": {
        "id": 71343,
        "url": "http://patchwork.ozlabs.org/api/people/71343/?format=api",
        "name": null,
        "email": "eric.gao@rock-chips.com"
    },
    "delegate": {
        "id": 1700,
        "url": "http://patchwork.ozlabs.org/api/users/1700/?format=api",
        "username": "ag",
        "first_name": "Anatolij",
        "last_name": "Gustschin",
        "email": "agust@denx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1498015234-12919-3-git-send-email-eric.gao@rock-chips.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/778607/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/778607/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3wsqlB1MMfz9s2s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 21 Jun 2017 13:22:14 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid E5A7AC21C4F; Wed, 21 Jun 2017 03:21:51 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id D78B8C21C73;\n\tWed, 21 Jun 2017 03:21:42 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 4AAAEC21C5C; Wed, 21 Jun 2017 03:21:26 +0000 (UTC)",
            "from regular1.263xmail.com (regular1.263xmail.com [211.150.99.138])\n\tby lists.denx.de (Postfix) with ESMTPS id 92E51C21C88\n\tfor <u-boot@lists.denx.de>; Wed, 21 Jun 2017 03:21:19 +0000 (UTC)",
            "from eric.gao?rock-chips.com (unknown [192.168.165.252])\n\tby regular1.263xmail.com (Postfix) with ESMTP id 6C1E87A22;\n\tWed, 21 Jun 2017 11:21:14 +0800 (CST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp.263.net (Postfix) with ESMTPA id 808DA42D;\n\tWed, 21 Jun 2017 11:21:09 +0800 (CST)",
            "from localhost (unknown [103.29.142.67])\n\tby smtp.263.net (Postfix) whith ESMTP id 292447I08HE;\n\tWed, 21 Jun 2017 11:21:11 +0800 (CST)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no\n\tversion=3.4.0",
        "X-263anti-spam": "",
        "X-MAIL-GRAY": "0",
        "X-MAIL-DELIVERY": "1",
        "X-ABS-CHECKED": "4",
        "X-RL-SENDER": "eric.gao@rock-chips.com",
        "X-FST-TO": "sjg@chromium.org",
        "X-SENDER-IP": "103.29.142.67",
        "X-LOGIN-NAME": "eric.gao@rock-chips.com",
        "X-UNIQUE-TAG": "<a5ba6b9a9cdc280cc662b3b3ca8dd106>",
        "X-ATTACHMENT-NUM": "0",
        "X-SENDER": "eric.gao@rock-chips.com",
        "X-DNS-TYPE": "0",
        "From": "Eric Gao <eric.gao@rock-chips.com>",
        "To": "sjg@chromium.org",
        "Date": "Wed, 21 Jun 2017 11:20:33 +0800",
        "Message-Id": "<1498015234-12919-3-git-send-email-eric.gao@rock-chips.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1498015234-12919-1-git-send-email-eric.gao@rock-chips.com>",
        "References": "<1498015234-12919-1-git-send-email-eric.gao@rock-chips.com>",
        "Cc": "u-boot@lists.denx.de, eric.gao@rock-chips.com",
        "Subject": "[U-Boot] [PATCH v3 2/3] rockchip: video: mipi: Split mipi driver\n\tinto common and specific parts",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "To compatible with different rockchip soc, we split the mipi dirver into\ncommon and soc specific parts, and all the soc share the common\nfunctions from common driver part.\n\nSigned-off-by: Eric Gao <eric.gao@rock-chips.com>\n\n---\n\nChanges in v2:\n-Use dev_read_addr to replace devfdt_get_addr.\n\nChanges in v1:\n-Delete the unused variable.\n\n drivers/video/rockchip/rk3399_mipi.c | 183 +++++++++++++++++++++++++++++++++++\n drivers/video/rockchip/rk_mipi.c     | 170 ++------------------------------\n drivers/video/rockchip/rk_mipi.h     |  32 ++++++\n 3 files changed, 221 insertions(+), 164 deletions(-)\n create mode 100644 drivers/video/rockchip/rk3399_mipi.c\n create mode 100644 drivers/video/rockchip/rk_mipi.h",
    "diff": "diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c\nnew file mode 100644\nindex 0000000..c1690bd\n--- /dev/null\n+++ b/drivers/video/rockchip/rk3399_mipi.c\n@@ -0,0 +1,183 @@\n+/*\n+ * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd\n+ * Author: Eric Gao <eric.gao@rock-chips.com>\n+ *\n+ * SPDX-License-Identifier: GPL-2.0+\n+ */\n+\n+#include <common.h>\n+#include <clk.h>\n+#include <display.h>\n+#include <dm.h>\n+#include <fdtdec.h>\n+#include <panel.h>\n+#include <regmap.h>\n+#include \"rk_mipi.h\"\n+#include <syscon.h>\n+#include <asm/gpio.h>\n+#include <asm/hardware.h>\n+#include <asm/io.h>\n+#include <dm/uclass-internal.h>\n+#include <linux/kernel.h>\n+#include <asm/arch/clock.h>\n+#include <asm/arch/cru_rk3399.h>\n+#include <asm/arch/grf_rk3399.h>\n+#include <asm/arch/rockchip_mipi_dsi.h>\n+\n+DECLARE_GLOBAL_DATA_PTR;\n+\n+/* Select mipi dsi source, big or little vop */\n+static int rk_mipi_dsi_source_select(struct udevice *dev)\n+{\n+\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n+\tstruct rk3399_grf_regs *grf = priv->grf;\n+\tstruct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);\n+\n+\t/* Select the video source */\n+\tswitch (disp_uc_plat->source_id) {\n+\tcase VOP_B:\n+\t\trk_clrsetreg(&grf->soc_con20, GRF_DSI0_VOP_SEL_MASK,\n+\t\t\t     GRF_DSI0_VOP_SEL_B << GRF_DSI0_VOP_SEL_SHIFT);\n+\t\tbreak;\n+\tcase VOP_L:\n+\t\trk_clrsetreg(&grf->soc_con20, GRF_DSI0_VOP_SEL_MASK,\n+\t\t\t     GRF_DSI0_VOP_SEL_L << GRF_DSI0_VOP_SEL_SHIFT);\n+\t\tbreak;\n+\tdefault:\n+\t\tdebug(\"%s: Invalid VOP id\\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/* Setup mipi dphy working mode */\n+static void rk_mipi_dphy_mode_set(struct udevice *dev)\n+{\n+\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n+\tstruct rk3399_grf_regs *grf = priv->grf;\n+\tint val;\n+\n+\t/* Set Controller as TX mode */\n+\tval = GRF_DPHY_TX0_RXMODE_DIS << GRF_DPHY_TX0_RXMODE_SHIFT;\n+\trk_clrsetreg(&grf->soc_con22, GRF_DPHY_TX0_RXMODE_MASK, val);\n+\n+\t/* Exit tx stop mode */\n+\tval |= GRF_DPHY_TX0_TXSTOPMODE_DIS << GRF_DPHY_TX0_TXSTOPMODE_SHIFT;\n+\trk_clrsetreg(&grf->soc_con22, GRF_DPHY_TX0_TXSTOPMODE_MASK, val);\n+\n+\t/* Disable turnequest */\n+\tval |= GRF_DPHY_TX0_TURNREQUEST_DIS << GRF_DPHY_TX0_TURNREQUEST_SHIFT;\n+\trk_clrsetreg(&grf->soc_con22, GRF_DPHY_TX0_TURNREQUEST_MASK, val);\n+}\n+\n+/*\n+ * This function is called by rk_display_init() using rk_mipi_dsi_enable() and\n+ * rk_mipi_phy_enable() to initialize mipi controller and dphy. If success,\n+ * enable backlight.\n+ */\n+static int rk_display_enable(struct udevice *dev, int panel_bpp,\n+\t\t\t  const struct display_timing *timing)\n+{\n+\tint ret;\n+\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n+\n+\t/* Fill the mipi controller parameter */\n+\tpriv->ref_clk = 24 * MHz;\n+\tpriv->sys_clk = priv->ref_clk;\n+\tpriv->pix_clk = timing->pixelclock.typ;\n+\tpriv->phy_clk = priv->pix_clk * 6;\n+\tpriv->txbyte_clk = priv->phy_clk / 8;\n+\tpriv->txesc_clk = 20 * MHz;\n+\n+\t/* Select vop port, big or little */\n+\trk_mipi_dsi_source_select(dev);\n+\n+\t/* Set mipi dphy work mode */\n+\trk_mipi_dphy_mode_set(dev);\n+\n+\t/* Config  and enable mipi dsi according to timing */\n+\tret = rk_mipi_dsi_enable(dev, timing);\n+\tif (ret) {\n+\t\tdebug(\"%s: rk_mipi_dsi_enable() failed (err=%d)\\n\",\n+\t\t      __func__, ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* Config and enable mipi phy */\n+\tret = rk_mipi_phy_enable(dev);\n+\tif (ret) {\n+\t\tdebug(\"%s: rk_mipi_phy_enable() failed (err=%d)\\n\",\n+\t\t      __func__, ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* Enable backlight */\n+\tret = panel_enable_backlight(priv->panel);\n+\tif (ret) {\n+\t\tdebug(\"%s: panel_enable_backlight() failed (err=%d)\\n\",\n+\t\t      __func__, ret);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int rk_mipi_ofdata_to_platdata(struct udevice *dev)\n+{\n+\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n+\n+\tpriv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);\n+\tif (priv->grf <= 0) {\n+\t\tdebug(\"%s: Get syscon grf failed (ret=%p)\\n\",\n+\t\t      __func__, priv->grf);\n+\t\treturn  -ENXIO;\n+\t}\n+\tpriv->regs = dev_read_addr(dev);\n+\tif (priv->regs <= 0) {\n+\t\tdebug(\"%s: Get MIPI dsi address failed (ret=%lu)\\n\", __func__,\n+\t\t      priv->regs);\n+\t\treturn  -ENXIO;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/*\n+ * Probe function: check panel existence and readingit's timing. Then config\n+ * mipi dsi controller and enable it according to the timing parameter.\n+ */\n+static int rk_mipi_probe(struct udevice *dev)\n+{\n+\tint ret;\n+\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n+\n+\tret = uclass_get_device_by_phandle(UCLASS_PANEL, dev, \"rockchip,panel\",\n+\t\t\t\t\t   &priv->panel);\n+\tif (ret) {\n+\t\tdebug(\"%s: Can not find panel (err=%d)\\n\", __func__, ret);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static const struct dm_display_ops rk_mipi_dsi_ops = {\n+\t.read_timing = rk_mipi_read_timing,\n+\t.enable = rk_display_enable,\n+};\n+\n+static const struct udevice_id rk_mipi_dsi_ids[] = {\n+\t{ .compatible = \"rockchip,rk3399_mipi_dsi\" },\n+\t{ }\n+};\n+\n+U_BOOT_DRIVER(rk_mipi_dsi) = {\n+\t.name\t= \"rk_mipi_dsi\",\n+\t.id\t= UCLASS_DISPLAY,\n+\t.of_match = rk_mipi_dsi_ids,\n+\t.ofdata_to_platdata = rk_mipi_ofdata_to_platdata,\n+\t.probe\t= rk_mipi_probe,\n+\t.ops\t= &rk_mipi_dsi_ops,\n+\t.priv_auto_alloc_size   = sizeof(struct rk_mipi_priv),\n+};\ndiff --git a/drivers/video/rockchip/rk_mipi.c b/drivers/video/rockchip/rk_mipi.c\nindex 1199a30..d537755 100644\n--- a/drivers/video/rockchip/rk_mipi.c\n+++ b/drivers/video/rockchip/rk_mipi.c\n@@ -12,6 +12,7 @@\n #include <fdtdec.h>\n #include <panel.h>\n #include <regmap.h>\n+#include \"rk_mipi.h\"\n #include <syscon.h>\n #include <asm/gpio.h>\n #include <asm/hardware.h>\n@@ -22,38 +23,11 @@\n #include <asm/arch/cru_rk3399.h>\n #include <asm/arch/grf_rk3399.h>\n #include <asm/arch/rockchip_mipi_dsi.h>\n-#include <dt-bindings/clock/rk3288-cru.h>\n \n DECLARE_GLOBAL_DATA_PTR;\n \n-/*\n- * Private information for rk mipi\n- *\n- * @regs: mipi controller address\n- * @grf: GRF register\n- * @panel: panel assined by device tree\n- * @ref_clk: reference clock for mipi dsi pll\n- * @sysclk: config clock for mipi dsi register\n- * @pix_clk: pixel clock for vop->dsi data transmission\n- * @phy_clk: mipi dphy output clock\n- * @txbyte_clk: clock for dsi->dphy high speed data transmission\n- * @txesc_clk: clock for tx esc mode\n- */\n-struct rk_mipi_priv {\n-\tuintptr_t regs;\n-\tstruct rk3399_grf_regs *grf;\n-\tstruct udevice *panel;\n-\tstruct mipi_dsi *dsi;\n-\tu32 ref_clk;\n-\tu32 sys_clk;\n-\tu32 pix_clk;\n-\tu32 phy_clk;\n-\tu32 txbyte_clk;\n-\tu32 txesc_clk;\n-};\n-\n-static int rk_mipi_read_timing(struct udevice *dev,\n-\t\t\t       struct display_timing *timing)\n+int rk_mipi_read_timing(struct udevice *dev,\n+\t\t\tstruct display_timing *timing)\n {\n \tint ret;\n \n@@ -102,46 +76,18 @@ static void rk_mipi_dsi_write(uintptr_t regs, u32 reg, u32 val)\n \twritel(dat, addr);\n }\n \n-static int rk_mipi_dsi_enable(struct udevice *dev,\n-\t\t\t      const struct display_timing *timing)\n+int rk_mipi_dsi_enable(struct udevice *dev,\n+\t\t       const struct display_timing *timing)\n {\n \tint node, timing_node;\n \tint val;\n \tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n \tuintptr_t regs = priv->regs;\n-\tstruct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);\n \tu32 txbyte_clk = priv->txbyte_clk;\n \tu32 txesc_clk = priv->txesc_clk;\n \n \ttxesc_clk = txbyte_clk/(txbyte_clk/txesc_clk + 1);\n \n-\t/* Select the video source */\n-\tswitch (disp_uc_plat->source_id) {\n-\tcase VOP_B:\n-\t\trk_clrsetreg(&priv->grf->soc_con20, GRF_DSI0_VOP_SEL_MASK,\n-\t\t\t     GRF_DSI0_VOP_SEL_B << GRF_DSI0_VOP_SEL_SHIFT);\n-\t\t break;\n-\tcase VOP_L:\n-\t\trk_clrsetreg(&priv->grf->soc_con20, GRF_DSI0_VOP_SEL_MASK,\n-\t\t\t     GRF_DSI0_VOP_SEL_L << GRF_DSI0_VOP_SEL_SHIFT);\n-\t\t break;\n-\tdefault:\n-\t\t debug(\"%s: Invalid VOP id\\n\", __func__);\n-\t\t return -EINVAL;\n-\t}\n-\n-\t/* Set Controller as TX mode */\n-\tval = GRF_DPHY_TX0_RXMODE_DIS << GRF_DPHY_TX0_RXMODE_SHIFT;\n-\trk_clrsetreg(&priv->grf->soc_con22, GRF_DPHY_TX0_RXMODE_MASK, val);\n-\n-\t/* Exit tx stop mode */\n-\tval |= GRF_DPHY_TX0_TXSTOPMODE_DIS << GRF_DPHY_TX0_TXSTOPMODE_SHIFT;\n-\trk_clrsetreg(&priv->grf->soc_con22, GRF_DPHY_TX0_TXSTOPMODE_MASK, val);\n-\n-\t/* Disable turnequest */\n-\tval |= GRF_DPHY_TX0_TURNREQUEST_DIS << GRF_DPHY_TX0_TURNREQUEST_SHIFT;\n-\trk_clrsetreg(&priv->grf->soc_con22, GRF_DPHY_TX0_TURNREQUEST_MASK, val);\n-\n \t/* Set Display timing parameter */\n \trk_mipi_dsi_write(regs, VID_HSA_TIME, timing->hsync_len.typ);\n \trk_mipi_dsi_write(regs, VID_HBP_TIME, timing->hback_porch.typ);\n@@ -249,7 +195,7 @@ static void rk_mipi_phy_write(uintptr_t regs, unsigned char test_code,\n  * fsfreqrang value ,cap ,lpf and so on according to the given pix clk rate,\n  * and then enable phy.\n  */\n-static int rk_mipi_phy_enable(struct udevice *dev)\n+int rk_mipi_phy_enable(struct udevice *dev)\n {\n \tint i;\n \tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n@@ -385,107 +331,3 @@ static int rk_mipi_phy_enable(struct udevice *dev)\n \treturn 0;\n }\n \n-/*\n- * This function is called by rk_display_init() using rk_mipi_dsi_enable() and\n- * rk_mipi_phy_enable() to initialize mipi controller and dphy. If success,\n- * enable backlight.\n- */\n-static int rk_display_enable(struct udevice *dev, int panel_bpp,\n-\t\t\t  const struct display_timing *timing)\n-{\n-\tint ret;\n-\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n-\n-\t/* Fill the mipi controller parameter */\n-\tpriv->ref_clk = 24 * MHz;\n-\tpriv->sys_clk = priv->ref_clk;\n-\tpriv->pix_clk = timing->pixelclock.typ;\n-\tpriv->phy_clk = priv->pix_clk * 6;\n-\tpriv->txbyte_clk = priv->phy_clk / 8;\n-\tpriv->txesc_clk = 20 * MHz;\n-\n-\t/* Config  and enable mipi dsi according to timing */\n-\tret = rk_mipi_dsi_enable(dev, timing);\n-\tif (ret) {\n-\t\tdebug(\"%s: rk_mipi_dsi_enable() failed (err=%d)\\n\",\n-\t\t      __func__, ret);\n-\t\treturn ret;\n-\t}\n-\n-\t/* Config and enable mipi phy */\n-\tret = rk_mipi_phy_enable(dev);\n-\tif (ret) {\n-\t\tdebug(\"%s: rk_mipi_phy_enable() failed (err=%d)\\n\",\n-\t\t      __func__, ret);\n-\t\treturn ret;\n-\t}\n-\n-\t/* Enable backlight */\n-\tret = panel_enable_backlight(priv->panel);\n-\tif (ret) {\n-\t\tdebug(\"%s: panel_enable_backlight() failed (err=%d)\\n\",\n-\t\t      __func__, ret);\n-\t\treturn ret;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int rk_mipi_ofdata_to_platdata(struct udevice *dev)\n-{\n-\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n-\n-\tpriv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);\n-\tif (priv->grf <= 0) {\n-\t\tdebug(\"%s: Get syscon grf failed (ret=%p)\\n\",\n-\t\t      __func__, priv->grf);\n-\t\treturn  -ENXIO;\n-\t}\n-\tpriv->regs = devfdt_get_addr(dev);\n-\tif (priv->regs <= 0) {\n-\t\tdebug(\"%s: Get MIPI dsi address failed (ret=%lu)\\n\", __func__,\n-\t\t      priv->regs);\n-\t\treturn  -ENXIO;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-/*\n- * Probe function: check panel existence and readingit's timing. Then config\n- * mipi dsi controller and enable it according to the timing parameter.\n- */\n-static int rk_mipi_probe(struct udevice *dev)\n-{\n-\tint ret;\n-\tstruct rk_mipi_priv *priv = dev_get_priv(dev);\n-\n-\tret = uclass_get_device_by_phandle(UCLASS_PANEL, dev, \"rockchip,panel\",\n-\t\t\t\t\t   &priv->panel);\n-\tif (ret) {\n-\t\tdebug(\"%s: Can not find panel (err=%d)\\n\", __func__, ret);\n-\t\treturn ret;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static const struct dm_display_ops rk_mipi_dsi_ops = {\n-\t.read_timing = rk_mipi_read_timing,\n-\t.enable = rk_display_enable,\n-};\n-\n-static const struct udevice_id rk_mipi_dsi_ids[] = {\n-\t{ .compatible = \"rockchip,rk3399_mipi_dsi\" },\n-\t{ }\n-};\n-\n-U_BOOT_DRIVER(rk_mipi_dsi) = {\n-\t.name\t= \"rk_mipi_dsi\",\n-\t.id\t= UCLASS_DISPLAY,\n-\t.of_match = rk_mipi_dsi_ids,\n-\t.ofdata_to_platdata = rk_mipi_ofdata_to_platdata,\n-\t.probe\t= rk_mipi_probe,\n-\t.ops\t= &rk_mipi_dsi_ops,\n-\t.priv_auto_alloc_size   = sizeof(struct rk_mipi_priv),\n-};\ndiff --git a/drivers/video/rockchip/rk_mipi.h b/drivers/video/rockchip/rk_mipi.h\nnew file mode 100644\nindex 0000000..906aaaa\n--- /dev/null\n+++ b/drivers/video/rockchip/rk_mipi.h\n@@ -0,0 +1,32 @@\n+/*\n+ * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd\n+ * Author: Eric Gao <eric.gao@rock-chips.com>\n+ * SPDX-License-Identifier: GPL-2.0+\n+ */\n+\n+#ifndef __RK_MIPI_H\n+#define __RK_MIPI_H\n+\n+struct rk_mipi_priv {\n+\tvoid __iomem *regs;\n+\tvoid *grf;\n+\tstruct udevice *panel;\n+\tstruct mipi_dsi *dsi;\n+\tu32 ref_clk;\n+\tu32 sys_clk;\n+\tu32 pix_clk;\n+\tu32 phy_clk;\n+\tu32 txbyte_clk;\n+\tu32 txesc_clk;\n+};\n+\n+int rk_mipi_read_timing(struct udevice *dev,\n+\t\t\t       struct display_timing *timing);\n+\n+int rk_mipi_dsi_enable(struct udevice *dev,\n+\t\t\t      const struct display_timing *timing);\n+\n+int rk_mipi_phy_enable(struct udevice *dev);\n+\n+\n+#endif\n",
    "prefixes": [
        "U-Boot",
        "v3",
        "2/3"
    ]
}