File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 16
16
#include "clk-mtk.h"
17
17
#include "clk-gate.h"
18
18
19
- static int mtk_cg_bit_is_cleared (struct clk_hw * hw )
19
+ static u32 mtk_get_clockgating (struct clk_hw * hw )
20
20
{
21
21
struct mtk_clk_gate * cg = to_mtk_clk_gate (hw );
22
22
u32 val ;
23
23
24
24
regmap_read (cg -> regmap , cg -> sta_ofs , & val );
25
25
26
- val &= BIT (cg -> bit );
26
+ return val & BIT (cg -> bit );
27
+ }
27
28
28
- return val == 0 ;
29
+ static int mtk_cg_bit_is_cleared (struct clk_hw * hw )
30
+ {
31
+ return mtk_get_clockgating (hw ) == 0 ;
29
32
}
30
33
31
34
static int mtk_cg_bit_is_set (struct clk_hw * hw )
32
35
{
33
- struct mtk_clk_gate * cg = to_mtk_clk_gate (hw );
34
- u32 val ;
35
-
36
- regmap_read (cg -> regmap , cg -> sta_ofs , & val );
37
-
38
- val &= BIT (cg -> bit );
39
-
40
- return val != 0 ;
36
+ return mtk_get_clockgating (hw ) != 0 ;
41
37
}
42
38
43
39
static void mtk_cg_set_bit (struct clk_hw * hw )
You can’t perform that action at this time.
0 commit comments