]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/amba/bus.c
Merge branch 'work.mount3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux.git] / drivers / amba / bus.c
index 100e798a5c82a0651c92cbfdfc77b05c70af8036..f39f075abff9f71bac1f688db5483017957ad88c 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/limits.h>
 #include <linux/clk/clk-conf.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 
 #include <asm/irq.h>
 
@@ -401,6 +402,19 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
        ret = amba_get_enable_pclk(dev);
        if (ret == 0) {
                u32 pid, cid;
+               struct reset_control *rstc;
+
+               /*
+                * Find reset control(s) of the amba bus and de-assert them.
+                */
+               rstc = of_reset_control_array_get_optional_shared(dev->dev.of_node);
+               if (IS_ERR(rstc)) {
+                       if (PTR_ERR(rstc) != -EPROBE_DEFER)
+                               dev_err(&dev->dev, "Can't get amba reset!\n");
+                       return PTR_ERR(rstc);
+               }
+               reset_control_deassert(rstc);
+               reset_control_put(rstc);
 
                /*
                 * Read pid and cid based on size of resource