Lines Matching +full:semi +full:- +full:static
1 // SPDX-License-Identifier: GPL-2.0+
5 // Copyright (c) 2014 Actions Semi Inc.
6 // Author: David Liu <liuwei@actions-semi.com>
11 #include <linux/clk-provider.h>
14 #include "owl-gate.h"
19 int set = gate_hw->gate_flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; in owl_gate_set()
24 regmap_read(common->regmap, gate_hw->reg, ®); in owl_gate_set()
27 reg |= BIT(gate_hw->bit_idx); in owl_gate_set()
29 reg &= ~BIT(gate_hw->bit_idx); in owl_gate_set()
31 regmap_write(common->regmap, gate_hw->reg, reg); in owl_gate_set()
34 static void owl_gate_disable(struct clk_hw *hw) in owl_gate_disable()
37 struct owl_clk_common *common = &gate->common; in owl_gate_disable()
39 owl_gate_set(common, &gate->gate_hw, false); in owl_gate_disable()
42 static int owl_gate_enable(struct clk_hw *hw) in owl_gate_enable()
45 struct owl_clk_common *common = &gate->common; in owl_gate_enable()
47 owl_gate_set(common, &gate->gate_hw, true); in owl_gate_enable()
57 regmap_read(common->regmap, gate_hw->reg, ®); in owl_gate_clk_is_enabled()
59 if (gate_hw->gate_flags & CLK_GATE_SET_TO_DISABLE) in owl_gate_clk_is_enabled()
60 reg ^= BIT(gate_hw->bit_idx); in owl_gate_clk_is_enabled()
62 return !!(reg & BIT(gate_hw->bit_idx)); in owl_gate_clk_is_enabled()
65 static int owl_gate_is_enabled(struct clk_hw *hw) in owl_gate_is_enabled()
68 struct owl_clk_common *common = &gate->common; in owl_gate_is_enabled()
70 return owl_gate_clk_is_enabled(common, &gate->gate_hw); in owl_gate_is_enabled()