forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/drivers/clk/actions/owl-pll.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0+
1
+/* SPDX-License-Identifier: GPL-2.0+ */
22 //
33 // OWL pll clock driver
44 //
....@@ -12,6 +12,8 @@
1212 #define _OWL_PLL_H_
1313
1414 #include "owl-common.h"
15
+
16
+#define OWL_PLL_DEF_DELAY 50
1517
1618 /* last entry should have rate = 0 */
1719 struct clk_pll_table {
....@@ -27,6 +29,7 @@
2729 u8 width;
2830 u8 min_mul;
2931 u8 max_mul;
32
+ u8 delay;
3033 const struct clk_pll_table *table;
3134 };
3235
....@@ -36,7 +39,7 @@
3639 };
3740
3841 #define OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \
39
- _width, _min_mul, _max_mul, _table) \
42
+ _width, _min_mul, _max_mul, _delay, _table) \
4043 { \
4144 .reg = _reg, \
4245 .bfreq = _bfreq, \
....@@ -45,6 +48,7 @@
4548 .width = _width, \
4649 .min_mul = _min_mul, \
4750 .max_mul = _max_mul, \
51
+ .delay = _delay, \
4852 .table = _table, \
4953 }
5054
....@@ -52,8 +56,8 @@
5256 _shift, _width, _min_mul, _max_mul, _table, _flags) \
5357 struct owl_pll _struct = { \
5458 .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \
55
- _width, _min_mul, \
56
- _max_mul, _table), \
59
+ _width, _min_mul, _max_mul, \
60
+ OWL_PLL_DEF_DELAY, _table), \
5761 .common = { \
5862 .regmap = NULL, \
5963 .hw.init = CLK_HW_INIT(_name, \
....@@ -67,8 +71,23 @@
6771 _shift, _width, _min_mul, _max_mul, _table, _flags) \
6872 struct owl_pll _struct = { \
6973 .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \
70
- _width, _min_mul, \
71
- _max_mul, _table), \
74
+ _width, _min_mul, _max_mul, \
75
+ OWL_PLL_DEF_DELAY, _table), \
76
+ .common = { \
77
+ .regmap = NULL, \
78
+ .hw.init = CLK_HW_INIT_NO_PARENT(_name, \
79
+ &owl_pll_ops, \
80
+ _flags), \
81
+ }, \
82
+ }
83
+
84
+#define OWL_PLL_NO_PARENT_DELAY(_struct, _name, _reg, _bfreq, _bit_idx, \
85
+ _shift, _width, _min_mul, _max_mul, _delay, _table, \
86
+ _flags) \
87
+ struct owl_pll _struct = { \
88
+ .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \
89
+ _width, _min_mul, _max_mul, \
90
+ _delay, _table), \
7291 .common = { \
7392 .regmap = NULL, \
7493 .hw.init = CLK_HW_INIT_NO_PARENT(_name, \
....@@ -78,7 +97,6 @@
7897 }
7998
8099 #define mul_mask(m) ((1 << ((m)->width)) - 1)
81
-#define PLL_STABILITY_WAIT_US (50)
82100
83101 static inline struct owl_pll *hw_to_owl_pll(const struct clk_hw *hw)
84102 {