Merge tag 'trace-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux/fpc-iii.git] / drivers / clk / qcom / clk-branch.h
blob17a58119165e89018c248a20ddf61da626185120
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2013, The Linux Foundation. All rights reserved. */
4 #ifndef __QCOM_CLK_BRANCH_H__
5 #define __QCOM_CLK_BRANCH_H__
7 #include <linux/clk-provider.h>
9 #include "clk-regmap.h"
11 /**
12 * struct clk_branch - gating clock with status bit and dynamic hardware gating
14 * @hwcg_reg: dynamic hardware clock gating register
15 * @hwcg_bit: ORed with @hwcg_reg to enable dynamic hardware clock gating
16 * @halt_reg: halt register
17 * @halt_bit: ANDed with @halt_reg to test for clock halted
18 * @halt_check: type of halt checking to perform
19 * @clkr: handle between common and hardware-specific interfaces
21 * Clock which can gate its output.
23 struct clk_branch {
24 u32 hwcg_reg;
25 u32 halt_reg;
26 u8 hwcg_bit;
27 u8 halt_bit;
28 u8 halt_check;
29 #define BRANCH_VOTED BIT(7) /* Delay on disable */
30 #define BRANCH_HALT 0 /* pol: 1 = halt */
31 #define BRANCH_HALT_VOTED (BRANCH_HALT | BRANCH_VOTED)
32 #define BRANCH_HALT_ENABLE 1 /* pol: 0 = halt */
33 #define BRANCH_HALT_ENABLE_VOTED (BRANCH_HALT_ENABLE | BRANCH_VOTED)
34 #define BRANCH_HALT_DELAY 2 /* No bit to check; just delay */
35 #define BRANCH_HALT_SKIP 3 /* Don't check halt bit */
37 struct clk_regmap clkr;
40 extern const struct clk_ops clk_branch_ops;
41 extern const struct clk_ops clk_branch2_ops;
42 extern const struct clk_ops clk_branch_simple_ops;
43 extern const struct clk_ops clk_branch2_aon_ops;
45 #define to_clk_branch(_hw) \
46 container_of(to_clk_regmap(_hw), struct clk_branch, clkr)
48 #endif