Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Helper routines for R-Car sound ADG. |
| 3 | * |
| 4 | * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | #include <linux/sh_clk.h> |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 11 | #include "rsnd.h" |
| 12 | |
| 13 | #define CLKA 0 |
| 14 | #define CLKB 1 |
| 15 | #define CLKC 2 |
| 16 | #define CLKI 3 |
| 17 | #define CLKMAX 4 |
| 18 | |
| 19 | struct rsnd_adg { |
| 20 | struct clk *clk[CLKMAX]; |
| 21 | |
Kuninori Morimoto | 7808aa3 | 2013-12-19 19:27:19 -0800 | [diff] [blame] | 22 | int rbga_rate_for_441khz_div_6; /* RBGA */ |
| 23 | int rbgb_rate_for_48khz_div_6; /* RBGB */ |
Kuninori Morimoto | efeb970 | 2013-09-23 23:12:17 -0700 | [diff] [blame] | 24 | u32 ckr; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | #define for_each_rsnd_clk(pos, adg, i) \ |
Kuninori Morimoto | 00463c11 | 2014-02-11 17:15:51 -0800 | [diff] [blame] | 28 | for (i = 0; \ |
| 29 | (i < CLKMAX) && \ |
| 30 | ((pos) = adg->clk[i]); \ |
| 31 | i++) |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 32 | #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg) |
| 33 | |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 34 | |
Kuninori Morimoto | 8467ded | 2014-03-02 23:43:33 -0800 | [diff] [blame] | 35 | static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_dai_stream *io) |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 36 | { |
Kuninori Morimoto | 8467ded | 2014-03-02 23:43:33 -0800 | [diff] [blame] | 37 | struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io); |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 38 | struct rsnd_priv *priv = rsnd_mod_to_priv(mod); |
| 39 | int id = rsnd_mod_id(mod); |
| 40 | int ws = id; |
| 41 | |
| 42 | if (rsnd_ssi_is_pin_sharing(rsnd_ssi_mod_get(priv, id))) { |
| 43 | switch (id) { |
| 44 | case 1: |
| 45 | case 2: |
| 46 | ws = 0; |
| 47 | break; |
| 48 | case 4: |
| 49 | ws = 3; |
| 50 | break; |
| 51 | case 8: |
| 52 | ws = 7; |
| 53 | break; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | return (0x6 + ws) << 8; |
| 58 | } |
| 59 | |
| 60 | static int rsnd_adg_set_src_timsel_gen2(struct rsnd_dai *rdai, |
| 61 | struct rsnd_mod *mod, |
| 62 | struct rsnd_dai_stream *io, |
| 63 | u32 timsel) |
| 64 | { |
| 65 | int is_play = rsnd_dai_is_play(rdai, io); |
| 66 | int id = rsnd_mod_id(mod); |
| 67 | int shift = (id % 2) ? 16 : 0; |
| 68 | u32 mask, ws; |
| 69 | u32 in, out; |
| 70 | |
Kuninori Morimoto | 8467ded | 2014-03-02 23:43:33 -0800 | [diff] [blame] | 71 | ws = rsnd_adg_ssi_ws_timing_gen2(io); |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 72 | |
| 73 | in = (is_play) ? timsel : ws; |
| 74 | out = (is_play) ? ws : timsel; |
| 75 | |
| 76 | in = in << shift; |
| 77 | out = out << shift; |
| 78 | mask = 0xffff << shift; |
| 79 | |
| 80 | switch (id / 2) { |
| 81 | case 0: |
| 82 | rsnd_mod_bset(mod, SRCIN_TIMSEL0, mask, in); |
| 83 | rsnd_mod_bset(mod, SRCOUT_TIMSEL0, mask, out); |
| 84 | break; |
| 85 | case 1: |
| 86 | rsnd_mod_bset(mod, SRCIN_TIMSEL1, mask, in); |
| 87 | rsnd_mod_bset(mod, SRCOUT_TIMSEL1, mask, out); |
| 88 | break; |
| 89 | case 2: |
| 90 | rsnd_mod_bset(mod, SRCIN_TIMSEL2, mask, in); |
| 91 | rsnd_mod_bset(mod, SRCOUT_TIMSEL2, mask, out); |
| 92 | break; |
| 93 | case 3: |
| 94 | rsnd_mod_bset(mod, SRCIN_TIMSEL3, mask, in); |
| 95 | rsnd_mod_bset(mod, SRCOUT_TIMSEL3, mask, out); |
| 96 | break; |
| 97 | case 4: |
| 98 | rsnd_mod_bset(mod, SRCIN_TIMSEL4, mask, in); |
| 99 | rsnd_mod_bset(mod, SRCOUT_TIMSEL4, mask, out); |
| 100 | break; |
| 101 | } |
| 102 | |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod, |
| 107 | struct rsnd_dai *rdai, |
| 108 | struct rsnd_dai_stream *io, |
| 109 | unsigned int src_rate, |
| 110 | unsigned int dst_rate) |
| 111 | { |
| 112 | struct rsnd_priv *priv = rsnd_mod_to_priv(mod); |
| 113 | struct rsnd_adg *adg = rsnd_priv_to_adg(priv); |
| 114 | struct device *dev = rsnd_priv_to_dev(priv); |
Kuninori Morimoto | ee2c828 | 2014-02-11 21:04:12 -0800 | [diff] [blame] | 115 | int idx, sel, div, step, ret; |
| 116 | u32 val, en; |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 117 | unsigned int min, diff; |
| 118 | unsigned int sel_rate [] = { |
| 119 | clk_get_rate(adg->clk[CLKA]), /* 0000: CLKA */ |
| 120 | clk_get_rate(adg->clk[CLKB]), /* 0001: CLKB */ |
| 121 | clk_get_rate(adg->clk[CLKC]), /* 0010: CLKC */ |
| 122 | adg->rbga_rate_for_441khz_div_6,/* 0011: RBGA */ |
| 123 | adg->rbgb_rate_for_48khz_div_6, /* 0100: RBGB */ |
| 124 | }; |
| 125 | |
| 126 | min = ~0; |
| 127 | val = 0; |
Kuninori Morimoto | ee2c828 | 2014-02-11 21:04:12 -0800 | [diff] [blame] | 128 | en = 0; |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 129 | for (sel = 0; sel < ARRAY_SIZE(sel_rate); sel++) { |
| 130 | idx = 0; |
| 131 | step = 2; |
| 132 | |
| 133 | if (!sel_rate[sel]) |
| 134 | continue; |
| 135 | |
| 136 | for (div = 2; div <= 98304; div += step) { |
| 137 | diff = abs(src_rate - sel_rate[sel] / div); |
| 138 | if (min > diff) { |
| 139 | val = (sel << 8) | idx; |
| 140 | min = diff; |
Kuninori Morimoto | ee2c828 | 2014-02-11 21:04:12 -0800 | [diff] [blame] | 141 | en = 1 << (sel + 1); /* fixme */ |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | /* |
| 145 | * step of 0_0000 / 0_0001 / 0_1101 |
| 146 | * are out of order |
| 147 | */ |
| 148 | if ((idx > 2) && (idx % 2)) |
| 149 | step *= 2; |
| 150 | if (idx == 0x1c) { |
| 151 | div += step; |
| 152 | step *= 2; |
| 153 | } |
| 154 | idx++; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | if (min == ~0) { |
| 159 | dev_err(dev, "no Input clock\n"); |
| 160 | return -EIO; |
| 161 | } |
| 162 | |
Kuninori Morimoto | ee2c828 | 2014-02-11 21:04:12 -0800 | [diff] [blame] | 163 | ret = rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val); |
| 164 | if (ret < 0) { |
| 165 | dev_err(dev, "timsel error\n"); |
| 166 | return ret; |
| 167 | } |
| 168 | |
| 169 | rsnd_mod_bset(mod, DIV_EN, en, en); |
| 170 | |
| 171 | return 0; |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod, |
| 175 | struct rsnd_dai *rdai, |
| 176 | struct rsnd_dai_stream *io) |
| 177 | { |
Kuninori Morimoto | 8467ded | 2014-03-02 23:43:33 -0800 | [diff] [blame] | 178 | u32 val = rsnd_adg_ssi_ws_timing_gen2(io); |
Kuninori Morimoto | 629509c | 2014-01-23 18:42:00 -0800 | [diff] [blame] | 179 | |
| 180 | return rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val); |
| 181 | } |
| 182 | |
Kuninori Morimoto | 28dc4b6 | 2014-01-23 18:41:10 -0800 | [diff] [blame] | 183 | int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv, |
| 184 | struct rsnd_mod *mod, |
| 185 | unsigned int src_rate, |
| 186 | unsigned int dst_rate) |
Kuninori Morimoto | ef74940 | 2013-12-19 19:28:51 -0800 | [diff] [blame] | 187 | { |
| 188 | struct rsnd_adg *adg = rsnd_priv_to_adg(priv); |
| 189 | struct device *dev = rsnd_priv_to_dev(priv); |
| 190 | int idx, sel, div, shift; |
| 191 | u32 mask, val; |
| 192 | int id = rsnd_mod_id(mod); |
| 193 | unsigned int sel_rate [] = { |
| 194 | clk_get_rate(adg->clk[CLKA]), /* 000: CLKA */ |
| 195 | clk_get_rate(adg->clk[CLKB]), /* 001: CLKB */ |
| 196 | clk_get_rate(adg->clk[CLKC]), /* 010: CLKC */ |
| 197 | 0, /* 011: MLBCLK (not used) */ |
| 198 | adg->rbga_rate_for_441khz_div_6,/* 100: RBGA */ |
| 199 | adg->rbgb_rate_for_48khz_div_6, /* 101: RBGB */ |
| 200 | }; |
| 201 | |
| 202 | /* find div (= 1/128, 1/256, 1/512, 1/1024, 1/2048 */ |
| 203 | for (sel = 0; sel < ARRAY_SIZE(sel_rate); sel++) { |
| 204 | for (div = 128, idx = 0; |
| 205 | div <= 2048; |
| 206 | div *= 2, idx++) { |
| 207 | if (src_rate == sel_rate[sel] / div) { |
| 208 | val = (idx << 4) | sel; |
| 209 | goto find_rate; |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | dev_err(dev, "can't find convert src clk\n"); |
| 214 | return -EINVAL; |
| 215 | |
| 216 | find_rate: |
| 217 | shift = (id % 4) * 8; |
| 218 | mask = 0xFF << shift; |
| 219 | val = val << shift; |
| 220 | |
| 221 | dev_dbg(dev, "adg convert src clk = %02x\n", val); |
| 222 | |
| 223 | switch (id / 4) { |
| 224 | case 0: |
| 225 | rsnd_mod_bset(mod, AUDIO_CLK_SEL3, mask, val); |
| 226 | break; |
| 227 | case 1: |
| 228 | rsnd_mod_bset(mod, AUDIO_CLK_SEL4, mask, val); |
| 229 | break; |
| 230 | case 2: |
| 231 | rsnd_mod_bset(mod, AUDIO_CLK_SEL5, mask, val); |
| 232 | break; |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 | * Gen1 doesn't need dst_rate settings, |
| 237 | * since it uses SSI WS pin. |
| 238 | * see also rsnd_src_set_route_if_gen1() |
| 239 | */ |
| 240 | |
| 241 | return 0; |
| 242 | } |
| 243 | |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 244 | static void rsnd_adg_set_ssi_clk(struct rsnd_mod *mod, u32 val) |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 245 | { |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 246 | int id = rsnd_mod_id(mod); |
| 247 | int shift = (id % 4) * 8; |
| 248 | u32 mask = 0xFF << shift; |
| 249 | |
| 250 | val = val << shift; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 251 | |
| 252 | /* |
| 253 | * SSI 8 is not connected to ADG. |
| 254 | * it works with SSI 7 |
| 255 | */ |
| 256 | if (id == 8) |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 257 | return; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 258 | |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 259 | switch (id / 4) { |
| 260 | case 0: |
| 261 | rsnd_mod_bset(mod, AUDIO_CLK_SEL0, mask, val); |
| 262 | break; |
| 263 | case 1: |
| 264 | rsnd_mod_bset(mod, AUDIO_CLK_SEL1, mask, val); |
| 265 | break; |
| 266 | case 2: |
| 267 | rsnd_mod_bset(mod, AUDIO_CLK_SEL2, mask, val); |
| 268 | break; |
| 269 | } |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | int rsnd_adg_ssi_clk_stop(struct rsnd_mod *mod) |
| 273 | { |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 274 | /* |
| 275 | * "mod" = "ssi" here. |
| 276 | * we can get "ssi id" from mod |
| 277 | */ |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 278 | rsnd_adg_set_ssi_clk(mod, 0); |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 279 | |
| 280 | return 0; |
| 281 | } |
| 282 | |
| 283 | int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate) |
| 284 | { |
| 285 | struct rsnd_priv *priv = rsnd_mod_to_priv(mod); |
| 286 | struct rsnd_adg *adg = rsnd_priv_to_adg(priv); |
| 287 | struct device *dev = rsnd_priv_to_dev(priv); |
| 288 | struct clk *clk; |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 289 | int i; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 290 | u32 data; |
| 291 | int sel_table[] = { |
| 292 | [CLKA] = 0x1, |
| 293 | [CLKB] = 0x2, |
| 294 | [CLKC] = 0x3, |
| 295 | [CLKI] = 0x0, |
| 296 | }; |
| 297 | |
| 298 | dev_dbg(dev, "request clock = %d\n", rate); |
| 299 | |
| 300 | /* |
| 301 | * find suitable clock from |
| 302 | * AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC/AUDIO_CLKI. |
| 303 | */ |
| 304 | data = 0; |
| 305 | for_each_rsnd_clk(clk, adg, i) { |
| 306 | if (rate == clk_get_rate(clk)) { |
| 307 | data = sel_table[i]; |
| 308 | goto found_clock; |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /* |
| 313 | * find 1/6 clock from BRGA/BRGB |
| 314 | */ |
Kuninori Morimoto | 7808aa3 | 2013-12-19 19:27:19 -0800 | [diff] [blame] | 315 | if (rate == adg->rbga_rate_for_441khz_div_6) { |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 316 | data = 0x10; |
| 317 | goto found_clock; |
| 318 | } |
| 319 | |
Kuninori Morimoto | 7808aa3 | 2013-12-19 19:27:19 -0800 | [diff] [blame] | 320 | if (rate == adg->rbgb_rate_for_48khz_div_6) { |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 321 | data = 0x20; |
| 322 | goto found_clock; |
| 323 | } |
| 324 | |
| 325 | return -EIO; |
| 326 | |
| 327 | found_clock: |
| 328 | |
Kuninori Morimoto | efeb970 | 2013-09-23 23:12:17 -0700 | [diff] [blame] | 329 | /* see rsnd_adg_ssi_clk_init() */ |
| 330 | rsnd_mod_bset(mod, SSICKR, 0x00FF0000, adg->ckr); |
| 331 | rsnd_mod_write(mod, BRRA, 0x00000002); /* 1/6 */ |
| 332 | rsnd_mod_write(mod, BRRB, 0x00000002); /* 1/6 */ |
| 333 | |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 334 | /* |
| 335 | * This "mod" = "ssi" here. |
| 336 | * we can get "ssi id" from mod |
| 337 | */ |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 338 | rsnd_adg_set_ssi_clk(mod, data); |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 339 | |
Kuninori Morimoto | e337853 | 2013-12-19 19:26:31 -0800 | [diff] [blame] | 340 | dev_dbg(dev, "ADG: ssi%d selects clk%d = %d", |
| 341 | rsnd_mod_id(mod), i, rate); |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 342 | |
| 343 | return 0; |
| 344 | } |
| 345 | |
| 346 | static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg) |
| 347 | { |
| 348 | struct clk *clk; |
| 349 | unsigned long rate; |
| 350 | u32 ckr; |
| 351 | int i; |
| 352 | int brg_table[] = { |
| 353 | [CLKA] = 0x0, |
| 354 | [CLKB] = 0x1, |
| 355 | [CLKC] = 0x4, |
| 356 | [CLKI] = 0x2, |
| 357 | }; |
| 358 | |
| 359 | /* |
| 360 | * This driver is assuming that AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC |
| 361 | * have 44.1kHz or 48kHz base clocks for now. |
| 362 | * |
| 363 | * SSI itself can divide parent clock by 1/1 - 1/16 |
| 364 | * So, BRGA outputs 44.1kHz base parent clock 1/32, |
| 365 | * and, BRGB outputs 48.0kHz base parent clock 1/32 here. |
| 366 | * see |
| 367 | * rsnd_adg_ssi_clk_try_start() |
| 368 | */ |
| 369 | ckr = 0; |
Kuninori Morimoto | 7808aa3 | 2013-12-19 19:27:19 -0800 | [diff] [blame] | 370 | adg->rbga_rate_for_441khz_div_6 = 0; |
| 371 | adg->rbgb_rate_for_48khz_div_6 = 0; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 372 | for_each_rsnd_clk(clk, adg, i) { |
| 373 | rate = clk_get_rate(clk); |
| 374 | |
| 375 | if (0 == rate) /* not used */ |
| 376 | continue; |
| 377 | |
| 378 | /* RBGA */ |
Kuninori Morimoto | 7808aa3 | 2013-12-19 19:27:19 -0800 | [diff] [blame] | 379 | if (!adg->rbga_rate_for_441khz_div_6 && (0 == rate % 44100)) { |
| 380 | adg->rbga_rate_for_441khz_div_6 = rate / 6; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 381 | ckr |= brg_table[i] << 20; |
| 382 | } |
| 383 | |
| 384 | /* RBGB */ |
Kuninori Morimoto | 7808aa3 | 2013-12-19 19:27:19 -0800 | [diff] [blame] | 385 | if (!adg->rbgb_rate_for_48khz_div_6 && (0 == rate % 48000)) { |
| 386 | adg->rbgb_rate_for_48khz_div_6 = rate / 6; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 387 | ckr |= brg_table[i] << 16; |
| 388 | } |
| 389 | } |
| 390 | |
Kuninori Morimoto | efeb970 | 2013-09-23 23:12:17 -0700 | [diff] [blame] | 391 | adg->ckr = ckr; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | int rsnd_adg_probe(struct platform_device *pdev, |
Kuninori Morimoto | 90e8e50 | 2014-03-17 19:29:55 -0700 | [diff] [blame] | 395 | const struct rsnd_of_data *of_data, |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 396 | struct rsnd_priv *priv) |
| 397 | { |
| 398 | struct rsnd_adg *adg; |
| 399 | struct device *dev = rsnd_priv_to_dev(priv); |
Kuninori Morimoto | 5e392ea | 2014-05-08 01:59:00 -0700 | [diff] [blame^] | 400 | struct clk *clk; |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 401 | int i; |
| 402 | |
| 403 | adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL); |
| 404 | if (!adg) { |
| 405 | dev_err(dev, "ADG allocate failed\n"); |
| 406 | return -ENOMEM; |
| 407 | } |
| 408 | |
Kuninori Morimoto | 468be93 | 2014-03-02 23:43:11 -0800 | [diff] [blame] | 409 | adg->clk[CLKA] = devm_clk_get(dev, "clk_a"); |
| 410 | adg->clk[CLKB] = devm_clk_get(dev, "clk_b"); |
| 411 | adg->clk[CLKC] = devm_clk_get(dev, "clk_c"); |
| 412 | adg->clk[CLKI] = devm_clk_get(dev, "clk_i"); |
Kuninori Morimoto | 8691d07 | 2014-02-07 00:53:06 -0800 | [diff] [blame] | 413 | |
Kuninori Morimoto | 5e392ea | 2014-05-08 01:59:00 -0700 | [diff] [blame^] | 414 | for_each_rsnd_clk(clk, adg, i) |
| 415 | dev_dbg(dev, "clk %d : %p\n", i, clk); |
Kuninori Morimoto | dfc9403 | 2013-07-21 21:36:46 -0700 | [diff] [blame] | 416 | |
| 417 | rsnd_adg_ssi_clk_init(priv, adg); |
| 418 | |
| 419 | priv->adg = adg; |
| 420 | |
| 421 | dev_dbg(dev, "adg probed\n"); |
| 422 | |
| 423 | return 0; |
| 424 | } |