• Home
  • Raw
  • Download

Lines Matching refs:gate

43 	struct clk_gate2 *gate = to_clk_gate2(hw);  in clk_gate2_enable()  local
47 spin_lock_irqsave(gate->lock, flags); in clk_gate2_enable()
49 if (gate->share_count && (*gate->share_count)++ > 0) in clk_gate2_enable()
52 reg = readl(gate->reg); in clk_gate2_enable()
53 reg |= 3 << gate->bit_idx; in clk_gate2_enable()
54 writel(reg, gate->reg); in clk_gate2_enable()
57 spin_unlock_irqrestore(gate->lock, flags); in clk_gate2_enable()
64 struct clk_gate2 *gate = to_clk_gate2(hw); in clk_gate2_disable() local
68 spin_lock_irqsave(gate->lock, flags); in clk_gate2_disable()
70 if (gate->share_count) { in clk_gate2_disable()
71 if (WARN_ON(*gate->share_count == 0)) in clk_gate2_disable()
73 else if (--(*gate->share_count) > 0) in clk_gate2_disable()
77 reg = readl(gate->reg); in clk_gate2_disable()
78 reg &= ~(3 << gate->bit_idx); in clk_gate2_disable()
79 writel(reg, gate->reg); in clk_gate2_disable()
82 spin_unlock_irqrestore(gate->lock, flags); in clk_gate2_disable()
97 struct clk_gate2 *gate = to_clk_gate2(hw); in clk_gate2_is_enabled() local
99 if (gate->share_count) in clk_gate2_is_enabled()
102 return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx); in clk_gate2_is_enabled()
117 struct clk_gate2 *gate; in clk_register_gate2() local
121 gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL); in clk_register_gate2()
122 if (!gate) in clk_register_gate2()
126 gate->reg = reg; in clk_register_gate2()
127 gate->bit_idx = bit_idx; in clk_register_gate2()
128 gate->flags = clk_gate2_flags; in clk_register_gate2()
129 gate->lock = lock; in clk_register_gate2()
130 gate->share_count = share_count; in clk_register_gate2()
138 gate->hw.init = &init; in clk_register_gate2()
140 clk = clk_register(dev, &gate->hw); in clk_register_gate2()
142 kfree(gate); in clk_register_gate2()