Jerome Brunet | 22f65a3 | 2018-05-16 10:50:40 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015 Endless Mobile, Inc. |
| 4 | * Author: Carlo Caione <carlo@endlessm.com> |
| 5 | * |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 6 | * Copyright (c) 2018 Baylibre, SAS. |
| 7 | * Author: Jerome Brunet <jbrunet@baylibre.com> |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * In the most basic form, a Meson PLL is composed as follows: |
| 12 | * |
| 13 | * PLL |
Jerome Brunet | 8717355 | 2018-08-01 16:00:52 +0200 | [diff] [blame] | 14 | * +--------------------------------+ |
| 15 | * | | |
| 16 | * | +--+ | |
| 17 | * in >>-----[ /N ]--->| | +-----+ | |
| 18 | * | | |------| DCO |---->> out |
| 19 | * | +--------->| | +--v--+ | |
| 20 | * | | +--+ | | |
| 21 | * | | | | |
| 22 | * | +--[ *(M + (F/Fmax) ]<--+ | |
| 23 | * | | |
| 24 | * +--------------------------------+ |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 25 | * |
Jerome Brunet | 8717355 | 2018-08-01 16:00:52 +0200 | [diff] [blame] | 26 | * out = in * (m + frac / frac_max) / n |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 27 | */ |
| 28 | |
| 29 | #include <linux/clk-provider.h> |
| 30 | #include <linux/delay.h> |
| 31 | #include <linux/err.h> |
| 32 | #include <linux/io.h> |
Jerome Brunet | 94aa8a4 | 2018-01-19 16:55:23 +0100 | [diff] [blame] | 33 | #include <linux/math64.h> |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 34 | #include <linux/module.h> |
| 35 | #include <linux/of_address.h> |
| 36 | #include <linux/slab.h> |
| 37 | #include <linux/string.h> |
| 38 | |
| 39 | #include "clkc.h" |
| 40 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 41 | static inline struct meson_clk_pll_data * |
| 42 | meson_clk_pll_data(struct clk_regmap *clk) |
| 43 | { |
| 44 | return (struct meson_clk_pll_data *)clk->data; |
| 45 | } |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 46 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 47 | static unsigned long __pll_params_to_rate(unsigned long parent_rate, |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 48 | const struct pll_params_table *pllt, |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 49 | u16 frac, |
| 50 | struct meson_clk_pll_data *pll) |
| 51 | { |
| 52 | u64 rate = (u64)parent_rate * pllt->m; |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 53 | |
| 54 | if (frac && MESON_PARM_APPLICABLE(&pll->frac)) { |
| 55 | u64 frac_rate = (u64)parent_rate * frac; |
| 56 | |
| 57 | rate += DIV_ROUND_UP_ULL(frac_rate, |
| 58 | (1 << pll->frac.width)); |
| 59 | } |
| 60 | |
Jerome Brunet | 8717355 | 2018-08-01 16:00:52 +0200 | [diff] [blame] | 61 | return DIV_ROUND_UP_ULL(rate, pllt->n); |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 62 | } |
| 63 | |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 64 | static unsigned long meson_clk_pll_recalc_rate(struct clk_hw *hw, |
| 65 | unsigned long parent_rate) |
| 66 | { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 67 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 68 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 69 | struct pll_params_table pllt; |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 70 | u16 frac; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 71 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 72 | pllt.n = meson_parm_read(clk->map, &pll->n); |
| 73 | pllt.m = meson_parm_read(clk->map, &pll->m); |
Jerome Brunet | 7d3142e | 2018-01-19 16:55:25 +0100 | [diff] [blame] | 74 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 75 | frac = MESON_PARM_APPLICABLE(&pll->frac) ? |
| 76 | meson_parm_read(clk->map, &pll->frac) : |
| 77 | 0; |
Jerome Brunet | 94aa8a4 | 2018-01-19 16:55:23 +0100 | [diff] [blame] | 78 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 79 | return __pll_params_to_rate(parent_rate, &pllt, frac, pll); |
| 80 | } |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 81 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 82 | static u16 __pll_params_with_frac(unsigned long rate, |
| 83 | unsigned long parent_rate, |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 84 | const struct pll_params_table *pllt, |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 85 | struct meson_clk_pll_data *pll) |
| 86 | { |
| 87 | u16 frac_max = (1 << pll->frac.width); |
| 88 | u64 val = (u64)rate * pllt->n; |
Jerome Brunet | 94aa8a4 | 2018-01-19 16:55:23 +0100 | [diff] [blame] | 89 | |
Jerome Brunet | 0a1be86 | 2018-02-19 12:21:41 +0100 | [diff] [blame] | 90 | if (pll->flags & CLK_MESON_PLL_ROUND_CLOSEST) |
| 91 | val = DIV_ROUND_CLOSEST_ULL(val * frac_max, parent_rate); |
| 92 | else |
| 93 | val = div_u64(val * frac_max, parent_rate); |
| 94 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 95 | val -= pllt->m * frac_max; |
| 96 | |
| 97 | return min((u16)val, (u16)(frac_max - 1)); |
| 98 | } |
| 99 | |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 100 | static bool meson_clk_pll_is_better(unsigned long rate, |
| 101 | unsigned long best, |
| 102 | unsigned long now, |
| 103 | struct meson_clk_pll_data *pll) |
| 104 | { |
| 105 | if (!(pll->flags & CLK_MESON_PLL_ROUND_CLOSEST) || |
| 106 | MESON_PARM_APPLICABLE(&pll->frac)) { |
| 107 | /* Round down */ |
| 108 | if (now < rate && best < now) |
| 109 | return true; |
| 110 | } else { |
| 111 | /* Round Closest */ |
| 112 | if (abs(now - rate) < abs(best - rate)) |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | static const struct pll_params_table * |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 120 | meson_clk_get_pll_settings(unsigned long rate, |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 121 | unsigned long parent_rate, |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 122 | struct meson_clk_pll_data *pll) |
| 123 | { |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 124 | const struct pll_params_table *table = pll->table; |
| 125 | unsigned long best = 0, now = 0; |
| 126 | unsigned int i, best_i = 0; |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 127 | |
| 128 | if (!table) |
| 129 | return NULL; |
| 130 | |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 131 | for (i = 0; table[i].n; i++) { |
| 132 | now = __pll_params_to_rate(parent_rate, &table[i], 0, pll); |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 133 | |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 134 | /* If we get an exact match, don't bother any further */ |
| 135 | if (now == rate) { |
| 136 | return &table[i]; |
| 137 | } else if (meson_clk_pll_is_better(rate, best, now, pll)) { |
| 138 | best = now; |
| 139 | best_i = i; |
| 140 | } |
Jerome Brunet | 0a1be86 | 2018-02-19 12:21:41 +0100 | [diff] [blame] | 141 | } |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 142 | |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 143 | return (struct pll_params_table *)&table[best_i]; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | static long meson_clk_pll_round_rate(struct clk_hw *hw, unsigned long rate, |
| 147 | unsigned long *parent_rate) |
| 148 | { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 149 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 150 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 151 | const struct pll_params_table *pllt = |
| 152 | meson_clk_get_pll_settings(rate, *parent_rate, pll); |
| 153 | unsigned long round; |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 154 | u16 frac; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 155 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 156 | if (!pllt) |
Jerome Brunet | 840e1a7 | 2018-01-19 16:55:21 +0100 | [diff] [blame] | 157 | return meson_clk_pll_recalc_rate(hw, *parent_rate); |
| 158 | |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 159 | round = __pll_params_to_rate(*parent_rate, pllt, 0, pll); |
| 160 | |
| 161 | if (!MESON_PARM_APPLICABLE(&pll->frac) || rate == round) |
| 162 | return round; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 163 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 164 | /* |
| 165 | * The rate provided by the setting is not an exact match, let's |
| 166 | * try to improve the result using the fractional parameter |
| 167 | */ |
| 168 | frac = __pll_params_with_frac(rate, *parent_rate, pllt, pll); |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 169 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 170 | return __pll_params_to_rate(*parent_rate, pllt, frac, pll); |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 171 | } |
| 172 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 173 | static int meson_clk_pll_wait_lock(struct clk_hw *hw) |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 174 | { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 175 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 176 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
Jerome Brunet | c178b00 | 2018-02-19 12:21:38 +0100 | [diff] [blame] | 177 | int delay = 24000000; |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 178 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 179 | do { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 180 | /* Is the clock locked now ? */ |
| 181 | if (meson_parm_read(clk->map, &pll->l)) |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 182 | return 0; |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 183 | |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 184 | delay--; |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 185 | } while (delay > 0); |
| 186 | |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 187 | return -ETIMEDOUT; |
| 188 | } |
| 189 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 190 | static void meson_clk_pll_init(struct clk_hw *hw) |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 191 | { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 192 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 193 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 194 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 195 | if (pll->init_count) { |
| 196 | meson_parm_write(clk->map, &pll->rst, 1); |
| 197 | regmap_multi_reg_write(clk->map, pll->init_regs, |
| 198 | pll->init_count); |
| 199 | meson_parm_write(clk->map, &pll->rst, 0); |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 200 | } |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 201 | } |
| 202 | |
Martin Blumenstingl | d6e8184 | 2018-11-15 23:40:43 +0100 | [diff] [blame] | 203 | static int meson_clk_pll_is_enabled(struct clk_hw *hw) |
| 204 | { |
| 205 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 206 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
| 207 | |
| 208 | if (meson_parm_read(clk->map, &pll->rst) || |
| 209 | !meson_parm_read(clk->map, &pll->en) || |
| 210 | !meson_parm_read(clk->map, &pll->l)) |
| 211 | return 0; |
| 212 | |
| 213 | return 1; |
| 214 | } |
| 215 | |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 216 | static int meson_clk_pll_enable(struct clk_hw *hw) |
| 217 | { |
| 218 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 219 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
| 220 | |
Martin Blumenstingl | d6e8184 | 2018-11-15 23:40:43 +0100 | [diff] [blame] | 221 | /* do nothing if the PLL is already enabled */ |
| 222 | if (clk_hw_is_enabled(hw)) |
| 223 | return 0; |
| 224 | |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 225 | /* Make sure the pll is in reset */ |
| 226 | meson_parm_write(clk->map, &pll->rst, 1); |
| 227 | |
| 228 | /* Enable the pll */ |
| 229 | meson_parm_write(clk->map, &pll->en, 1); |
| 230 | |
| 231 | /* Take the pll out reset */ |
| 232 | meson_parm_write(clk->map, &pll->rst, 0); |
| 233 | |
| 234 | if (meson_clk_pll_wait_lock(hw)) |
| 235 | return -EIO; |
| 236 | |
| 237 | return 0; |
| 238 | } |
| 239 | |
| 240 | static void meson_clk_pll_disable(struct clk_hw *hw) |
| 241 | { |
| 242 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 243 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
| 244 | |
| 245 | /* Put the pll is in reset */ |
| 246 | meson_parm_write(clk->map, &pll->rst, 1); |
| 247 | |
| 248 | /* Disable the pll */ |
| 249 | meson_parm_write(clk->map, &pll->en, 0); |
| 250 | } |
| 251 | |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 252 | static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, |
| 253 | unsigned long parent_rate) |
| 254 | { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 255 | struct clk_regmap *clk = to_clk_regmap(hw); |
| 256 | struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 257 | const struct pll_params_table *pllt; |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 258 | unsigned int enabled; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 259 | unsigned long old_rate; |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 260 | u16 frac = 0; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 261 | |
| 262 | if (parent_rate == 0 || rate == 0) |
| 263 | return -EINVAL; |
| 264 | |
| 265 | old_rate = rate; |
| 266 | |
Jerome Brunet | dd601db | 2018-08-01 16:00:53 +0200 | [diff] [blame] | 267 | pllt = meson_clk_get_pll_settings(rate, parent_rate, pll); |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 268 | if (!pllt) |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 269 | return -EINVAL; |
| 270 | |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 271 | enabled = meson_parm_read(clk->map, &pll->en); |
| 272 | if (enabled) |
| 273 | meson_clk_pll_disable(hw); |
Neil Armstrong | 45fcbec | 2017-03-22 11:32:23 +0100 | [diff] [blame] | 274 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 275 | meson_parm_write(clk->map, &pll->n, pllt->n); |
| 276 | meson_parm_write(clk->map, &pll->m, pllt->m); |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 277 | |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 278 | |
Jerome Brunet | 8289aaf | 2018-02-19 12:21:39 +0100 | [diff] [blame] | 279 | if (MESON_PARM_APPLICABLE(&pll->frac)) { |
| 280 | frac = __pll_params_with_frac(rate, parent_rate, pllt, pll); |
| 281 | meson_parm_write(clk->map, &pll->frac, frac); |
| 282 | } |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 283 | |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 284 | /* If the pll is stopped, bail out now */ |
| 285 | if (!enabled) |
| 286 | return 0; |
Michael Turquette | 4a47295 | 2016-06-06 18:08:15 -0700 | [diff] [blame] | 287 | |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 288 | if (meson_clk_pll_enable(hw)) { |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 289 | pr_warn("%s: pll did not lock, trying to restore old rate %lu\n", |
| 290 | __func__, old_rate); |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 291 | /* |
| 292 | * FIXME: Do we really need/want this HACK ? |
| 293 | * It looks unsafe. what happens if the clock gets into a |
| 294 | * broken state and we can't lock back on the old_rate ? Looks |
| 295 | * like an infinite recursion is possible |
| 296 | */ |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 297 | meson_clk_pll_set_rate(hw, old_rate, parent_rate); |
| 298 | } |
| 299 | |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 300 | return 0; |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 301 | } |
| 302 | |
Michael Turquette | ec623f2 | 2016-04-28 12:01:42 -0700 | [diff] [blame] | 303 | const struct clk_ops meson_clk_pll_ops = { |
Jerome Brunet | 722825d | 2018-02-12 15:58:42 +0100 | [diff] [blame] | 304 | .init = meson_clk_pll_init, |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 305 | .recalc_rate = meson_clk_pll_recalc_rate, |
| 306 | .round_rate = meson_clk_pll_round_rate, |
| 307 | .set_rate = meson_clk_pll_set_rate, |
Martin Blumenstingl | d6e8184 | 2018-11-15 23:40:43 +0100 | [diff] [blame] | 308 | .is_enabled = meson_clk_pll_is_enabled, |
Jerome Brunet | e40c7e3 | 2018-08-01 16:00:50 +0200 | [diff] [blame] | 309 | .enable = meson_clk_pll_enable, |
| 310 | .disable = meson_clk_pll_disable |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 311 | }; |
| 312 | |
Michael Turquette | ec623f2 | 2016-04-28 12:01:42 -0700 | [diff] [blame] | 313 | const struct clk_ops meson_clk_pll_ro_ops = { |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 314 | .recalc_rate = meson_clk_pll_recalc_rate, |
Martin Blumenstingl | d6e8184 | 2018-11-15 23:40:43 +0100 | [diff] [blame] | 315 | .is_enabled = meson_clk_pll_is_enabled, |
Carlo Caione | 7a29a86 | 2015-06-01 13:13:53 +0200 | [diff] [blame] | 316 | }; |