ti-cpufreq.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * TI CPUFreq/OPP hw-supported driver
  4. *
  5. * Copyright (C) 2016-2017 Texas Instruments, Inc.
  6. * Dave Gerlach <d-gerlach@ti.com>
  7. */
  8. #include <linux/cpu.h>
  9. #include <linux/io.h>
  10. #include <linux/mfd/syscon.h>
  11. #include <linux/module.h>
  12. #include <linux/init.h>
  13. #include <linux/of.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/pm_opp.h>
  16. #include <linux/regmap.h>
  17. #include <linux/slab.h>
  18. #include <linux/sys_soc.h>
  19. #define REVISION_MASK 0xF
  20. #define REVISION_SHIFT 28
  21. #define AM33XX_800M_ARM_MPU_MAX_FREQ 0x1E2F
  22. #define AM43XX_600M_ARM_MPU_MAX_FREQ 0xFFA
  23. #define DRA7_EFUSE_HAS_OD_MPU_OPP 11
  24. #define DRA7_EFUSE_HAS_HIGH_MPU_OPP 15
  25. #define DRA76_EFUSE_HAS_PLUS_MPU_OPP 18
  26. #define DRA7_EFUSE_HAS_ALL_MPU_OPP 23
  27. #define DRA76_EFUSE_HAS_ALL_MPU_OPP 24
  28. #define DRA7_EFUSE_NOM_MPU_OPP BIT(0)
  29. #define DRA7_EFUSE_OD_MPU_OPP BIT(1)
  30. #define DRA7_EFUSE_HIGH_MPU_OPP BIT(2)
  31. #define DRA76_EFUSE_PLUS_MPU_OPP BIT(3)
  32. #define OMAP3_CONTROL_DEVICE_STATUS 0x4800244C
  33. #define OMAP3_CONTROL_IDCODE 0x4830A204
  34. #define OMAP34xx_ProdID_SKUID 0x4830A20C
  35. #define OMAP3_SYSCON_BASE (0x48000000 + 0x2000 + 0x270)
  36. #define AM625_EFUSE_K_MPU_OPP 11
  37. #define AM625_EFUSE_S_MPU_OPP 19
  38. #define AM625_EFUSE_T_MPU_OPP 20
  39. #define AM625_SUPPORT_K_MPU_OPP BIT(0)
  40. #define AM625_SUPPORT_S_MPU_OPP BIT(1)
  41. #define AM625_SUPPORT_T_MPU_OPP BIT(2)
  42. enum {
  43. AM62A7_EFUSE_M_MPU_OPP = 13,
  44. AM62A7_EFUSE_N_MPU_OPP,
  45. AM62A7_EFUSE_O_MPU_OPP,
  46. AM62A7_EFUSE_P_MPU_OPP,
  47. AM62A7_EFUSE_Q_MPU_OPP,
  48. AM62A7_EFUSE_R_MPU_OPP,
  49. AM62A7_EFUSE_S_MPU_OPP,
  50. /*
  51. * The V, U, and T speed grade numbering is out of order
  52. * to align with the AM625 more uniformly. I promise I know
  53. * my ABCs ;)
  54. */
  55. AM62A7_EFUSE_V_MPU_OPP,
  56. AM62A7_EFUSE_U_MPU_OPP,
  57. AM62A7_EFUSE_T_MPU_OPP,
  58. };
  59. #define AM62A7_SUPPORT_N_MPU_OPP BIT(0)
  60. #define AM62A7_SUPPORT_R_MPU_OPP BIT(1)
  61. #define AM62A7_SUPPORT_V_MPU_OPP BIT(2)
  62. #define AM62P5_EFUSE_O_MPU_OPP 15
  63. #define AM62P5_EFUSE_S_MPU_OPP 19
  64. #define AM62P5_EFUSE_U_MPU_OPP 21
  65. #define AM62P5_SUPPORT_O_MPU_OPP BIT(0)
  66. #define AM62P5_SUPPORT_U_MPU_OPP BIT(2)
  67. #define VERSION_COUNT 2
  68. struct ti_cpufreq_data;
  69. struct ti_cpufreq_soc_data {
  70. const char * const *reg_names;
  71. unsigned long (*efuse_xlate)(struct ti_cpufreq_data *opp_data,
  72. unsigned long efuse);
  73. unsigned long efuse_fallback;
  74. unsigned long efuse_offset;
  75. unsigned long efuse_mask;
  76. unsigned long efuse_shift;
  77. unsigned long rev_offset;
  78. bool multi_regulator;
  79. /* Backward compatibility hack: Might have missing syscon */
  80. #define TI_QUIRK_SYSCON_MAY_BE_MISSING 0x1
  81. u8 quirks;
  82. };
  83. struct ti_cpufreq_data {
  84. struct device *cpu_dev;
  85. struct device_node *opp_node;
  86. struct regmap *syscon;
  87. const struct ti_cpufreq_soc_data *soc_data;
  88. };
  89. static unsigned long amx3_efuse_xlate(struct ti_cpufreq_data *opp_data,
  90. unsigned long efuse)
  91. {
  92. if (!efuse)
  93. efuse = opp_data->soc_data->efuse_fallback;
  94. /* AM335x and AM437x use "OPP disable" bits, so invert */
  95. return ~efuse;
  96. }
  97. static unsigned long dra7_efuse_xlate(struct ti_cpufreq_data *opp_data,
  98. unsigned long efuse)
  99. {
  100. unsigned long calculated_efuse = DRA7_EFUSE_NOM_MPU_OPP;
  101. /*
  102. * The efuse on dra7 and am57 parts contains a specific
  103. * value indicating the highest available OPP.
  104. */
  105. switch (efuse) {
  106. case DRA76_EFUSE_HAS_PLUS_MPU_OPP:
  107. case DRA76_EFUSE_HAS_ALL_MPU_OPP:
  108. calculated_efuse |= DRA76_EFUSE_PLUS_MPU_OPP;
  109. fallthrough;
  110. case DRA7_EFUSE_HAS_ALL_MPU_OPP:
  111. case DRA7_EFUSE_HAS_HIGH_MPU_OPP:
  112. calculated_efuse |= DRA7_EFUSE_HIGH_MPU_OPP;
  113. fallthrough;
  114. case DRA7_EFUSE_HAS_OD_MPU_OPP:
  115. calculated_efuse |= DRA7_EFUSE_OD_MPU_OPP;
  116. }
  117. return calculated_efuse;
  118. }
  119. static unsigned long omap3_efuse_xlate(struct ti_cpufreq_data *opp_data,
  120. unsigned long efuse)
  121. {
  122. /* OPP enable bit ("Speed Binned") */
  123. return BIT(efuse);
  124. }
  125. static unsigned long am62p5_efuse_xlate(struct ti_cpufreq_data *opp_data,
  126. unsigned long efuse)
  127. {
  128. unsigned long calculated_efuse = AM62P5_SUPPORT_O_MPU_OPP;
  129. switch (efuse) {
  130. case AM62P5_EFUSE_U_MPU_OPP:
  131. case AM62P5_EFUSE_S_MPU_OPP:
  132. calculated_efuse |= AM62P5_SUPPORT_U_MPU_OPP;
  133. fallthrough;
  134. case AM62P5_EFUSE_O_MPU_OPP:
  135. calculated_efuse |= AM62P5_SUPPORT_O_MPU_OPP;
  136. }
  137. return calculated_efuse;
  138. }
  139. static unsigned long am62a7_efuse_xlate(struct ti_cpufreq_data *opp_data,
  140. unsigned long efuse)
  141. {
  142. unsigned long calculated_efuse = AM62A7_SUPPORT_N_MPU_OPP;
  143. switch (efuse) {
  144. case AM62A7_EFUSE_V_MPU_OPP:
  145. case AM62A7_EFUSE_U_MPU_OPP:
  146. case AM62A7_EFUSE_T_MPU_OPP:
  147. case AM62A7_EFUSE_S_MPU_OPP:
  148. calculated_efuse |= AM62A7_SUPPORT_V_MPU_OPP;
  149. fallthrough;
  150. case AM62A7_EFUSE_R_MPU_OPP:
  151. case AM62A7_EFUSE_Q_MPU_OPP:
  152. case AM62A7_EFUSE_P_MPU_OPP:
  153. case AM62A7_EFUSE_O_MPU_OPP:
  154. calculated_efuse |= AM62A7_SUPPORT_R_MPU_OPP;
  155. fallthrough;
  156. case AM62A7_EFUSE_N_MPU_OPP:
  157. case AM62A7_EFUSE_M_MPU_OPP:
  158. calculated_efuse |= AM62A7_SUPPORT_N_MPU_OPP;
  159. }
  160. return calculated_efuse;
  161. }
  162. static unsigned long am625_efuse_xlate(struct ti_cpufreq_data *opp_data,
  163. unsigned long efuse)
  164. {
  165. unsigned long calculated_efuse = AM625_SUPPORT_K_MPU_OPP;
  166. switch (efuse) {
  167. case AM625_EFUSE_T_MPU_OPP:
  168. calculated_efuse |= AM625_SUPPORT_T_MPU_OPP;
  169. fallthrough;
  170. case AM625_EFUSE_S_MPU_OPP:
  171. calculated_efuse |= AM625_SUPPORT_S_MPU_OPP;
  172. fallthrough;
  173. case AM625_EFUSE_K_MPU_OPP:
  174. calculated_efuse |= AM625_SUPPORT_K_MPU_OPP;
  175. }
  176. return calculated_efuse;
  177. }
  178. static struct ti_cpufreq_soc_data am3x_soc_data = {
  179. .efuse_xlate = amx3_efuse_xlate,
  180. .efuse_fallback = AM33XX_800M_ARM_MPU_MAX_FREQ,
  181. .efuse_offset = 0x07fc,
  182. .efuse_mask = 0x1fff,
  183. .rev_offset = 0x600,
  184. .multi_regulator = false,
  185. };
  186. static struct ti_cpufreq_soc_data am4x_soc_data = {
  187. .efuse_xlate = amx3_efuse_xlate,
  188. .efuse_fallback = AM43XX_600M_ARM_MPU_MAX_FREQ,
  189. .efuse_offset = 0x0610,
  190. .efuse_mask = 0x3f,
  191. .rev_offset = 0x600,
  192. .multi_regulator = false,
  193. };
  194. static struct ti_cpufreq_soc_data dra7_soc_data = {
  195. .efuse_xlate = dra7_efuse_xlate,
  196. .efuse_offset = 0x020c,
  197. .efuse_mask = 0xf80000,
  198. .efuse_shift = 19,
  199. .rev_offset = 0x204,
  200. .multi_regulator = true,
  201. };
  202. /*
  203. * OMAP35x TRM (SPRUF98K):
  204. * CONTROL_IDCODE (0x4830 A204) describes Silicon revisions.
  205. * Control OMAP Status Register 15:0 (Address 0x4800 244C)
  206. * to separate between omap3503, omap3515, omap3525, omap3530
  207. * and feature presence.
  208. * There are encodings for versions limited to 400/266MHz
  209. * but we ignore.
  210. * Not clear if this also holds for omap34xx.
  211. * some eFuse values e.g. CONTROL_FUSE_OPP1_VDD1
  212. * are stored in the SYSCON register range
  213. * Register 0x4830A20C [ProdID.SKUID] [0:3]
  214. * 0x0 for normal 600/430MHz device.
  215. * 0x8 for 720/520MHz device.
  216. * Not clear what omap34xx value is.
  217. */
  218. static struct ti_cpufreq_soc_data omap34xx_soc_data = {
  219. .efuse_xlate = omap3_efuse_xlate,
  220. .efuse_offset = OMAP34xx_ProdID_SKUID - OMAP3_SYSCON_BASE,
  221. .efuse_shift = 3,
  222. .efuse_mask = BIT(3),
  223. .rev_offset = OMAP3_CONTROL_IDCODE - OMAP3_SYSCON_BASE,
  224. .multi_regulator = false,
  225. .quirks = TI_QUIRK_SYSCON_MAY_BE_MISSING,
  226. };
  227. /*
  228. * AM/DM37x TRM (SPRUGN4M)
  229. * CONTROL_IDCODE (0x4830 A204) describes Silicon revisions.
  230. * Control Device Status Register 15:0 (Address 0x4800 244C)
  231. * to separate between am3703, am3715, dm3725, dm3730
  232. * and feature presence.
  233. * Speed Binned = Bit 9
  234. * 0 800/600 MHz
  235. * 1 1000/800 MHz
  236. * some eFuse values e.g. CONTROL_FUSE_OPP 1G_VDD1
  237. * are stored in the SYSCON register range.
  238. * There is no 0x4830A20C [ProdID.SKUID] register (exists but
  239. * seems to always read as 0).
  240. */
  241. static const char * const omap3_reg_names[] = {"cpu0", "vbb", NULL};
  242. static struct ti_cpufreq_soc_data omap36xx_soc_data = {
  243. .reg_names = omap3_reg_names,
  244. .efuse_xlate = omap3_efuse_xlate,
  245. .efuse_offset = OMAP3_CONTROL_DEVICE_STATUS - OMAP3_SYSCON_BASE,
  246. .efuse_shift = 9,
  247. .efuse_mask = BIT(9),
  248. .rev_offset = OMAP3_CONTROL_IDCODE - OMAP3_SYSCON_BASE,
  249. .multi_regulator = true,
  250. .quirks = TI_QUIRK_SYSCON_MAY_BE_MISSING,
  251. };
  252. /*
  253. * AM3517 is quite similar to AM/DM37x except that it has no
  254. * high speed grade eFuse and no abb ldo
  255. */
  256. static struct ti_cpufreq_soc_data am3517_soc_data = {
  257. .efuse_xlate = omap3_efuse_xlate,
  258. .efuse_offset = OMAP3_CONTROL_DEVICE_STATUS - OMAP3_SYSCON_BASE,
  259. .efuse_shift = 0,
  260. .efuse_mask = 0,
  261. .rev_offset = OMAP3_CONTROL_IDCODE - OMAP3_SYSCON_BASE,
  262. .multi_regulator = false,
  263. .quirks = TI_QUIRK_SYSCON_MAY_BE_MISSING,
  264. };
  265. static const struct soc_device_attribute k3_cpufreq_soc[] = {
  266. { .family = "AM62X", .revision = "SR1.0" },
  267. { .family = "AM62AX", .revision = "SR1.0" },
  268. { .family = "AM62PX", .revision = "SR1.0" },
  269. { /* sentinel */ }
  270. };
  271. static struct ti_cpufreq_soc_data am625_soc_data = {
  272. .efuse_xlate = am625_efuse_xlate,
  273. .efuse_offset = 0x0018,
  274. .efuse_mask = 0x07c0,
  275. .efuse_shift = 0x6,
  276. .rev_offset = 0x0014,
  277. .multi_regulator = false,
  278. };
  279. static struct ti_cpufreq_soc_data am62a7_soc_data = {
  280. .efuse_xlate = am62a7_efuse_xlate,
  281. .efuse_offset = 0x0,
  282. .efuse_mask = 0x07c0,
  283. .efuse_shift = 0x6,
  284. .rev_offset = 0x0014,
  285. .multi_regulator = false,
  286. };
  287. static struct ti_cpufreq_soc_data am62p5_soc_data = {
  288. .efuse_xlate = am62p5_efuse_xlate,
  289. .efuse_offset = 0x0,
  290. .efuse_mask = 0x07c0,
  291. .efuse_shift = 0x6,
  292. .rev_offset = 0x0014,
  293. .multi_regulator = false,
  294. };
  295. /**
  296. * ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC
  297. * @opp_data: pointer to ti_cpufreq_data context
  298. * @efuse_value: Set to the value parsed from efuse
  299. *
  300. * Returns error code if efuse not read properly.
  301. */
  302. static int ti_cpufreq_get_efuse(struct ti_cpufreq_data *opp_data,
  303. u32 *efuse_value)
  304. {
  305. struct device *dev = opp_data->cpu_dev;
  306. u32 efuse;
  307. int ret;
  308. ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset,
  309. &efuse);
  310. if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING && ret == -EIO) {
  311. /* not a syscon register! */
  312. void __iomem *regs = ioremap(OMAP3_SYSCON_BASE +
  313. opp_data->soc_data->efuse_offset, 4);
  314. if (!regs)
  315. return -ENOMEM;
  316. efuse = readl(regs);
  317. iounmap(regs);
  318. }
  319. else if (ret) {
  320. dev_err(dev,
  321. "Failed to read the efuse value from syscon: %d\n",
  322. ret);
  323. return ret;
  324. }
  325. efuse = (efuse & opp_data->soc_data->efuse_mask);
  326. efuse >>= opp_data->soc_data->efuse_shift;
  327. *efuse_value = opp_data->soc_data->efuse_xlate(opp_data, efuse);
  328. return 0;
  329. }
  330. /**
  331. * ti_cpufreq_get_rev() - Parse and return rev value present on SoC
  332. * @opp_data: pointer to ti_cpufreq_data context
  333. * @revision_value: Set to the value parsed from revision register
  334. *
  335. * Returns error code if revision not read properly.
  336. */
  337. static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data,
  338. u32 *revision_value)
  339. {
  340. struct device *dev = opp_data->cpu_dev;
  341. u32 revision;
  342. int ret;
  343. if (soc_device_match(k3_cpufreq_soc)) {
  344. /*
  345. * Since the SR is 1.0, hard code the revision_value as
  346. * 0x1 here. This way we avoid re using the same register
  347. * that is giving us required information inside socinfo
  348. * anyway.
  349. */
  350. *revision_value = 0x1;
  351. goto done;
  352. }
  353. ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset,
  354. &revision);
  355. if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING && ret == -EIO) {
  356. /* not a syscon register! */
  357. void __iomem *regs = ioremap(OMAP3_SYSCON_BASE +
  358. opp_data->soc_data->rev_offset, 4);
  359. if (!regs)
  360. return -ENOMEM;
  361. revision = readl(regs);
  362. iounmap(regs);
  363. }
  364. else if (ret) {
  365. dev_err(dev,
  366. "Failed to read the revision number from syscon: %d\n",
  367. ret);
  368. return ret;
  369. }
  370. *revision_value = BIT((revision >> REVISION_SHIFT) & REVISION_MASK);
  371. done:
  372. return 0;
  373. }
  374. static int ti_cpufreq_setup_syscon_register(struct ti_cpufreq_data *opp_data)
  375. {
  376. struct device *dev = opp_data->cpu_dev;
  377. struct device_node *np = opp_data->opp_node;
  378. opp_data->syscon = syscon_regmap_lookup_by_phandle(np,
  379. "syscon");
  380. if (IS_ERR(opp_data->syscon)) {
  381. dev_err(dev,
  382. "\"syscon\" is missing, cannot use OPPv2 table.\n");
  383. return PTR_ERR(opp_data->syscon);
  384. }
  385. return 0;
  386. }
  387. static const struct of_device_id ti_cpufreq_of_match[] __maybe_unused = {
  388. { .compatible = "ti,am33xx", .data = &am3x_soc_data, },
  389. { .compatible = "ti,am3517", .data = &am3517_soc_data, },
  390. { .compatible = "ti,am43", .data = &am4x_soc_data, },
  391. { .compatible = "ti,dra7", .data = &dra7_soc_data },
  392. { .compatible = "ti,omap34xx", .data = &omap34xx_soc_data, },
  393. { .compatible = "ti,omap36xx", .data = &omap36xx_soc_data, },
  394. { .compatible = "ti,am625", .data = &am625_soc_data, },
  395. { .compatible = "ti,am62a7", .data = &am62a7_soc_data, },
  396. { .compatible = "ti,am62p5", .data = &am62p5_soc_data, },
  397. /* legacy */
  398. { .compatible = "ti,omap3430", .data = &omap34xx_soc_data, },
  399. { .compatible = "ti,omap3630", .data = &omap36xx_soc_data, },
  400. {},
  401. };
  402. static const struct of_device_id *ti_cpufreq_match_node(void)
  403. {
  404. struct device_node *np __free(device_node) = of_find_node_by_path("/");
  405. const struct of_device_id *match;
  406. match = of_match_node(ti_cpufreq_of_match, np);
  407. return match;
  408. }
  409. static int ti_cpufreq_probe(struct platform_device *pdev)
  410. {
  411. u32 version[VERSION_COUNT];
  412. const struct of_device_id *match;
  413. struct ti_cpufreq_data *opp_data;
  414. const char * const default_reg_names[] = {"vdd", "vbb", NULL};
  415. int ret;
  416. struct dev_pm_opp_config config = {
  417. .supported_hw = version,
  418. .supported_hw_count = ARRAY_SIZE(version),
  419. };
  420. match = dev_get_platdata(&pdev->dev);
  421. if (!match)
  422. return -ENODEV;
  423. opp_data = devm_kzalloc(&pdev->dev, sizeof(*opp_data), GFP_KERNEL);
  424. if (!opp_data)
  425. return -ENOMEM;
  426. opp_data->soc_data = match->data;
  427. opp_data->cpu_dev = get_cpu_device(0);
  428. if (!opp_data->cpu_dev) {
  429. pr_err("%s: Failed to get device for CPU0\n", __func__);
  430. return -ENODEV;
  431. }
  432. opp_data->opp_node = dev_pm_opp_of_get_opp_desc_node(opp_data->cpu_dev);
  433. if (!opp_data->opp_node) {
  434. dev_info(opp_data->cpu_dev,
  435. "OPP-v2 not supported, cpufreq-dt will attempt to use legacy tables.\n");
  436. goto register_cpufreq_dt;
  437. }
  438. ret = ti_cpufreq_setup_syscon_register(opp_data);
  439. if (ret)
  440. goto fail_put_node;
  441. /*
  442. * OPPs determine whether or not they are supported based on
  443. * two metrics:
  444. * 0 - SoC Revision
  445. * 1 - eFuse value
  446. */
  447. ret = ti_cpufreq_get_rev(opp_data, &version[0]);
  448. if (ret)
  449. goto fail_put_node;
  450. ret = ti_cpufreq_get_efuse(opp_data, &version[1]);
  451. if (ret)
  452. goto fail_put_node;
  453. if (opp_data->soc_data->multi_regulator) {
  454. if (opp_data->soc_data->reg_names)
  455. config.regulator_names = opp_data->soc_data->reg_names;
  456. else
  457. config.regulator_names = default_reg_names;
  458. }
  459. ret = dev_pm_opp_set_config(opp_data->cpu_dev, &config);
  460. if (ret < 0) {
  461. dev_err_probe(opp_data->cpu_dev, ret, "Failed to set OPP config\n");
  462. goto fail_put_node;
  463. }
  464. of_node_put(opp_data->opp_node);
  465. register_cpufreq_dt:
  466. platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
  467. return 0;
  468. fail_put_node:
  469. of_node_put(opp_data->opp_node);
  470. return ret;
  471. }
  472. static int __init ti_cpufreq_init(void)
  473. {
  474. const struct of_device_id *match;
  475. /* Check to ensure we are on a compatible platform */
  476. match = ti_cpufreq_match_node();
  477. if (match)
  478. platform_device_register_data(NULL, "ti-cpufreq", -1, match,
  479. sizeof(*match));
  480. return 0;
  481. }
  482. module_init(ti_cpufreq_init);
  483. static struct platform_driver ti_cpufreq_driver = {
  484. .probe = ti_cpufreq_probe,
  485. .driver = {
  486. .name = "ti-cpufreq",
  487. },
  488. };
  489. builtin_platform_driver(ti_cpufreq_driver);
  490. MODULE_DESCRIPTION("TI CPUFreq/OPP hw-supported driver");
  491. MODULE_AUTHOR("Dave Gerlach <d-gerlach@ti.com>");
  492. MODULE_LICENSE("GPL v2");