]> git.sur5r.net Git - u-boot/commitdiff
rockchip: clock: update sysreset driver binding
authorKever Yang <kever.yang@rock-chips.com>
Fri, 3 Nov 2017 07:16:13 +0000 (15:16 +0800)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tue, 21 Nov 2017 22:57:23 +0000 (23:57 +0100)
Using priv for new sysreset driver binding.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/clk/rockchip/clk_rk3036.c
drivers/clk/rockchip/clk_rk3188.c
drivers/clk/rockchip/clk_rk322x.c
drivers/clk/rockchip/clk_rk3288.c
drivers/clk/rockchip/clk_rk3328.c
drivers/clk/rockchip/clk_rk3368.c
drivers/clk/rockchip/clk_rk3399.c
drivers/clk/rockchip/clk_rv1108.c

index 83f4ae6ca394f5dad546c9037573f617b614d642..280ebb9ba2e6a0e13844c471ba7fe78b1a0612f3 100644 (file)
@@ -330,11 +330,22 @@ 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);
-       if (ret)
-               debug("Warning: No RK3036 reset driver: ret=%d\n", ret);
+       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;
+       }
 
        return 0;
 }
index 8c2c9bc1d87ca0350977f8e50863a3105d2efdaa..fca6899d8b6ec6164a71bb4ab9dafc789a46cd0f 100644 (file)
@@ -573,11 +573,22 @@ static int rk3188_clk_probe(struct udevice *dev)
 static int rk3188_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, "rk3188_sysreset", "reset", &dev);
-       if (ret)
-               debug("Warning: No rk3188 reset driver: ret=%d\n", ret);
+       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 rk3188_cru,
+                                                   cru_glb_srst_fst_value);
+               priv->glb_srst_snd_value = offsetof(struct rk3188_cru,
+                                                   cru_glb_srst_snd_value);
+               sys_child->priv = priv;
+       }
 
        return 0;
 }
index e87267d239fe4433e3a43f88415ddecb8beb024a..ff52b5522903ea026c779cbc93e4faf9e1234366 100644 (file)
@@ -385,11 +385,22 @@ static int rk322x_clk_probe(struct udevice *dev)
 static int rk322x_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, "rk322x_sysreset", "reset", &dev);
-       if (ret)
-               debug("Warning: No RK322x reset driver: ret=%d\n", ret);
+       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 rk322x_cru,
+                                                   cru_glb_srst_fst_value);
+               priv->glb_srst_snd_value = offsetof(struct rk322x_cru,
+                                                   cru_glb_srst_snd_value);
+               sys_child->priv = priv;
+       }
 
        return 0;
 }
index a133810bf6074416aae264302bab2bb16895c44f..ac53239363c7478bc0d7f86f26f17983437b21ff 100644 (file)
@@ -859,11 +859,22 @@ static int rk3288_clk_probe(struct udevice *dev)
 static int rk3288_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, "rk3288_sysreset", "reset", &dev);
-       if (ret)
-               debug("Warning: No RK3288 reset driver: ret=%d\n", ret);
+       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 rk3288_cru,
+                                                   cru_glb_srst_fst_value);
+               priv->glb_srst_snd_value = offsetof(struct rk3288_cru,
+                                                   cru_glb_srst_snd_value);
+               sys_child->priv = priv;
+       }
 
        return 0;
 }
index 540d9104c3ccba4208b717fe3af4a3344ad67d25..4d522a781647492d4810dda9034b673138c86828 100644 (file)
@@ -597,11 +597,22 @@ static int rk3328_clk_ofdata_to_platdata(struct udevice *dev)
 static int rk3328_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, "rk3328_sysreset", "reset", &dev);
-       if (ret)
-               printf("Warning: No RK3328 reset driver: ret=%d\n", ret);
+       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 rk3328_cru,
+                                                   glb_srst_fst_value);
+               priv->glb_srst_snd_value = offsetof(struct rk3328_cru,
+                                                   glb_srst_snd_value);
+               sys_child->priv = priv;
+       }
 
        return ret;
 }
index 3661769748f20532fec6e1719b3770a995828ad4..bfeef39d2a263f51518e67b9e73de94bed623859 100644 (file)
@@ -526,11 +526,22 @@ static int rk3368_clk_ofdata_to_platdata(struct udevice *dev)
 static int rk3368_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, "rk3368_sysreset", "reset", &dev);
-       if (ret)
-               pr_err("bind RK3368 reset driver failed: ret=%d\n", ret);
+       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 rk3368_cru,
+                                                   glb_srst_fst_val);
+               priv->glb_srst_snd_value = offsetof(struct rk3368_cru,
+                                                   glb_srst_snd_val);
+               sys_child->priv = priv;
+       }
 
        return ret;
 }
index 6f85a38e4193587b2d0a638665ffea41848f451c..e21d056efb24fe45a30dd89ebdc0562821f959b1 100644 (file)
@@ -1033,11 +1033,22 @@ static int rk3399_clk_ofdata_to_platdata(struct udevice *dev)
 static int rk3399_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, "rk3399_sysreset", "reset", &dev);
-       if (ret)
-               printf("Warning: No RK3399 reset driver: ret=%d\n", ret);
+       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 rk3399_cru,
+                                                   glb_srst_fst_value);
+               priv->glb_srst_snd_value = offsetof(struct rk3399_cru,
+                                                   glb_srst_snd_value);
+               sys_child->priv = priv;
+       }
 
        return 0;
 }
index 55741c3a1e23ccde8770fa1c31d07b4d2e12fc51..a1195486a9aafe0c1f9a18a9923a614e81870de4 100644 (file)
@@ -223,11 +223,22 @@ static int rv1108_clk_probe(struct udevice *dev)
 static int rv1108_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, "rv1108_sysreset", "reset", &dev);
-       if (ret)
-               pr_err("No Rv1108 reset driver: ret=%d\n", ret);
+       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 rv1108_cru,
+                                                   glb_srst_fst_val);
+               priv->glb_srst_snd_value = offsetof(struct rv1108_cru,
+                                                   glb_srst_snd_val);
+               sys_child->priv = priv;
+       }
 
        return 0;
 }