clk-cpu-8996.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4. */
  5. /*
  6. * Each of the CPU clusters (Power and Perf) on msm8996 are
  7. * clocked via 2 PLLs, a primary and alternate. There are also
  8. * 2 Mux'es, a primary and secondary all connected together
  9. * as shown below
  10. *
  11. * +-------+
  12. * XO | |
  13. * +------------------>0 |
  14. * | |
  15. * PLL/2 | SMUX +----+
  16. * +------->1 | |
  17. * | | | |
  18. * | +-------+ | +-------+
  19. * | +---->0 |
  20. * | | |
  21. * +---------------+ | +----------->1 | CPU clk
  22. * |Primary PLL +----+ PLL_EARLY | | +------>
  23. * | +------+-----------+ +------>2 PMUX |
  24. * +---------------+ | | | |
  25. * | +------+ | +-->3 |
  26. * +--^+ ACD +-----+ | +-------+
  27. * +---------------+ +------+ |
  28. * |Alt PLL | |
  29. * | +---------------------------+
  30. * +---------------+ PLL_EARLY
  31. *
  32. * The primary PLL is what drives the CPU clk, except for times
  33. * when we are reprogramming the PLL itself (for rate changes) when
  34. * we temporarily switch to an alternate PLL.
  35. *
  36. * The primary PLL operates on a single VCO range, between 600MHz
  37. * and 3GHz. However the CPUs do support OPPs with frequencies
  38. * between 300MHz and 600MHz. In order to support running the CPUs
  39. * at those frequencies we end up having to lock the PLL at twice
  40. * the rate and drive the CPU clk via the PLL/2 output and SMUX.
  41. *
  42. * So for frequencies above 600MHz we follow the following path
  43. * Primary PLL --> PLL_EARLY --> PMUX(1) --> CPU clk
  44. * and for frequencies between 300MHz and 600MHz we follow
  45. * Primary PLL --> PLL/2 --> SMUX(1) --> PMUX(0) --> CPU clk
  46. *
  47. * ACD stands for Adaptive Clock Distribution and is used to
  48. * detect voltage droops.
  49. */
  50. #include <linux/bitfield.h>
  51. #include <linux/clk.h>
  52. #include <linux/clk-provider.h>
  53. #include <linux/io.h>
  54. #include <linux/module.h>
  55. #include <linux/platform_device.h>
  56. #include <linux/regmap.h>
  57. #include <soc/qcom/kryo-l2-accessors.h>
  58. #include "clk-alpha-pll.h"
  59. #include "clk-regmap.h"
  60. #include "clk-regmap-mux.h"
  61. enum _pmux_input {
  62. SMUX_INDEX = 0,
  63. PLL_INDEX,
  64. ACD_INDEX,
  65. ALT_INDEX,
  66. NUM_OF_PMUX_INPUTS
  67. };
  68. #define DIV_2_THRESHOLD 600000000
  69. #define PWRCL_REG_OFFSET 0x0
  70. #define PERFCL_REG_OFFSET 0x80000
  71. #define MUX_OFFSET 0x40
  72. #define ALT_PLL_OFFSET 0x100
  73. #define SSSCTL_OFFSET 0x160
  74. #define PMUX_MASK 0x3
  75. static const u8 prim_pll_regs[PLL_OFF_MAX_REGS] = {
  76. [PLL_OFF_L_VAL] = 0x04,
  77. [PLL_OFF_ALPHA_VAL] = 0x08,
  78. [PLL_OFF_USER_CTL] = 0x10,
  79. [PLL_OFF_CONFIG_CTL] = 0x18,
  80. [PLL_OFF_CONFIG_CTL_U] = 0x1c,
  81. [PLL_OFF_TEST_CTL] = 0x20,
  82. [PLL_OFF_TEST_CTL_U] = 0x24,
  83. [PLL_OFF_STATUS] = 0x28,
  84. };
  85. static const u8 alt_pll_regs[PLL_OFF_MAX_REGS] = {
  86. [PLL_OFF_L_VAL] = 0x04,
  87. [PLL_OFF_ALPHA_VAL] = 0x08,
  88. [PLL_OFF_ALPHA_VAL_U] = 0x0c,
  89. [PLL_OFF_USER_CTL] = 0x10,
  90. [PLL_OFF_USER_CTL_U] = 0x14,
  91. [PLL_OFF_CONFIG_CTL] = 0x18,
  92. [PLL_OFF_TEST_CTL] = 0x20,
  93. [PLL_OFF_TEST_CTL_U] = 0x24,
  94. [PLL_OFF_STATUS] = 0x28,
  95. };
  96. /* PLLs */
  97. static const struct alpha_pll_config hfpll_config = {
  98. .l = 60,
  99. .config_ctl_val = 0x200d4aa8,
  100. .config_ctl_hi_val = 0x006,
  101. .pre_div_mask = BIT(12),
  102. .post_div_mask = 0x3 << 8,
  103. .post_div_val = 0x1 << 8,
  104. .main_output_mask = BIT(0),
  105. .early_output_mask = BIT(3),
  106. };
  107. static const struct clk_parent_data pll_parent[] = {
  108. { .fw_name = "xo" },
  109. };
  110. static struct clk_alpha_pll pwrcl_pll = {
  111. .offset = PWRCL_REG_OFFSET,
  112. .regs = prim_pll_regs,
  113. .flags = SUPPORTS_DYNAMIC_UPDATE | SUPPORTS_FSM_MODE,
  114. .clkr.hw.init = &(struct clk_init_data){
  115. .name = "pwrcl_pll",
  116. .parent_data = pll_parent,
  117. .num_parents = ARRAY_SIZE(pll_parent),
  118. .ops = &clk_alpha_pll_huayra_ops,
  119. },
  120. };
  121. static struct clk_alpha_pll perfcl_pll = {
  122. .offset = PERFCL_REG_OFFSET,
  123. .regs = prim_pll_regs,
  124. .flags = SUPPORTS_DYNAMIC_UPDATE | SUPPORTS_FSM_MODE,
  125. .clkr.hw.init = &(struct clk_init_data){
  126. .name = "perfcl_pll",
  127. .parent_data = pll_parent,
  128. .num_parents = ARRAY_SIZE(pll_parent),
  129. .ops = &clk_alpha_pll_huayra_ops,
  130. },
  131. };
  132. static struct clk_fixed_factor pwrcl_pll_postdiv = {
  133. .mult = 1,
  134. .div = 2,
  135. .hw.init = &(struct clk_init_data){
  136. .name = "pwrcl_pll_postdiv",
  137. .parent_data = &(const struct clk_parent_data){
  138. .hw = &pwrcl_pll.clkr.hw
  139. },
  140. .num_parents = 1,
  141. .ops = &clk_fixed_factor_ops,
  142. .flags = CLK_SET_RATE_PARENT,
  143. },
  144. };
  145. static struct clk_fixed_factor perfcl_pll_postdiv = {
  146. .mult = 1,
  147. .div = 2,
  148. .hw.init = &(struct clk_init_data){
  149. .name = "perfcl_pll_postdiv",
  150. .parent_data = &(const struct clk_parent_data){
  151. .hw = &perfcl_pll.clkr.hw
  152. },
  153. .num_parents = 1,
  154. .ops = &clk_fixed_factor_ops,
  155. .flags = CLK_SET_RATE_PARENT,
  156. },
  157. };
  158. static struct clk_fixed_factor perfcl_pll_acd = {
  159. .mult = 1,
  160. .div = 1,
  161. .hw.init = &(struct clk_init_data){
  162. .name = "perfcl_pll_acd",
  163. .parent_data = &(const struct clk_parent_data){
  164. .hw = &perfcl_pll.clkr.hw
  165. },
  166. .num_parents = 1,
  167. .ops = &clk_fixed_factor_ops,
  168. .flags = CLK_SET_RATE_PARENT,
  169. },
  170. };
  171. static struct clk_fixed_factor pwrcl_pll_acd = {
  172. .mult = 1,
  173. .div = 1,
  174. .hw.init = &(struct clk_init_data){
  175. .name = "pwrcl_pll_acd",
  176. .parent_data = &(const struct clk_parent_data){
  177. .hw = &pwrcl_pll.clkr.hw
  178. },
  179. .num_parents = 1,
  180. .ops = &clk_fixed_factor_ops,
  181. .flags = CLK_SET_RATE_PARENT,
  182. },
  183. };
  184. static const struct pll_vco alt_pll_vco_modes[] = {
  185. VCO(3, 250000000, 500000000),
  186. VCO(2, 500000000, 750000000),
  187. VCO(1, 750000000, 1000000000),
  188. VCO(0, 1000000000, 2150400000),
  189. };
  190. static const struct alpha_pll_config altpll_config = {
  191. .l = 16,
  192. .vco_val = 0x3 << 20,
  193. .vco_mask = 0x3 << 20,
  194. .config_ctl_val = 0x4001051b,
  195. .post_div_mask = 0x3 << 8,
  196. .post_div_val = 0x1 << 8,
  197. .main_output_mask = BIT(0),
  198. .early_output_mask = BIT(3),
  199. };
  200. static struct clk_alpha_pll pwrcl_alt_pll = {
  201. .offset = PWRCL_REG_OFFSET + ALT_PLL_OFFSET,
  202. .regs = alt_pll_regs,
  203. .vco_table = alt_pll_vco_modes,
  204. .num_vco = ARRAY_SIZE(alt_pll_vco_modes),
  205. .flags = SUPPORTS_OFFLINE_REQ | SUPPORTS_FSM_MODE,
  206. .clkr.hw.init = &(struct clk_init_data) {
  207. .name = "pwrcl_alt_pll",
  208. .parent_data = pll_parent,
  209. .num_parents = ARRAY_SIZE(pll_parent),
  210. .ops = &clk_alpha_pll_hwfsm_ops,
  211. },
  212. };
  213. static struct clk_alpha_pll perfcl_alt_pll = {
  214. .offset = PERFCL_REG_OFFSET + ALT_PLL_OFFSET,
  215. .regs = alt_pll_regs,
  216. .vco_table = alt_pll_vco_modes,
  217. .num_vco = ARRAY_SIZE(alt_pll_vco_modes),
  218. .flags = SUPPORTS_OFFLINE_REQ | SUPPORTS_FSM_MODE,
  219. .clkr.hw.init = &(struct clk_init_data) {
  220. .name = "perfcl_alt_pll",
  221. .parent_data = pll_parent,
  222. .num_parents = ARRAY_SIZE(pll_parent),
  223. .ops = &clk_alpha_pll_hwfsm_ops,
  224. },
  225. };
  226. struct clk_cpu_8996_pmux {
  227. u32 reg;
  228. struct notifier_block nb;
  229. struct clk_regmap clkr;
  230. };
  231. static int cpu_clk_notifier_cb(struct notifier_block *nb, unsigned long event,
  232. void *data);
  233. #define to_clk_cpu_8996_pmux_nb(_nb) \
  234. container_of(_nb, struct clk_cpu_8996_pmux, nb)
  235. static inline struct clk_cpu_8996_pmux *to_clk_cpu_8996_pmux_hw(struct clk_hw *hw)
  236. {
  237. return container_of(to_clk_regmap(hw), struct clk_cpu_8996_pmux, clkr);
  238. }
  239. static u8 clk_cpu_8996_pmux_get_parent(struct clk_hw *hw)
  240. {
  241. struct clk_regmap *clkr = to_clk_regmap(hw);
  242. struct clk_cpu_8996_pmux *cpuclk = to_clk_cpu_8996_pmux_hw(hw);
  243. u32 val;
  244. regmap_read(clkr->regmap, cpuclk->reg, &val);
  245. return FIELD_GET(PMUX_MASK, val);
  246. }
  247. static int clk_cpu_8996_pmux_set_parent(struct clk_hw *hw, u8 index)
  248. {
  249. struct clk_regmap *clkr = to_clk_regmap(hw);
  250. struct clk_cpu_8996_pmux *cpuclk = to_clk_cpu_8996_pmux_hw(hw);
  251. u32 val;
  252. val = FIELD_PREP(PMUX_MASK, index);
  253. return regmap_update_bits(clkr->regmap, cpuclk->reg, PMUX_MASK, val);
  254. }
  255. static int clk_cpu_8996_pmux_determine_rate(struct clk_hw *hw,
  256. struct clk_rate_request *req)
  257. {
  258. struct clk_hw *parent;
  259. if (req->rate < (DIV_2_THRESHOLD / 2))
  260. return -EINVAL;
  261. if (req->rate < DIV_2_THRESHOLD)
  262. parent = clk_hw_get_parent_by_index(hw, SMUX_INDEX);
  263. else
  264. parent = clk_hw_get_parent_by_index(hw, ACD_INDEX);
  265. if (!parent)
  266. return -EINVAL;
  267. req->best_parent_rate = clk_hw_round_rate(parent, req->rate);
  268. req->best_parent_hw = parent;
  269. return 0;
  270. }
  271. static const struct clk_ops clk_cpu_8996_pmux_ops = {
  272. .set_parent = clk_cpu_8996_pmux_set_parent,
  273. .get_parent = clk_cpu_8996_pmux_get_parent,
  274. .determine_rate = clk_cpu_8996_pmux_determine_rate,
  275. };
  276. static const struct clk_parent_data pwrcl_smux_parents[] = {
  277. { .fw_name = "xo" },
  278. { .hw = &pwrcl_pll_postdiv.hw },
  279. };
  280. static const struct clk_parent_data perfcl_smux_parents[] = {
  281. { .fw_name = "xo" },
  282. { .hw = &perfcl_pll_postdiv.hw },
  283. };
  284. static struct clk_regmap_mux pwrcl_smux = {
  285. .reg = PWRCL_REG_OFFSET + MUX_OFFSET,
  286. .shift = 2,
  287. .width = 2,
  288. .clkr.hw.init = &(struct clk_init_data) {
  289. .name = "pwrcl_smux",
  290. .parent_data = pwrcl_smux_parents,
  291. .num_parents = ARRAY_SIZE(pwrcl_smux_parents),
  292. .ops = &clk_regmap_mux_closest_ops,
  293. .flags = CLK_SET_RATE_PARENT,
  294. },
  295. };
  296. static struct clk_regmap_mux perfcl_smux = {
  297. .reg = PERFCL_REG_OFFSET + MUX_OFFSET,
  298. .shift = 2,
  299. .width = 2,
  300. .clkr.hw.init = &(struct clk_init_data) {
  301. .name = "perfcl_smux",
  302. .parent_data = perfcl_smux_parents,
  303. .num_parents = ARRAY_SIZE(perfcl_smux_parents),
  304. .ops = &clk_regmap_mux_closest_ops,
  305. .flags = CLK_SET_RATE_PARENT,
  306. },
  307. };
  308. static const struct clk_hw *pwrcl_pmux_parents[] = {
  309. [SMUX_INDEX] = &pwrcl_smux.clkr.hw,
  310. [PLL_INDEX] = &pwrcl_pll.clkr.hw,
  311. [ACD_INDEX] = &pwrcl_pll_acd.hw,
  312. [ALT_INDEX] = &pwrcl_alt_pll.clkr.hw,
  313. };
  314. static const struct clk_hw *perfcl_pmux_parents[] = {
  315. [SMUX_INDEX] = &perfcl_smux.clkr.hw,
  316. [PLL_INDEX] = &perfcl_pll.clkr.hw,
  317. [ACD_INDEX] = &perfcl_pll_acd.hw,
  318. [ALT_INDEX] = &perfcl_alt_pll.clkr.hw,
  319. };
  320. static struct clk_cpu_8996_pmux pwrcl_pmux = {
  321. .reg = PWRCL_REG_OFFSET + MUX_OFFSET,
  322. .nb.notifier_call = cpu_clk_notifier_cb,
  323. .clkr.hw.init = &(struct clk_init_data) {
  324. .name = "pwrcl_pmux",
  325. .parent_hws = pwrcl_pmux_parents,
  326. .num_parents = ARRAY_SIZE(pwrcl_pmux_parents),
  327. .ops = &clk_cpu_8996_pmux_ops,
  328. /* CPU clock is critical and should never be gated */
  329. .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
  330. },
  331. };
  332. static struct clk_cpu_8996_pmux perfcl_pmux = {
  333. .reg = PERFCL_REG_OFFSET + MUX_OFFSET,
  334. .nb.notifier_call = cpu_clk_notifier_cb,
  335. .clkr.hw.init = &(struct clk_init_data) {
  336. .name = "perfcl_pmux",
  337. .parent_hws = perfcl_pmux_parents,
  338. .num_parents = ARRAY_SIZE(perfcl_pmux_parents),
  339. .ops = &clk_cpu_8996_pmux_ops,
  340. /* CPU clock is critical and should never be gated */
  341. .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
  342. },
  343. };
  344. static const struct regmap_config cpu_msm8996_regmap_config = {
  345. .reg_bits = 32,
  346. .reg_stride = 4,
  347. .val_bits = 32,
  348. .max_register = 0x80210,
  349. .fast_io = true,
  350. .val_format_endian = REGMAP_ENDIAN_LITTLE,
  351. };
  352. static struct clk_hw *cpu_msm8996_hw_clks[] = {
  353. &pwrcl_pll_postdiv.hw,
  354. &perfcl_pll_postdiv.hw,
  355. &pwrcl_pll_acd.hw,
  356. &perfcl_pll_acd.hw,
  357. };
  358. static struct clk_regmap *cpu_msm8996_clks[] = {
  359. &pwrcl_pll.clkr,
  360. &perfcl_pll.clkr,
  361. &pwrcl_alt_pll.clkr,
  362. &perfcl_alt_pll.clkr,
  363. &pwrcl_smux.clkr,
  364. &perfcl_smux.clkr,
  365. &pwrcl_pmux.clkr,
  366. &perfcl_pmux.clkr,
  367. };
  368. static int qcom_cpu_clk_msm8996_register_clks(struct device *dev,
  369. struct regmap *regmap)
  370. {
  371. int i, ret;
  372. for (i = 0; i < ARRAY_SIZE(cpu_msm8996_hw_clks); i++) {
  373. ret = devm_clk_hw_register(dev, cpu_msm8996_hw_clks[i]);
  374. if (ret)
  375. return ret;
  376. }
  377. for (i = 0; i < ARRAY_SIZE(cpu_msm8996_clks); i++) {
  378. ret = devm_clk_register_regmap(dev, cpu_msm8996_clks[i]);
  379. if (ret)
  380. return ret;
  381. }
  382. clk_alpha_pll_configure(&pwrcl_pll, regmap, &hfpll_config);
  383. clk_alpha_pll_configure(&perfcl_pll, regmap, &hfpll_config);
  384. clk_alpha_pll_configure(&pwrcl_alt_pll, regmap, &altpll_config);
  385. clk_alpha_pll_configure(&perfcl_alt_pll, regmap, &altpll_config);
  386. /* Enable alt PLLs */
  387. clk_prepare_enable(pwrcl_alt_pll.clkr.hw.clk);
  388. clk_prepare_enable(perfcl_alt_pll.clkr.hw.clk);
  389. devm_clk_notifier_register(dev, pwrcl_pmux.clkr.hw.clk, &pwrcl_pmux.nb);
  390. devm_clk_notifier_register(dev, perfcl_pmux.clkr.hw.clk, &perfcl_pmux.nb);
  391. return ret;
  392. }
  393. #define CPU_AFINITY_MASK 0xFFF
  394. #define PWRCL_CPU_REG_MASK 0x3
  395. #define PERFCL_CPU_REG_MASK 0x103
  396. #define L2ACDCR_REG 0x580ULL
  397. #define L2ACDTD_REG 0x581ULL
  398. #define L2ACDDVMRC_REG 0x584ULL
  399. #define L2ACDSSCR_REG 0x589ULL
  400. static DEFINE_SPINLOCK(qcom_clk_acd_lock);
  401. static void __iomem *base;
  402. static void qcom_cpu_clk_msm8996_acd_init(void __iomem *base)
  403. {
  404. u64 hwid;
  405. unsigned long flags;
  406. spin_lock_irqsave(&qcom_clk_acd_lock, flags);
  407. hwid = read_cpuid_mpidr() & CPU_AFINITY_MASK;
  408. kryo_l2_set_indirect_reg(L2ACDTD_REG, 0x00006a11);
  409. kryo_l2_set_indirect_reg(L2ACDDVMRC_REG, 0x000e0f0f);
  410. kryo_l2_set_indirect_reg(L2ACDSSCR_REG, 0x00000601);
  411. if (PWRCL_CPU_REG_MASK == (hwid | PWRCL_CPU_REG_MASK)) {
  412. writel(0xf, base + PWRCL_REG_OFFSET + SSSCTL_OFFSET);
  413. kryo_l2_set_indirect_reg(L2ACDCR_REG, 0x002c5ffd);
  414. }
  415. if (PERFCL_CPU_REG_MASK == (hwid | PERFCL_CPU_REG_MASK)) {
  416. kryo_l2_set_indirect_reg(L2ACDCR_REG, 0x002c5ffd);
  417. writel(0xf, base + PERFCL_REG_OFFSET + SSSCTL_OFFSET);
  418. }
  419. spin_unlock_irqrestore(&qcom_clk_acd_lock, flags);
  420. }
  421. static int cpu_clk_notifier_cb(struct notifier_block *nb, unsigned long event,
  422. void *data)
  423. {
  424. struct clk_cpu_8996_pmux *cpuclk = to_clk_cpu_8996_pmux_nb(nb);
  425. struct clk_notifier_data *cnd = data;
  426. int ret;
  427. switch (event) {
  428. case PRE_RATE_CHANGE:
  429. ret = clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw, ALT_INDEX);
  430. qcom_cpu_clk_msm8996_acd_init(base);
  431. break;
  432. case POST_RATE_CHANGE:
  433. if (cnd->new_rate < DIV_2_THRESHOLD)
  434. ret = clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw,
  435. SMUX_INDEX);
  436. else
  437. ret = clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw,
  438. ACD_INDEX);
  439. break;
  440. default:
  441. ret = 0;
  442. break;
  443. }
  444. return notifier_from_errno(ret);
  445. };
  446. static int qcom_cpu_clk_msm8996_driver_probe(struct platform_device *pdev)
  447. {
  448. struct regmap *regmap;
  449. struct clk_hw_onecell_data *data;
  450. struct device *dev = &pdev->dev;
  451. int ret;
  452. data = devm_kzalloc(dev, struct_size(data, hws, 2), GFP_KERNEL);
  453. if (!data)
  454. return -ENOMEM;
  455. base = devm_platform_ioremap_resource(pdev, 0);
  456. if (IS_ERR(base))
  457. return PTR_ERR(base);
  458. regmap = devm_regmap_init_mmio(dev, base, &cpu_msm8996_regmap_config);
  459. if (IS_ERR(regmap))
  460. return PTR_ERR(regmap);
  461. ret = qcom_cpu_clk_msm8996_register_clks(dev, regmap);
  462. if (ret)
  463. return ret;
  464. qcom_cpu_clk_msm8996_acd_init(base);
  465. data->hws[0] = &pwrcl_pmux.clkr.hw;
  466. data->hws[1] = &perfcl_pmux.clkr.hw;
  467. data->num = 2;
  468. return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, data);
  469. }
  470. static const struct of_device_id qcom_cpu_clk_msm8996_match_table[] = {
  471. { .compatible = "qcom,msm8996-apcc" },
  472. {}
  473. };
  474. MODULE_DEVICE_TABLE(of, qcom_cpu_clk_msm8996_match_table);
  475. static struct platform_driver qcom_cpu_clk_msm8996_driver = {
  476. .probe = qcom_cpu_clk_msm8996_driver_probe,
  477. .driver = {
  478. .name = "qcom-msm8996-apcc",
  479. .of_match_table = qcom_cpu_clk_msm8996_match_table,
  480. },
  481. };
  482. module_platform_driver(qcom_cpu_clk_msm8996_driver);
  483. MODULE_DESCRIPTION("QCOM MSM8996 CPU Clock Driver");
  484. MODULE_LICENSE("GPL v2");