]> Git Repo - u-boot.git/blobdiff - drivers/video/rockchip/rk_lvds.c
common: Drop asm/global_data.h from common header
[u-boot.git] / drivers / video / rockchip / rk_lvds.c
index cf5c0439b1ad063c31031f6bf869c0097af1c4bf..9cf3e3ca76885ca38b231a5c15fb6ba19efc4e72 100644 (file)
@@ -7,14 +7,17 @@
 #include <display.h>
 #include <dm.h>
 #include <edid.h>
+#include <log.h>
 #include <panel.h>
 #include <regmap.h>
 #include <syscon.h>
+#include <asm/global_data.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/lvds_rk3288.h>
 #include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/lvds_rk3288.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 #include <dt-bindings/video/rk3288.h>
 
@@ -51,7 +54,7 @@ int rk_lvds_enable(struct udevice *dev, int panel_bpp,
                   const struct display_timing *edid)
 {
        struct rk_lvds_priv *priv = dev_get_priv(dev);
-       struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+       struct display_plat *uc_plat = dev_get_uclass_plat(dev);
        int ret = 0;
        unsigned int val = 0;
 
@@ -160,8 +163,7 @@ int rk_lvds_enable(struct udevice *dev, int panel_bpp,
 
 int rk_lvds_read_timing(struct udevice *dev, struct display_timing *timing)
 {
-       if (fdtdec_decode_display_timing
-           (gd->fdt_blob, dev_of_offset(dev), 0, timing)) {
+       if (ofnode_decode_display_timing(dev_ofnode(dev), 0, timing)) {
                debug("%s: Failed to decode display timing\n", __func__);
                return -EINVAL;
        }
@@ -169,16 +171,14 @@ int rk_lvds_read_timing(struct udevice *dev, struct display_timing *timing)
        return 0;
 }
 
-static int rk_lvds_ofdata_to_platdata(struct udevice *dev)
+static int rk_lvds_of_to_plat(struct udevice *dev)
 {
        struct rk_lvds_priv *priv = dev_get_priv(dev);
-       const void *blob = gd->fdt_blob;
-       int node = dev_of_offset(dev);
        int ret;
-       priv->regs = (void *)devfdt_get_addr(dev);
+       priv->regs = dev_read_addr_ptr(dev);
        priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
 
-       ret = fdtdec_get_int(blob, node, "rockchip,output", -1);
+       ret = dev_read_s32_default(dev, "rockchip,output", -1);
        if (ret != -1) {
                priv->output = ret;
                debug("LVDS output : %d\n", ret);
@@ -187,7 +187,7 @@ static int rk_lvds_ofdata_to_platdata(struct udevice *dev)
                priv->output = LVDS_OUTPUT_RGB;
        }
 
-       ret = fdtdec_get_int(blob, node, "rockchip,data-mapping", -1);
+       ret = dev_read_s32_default(dev, "rockchip,data-mapping", -1);
        if (ret != -1) {
                priv->format = ret;
                debug("LVDS data-mapping : %d\n", ret);
@@ -196,7 +196,7 @@ static int rk_lvds_ofdata_to_platdata(struct udevice *dev)
                priv->format = LVDS_FORMAT_JEIDA;
        }
 
-       ret = fdtdec_get_int(blob, node, "rockchip,data-width", -1);
+       ret = dev_read_s32_default(dev, "rockchip,data-width", -1);
        if (ret != -1) {
                debug("LVDS data-width : %d\n", ret);
                if (ret == 24) {
@@ -246,7 +246,7 @@ U_BOOT_DRIVER(lvds_rockchip) = {
        .id     = UCLASS_DISPLAY,
        .of_match = rockchip_lvds_ids,
        .ops    = &lvds_rockchip_ops,
-       .ofdata_to_platdata     = rk_lvds_ofdata_to_platdata,
+       .of_to_plat     = rk_lvds_of_to_plat,
        .probe  = rk_lvds_probe,
-       .priv_auto_alloc_size   = sizeof(struct rk_lvds_priv),
+       .priv_auto      = sizeof(struct rk_lvds_priv),
 };
This page took 0.025745 seconds and 4 git commands to generate.