1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2015, 2018, The Linux Foundation. All rights reserved. */
4 #ifndef __QCOM_CLK_ALPHA_PLL_H__
5 #define __QCOM_CLK_ALPHA_PLL_H__
7 #include <linux/clk-provider.h>
8 #include "clk-regmap.h"
12 CLK_ALPHA_PLL_TYPE_DEFAULT,
13 CLK_ALPHA_PLL_TYPE_HUAYRA,
14 CLK_ALPHA_PLL_TYPE_BRAMMO,
15 CLK_ALPHA_PLL_TYPE_FABIA,
16 CLK_ALPHA_PLL_TYPE_MAX,
35 extern const u8 clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_MAX][PLL_OFF_MAX_REGS];
38 unsigned long min_freq;
39 unsigned long max_freq;
44 * struct clk_alpha_pll - phase locked loop (PLL)
45 * @offset: base address of registers
46 * @vco_table: array of VCO settings
47 * @regs: alpha pll register map (see @clk_alpha_pll_regs)
48 * @clkr: regmap clock handle
50 struct clk_alpha_pll {
54 const struct pll_vco *vco_table;
56 #define SUPPORTS_OFFLINE_REQ BIT(0)
57 #define SUPPORTS_FSM_MODE BIT(2)
58 #define SUPPORTS_DYNAMIC_UPDATE BIT(3)
61 struct clk_regmap clkr;
65 * struct clk_alpha_pll_postdiv - phase locked loop (PLL) post-divider
66 * @offset: base address of registers
67 * @regs: alpha pll register map (see @clk_alpha_pll_regs)
68 * @width: width of post-divider
69 * @post_div_shift: shift to differentiate between odd & even post-divider
70 * @post_div_table: table with PLL odd and even post-divider settings
71 * @num_post_div: Number of PLL post-divider settings
73 * @clkr: regmap clock handle
75 struct clk_alpha_pll_postdiv {
80 struct clk_regmap clkr;
82 const struct clk_div_table *post_div_table;
86 struct alpha_pll_config {
91 u32 config_ctl_hi_val;
95 u32 early_output_mask;
106 extern const struct clk_ops clk_alpha_pll_ops;
107 extern const struct clk_ops clk_alpha_pll_hwfsm_ops;
108 extern const struct clk_ops clk_alpha_pll_postdiv_ops;
109 extern const struct clk_ops clk_alpha_pll_huayra_ops;
110 extern const struct clk_ops clk_alpha_pll_postdiv_ro_ops;
112 extern const struct clk_ops clk_alpha_pll_fabia_ops;
113 extern const struct clk_ops clk_alpha_pll_fixed_fabia_ops;
114 extern const struct clk_ops clk_alpha_pll_postdiv_fabia_ops;
116 void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
117 const struct alpha_pll_config *config);
118 void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
119 const struct alpha_pll_config *config);