summaryrefslogtreecommitdiff
path: root/drivers/video/rockchip/rk_mipi.c
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2020-02-19 09:45:38 +0800
committerKever Yang <kever.yang@rock-chips.com>2020-04-28 18:05:08 +0800
commit653ac184ee8c785564d70ee9ccceffbd9a48b737 (patch)
treef738673872d7777c5ef466f234233a2c856c1da9 /drivers/video/rockchip/rk_mipi.c
parentc3d31af6d6c2cd63d4de173a00a72c7f009e6443 (diff)
rockchip: video: Convert to use APIs which support live DT
Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/rockchip/rk_mipi.c')
-rw-r--r--drivers/video/rockchip/rk_mipi.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/video/rockchip/rk_mipi.c b/drivers/video/rockchip/rk_mipi.c
index a77bdfd24d..f1c21bb8d7 100644
--- a/drivers/video/rockchip/rk_mipi.c
+++ b/drivers/video/rockchip/rk_mipi.c
@@ -8,7 +8,6 @@
#include <clk.h>
#include <display.h>
#include <dm.h>
-#include <fdtdec.h>
#include <panel.h>
#include <regmap.h>
#include "rk_mipi.h"
@@ -76,7 +75,7 @@ static void rk_mipi_dsi_write(uintptr_t regs, u32 reg, u32 val)
int rk_mipi_dsi_enable(struct udevice *dev,
const struct display_timing *timing)
{
- int node, timing_node;
+ ofnode node, timing_node;
int val;
struct rk_mipi_priv *priv = dev_get_priv(dev);
uintptr_t regs = priv->regs;
@@ -119,10 +118,10 @@ int rk_mipi_dsi_enable(struct udevice *dev,
rk_mipi_dsi_write(regs, VID_PKT_SIZE, 0x4b0);
/* Set dpi color coding depth 24 bit */
- timing_node = fdt_subnode_offset(gd->fdt_blob, dev_of_offset(dev),
- "display-timings");
- node = fdt_first_subnode(gd->fdt_blob, timing_node);
- val = fdtdec_get_int(gd->fdt_blob, node, "bits-per-pixel", -1);
+ timing_node = ofnode_find_subnode(dev->node, "display-timings");
+ node = ofnode_first_subnode(timing_node);
+
+ val = ofnode_read_u32_default(node, "bits-per-pixel", -1);
switch (val) {
case 16:
rk_mipi_dsi_write(regs, DPI_COLOR_CODING, DPI_16BIT_CFG_1);