devices.c 15 KB

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