[U-Boot] [PATCH v2 04/10] clk: Add clk_div_mask helper

Jagan Teki jagan at amarulasolutions.com
Tue Apr 2 11:28:37 UTC 2019


Add clock helper to compute the clock divider mask when use invoke
with clock width.

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 include/clk-uclass.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/clk-uclass.h b/include/clk-uclass.h
index e76d98e2f6..15ac8867a7 100644
--- a/include/clk-uclass.h
+++ b/include/clk-uclass.h
@@ -100,4 +100,6 @@ struct clk_ops {
 	int (*disable)(struct clk *clk);
 };
 
+#define clk_div_mask(width)		((1 << (width)) - 1)
+
 #endif
-- 
2.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list