stm32mp: bsec: manage clock when present in device tree
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Thu, 25 Feb 2021 12:43:07 +0000 (13:43 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Thu, 11 Mar 2021 16:50:10 +0000 (17:50 +0100)
Enable the clocks during bsec probe when they are present in device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/arm/mach-stm32mp/bsec.c

index 88c7aec..fe39bd8 100644 (file)
@@ -6,6 +6,7 @@
 #define LOG_CATEGORY UCLASS_MISC
 
 #include <common.h>
+#include <clk.h>
 #include <dm.h>
 #include <log.h>
 #include <misc.h>
@@ -490,6 +491,15 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 {
        int otp;
        struct stm32mp_bsec_plat *plat;
+       struct clk_bulk clk_bulk;
+       int ret;
+
+       ret = clk_get_bulk(dev, &clk_bulk);
+       if (!ret) {
+               ret = clk_enable_bulk(&clk_bulk);
+               if (ret)
+                       return ret;
+       }
 
        /*
         * update unlocked shadow for OTP cleared by the rom code