devices.c 15 KB

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