aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/tegra/clk.h
diff options
context:
space:
mode:
authorBill Huang <bilhuang@nvidia.com>2015-06-18 17:28:31 -0400
committerThierry Reding <treding@nvidia.com>2015-12-17 07:37:54 -0500
commitb985114e2f946de069b00002bd46a4efba5334eb (patch)
tree6c07fd29ec3b0576751c45d2257e2a988bb7cb47 /drivers/clk/tegra/clk.h
parentb5512b45d5ed699de328e17cd7c7027d89461920 (diff)
clk: tegra: pll: Add Set_default logic
Add logic which (if specified for a pll) can verify that a PLL is set to the proper default value and if not can set it. This can be specified per PLL as each will have different default values. Based on original work by Aleksandr Frid <afrid@nvidia.com> Signed-off-by: Bill Huang <bilhuang@nvidia.com> Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra/clk.h')
-rw-r--r--drivers/clk/tegra/clk.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index f94b1789c333..c78d9d088a6d 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -160,6 +160,8 @@ struct div_nmp {
160 160
161#define MAX_PLL_MISC_REG_COUNT 6 161#define MAX_PLL_MISC_REG_COUNT 6
162 162
163struct tegra_clk_pll;
164
163/** 165/**
164 * struct tegra_clk_pll_params - PLL parameters 166 * struct tegra_clk_pll_params - PLL parameters
165 * 167 *
@@ -192,6 +194,7 @@ struct div_nmp {
192 * @stepb_shift: Dynamic ramp step B field shift 194 * @stepb_shift: Dynamic ramp step B field shift
193 * @lock_delay: Delay in us if PLL lock is not used 195 * @lock_delay: Delay in us if PLL lock is not used
194 * @max_p: maximum value for the p divider 196 * @max_p: maximum value for the p divider
197 * @defaults_set: Boolean signaling all reg defaults for PLL set.
195 * @pdiv_tohw: mapping of p divider to register values 198 * @pdiv_tohw: mapping of p divider to register values
196 * @div_nmp: offsets and widths on n, m and p fields 199 * @div_nmp: offsets and widths on n, m and p fields
197 * @freq_table: array of frequencies supported by PLL 200 * @freq_table: array of frequencies supported by PLL
@@ -204,6 +207,12 @@ struct div_nmp {
204 * rates (dividers and multipler) are calculated. 207 * rates (dividers and multipler) are calculated.
205 * @adjust_vco: Callback to adjust the programming range of the 208 * @adjust_vco: Callback to adjust the programming range of the
206 * divider range (if SDM is present) 209 * divider range (if SDM is present)
210 * @set_defaults: Callback which will try to initialize PLL
211 * registers to sane default values. This is first
212 * tried during PLL registration, but if the PLL
213 * is already enabled, it will be done the first
214 * time the rate is changed while the PLL is
215 * disabled.
207 * 216 *
208 * Flags: 217 * Flags:
209 * TEGRA_PLL_USE_LOCK - This flag indicated to use lock bits for 218 * TEGRA_PLL_USE_LOCK - This flag indicated to use lock bits for
@@ -261,6 +270,7 @@ struct tegra_clk_pll_params {
261 int stepb_shift; 270 int stepb_shift;
262 int lock_delay; 271 int lock_delay;
263 int max_p; 272 int max_p;
273 bool defaults_set;
264 const struct pdiv_map *pdiv_tohw; 274 const struct pdiv_map *pdiv_tohw;
265 struct div_nmp *div_nmp; 275 struct div_nmp *div_nmp;
266 struct tegra_clk_pll_freq_table *freq_table; 276 struct tegra_clk_pll_freq_table *freq_table;
@@ -273,6 +283,7 @@ struct tegra_clk_pll_params {
273 unsigned long rate, unsigned long parent_rate); 283 unsigned long rate, unsigned long parent_rate);
274 unsigned long (*adjust_vco)(struct tegra_clk_pll_params *pll_params, 284 unsigned long (*adjust_vco)(struct tegra_clk_pll_params *pll_params,
275 unsigned long parent_rate); 285 unsigned long parent_rate);
286 void (*set_defaults)(struct tegra_clk_pll *pll);
276}; 287};
277 288
278#define TEGRA_PLL_USE_LOCK BIT(0) 289#define TEGRA_PLL_USE_LOCK BIT(0)