audio-ext-clk-up.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  3. */
  4. #include <linux/kernel.h>
  5. #include <linux/init.h>
  6. #include <linux/io.h>
  7. #include <linux/err.h>
  8. #include <linux/module.h>
  9. #include <linux/of.h>
  10. #include <linux/clk.h>
  11. #include <linux/clk-provider.h>
  12. #include "../../../drivers/clk/qcom/common.h"
  13. #include <linux/pinctrl/consumer.h>
  14. #include <linux/platform_device.h>
  15. #include <dt-bindings/clock/qcom,audio-ext-clk.h>
  16. #include <dsp/q6afe-v2.h>
  17. #include "audio-ext-clk-up.h"
  18. enum {
  19. AUDIO_EXT_CLK_PMI,
  20. AUDIO_EXT_CLK_LNBB2,
  21. AUDIO_EXT_CLK_LPASS,
  22. AUDIO_EXT_CLK_LPASS2,
  23. AUDIO_EXT_CLK_LPASS3,
  24. AUDIO_EXT_CLK_LPASS4,
  25. AUDIO_EXT_CLK_LPASS5,
  26. AUDIO_EXT_CLK_LPASS6,
  27. AUDIO_EXT_CLK_LPASS7,
  28. AUDIO_EXT_CLK_LPASS_CORE_HW_VOTE,
  29. AUDIO_EXT_CLK_LPASS8,
  30. AUDIO_EXT_CLK_LPASS_AUDIO_HW_VOTE,
  31. AUDIO_EXT_CLK_LPASS_MAX,
  32. AUDIO_EXT_CLK_EXTERNAL_PLL = AUDIO_EXT_CLK_LPASS_MAX,
  33. AUDIO_EXT_CLK_MAX,
  34. };
  35. struct pinctrl_info {
  36. struct pinctrl *pinctrl;
  37. struct pinctrl_state *sleep;
  38. struct pinctrl_state *active;
  39. char __iomem *base;
  40. };
  41. struct audio_ext_clk {
  42. struct pinctrl_info pnctrl_info;
  43. struct clk_fixed_factor fact;
  44. };
  45. struct audio_ext_clk_priv {
  46. struct device *dev;
  47. int clk_src;
  48. struct afe_clk_set clk_cfg;
  49. struct audio_ext_clk audio_clk;
  50. const char *clk_name;
  51. uint32_t lpass_core_hwvote_client_handle;
  52. uint32_t lpass_audio_hwvote_client_handle;
  53. };
  54. static inline struct audio_ext_clk_priv *to_audio_clk(struct clk_hw *hw)
  55. {
  56. return container_of(hw, struct audio_ext_clk_priv, audio_clk.fact.hw);
  57. }
  58. static int audio_ext_clk_prepare(struct clk_hw *hw)
  59. {
  60. struct audio_ext_clk_priv *clk_priv = to_audio_clk(hw);
  61. struct pinctrl_info *pnctrl_info = &clk_priv->audio_clk.pnctrl_info;
  62. int ret;
  63. if ((clk_priv->clk_src >= AUDIO_EXT_CLK_LPASS) &&
  64. (clk_priv->clk_src < AUDIO_EXT_CLK_LPASS_MAX)) {
  65. clk_priv->clk_cfg.enable = 1;
  66. trace_printk("%s: vote for %d clock\n",
  67. __func__, clk_priv->clk_src);
  68. ret = afe_set_lpass_clk_cfg(IDX_RSVD_3, &clk_priv->clk_cfg);
  69. if (ret < 0) {
  70. pr_err_ratelimited("%s afe_set_digital_codec_core_clock failed\n",
  71. __func__);
  72. return ret;
  73. }
  74. }
  75. if (pnctrl_info->pinctrl) {
  76. ret = pinctrl_select_state(pnctrl_info->pinctrl,
  77. pnctrl_info->active);
  78. if (ret) {
  79. pr_err("%s: active state select failed with %d\n",
  80. __func__, ret);
  81. return -EIO;
  82. }
  83. }
  84. if (pnctrl_info->base)
  85. iowrite32(1, pnctrl_info->base);
  86. return 0;
  87. }
  88. static void audio_ext_clk_unprepare(struct clk_hw *hw)
  89. {
  90. struct audio_ext_clk_priv *clk_priv = to_audio_clk(hw);
  91. struct pinctrl_info *pnctrl_info = &clk_priv->audio_clk.pnctrl_info;
  92. int ret;
  93. if (pnctrl_info->pinctrl) {
  94. ret = pinctrl_select_state(pnctrl_info->pinctrl,
  95. pnctrl_info->sleep);
  96. if (ret) {
  97. pr_err("%s: active state select failed with %d\n",
  98. __func__, ret);
  99. return;
  100. }
  101. }
  102. if ((clk_priv->clk_src >= AUDIO_EXT_CLK_LPASS) &&
  103. (clk_priv->clk_src < AUDIO_EXT_CLK_LPASS_MAX)) {
  104. clk_priv->clk_cfg.enable = 0;
  105. trace_printk("%s: unvote for %d clock\n",
  106. __func__, clk_priv->clk_src);
  107. ret = afe_set_lpass_clk_cfg(IDX_RSVD_3, &clk_priv->clk_cfg);
  108. if (ret < 0)
  109. pr_err_ratelimited("%s: afe_set_lpass_clk_cfg failed, ret = %d\n",
  110. __func__, ret);
  111. }
  112. if (pnctrl_info->base)
  113. iowrite32(0, pnctrl_info->base);
  114. }
  115. static u8 audio_ext_clk_get_parent(struct clk_hw *hw)
  116. {
  117. struct audio_ext_clk_priv *clk_priv = to_audio_clk(hw);
  118. int num_parents = clk_hw_get_num_parents(hw);
  119. const char * const *parent_names = hw->init->parent_names;
  120. u8 i = 0, ret = hw->init->num_parents + 1;
  121. if ((clk_priv->clk_src == AUDIO_EXT_CLK_PMI) && clk_priv->clk_name) {
  122. for (i = 0; i < num_parents; i++) {
  123. if (!strcmp(parent_names[i], clk_priv->clk_name))
  124. ret = i;
  125. }
  126. pr_debug("%s: parent index = %u\n", __func__, ret);
  127. return ret;
  128. } else
  129. return 0;
  130. }
  131. static int lpass_hw_vote_prepare(struct clk_hw *hw)
  132. {
  133. struct audio_ext_clk_priv *clk_priv = to_audio_clk(hw);
  134. int ret;
  135. if (clk_priv->clk_src == AUDIO_EXT_CLK_LPASS_CORE_HW_VOTE) {
  136. trace_printk("%s: vote for %d clock\n",
  137. __func__, clk_priv->clk_src);
  138. ret = afe_vote_lpass_core_hw(AFE_LPASS_CORE_HW_MACRO_BLOCK,
  139. "LPASS_HW_MACRO",
  140. &clk_priv->lpass_core_hwvote_client_handle);
  141. if (ret < 0) {
  142. pr_err("%s lpass core hw vote failed %d\n",
  143. __func__, ret);
  144. return ret;
  145. }
  146. }
  147. if (clk_priv->clk_src == AUDIO_EXT_CLK_LPASS_AUDIO_HW_VOTE) {
  148. trace_printk("%s: vote for %d clock\n",
  149. __func__, clk_priv->clk_src);
  150. ret = afe_vote_lpass_core_hw(AFE_LPASS_CORE_HW_DCODEC_BLOCK,
  151. "LPASS_HW_DCODEC",
  152. &clk_priv->lpass_audio_hwvote_client_handle);
  153. if (ret < 0) {
  154. pr_err("%s lpass audio hw vote failed %d\n",
  155. __func__, ret);
  156. return ret;
  157. }
  158. }
  159. return 0;
  160. }
  161. static void lpass_hw_vote_unprepare(struct clk_hw *hw)
  162. {
  163. struct audio_ext_clk_priv *clk_priv = to_audio_clk(hw);
  164. int ret = 0;
  165. if (clk_priv->clk_src == AUDIO_EXT_CLK_LPASS_CORE_HW_VOTE) {
  166. trace_printk("%s: unvote for %d clock\n",
  167. __func__, clk_priv->clk_src);
  168. ret = afe_unvote_lpass_core_hw(
  169. AFE_LPASS_CORE_HW_MACRO_BLOCK,
  170. clk_priv->lpass_core_hwvote_client_handle);
  171. if (ret < 0) {
  172. pr_err("%s lpass core hw vote failed %d\n",
  173. __func__, ret);
  174. }
  175. }
  176. if (clk_priv->clk_src == AUDIO_EXT_CLK_LPASS_AUDIO_HW_VOTE) {
  177. trace_printk("%s: unvote for %d clock\n",
  178. __func__, clk_priv->clk_src);
  179. ret = afe_unvote_lpass_core_hw(
  180. AFE_LPASS_CORE_HW_DCODEC_BLOCK,
  181. clk_priv->lpass_audio_hwvote_client_handle);
  182. if (ret < 0) {
  183. pr_err("%s lpass audio hw unvote failed %d\n",
  184. __func__, ret);
  185. }
  186. }
  187. }
  188. static const struct clk_ops audio_ext_clk_ops = {
  189. .prepare = audio_ext_clk_prepare,
  190. .unprepare = audio_ext_clk_unprepare,
  191. .get_parent = audio_ext_clk_get_parent,
  192. };
  193. static const struct clk_ops lpass_hw_vote_ops = {
  194. .prepare = lpass_hw_vote_prepare,
  195. .unprepare = lpass_hw_vote_unprepare,
  196. };
  197. static const char * const audio_ext_pmi_div_clk[] = {
  198. "qpnp_clkdiv_1",
  199. "pms405_div_clk1",
  200. "pm6150_div_clk1",
  201. "pm6125_div_clk1",
  202. };
  203. static int audio_ext_clk_dummy_prepare(struct clk_hw *hw)
  204. {
  205. return 0;
  206. }
  207. static void audio_ext_clk_dummy_unprepare(struct clk_hw *hw)
  208. {
  209. }
  210. static const struct clk_ops audio_ext_clk_dummy_ops = {
  211. .prepare = audio_ext_clk_dummy_prepare,
  212. .unprepare = audio_ext_clk_dummy_unprepare,
  213. };
  214. static struct audio_ext_clk audio_clk_array[] = {
  215. {
  216. .pnctrl_info = {NULL},
  217. .fact = {
  218. .mult = 1,
  219. .div = 1,
  220. .hw.init = &(struct clk_init_data){
  221. .name = "audio_ext_pmi_clk",
  222. .parent_names = audio_ext_pmi_div_clk,
  223. .num_parents =
  224. ARRAY_SIZE(audio_ext_pmi_div_clk),
  225. .ops = &audio_ext_clk_ops,
  226. },
  227. },
  228. },
  229. {
  230. .pnctrl_info = {NULL},
  231. .fact = {
  232. .mult = 1,
  233. .div = 1,
  234. .hw.init = &(struct clk_init_data){
  235. .name = "audio_ext_pmi_lnbb_clk",
  236. .parent_names = (const char *[])
  237. { "ln_bb_clk2" },
  238. .num_parents = 1,
  239. .ops = &audio_ext_clk_dummy_ops,
  240. },
  241. },
  242. },
  243. {
  244. .pnctrl_info = {NULL},
  245. .fact = {
  246. .mult = 1,
  247. .div = 1,
  248. .hw.init = &(struct clk_init_data){
  249. .name = "audio_lpass_mclk",
  250. .ops = &audio_ext_clk_ops,
  251. },
  252. },
  253. },
  254. {
  255. .pnctrl_info = {NULL},
  256. .fact = {
  257. .mult = 1,
  258. .div = 1,
  259. .hw.init = &(struct clk_init_data){
  260. .name = "audio_lpass_mclk2",
  261. .ops = &audio_ext_clk_ops,
  262. },
  263. },
  264. },
  265. {
  266. .pnctrl_info = {NULL},
  267. .fact = {
  268. .mult = 1,
  269. .div = 1,
  270. .hw.init = &(struct clk_init_data){
  271. .name = "audio_lpass_mclk3",
  272. .ops = &audio_ext_clk_ops,
  273. },
  274. },
  275. },
  276. {
  277. .pnctrl_info = {NULL},
  278. .fact = {
  279. .mult = 1,
  280. .div = 1,
  281. .hw.init = &(struct clk_init_data){
  282. .name = "audio_lpass_mclk4",
  283. .ops = &audio_ext_clk_ops,
  284. },
  285. },
  286. },
  287. {
  288. .pnctrl_info = {NULL},
  289. .fact = {
  290. .mult = 1,
  291. .div = 1,
  292. .hw.init = &(struct clk_init_data){
  293. .name = "audio_lpass_mclk5",
  294. .ops = &audio_ext_clk_ops,
  295. },
  296. },
  297. },
  298. {
  299. .pnctrl_info = {NULL},
  300. .fact = {
  301. .mult = 1,
  302. .div = 1,
  303. .hw.init = &(struct clk_init_data){
  304. .name = "audio_lpass_mclk6",
  305. .ops = &audio_ext_clk_ops,
  306. },
  307. },
  308. },
  309. {
  310. .pnctrl_info = {NULL},
  311. .fact = {
  312. .mult = 1,
  313. .div = 1,
  314. .hw.init = &(struct clk_init_data){
  315. .name = "audio_lpass_mclk7",
  316. .ops = &audio_ext_clk_ops,
  317. },
  318. },
  319. },
  320. {
  321. .pnctrl_info = {NULL},
  322. .fact = {
  323. .hw.init = &(struct clk_init_data){
  324. .name = "lpass_hw_vote_clk",
  325. .ops = &lpass_hw_vote_ops,
  326. },
  327. },
  328. },
  329. {
  330. .pnctrl_info = {NULL},
  331. .fact = {
  332. .mult = 1,
  333. .div = 1,
  334. .hw.init = &(struct clk_init_data){
  335. .name = "audio_lpass_mclk8",
  336. .ops = &audio_ext_clk_ops,
  337. },
  338. },
  339. },
  340. {
  341. .pnctrl_info = {NULL},
  342. .fact = {
  343. .hw.init = &(struct clk_init_data){
  344. .name = "lpass_audio_hw_vote_clk",
  345. .ops = &lpass_hw_vote_ops,
  346. },
  347. },
  348. },
  349. {
  350. .pnctrl_info = {NULL},
  351. .fact = {
  352. .mult = 1,
  353. .div = 1,
  354. .hw.init = &(struct clk_init_data){
  355. .name = "audio_external_pll_clk",
  356. .ops = &audio_ext_clk_ops,
  357. },
  358. },
  359. },
  360. };
  361. static int audio_get_pinctrl(struct platform_device *pdev)
  362. {
  363. struct device *dev = &pdev->dev;
  364. struct audio_ext_clk_priv *clk_priv = platform_get_drvdata(pdev);
  365. struct pinctrl_info *pnctrl_info;
  366. struct pinctrl *pinctrl;
  367. int ret;
  368. u32 reg;
  369. pnctrl_info = &clk_priv->audio_clk.pnctrl_info;
  370. if (pnctrl_info->pinctrl) {
  371. dev_err(dev, "%s: already requested before\n",
  372. __func__);
  373. return -EINVAL;
  374. }
  375. pinctrl = devm_pinctrl_get(dev);
  376. if (IS_ERR_OR_NULL(pinctrl)) {
  377. dev_err(dev, "%s: Unable to get pinctrl handle\n",
  378. __func__);
  379. return -EINVAL;
  380. }
  381. pnctrl_info->pinctrl = pinctrl;
  382. /* get all state handles from Device Tree */
  383. pnctrl_info->sleep = pinctrl_lookup_state(pinctrl, "sleep");
  384. if (IS_ERR(pnctrl_info->sleep)) {
  385. dev_err(dev, "%s: could not get sleep pinstate\n",
  386. __func__);
  387. goto err;
  388. }
  389. pnctrl_info->active = pinctrl_lookup_state(pinctrl, "active");
  390. if (IS_ERR(pnctrl_info->active)) {
  391. dev_err(dev, "%s: could not get active pinstate\n",
  392. __func__);
  393. goto err;
  394. }
  395. /* Reset the TLMM pins to a default state */
  396. ret = pinctrl_select_state(pnctrl_info->pinctrl,
  397. pnctrl_info->sleep);
  398. if (ret) {
  399. dev_err(dev, "%s: Disable TLMM pins failed with %d\n",
  400. __func__, ret);
  401. goto err;
  402. }
  403. ret = of_property_read_u32(dev->of_node, "qcom,mclk-clk-reg", &reg);
  404. if (ret < 0) {
  405. dev_dbg(dev, "%s: miss mclk reg\n", __func__);
  406. } else {
  407. pnctrl_info->base = ioremap(reg, sizeof(u32));
  408. if (pnctrl_info->base == NULL) {
  409. dev_err(dev, "%s ioremap failed\n", __func__);
  410. goto err;
  411. }
  412. }
  413. return 0;
  414. err:
  415. devm_pinctrl_put(pnctrl_info->pinctrl);
  416. return -EINVAL;
  417. }
  418. static int audio_put_pinctrl(struct platform_device *pdev)
  419. {
  420. struct audio_ext_clk_priv *clk_priv = platform_get_drvdata(pdev);
  421. struct pinctrl_info *pnctrl_info = NULL;
  422. pnctrl_info = &clk_priv->audio_clk.pnctrl_info;
  423. if (pnctrl_info && pnctrl_info->pinctrl) {
  424. devm_pinctrl_put(pnctrl_info->pinctrl);
  425. pnctrl_info->pinctrl = NULL;
  426. }
  427. return 0;
  428. }
  429. static int audio_get_clk_data(struct platform_device *pdev)
  430. {
  431. int ret;
  432. struct clk *audio_clk;
  433. struct clk_hw *clkhw;
  434. struct clk_onecell_data *clk_data;
  435. struct audio_ext_clk_priv *clk_priv = platform_get_drvdata(pdev);
  436. clk_data = devm_kzalloc(&pdev->dev, sizeof(*clk_data), GFP_KERNEL);
  437. if (!clk_data)
  438. return -ENOMEM;
  439. clk_data->clk_num = 1;
  440. clk_data->clks = devm_kzalloc(&pdev->dev,
  441. sizeof(struct clk *),
  442. GFP_KERNEL);
  443. if (!clk_data->clks)
  444. return -ENOMEM;
  445. clkhw = &clk_priv->audio_clk.fact.hw;
  446. audio_clk = devm_clk_register(&pdev->dev, clkhw);
  447. if (IS_ERR(audio_clk)) {
  448. dev_err(&pdev->dev,
  449. "%s: clock register failed for clk_src = %d\\n",
  450. __func__, clk_priv->clk_src);
  451. ret = PTR_ERR(audio_clk);
  452. return ret;
  453. }
  454. clk_data->clks[0] = audio_clk;
  455. ret = of_clk_add_provider(pdev->dev.of_node,
  456. of_clk_src_onecell_get, clk_data);
  457. if (ret)
  458. dev_err(&pdev->dev, "%s: clock add failed for clk_src = %d\n",
  459. __func__, clk_priv->clk_src);
  460. return ret;
  461. }
  462. static int audio_ref_clk_probe(struct platform_device *pdev)
  463. {
  464. int ret;
  465. struct audio_ext_clk_priv *clk_priv;
  466. u32 clk_freq = 0, clk_id = 0, clk_src = 0, use_pinctrl = 0;
  467. clk_priv = devm_kzalloc(&pdev->dev, sizeof(*clk_priv), GFP_KERNEL);
  468. if (!clk_priv)
  469. return -ENOMEM;
  470. ret = of_property_read_u32(pdev->dev.of_node,
  471. "qcom,codec-ext-clk-src",
  472. &clk_src);
  473. if (ret) {
  474. dev_err(&pdev->dev, "%s: could not get clk source, ret = %d\n",
  475. __func__, ret);
  476. return ret;
  477. }
  478. if (clk_src >= AUDIO_EXT_CLK_MAX) {
  479. dev_err(&pdev->dev, "%s: Invalid clk source = %d\n",
  480. __func__, clk_src);
  481. return -EINVAL;
  482. }
  483. clk_priv->clk_name = NULL;
  484. clk_priv->clk_src = clk_src;
  485. memcpy(&clk_priv->audio_clk, &audio_clk_array[clk_src],
  486. sizeof(struct audio_ext_clk));
  487. /* Init lpass clk default values */
  488. clk_priv->clk_cfg.clk_set_minor_version =
  489. Q6AFE_LPASS_CLK_CONFIG_API_VERSION;
  490. clk_priv->clk_cfg.clk_id = Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_OSR;
  491. clk_priv->clk_cfg.clk_freq_in_hz = Q6AFE_LPASS_OSR_CLK_9_P600_MHZ;
  492. clk_priv->clk_cfg.clk_attri = Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO;
  493. ret = of_property_read_u32(pdev->dev.of_node,
  494. "qcom,codec-lpass-ext-clk-freq",
  495. &clk_freq);
  496. if (!ret)
  497. clk_priv->clk_cfg.clk_freq_in_hz = clk_freq;
  498. ret = of_property_read_u32(pdev->dev.of_node,
  499. "qcom,codec-lpass-clk-id",
  500. &clk_id);
  501. if (!ret)
  502. clk_priv->clk_cfg.clk_id = clk_id;
  503. dev_dbg(&pdev->dev, "%s: ext-clk freq: %d, lpass clk_id: %d, clk_src: %d\n",
  504. __func__, clk_priv->clk_cfg.clk_freq_in_hz,
  505. clk_priv->clk_cfg.clk_id, clk_priv->clk_src);
  506. platform_set_drvdata(pdev, clk_priv);
  507. ret = of_property_read_string(pdev->dev.of_node, "pmic-clock-names",
  508. &clk_priv->clk_name);
  509. if (ret)
  510. dev_dbg(&pdev->dev, "%s: could not find pmic clock names\n",
  511. __func__);
  512. /*
  513. * property qcom,use-pinctrl to be defined in DTSI to val 1
  514. * for clock nodes using pinctrl
  515. */
  516. of_property_read_u32(pdev->dev.of_node, "qcom,use-pinctrl",
  517. &use_pinctrl);
  518. dev_dbg(&pdev->dev, "%s: use-pinctrl : %d\n",
  519. __func__, use_pinctrl);
  520. if (use_pinctrl) {
  521. ret = audio_get_pinctrl(pdev);
  522. if (ret) {
  523. dev_err(&pdev->dev, "%s: Parsing PMI pinctrl failed\n",
  524. __func__);
  525. return ret;
  526. }
  527. }
  528. ret = audio_get_clk_data(pdev);
  529. if (ret) {
  530. dev_err(&pdev->dev, "%s: clk_init is failed\n",
  531. __func__);
  532. audio_put_pinctrl(pdev);
  533. return ret;
  534. }
  535. return 0;
  536. }
  537. static int audio_ref_clk_remove(struct platform_device *pdev)
  538. {
  539. audio_put_pinctrl(pdev);
  540. return 0;
  541. }
  542. static const struct of_device_id audio_ref_clk_match[] = {
  543. {.compatible = "qcom,audio-ref-clk"},
  544. {}
  545. };
  546. MODULE_DEVICE_TABLE(of, audio_ref_clk_match);
  547. static struct platform_driver audio_ref_clk_driver = {
  548. .driver = {
  549. .name = "audio-ref-clk",
  550. .owner = THIS_MODULE,
  551. .of_match_table = audio_ref_clk_match,
  552. .suppress_bind_attrs = true,
  553. },
  554. .probe = audio_ref_clk_probe,
  555. .remove = audio_ref_clk_remove,
  556. };
  557. int audio_ref_clk_platform_init(void)
  558. {
  559. return platform_driver_register(&audio_ref_clk_driver);
  560. }
  561. void audio_ref_clk_platform_exit(void)
  562. {
  563. platform_driver_unregister(&audio_ref_clk_driver);
  564. }
  565. MODULE_DESCRIPTION("Audio Ref Up Clock module platform driver");
  566. MODULE_LICENSE("GPL v2");