Merge git://git.denx.de/u-boot-video
[oweals/u-boot.git] / drivers / clk / rockchip / clk_rk3036.c
index 83f4ae6ca394f5dad546c9037573f617b614d642..510a00a3aaf32f0a33f54335c2d6bda87f4eb505 100644 (file)
@@ -330,11 +330,29 @@ static int rk3036_clk_probe(struct udevice *dev)
 static int rk3036_clk_bind(struct udevice *dev)
 {
        int ret;
+       struct udevice *sys_child;
+       struct sysreset_reg *priv;
 
        /* The reset driver does not have a device node, so bind it here */
-       ret = device_bind_driver(gd->dm_root, "rk3036_sysreset", "reset", &dev);
+       ret = device_bind_driver(dev, "rockchip_sysreset", "sysreset",
+                                &sys_child);
+       if (ret) {
+               debug("Warning: No sysreset driver: ret=%d\n", ret);
+       } else {
+               priv = malloc(sizeof(struct sysreset_reg));
+               priv->glb_srst_fst_value = offsetof(struct rk3036_cru,
+                                                   cru_glb_srst_fst_value);
+               priv->glb_srst_snd_value = offsetof(struct rk3036_cru,
+                                                   cru_glb_srst_snd_value);
+               sys_child->priv = priv;
+       }
+
+#if CONFIG_IS_ENABLED(CONFIG_RESET_ROCKCHIP)
+       ret = offsetof(struct rk3036_cru, cru_softrst_con[0]);
+       ret = rockchip_reset_bind(dev, ret, 9);
        if (ret)
-               debug("Warning: No RK3036 reset driver: ret=%d\n", ret);
+               debug("Warning: software reset driver bind faile\n");
+#endif
 
        return 0;
 }