devices.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /*
  2. * linux/arch/arm/mach-omap2/devices.c
  3. *
  4. * OMAP2 platform device setup/initialization
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #include <linux/gpio.h>
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/io.h>
  16. #include <linux/clk.h>
  17. #include <linux/err.h>
  18. #include <linux/gpio.h>
  19. #include <linux/slab.h>
  20. #include <linux/of.h>
  21. #include <linux/pinctrl/machine.h>
  22. #include <linux/platform_data/omap4-keypad.h>
  23. #include <linux/platform_data/omap_ocp2scp.h>
  24. #include <linux/usb/omap_control_usb.h>
  25. #include <linux/wl12xx.h>
  26. #include <asm/mach-types.h>
  27. #include <asm/mach/map.h>
  28. #include <linux/omap-dma.h>
  29. #include "iomap.h"
  30. #include "omap_hwmod.h"
  31. #include "omap_device.h"
  32. #include "omap4-keypad.h"
  33. #include "soc.h"
  34. #include "common.h"
  35. #include "mux.h"
  36. #include "control.h"
  37. #include "devices.h"
  38. #include "dma.h"
  39. #define L3_MODULES_MAX_LEN 12
  40. #define L3_MODULES 3
  41. static int __init omap3_l3_init(void)
  42. {
  43. struct omap_hwmod *oh;
  44. struct platform_device *pdev;
  45. char oh_name[L3_MODULES_MAX_LEN];
  46. /*
  47. * To avoid code running on other OMAPs in
  48. * multi-omap builds
  49. */
  50. if (!(cpu_is_omap34xx()))
  51. return -ENODEV;
  52. snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");
  53. oh = omap_hwmod_lookup(oh_name);
  54. if (!oh)
  55. pr_err("could not look up %s\n", oh_name);
  56. pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0);
  57. WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
  58. return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  59. }
  60. omap_postcore_initcall(omap3_l3_init);
  61. static int __init omap4_l3_init(void)
  62. {
  63. int i;
  64. struct omap_hwmod *oh[3];
  65. struct platform_device *pdev;
  66. char oh_name[L3_MODULES_MAX_LEN];
  67. /* If dtb is there, the devices will be created dynamically */
  68. if (of_have_populated_dt())
  69. return -ENODEV;
  70. /*
  71. * To avoid code running on other OMAPs in
  72. * multi-omap builds
  73. */
  74. if (!cpu_is_omap44xx() && !soc_is_omap54xx())
  75. return -ENODEV;
  76. for (i = 0; i < L3_MODULES; i++) {
  77. snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1);
  78. oh[i] = omap_hwmod_lookup(oh_name);
  79. if (!(oh[i]))
  80. pr_err("could not look up %s\n", oh_name);
  81. }
  82. pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, 0);
  83. WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
  84. return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  85. }
  86. omap_postcore_initcall(omap4_l3_init);
  87. #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
  88. static struct resource omap2cam_resources[] = {
  89. {
  90. .start = OMAP24XX_CAMERA_BASE,
  91. .end = OMAP24XX_CAMERA_BASE + 0xfff,
  92. .flags = IORESOURCE_MEM,
  93. },
  94. {
  95. .start = 24 + OMAP_INTC_START,
  96. .flags = IORESOURCE_IRQ,
  97. }
  98. };
  99. static struct platform_device omap2cam_device = {
  100. .name = "omap24xxcam",
  101. .id = -1,
  102. .num_resources = ARRAY_SIZE(omap2cam_resources),
  103. .resource = omap2cam_resources,
  104. };
  105. #endif
  106. #if defined(CONFIG_IOMMU_API)
  107. #include <linux/platform_data/iommu-omap.h>
  108. static struct resource omap3isp_resources[] = {
  109. {
  110. .start = OMAP3430_ISP_BASE,
  111. .end = OMAP3430_ISP_END,
  112. .flags = IORESOURCE_MEM,
  113. },
  114. {
  115. .start = OMAP3430_ISP_CCP2_BASE,
  116. .end = OMAP3430_ISP_CCP2_END,
  117. .flags = IORESOURCE_MEM,
  118. },
  119. {
  120. .start = OMAP3430_ISP_CCDC_BASE,
  121. .end = OMAP3430_ISP_CCDC_END,
  122. .flags = IORESOURCE_MEM,
  123. },
  124. {
  125. .start = OMAP3430_ISP_HIST_BASE,
  126. .end = OMAP3430_ISP_HIST_END,
  127. .flags = IORESOURCE_MEM,
  128. },
  129. {
  130. .start = OMAP3430_ISP_H3A_BASE,
  131. .end = OMAP3430_ISP_H3A_END,
  132. .flags = IORESOURCE_MEM,
  133. },
  134. {
  135. .start = OMAP3430_ISP_PREV_BASE,
  136. .end = OMAP3430_ISP_PREV_END,
  137. .flags = IORESOURCE_MEM,
  138. },
  139. {
  140. .start = OMAP3430_ISP_RESZ_BASE,
  141. .end = OMAP3430_ISP_RESZ_END,
  142. .flags = IORESOURCE_MEM,
  143. },
  144. {
  145. .start = OMAP3430_ISP_SBL_BASE,
  146. .end = OMAP3430_ISP_SBL_END,
  147. .flags = IORESOURCE_MEM,
  148. },
  149. {
  150. .start = OMAP3430_ISP_CSI2A_REGS1_BASE,
  151. .end = OMAP3430_ISP_CSI2A_REGS1_END,
  152. .flags = IORESOURCE_MEM,
  153. },
  154. {
  155. .start = OMAP3430_ISP_CSIPHY2_BASE,
  156. .end = OMAP3430_ISP_CSIPHY2_END,
  157. .flags = IORESOURCE_MEM,
  158. },
  159. {
  160. .start = OMAP3630_ISP_CSI2A_REGS2_BASE,
  161. .end = OMAP3630_ISP_CSI2A_REGS2_END,
  162. .flags = IORESOURCE_MEM,
  163. },
  164. {
  165. .start = OMAP3630_ISP_CSI2C_REGS1_BASE,
  166. .end = OMAP3630_ISP_CSI2C_REGS1_END,
  167. .flags = IORESOURCE_MEM,
  168. },
  169. {
  170. .start = OMAP3630_ISP_CSIPHY1_BASE,
  171. .end = OMAP3630_ISP_CSIPHY1_END,
  172. .flags = IORESOURCE_MEM,
  173. },
  174. {
  175. .start = OMAP3630_ISP_CSI2C_REGS2_BASE,
  176. .end = OMAP3630_ISP_CSI2C_REGS2_END,
  177. .flags = IORESOURCE_MEM,
  178. },
  179. {
  180. .start = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE,
  181. .end = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE + 3,
  182. .flags = IORESOURCE_MEM,
  183. },
  184. {
  185. .start = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL,
  186. .end = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3,
  187. .flags = IORESOURCE_MEM,
  188. },
  189. {
  190. .start = 24 + OMAP_INTC_START,
  191. .flags = IORESOURCE_IRQ,
  192. }
  193. };
  194. static struct platform_device omap3isp_device = {
  195. .name = "omap3isp",
  196. .id = -1,
  197. .num_resources = ARRAY_SIZE(omap3isp_resources),
  198. .resource = omap3isp_resources,
  199. };
  200. static struct omap_iommu_arch_data omap3_isp_iommu = {
  201. .name = "mmu_isp",
  202. };
  203. int omap3_init_camera(struct isp_platform_data *pdata)
  204. {
  205. omap3isp_device.dev.platform_data = pdata;
  206. omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu;
  207. return platform_device_register(&omap3isp_device);
  208. }
  209. #else /* !CONFIG_IOMMU_API */
  210. int omap3_init_camera(struct isp_platform_data *pdata)
  211. {
  212. return 0;
  213. }
  214. #endif
  215. static inline void omap_init_camera(void)
  216. {
  217. #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
  218. if (cpu_is_omap24xx())
  219. platform_device_register(&omap2cam_device);
  220. #endif
  221. }
  222. #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
  223. static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
  224. .type = 1,
  225. };
  226. struct resource omap4_control_usb_res[] = {
  227. {
  228. .name = "control_dev_conf",
  229. .start = 0x4a002300,
  230. .end = 0x4a002303,
  231. .flags = IORESOURCE_MEM,
  232. },
  233. {
  234. .name = "otghs_control",
  235. .start = 0x4a00233c,
  236. .end = 0x4a00233f,
  237. .flags = IORESOURCE_MEM,
  238. },
  239. };
  240. static struct platform_device omap4_control_usb = {
  241. .name = "omap-control-usb",
  242. .id = -1,
  243. .dev = {
  244. .platform_data = &omap4_control_usb_pdata,
  245. },
  246. .num_resources = 2,
  247. .resource = omap4_control_usb_res,
  248. };
  249. static inline void __init omap_init_control_usb(void)
  250. {
  251. if (!cpu_is_omap44xx())
  252. return;
  253. if (platform_device_register(&omap4_control_usb))
  254. pr_err("Error registering omap_control_usb device\n");
  255. }
  256. #else
  257. static inline void omap_init_control_usb(void) { }
  258. #endif /* CONFIG_OMAP_CONTROL_USB */
  259. int __init omap4_keyboard_init(struct omap4_keypad_platform_data
  260. *sdp4430_keypad_data, struct omap_board_data *bdata)
  261. {
  262. struct platform_device *pdev;
  263. struct omap_hwmod *oh;
  264. struct omap4_keypad_platform_data *keypad_data;
  265. unsigned int id = -1;
  266. char *oh_name = "kbd";
  267. char *name = "omap4-keypad";
  268. oh = omap_hwmod_lookup(oh_name);
  269. if (!oh) {
  270. pr_err("Could not look up %s\n", oh_name);
  271. return -ENODEV;
  272. }
  273. keypad_data = sdp4430_keypad_data;
  274. pdev = omap_device_build(name, id, oh, keypad_data,
  275. sizeof(struct omap4_keypad_platform_data));
  276. if (IS_ERR(pdev)) {
  277. WARN(1, "Can't build omap_device for %s:%s.\n",
  278. name, oh->name);
  279. return PTR_ERR(pdev);
  280. }
  281. oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
  282. return 0;
  283. }
  284. #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
  285. static inline void __init omap_init_mbox(void)
  286. {
  287. struct omap_hwmod *oh;
  288. struct platform_device *pdev;
  289. oh = omap_hwmod_lookup("mailbox");
  290. if (!oh) {
  291. pr_err("%s: unable to find hwmod\n", __func__);
  292. return;
  293. }
  294. pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0);
  295. WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
  296. __func__, PTR_ERR(pdev));
  297. }
  298. #else
  299. static inline void omap_init_mbox(void) { }
  300. #endif /* CONFIG_OMAP_MBOX_FWK */
  301. static inline void omap_init_sti(void) {}
  302. #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
  303. static struct platform_device omap_pcm = {
  304. .name = "omap-pcm-audio",
  305. .id = -1,
  306. };
  307. static void omap_init_audio(void)
  308. {
  309. platform_device_register(&omap_pcm);
  310. }
  311. #else
  312. static inline void omap_init_audio(void) {}
  313. #endif
  314. #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
  315. defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
  316. static void __init omap_init_mcpdm(void)
  317. {
  318. struct omap_hwmod *oh;
  319. struct platform_device *pdev;
  320. oh = omap_hwmod_lookup("mcpdm");
  321. if (!oh) {
  322. printk(KERN_ERR "Could not look up mcpdm hw_mod\n");
  323. return;
  324. }
  325. pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0);
  326. WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n");
  327. }
  328. #else
  329. static inline void omap_init_mcpdm(void) {}
  330. #endif
  331. #if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
  332. defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
  333. static void __init omap_init_dmic(void)
  334. {
  335. struct omap_hwmod *oh;
  336. struct platform_device *pdev;
  337. oh = omap_hwmod_lookup("dmic");
  338. if (!oh) {
  339. pr_err("Could not look up dmic hw_mod\n");
  340. return;
  341. }
  342. pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0);
  343. WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
  344. }
  345. #else
  346. static inline void omap_init_dmic(void) {}
  347. #endif
  348. #if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
  349. defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
  350. static struct platform_device omap_hdmi_audio = {
  351. .name = "omap-hdmi-audio",
  352. .id = -1,
  353. };
  354. static void __init omap_init_hdmi_audio(void)
  355. {
  356. struct omap_hwmod *oh;
  357. struct platform_device *pdev;
  358. oh = omap_hwmod_lookup("dss_hdmi");
  359. if (!oh) {
  360. printk(KERN_ERR "Could not look up dss_hdmi hw_mod\n");
  361. return;
  362. }
  363. pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
  364. WARN(IS_ERR(pdev),
  365. "Can't build omap_device for omap-hdmi-audio-dai.\n");
  366. platform_device_register(&omap_hdmi_audio);
  367. }
  368. #else
  369. static inline void omap_init_hdmi_audio(void) {}
  370. #endif
  371. #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
  372. #include <linux/platform_data/spi-omap2-mcspi.h>
  373. static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
  374. {
  375. struct platform_device *pdev;
  376. char *name = "omap2_mcspi";
  377. struct omap2_mcspi_platform_config *pdata;
  378. static int spi_num;
  379. struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr;
  380. pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
  381. if (!pdata) {
  382. pr_err("Memory allocation for McSPI device failed\n");
  383. return -ENOMEM;
  384. }
  385. pdata->num_cs = mcspi_attrib->num_chipselect;
  386. switch (oh->class->rev) {
  387. case OMAP2_MCSPI_REV:
  388. case OMAP3_MCSPI_REV:
  389. pdata->regs_offset = 0;
  390. break;
  391. case OMAP4_MCSPI_REV:
  392. pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET;
  393. break;
  394. default:
  395. pr_err("Invalid McSPI Revision value\n");
  396. kfree(pdata);
  397. return -EINVAL;
  398. }
  399. spi_num++;
  400. pdev = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata));
  401. WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
  402. name, oh->name);
  403. kfree(pdata);
  404. return 0;
  405. }
  406. static void omap_init_mcspi(void)
  407. {
  408. omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL);
  409. }
  410. #else
  411. static inline void omap_init_mcspi(void) {}
  412. #endif
  413. /**
  414. * omap_init_rng - bind the RNG hwmod to the RNG omap_device
  415. *
  416. * Bind the RNG hwmod to the RNG omap_device. No return value.
  417. */
  418. static void omap_init_rng(void)
  419. {
  420. struct omap_hwmod *oh;
  421. struct platform_device *pdev;
  422. oh = omap_hwmod_lookup("rng");
  423. if (!oh)
  424. return;
  425. pdev = omap_device_build("omap_rng", -1, oh, NULL, 0);
  426. WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
  427. }
  428. static void __init omap_init_sham(void)
  429. {
  430. struct omap_hwmod *oh;
  431. struct platform_device *pdev;
  432. oh = omap_hwmod_lookup("sham");
  433. if (!oh)
  434. return;
  435. pdev = omap_device_build("omap-sham", -1, oh, NULL, 0);
  436. WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n");
  437. }
  438. static void __init omap_init_aes(void)
  439. {
  440. struct omap_hwmod *oh;
  441. struct platform_device *pdev;
  442. oh = omap_hwmod_lookup("aes");
  443. if (!oh)
  444. return;
  445. pdev = omap_device_build("omap-aes", -1, oh, NULL, 0);
  446. WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n");
  447. }
  448. /*-------------------------------------------------------------------------*/
  449. #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
  450. defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
  451. #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
  452. static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
  453. };
  454. #else
  455. static struct resource omap_vout_resource[2] = {
  456. };
  457. #endif
  458. static struct platform_device omap_vout_device = {
  459. .name = "omap_vout",
  460. .num_resources = ARRAY_SIZE(omap_vout_resource),
  461. .resource = &omap_vout_resource[0],
  462. .id = -1,
  463. };
  464. static void omap_init_vout(void)
  465. {
  466. if (platform_device_register(&omap_vout_device) < 0)
  467. printk(KERN_ERR "Unable to register OMAP-VOUT device\n");
  468. }
  469. #else
  470. static inline void omap_init_vout(void) {}
  471. #endif
  472. #if defined(CONFIG_OMAP_OCP2SCP) || defined(CONFIG_OMAP_OCP2SCP_MODULE)
  473. static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev)
  474. {
  475. int cnt = 0;
  476. while (ocp2scp_dev->drv_name != NULL) {
  477. cnt++;
  478. ocp2scp_dev++;
  479. }
  480. return cnt;
  481. }
  482. static void __init omap_init_ocp2scp(void)
  483. {
  484. struct omap_hwmod *oh;
  485. struct platform_device *pdev;
  486. int bus_id = -1, dev_cnt = 0, i;
  487. struct omap_ocp2scp_dev *ocp2scp_dev;
  488. const char *oh_name, *name;
  489. struct omap_ocp2scp_platform_data *pdata;
  490. if (!cpu_is_omap44xx())
  491. return;
  492. oh_name = "ocp2scp_usb_phy";
  493. name = "omap-ocp2scp";
  494. oh = omap_hwmod_lookup(oh_name);
  495. if (!oh) {
  496. pr_err("%s: could not find omap_hwmod for %s\n", __func__,
  497. oh_name);
  498. return;
  499. }
  500. pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
  501. if (!pdata) {
  502. pr_err("%s: No memory for ocp2scp pdata\n", __func__);
  503. return;
  504. }
  505. ocp2scp_dev = oh->dev_attr;
  506. dev_cnt = count_ocp2scp_devices(ocp2scp_dev);
  507. if (!dev_cnt) {
  508. pr_err("%s: No devices connected to ocp2scp\n", __func__);
  509. kfree(pdata);
  510. return;
  511. }
  512. pdata->devices = kzalloc(sizeof(struct omap_ocp2scp_dev *)
  513. * dev_cnt, GFP_KERNEL);
  514. if (!pdata->devices) {
  515. pr_err("%s: No memory for ocp2scp pdata devices\n", __func__);
  516. kfree(pdata);
  517. return;
  518. }
  519. for (i = 0; i < dev_cnt; i++, ocp2scp_dev++)
  520. pdata->devices[i] = ocp2scp_dev;
  521. pdata->dev_cnt = dev_cnt;
  522. pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata));
  523. if (IS_ERR(pdev)) {
  524. pr_err("Could not build omap_device for %s %s\n",
  525. name, oh_name);
  526. kfree(pdata->devices);
  527. kfree(pdata);
  528. return;
  529. }
  530. }
  531. #else
  532. static inline void omap_init_ocp2scp(void) { }
  533. #endif
  534. #if IS_ENABLED(CONFIG_WL12XX)
  535. static struct wl12xx_platform_data wl12xx __initdata;
  536. void __init omap_init_wl12xx_of(void)
  537. {
  538. int ret;
  539. if (!of_have_populated_dt())
  540. return;
  541. if (of_machine_is_compatible("ti,omap4-sdp")) {
  542. wl12xx.board_ref_clock = WL12XX_REFCLOCK_26;
  543. wl12xx.board_tcxo_clock = WL12XX_TCXOCLOCK_26;
  544. wl12xx.irq = gpio_to_irq(53);
  545. } else if (of_machine_is_compatible("ti,omap4-panda")) {
  546. wl12xx.board_ref_clock = WL12XX_REFCLOCK_38;
  547. wl12xx.irq = gpio_to_irq(53);
  548. } else {
  549. return;
  550. }
  551. ret = wl12xx_set_platform_data(&wl12xx);
  552. if (ret) {
  553. pr_err("error setting wl12xx data: %d\n", ret);
  554. return;
  555. }
  556. }
  557. #else
  558. static inline void omap_init_wl12xx_of(void)
  559. {
  560. }
  561. #endif
  562. /*-------------------------------------------------------------------------*/
  563. static int __init omap2_init_devices(void)
  564. {
  565. /* Enable dummy states for those platforms without pinctrl support */
  566. if (!of_have_populated_dt())
  567. pinctrl_provide_dummies();
  568. /*
  569. * please keep these calls, and their implementations above,
  570. * in alphabetical order so they're easier to sort through.
  571. */
  572. omap_init_audio();
  573. omap_init_camera();
  574. omap_init_hdmi_audio();
  575. omap_init_mbox();
  576. /* If dtb is there, the devices will be created dynamically */
  577. if (!of_have_populated_dt()) {
  578. omap_init_control_usb();
  579. omap_init_dmic();
  580. omap_init_mcpdm();
  581. omap_init_mcspi();
  582. omap_init_sham();
  583. omap_init_aes();
  584. } else {
  585. /* These can be removed when bindings are done */
  586. omap_init_wl12xx_of();
  587. }
  588. omap_init_sti();
  589. omap_init_rng();
  590. omap_init_vout();
  591. omap_init_ocp2scp();
  592. return 0;
  593. }
  594. omap_arch_initcall(omap2_init_devices);