]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/clk/qcom/common.h
clk: qcom: add read-only divider operations
[mirror_ubuntu-jammy-kernel.git] / drivers / clk / qcom / common.h
CommitLineData
49fc825f
SB
1/*
2 * Copyright (c) 2014, The Linux Foundation. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13#ifndef __QCOM_CLK_COMMON_H__
14#define __QCOM_CLK_COMMON_H__
15
16struct platform_device;
17struct regmap_config;
18struct clk_regmap;
19struct qcom_reset_map;
5b6b7490 20struct regmap;
50c6a503 21struct freq_tbl;
293d2e97
GD
22struct clk_hw;
23struct parent_map;
49fc825f 24
400d9fda
RN
25#define PLL_LOCK_COUNT_SHIFT 8
26#define PLL_LOCK_COUNT_MASK 0x3f
27#define PLL_BIAS_COUNT_SHIFT 14
28#define PLL_BIAS_COUNT_MASK 0x3f
29#define PLL_VOTE_FSM_ENA BIT(20)
30#define PLL_VOTE_FSM_RESET BIT(21)
31
49fc825f
SB
32struct qcom_cc_desc {
33 const struct regmap_config *config;
34 struct clk_regmap **clks;
35 size_t num_clks;
36 const struct qcom_reset_map *resets;
37 size_t num_resets;
5e5cc241
RN
38 struct gdsc **gdscs;
39 size_t num_gdscs;
49fc825f
SB
40};
41
50c6a503
SB
42extern const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f,
43 unsigned long rate);
081ba802
RN
44extern const struct freq_tbl *qcom_find_freq_floor(const struct freq_tbl *f,
45 unsigned long rate);
400d9fda
RN
46extern void
47qcom_pll_set_fsm_mode(struct regmap *m, u32 reg, u8 bias_count, u8 lock_count);
293d2e97
GD
48extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map,
49 u8 src);
50c6a503 50
ee15faff
SB
51extern int qcom_cc_register_board_clk(struct device *dev, const char *path,
52 const char *name, unsigned long rate);
53extern int qcom_cc_register_sleep_clk(struct device *dev);
54
5b6b7490
SB
55extern struct regmap *qcom_cc_map(struct platform_device *pdev,
56 const struct qcom_cc_desc *desc);
57extern int qcom_cc_really_probe(struct platform_device *pdev,
58 const struct qcom_cc_desc *desc,
59 struct regmap *regmap);
49fc825f
SB
60extern int qcom_cc_probe(struct platform_device *pdev,
61 const struct qcom_cc_desc *desc);
62
49fc825f 63#endif