omap_device.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * omap_device implementation
  4. *
  5. * Copyright (C) 2009-2010 Nokia Corporation
  6. * Paul Walmsley, Kevin Hilman
  7. *
  8. * Developed in collaboration with (alphabetical order): Benoit
  9. * Cousson, Thara Gopinath, Tony Lindgren, Rajendra Nayak, Vikram
  10. * Pandita, Sakari Poussa, Anand Sawant, Santosh Shilimkar, Richard
  11. * Woodruff
  12. *
  13. * This code provides a consistent interface for OMAP device drivers
  14. * to control power management and interconnect properties of their
  15. * devices.
  16. *
  17. * In the medium- to long-term, this code should be implemented as a
  18. * proper omap_bus/omap_device in Linux, no more platform_data func
  19. * pointers
  20. */
  21. #undef DEBUG
  22. #include <linux/kernel.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/slab.h>
  25. #include <linux/err.h>
  26. #include <linux/io.h>
  27. #include <linux/clk.h>
  28. #include <linux/clkdev.h>
  29. #include <linux/pm_domain.h>
  30. #include <linux/pm_runtime.h>
  31. #include <linux/of.h>
  32. #include <linux/of_address.h>
  33. #include <linux/of_irq.h>
  34. #include <linux/notifier.h>
  35. #include "common.h"
  36. #include "soc.h"
  37. #include "omap_device.h"
  38. #include "omap_hwmod.h"
  39. /* Private functions */
  40. static void _add_clkdev(struct omap_device *od, const char *clk_alias,
  41. const char *clk_name)
  42. {
  43. struct clk *r;
  44. int rc;
  45. if (!clk_alias || !clk_name)
  46. return;
  47. dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name);
  48. r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias);
  49. if (!IS_ERR(r)) {
  50. dev_dbg(&od->pdev->dev,
  51. "alias %s already exists\n", clk_alias);
  52. clk_put(r);
  53. return;
  54. }
  55. r = clk_get_sys(NULL, clk_name);
  56. if (IS_ERR(r)) {
  57. struct of_phandle_args clkspec;
  58. clkspec.np = of_find_node_by_name(NULL, clk_name);
  59. r = of_clk_get_from_provider(&clkspec);
  60. rc = clk_register_clkdev(r, clk_alias,
  61. dev_name(&od->pdev->dev));
  62. } else {
  63. rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev),
  64. clk_name, NULL);
  65. }
  66. if (rc) {
  67. if (rc == -ENODEV || rc == -ENOMEM)
  68. dev_err(&od->pdev->dev,
  69. "clkdev_alloc for %s failed\n", clk_alias);
  70. else
  71. dev_err(&od->pdev->dev,
  72. "clk_get for %s failed\n", clk_name);
  73. }
  74. }
  75. /**
  76. * _add_hwmod_clocks_clkdev - Add clkdev entry for hwmod optional clocks
  77. * and main clock
  78. * @od: struct omap_device *od
  79. * @oh: struct omap_hwmod *oh
  80. *
  81. * For the main clock and every optional clock present per hwmod per
  82. * omap_device, this function adds an entry in the clkdev table of the
  83. * form <dev-id=dev_name, con-id=role> if it does not exist already.
  84. *
  85. * This allows drivers to get a pointer to its optional clocks based on its role
  86. * by calling clk_get(<dev*>, <role>).
  87. * In the case of the main clock, a "fck" alias is used.
  88. *
  89. * No return value.
  90. */
  91. static void _add_hwmod_clocks_clkdev(struct omap_device *od,
  92. struct omap_hwmod *oh)
  93. {
  94. int i;
  95. _add_clkdev(od, "fck", oh->main_clk);
  96. for (i = 0; i < oh->opt_clks_cnt; i++)
  97. _add_clkdev(od, oh->opt_clks[i].role, oh->opt_clks[i].clk);
  98. }
  99. /**
  100. * omap_device_build_from_dt - build an omap_device with multiple hwmods
  101. * @pdev: The platform device to update.
  102. *
  103. * Function for building an omap_device already registered from device-tree
  104. *
  105. * Returns 0 or PTR_ERR() on error.
  106. */
  107. static int omap_device_build_from_dt(struct platform_device *pdev)
  108. {
  109. struct omap_hwmod **hwmods;
  110. struct omap_device *od;
  111. struct omap_hwmod *oh;
  112. struct device_node *node = pdev->dev.of_node;
  113. struct resource res;
  114. const char *oh_name;
  115. int oh_cnt, i, ret = 0;
  116. bool device_active = false, skip_pm_domain = false;
  117. oh_cnt = of_property_count_strings(node, "ti,hwmods");
  118. if (oh_cnt <= 0) {
  119. dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n");
  120. return -ENODEV;
  121. }
  122. /* SDMA still needs special handling for omap_device_build() */
  123. ret = of_property_read_string_index(node, "ti,hwmods", 0, &oh_name);
  124. if (!ret && (!strncmp("dma_system", oh_name, 10) ||
  125. !strncmp("dma", oh_name, 3)))
  126. skip_pm_domain = true;
  127. /* Use ti-sysc driver instead of omap_device? */
  128. if (!skip_pm_domain &&
  129. !omap_hwmod_parse_module_range(NULL, node, &res))
  130. return -ENODEV;
  131. hwmods = kcalloc(oh_cnt, sizeof(struct omap_hwmod *), GFP_KERNEL);
  132. if (!hwmods) {
  133. ret = -ENOMEM;
  134. goto odbfd_exit;
  135. }
  136. for (i = 0; i < oh_cnt; i++) {
  137. of_property_read_string_index(node, "ti,hwmods", i, &oh_name);
  138. oh = omap_hwmod_lookup(oh_name);
  139. if (!oh) {
  140. dev_err(&pdev->dev, "Cannot lookup hwmod '%s'\n",
  141. oh_name);
  142. ret = -EINVAL;
  143. goto odbfd_exit1;
  144. }
  145. hwmods[i] = oh;
  146. if (oh->flags & HWMOD_INIT_NO_IDLE)
  147. device_active = true;
  148. }
  149. od = omap_device_alloc(pdev, hwmods, oh_cnt);
  150. if (IS_ERR(od)) {
  151. dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
  152. oh_name);
  153. ret = PTR_ERR(od);
  154. goto odbfd_exit1;
  155. }
  156. /* Fix up missing resource names */
  157. for (i = 0; i < pdev->num_resources; i++) {
  158. struct resource *r = &pdev->resource[i];
  159. if (r->name == NULL)
  160. r->name = dev_name(&pdev->dev);
  161. }
  162. if (!skip_pm_domain) {
  163. dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain);
  164. if (device_active) {
  165. omap_device_enable(pdev);
  166. pm_runtime_set_active(&pdev->dev);
  167. }
  168. }
  169. odbfd_exit1:
  170. kfree(hwmods);
  171. odbfd_exit:
  172. /* if data/we are at fault.. load up a fail handler */
  173. if (ret)
  174. dev_pm_domain_set(&pdev->dev, &omap_device_fail_pm_domain);
  175. return ret;
  176. }
  177. static int _omap_device_notifier_call(struct notifier_block *nb,
  178. unsigned long event, void *dev)
  179. {
  180. struct platform_device *pdev = to_platform_device(dev);
  181. struct omap_device *od;
  182. int err;
  183. switch (event) {
  184. case BUS_NOTIFY_REMOVED_DEVICE:
  185. if (pdev->archdata.od)
  186. omap_device_delete(pdev->archdata.od);
  187. break;
  188. case BUS_NOTIFY_UNBOUND_DRIVER:
  189. od = to_omap_device(pdev);
  190. if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED)) {
  191. dev_info(dev, "enabled after unload, idling\n");
  192. err = omap_device_idle(pdev);
  193. if (err)
  194. dev_err(dev, "failed to idle\n");
  195. }
  196. break;
  197. case BUS_NOTIFY_BIND_DRIVER:
  198. od = to_omap_device(pdev);
  199. if (od) {
  200. od->_driver_status = BUS_NOTIFY_BIND_DRIVER;
  201. if (od->_state == OMAP_DEVICE_STATE_ENABLED &&
  202. pm_runtime_status_suspended(dev)) {
  203. pm_runtime_set_active(dev);
  204. }
  205. }
  206. break;
  207. case BUS_NOTIFY_ADD_DEVICE:
  208. if (pdev->dev.of_node)
  209. omap_device_build_from_dt(pdev);
  210. omap_auxdata_legacy_init(dev);
  211. fallthrough;
  212. default:
  213. od = to_omap_device(pdev);
  214. if (od)
  215. od->_driver_status = event;
  216. }
  217. return NOTIFY_DONE;
  218. }
  219. /**
  220. * _omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
  221. * @od: struct omap_device *od
  222. *
  223. * Enable all underlying hwmods. Returns 0.
  224. */
  225. static int _omap_device_enable_hwmods(struct omap_device *od)
  226. {
  227. int ret = 0;
  228. int i;
  229. for (i = 0; i < od->hwmods_cnt; i++)
  230. ret |= omap_hwmod_enable(od->hwmods[i]);
  231. return ret;
  232. }
  233. /**
  234. * _omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
  235. * @od: struct omap_device *od
  236. *
  237. * Idle all underlying hwmods. Returns 0.
  238. */
  239. static int _omap_device_idle_hwmods(struct omap_device *od)
  240. {
  241. int ret = 0;
  242. int i;
  243. for (i = 0; i < od->hwmods_cnt; i++)
  244. ret |= omap_hwmod_idle(od->hwmods[i]);
  245. return ret;
  246. }
  247. /* Public functions for use by core code */
  248. /**
  249. * omap_device_get_context_loss_count - get lost context count
  250. * @pdev: The platform device to update.
  251. *
  252. * Using the primary hwmod, query the context loss count for this
  253. * device.
  254. *
  255. * Callers should consider context for this device lost any time this
  256. * function returns a value different than the value the caller got
  257. * the last time it called this function.
  258. *
  259. * If any hwmods exist for the omap_device associated with @pdev,
  260. * return the context loss counter for that hwmod, otherwise return
  261. * zero.
  262. */
  263. int omap_device_get_context_loss_count(struct platform_device *pdev)
  264. {
  265. struct omap_device *od;
  266. u32 ret = 0;
  267. od = to_omap_device(pdev);
  268. if (od->hwmods_cnt)
  269. ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
  270. return ret;
  271. }
  272. /**
  273. * omap_device_alloc - allocate an omap_device
  274. * @pdev: platform_device that will be included in this omap_device
  275. * @ohs: ptr to the omap_hwmod for this omap_device
  276. * @oh_cnt: the size of the ohs list
  277. *
  278. * Convenience function for allocating an omap_device structure and filling
  279. * hwmods, and resources.
  280. *
  281. * Returns an struct omap_device pointer or ERR_PTR() on error;
  282. */
  283. struct omap_device *omap_device_alloc(struct platform_device *pdev,
  284. struct omap_hwmod **ohs, int oh_cnt)
  285. {
  286. int ret = -ENOMEM;
  287. struct omap_device *od;
  288. int i;
  289. struct omap_hwmod **hwmods;
  290. od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
  291. if (!od)
  292. goto oda_exit1;
  293. od->hwmods_cnt = oh_cnt;
  294. hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
  295. if (!hwmods)
  296. goto oda_exit2;
  297. od->hwmods = hwmods;
  298. od->pdev = pdev;
  299. pdev->archdata.od = od;
  300. for (i = 0; i < oh_cnt; i++) {
  301. hwmods[i]->od = od;
  302. _add_hwmod_clocks_clkdev(od, hwmods[i]);
  303. }
  304. return od;
  305. oda_exit2:
  306. kfree(od);
  307. oda_exit1:
  308. dev_err(&pdev->dev, "omap_device: build failed (%d)\n", ret);
  309. return ERR_PTR(ret);
  310. }
  311. void omap_device_delete(struct omap_device *od)
  312. {
  313. if (!od)
  314. return;
  315. od->pdev->archdata.od = NULL;
  316. kfree(od->hwmods);
  317. kfree(od);
  318. }
  319. #ifdef CONFIG_PM
  320. static int _od_runtime_suspend(struct device *dev)
  321. {
  322. struct platform_device *pdev = to_platform_device(dev);
  323. int ret;
  324. ret = pm_generic_runtime_suspend(dev);
  325. if (ret)
  326. return ret;
  327. return omap_device_idle(pdev);
  328. }
  329. static int _od_runtime_resume(struct device *dev)
  330. {
  331. struct platform_device *pdev = to_platform_device(dev);
  332. int ret;
  333. ret = omap_device_enable(pdev);
  334. if (ret) {
  335. dev_err(dev, "use pm_runtime_put_sync_suspend() in driver?\n");
  336. return ret;
  337. }
  338. return pm_generic_runtime_resume(dev);
  339. }
  340. static int _od_fail_runtime_suspend(struct device *dev)
  341. {
  342. dev_warn(dev, "%s: FIXME: missing hwmod/omap_dev info\n", __func__);
  343. return -ENODEV;
  344. }
  345. static int _od_fail_runtime_resume(struct device *dev)
  346. {
  347. dev_warn(dev, "%s: FIXME: missing hwmod/omap_dev info\n", __func__);
  348. return -ENODEV;
  349. }
  350. #endif
  351. #ifdef CONFIG_SUSPEND
  352. static int _od_suspend_noirq(struct device *dev)
  353. {
  354. struct platform_device *pdev = to_platform_device(dev);
  355. struct omap_device *od = to_omap_device(pdev);
  356. int ret;
  357. /* Don't attempt late suspend on a driver that is not bound */
  358. if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
  359. return 0;
  360. ret = pm_generic_suspend_noirq(dev);
  361. if (!ret && !pm_runtime_status_suspended(dev)) {
  362. if (pm_generic_runtime_suspend(dev) == 0) {
  363. omap_device_idle(pdev);
  364. od->flags |= OMAP_DEVICE_SUSPENDED;
  365. }
  366. }
  367. return ret;
  368. }
  369. static int _od_resume_noirq(struct device *dev)
  370. {
  371. struct platform_device *pdev = to_platform_device(dev);
  372. struct omap_device *od = to_omap_device(pdev);
  373. if (od->flags & OMAP_DEVICE_SUSPENDED) {
  374. od->flags &= ~OMAP_DEVICE_SUSPENDED;
  375. omap_device_enable(pdev);
  376. pm_generic_runtime_resume(dev);
  377. }
  378. return pm_generic_resume_noirq(dev);
  379. }
  380. #else
  381. #define _od_suspend_noirq NULL
  382. #define _od_resume_noirq NULL
  383. #endif
  384. struct dev_pm_domain omap_device_fail_pm_domain = {
  385. .ops = {
  386. SET_RUNTIME_PM_OPS(_od_fail_runtime_suspend,
  387. _od_fail_runtime_resume, NULL)
  388. }
  389. };
  390. struct dev_pm_domain omap_device_pm_domain = {
  391. .ops = {
  392. SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
  393. NULL)
  394. USE_PLATFORM_PM_SLEEP_OPS
  395. SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(_od_suspend_noirq,
  396. _od_resume_noirq)
  397. }
  398. };
  399. /* Public functions for use by device drivers through struct platform_data */
  400. /**
  401. * omap_device_enable - fully activate an omap_device
  402. * @pdev: the platform device to activate
  403. *
  404. * Do whatever is necessary for the hwmods underlying omap_device @od
  405. * to be accessible and ready to operate. This generally involves
  406. * enabling clocks, setting SYSCONFIG registers; and in the future may
  407. * involve remuxing pins. Device drivers should call this function
  408. * indirectly via pm_runtime_get*(). Returns -EINVAL if called when
  409. * the omap_device is already enabled, or passes along the return
  410. * value of _omap_device_enable_hwmods().
  411. */
  412. int omap_device_enable(struct platform_device *pdev)
  413. {
  414. int ret;
  415. struct omap_device *od;
  416. od = to_omap_device(pdev);
  417. if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
  418. dev_warn(&pdev->dev,
  419. "omap_device: %s() called from invalid state %d\n",
  420. __func__, od->_state);
  421. return -EINVAL;
  422. }
  423. ret = _omap_device_enable_hwmods(od);
  424. if (ret == 0)
  425. od->_state = OMAP_DEVICE_STATE_ENABLED;
  426. return ret;
  427. }
  428. /**
  429. * omap_device_idle - idle an omap_device
  430. * @pdev: The platform_device (omap_device) to idle
  431. *
  432. * Idle omap_device @od. Device drivers call this function indirectly
  433. * via pm_runtime_put*(). Returns -EINVAL if the omap_device is not
  434. * currently enabled, or passes along the return value of
  435. * _omap_device_idle_hwmods().
  436. */
  437. int omap_device_idle(struct platform_device *pdev)
  438. {
  439. int ret;
  440. struct omap_device *od;
  441. od = to_omap_device(pdev);
  442. if (od->_state != OMAP_DEVICE_STATE_ENABLED) {
  443. dev_warn(&pdev->dev,
  444. "omap_device: %s() called from invalid state %d\n",
  445. __func__, od->_state);
  446. return -EINVAL;
  447. }
  448. ret = _omap_device_idle_hwmods(od);
  449. if (ret == 0)
  450. od->_state = OMAP_DEVICE_STATE_IDLE;
  451. return ret;
  452. }
  453. /**
  454. * omap_device_assert_hardreset - set a device's hardreset line
  455. * @pdev: struct platform_device * to reset
  456. * @name: const char * name of the reset line
  457. *
  458. * Set the hardreset line identified by @name on the IP blocks
  459. * associated with the hwmods backing the platform_device @pdev. All
  460. * of the hwmods associated with @pdev must have the same hardreset
  461. * line linked to them for this to work. Passes along the return value
  462. * of omap_hwmod_assert_hardreset() in the event of any failure, or
  463. * returns 0 upon success.
  464. */
  465. int omap_device_assert_hardreset(struct platform_device *pdev, const char *name)
  466. {
  467. struct omap_device *od = to_omap_device(pdev);
  468. int ret = 0;
  469. int i;
  470. for (i = 0; i < od->hwmods_cnt; i++) {
  471. ret = omap_hwmod_assert_hardreset(od->hwmods[i], name);
  472. if (ret)
  473. break;
  474. }
  475. return ret;
  476. }
  477. /**
  478. * omap_device_deassert_hardreset - release a device's hardreset line
  479. * @pdev: struct platform_device * to reset
  480. * @name: const char * name of the reset line
  481. *
  482. * Release the hardreset line identified by @name on the IP blocks
  483. * associated with the hwmods backing the platform_device @pdev. All
  484. * of the hwmods associated with @pdev must have the same hardreset
  485. * line linked to them for this to work. Passes along the return
  486. * value of omap_hwmod_deassert_hardreset() in the event of any
  487. * failure, or returns 0 upon success.
  488. */
  489. int omap_device_deassert_hardreset(struct platform_device *pdev,
  490. const char *name)
  491. {
  492. struct omap_device *od = to_omap_device(pdev);
  493. int ret = 0;
  494. int i;
  495. for (i = 0; i < od->hwmods_cnt; i++) {
  496. ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name);
  497. if (ret)
  498. break;
  499. }
  500. return ret;
  501. }
  502. /**
  503. * omap_device_get_by_hwmod_name() - convert a hwmod name to
  504. * device pointer.
  505. * @oh_name: name of the hwmod device
  506. *
  507. * Returns back a struct device * pointer associated with a hwmod
  508. * device represented by a hwmod_name
  509. */
  510. struct device *omap_device_get_by_hwmod_name(const char *oh_name)
  511. {
  512. struct omap_hwmod *oh;
  513. if (!oh_name) {
  514. WARN(1, "%s: no hwmod name!\n", __func__);
  515. return ERR_PTR(-EINVAL);
  516. }
  517. oh = omap_hwmod_lookup(oh_name);
  518. if (!oh) {
  519. WARN(1, "%s: no hwmod for %s\n", __func__,
  520. oh_name);
  521. return ERR_PTR(-ENODEV);
  522. }
  523. if (!oh->od) {
  524. WARN(1, "%s: no omap_device for %s\n", __func__,
  525. oh_name);
  526. return ERR_PTR(-ENODEV);
  527. }
  528. return &oh->od->pdev->dev;
  529. }
  530. static struct notifier_block platform_nb = {
  531. .notifier_call = _omap_device_notifier_call,
  532. };
  533. static int __init omap_device_init(void)
  534. {
  535. bus_register_notifier(&platform_bus_type, &platform_nb);
  536. return 0;
  537. }
  538. omap_postcore_initcall(omap_device_init);
  539. /**
  540. * omap_device_late_idle - idle devices without drivers
  541. * @dev: struct device * associated with omap_device
  542. * @data: unused
  543. *
  544. * Check the driver bound status of this device, and idle it
  545. * if there is no driver attached.
  546. */
  547. static int __init omap_device_late_idle(struct device *dev, void *data)
  548. {
  549. struct platform_device *pdev = to_platform_device(dev);
  550. struct omap_device *od = to_omap_device(pdev);
  551. int i;
  552. if (!od)
  553. return 0;
  554. /*
  555. * If omap_device state is enabled, but has no driver bound,
  556. * idle it.
  557. */
  558. /*
  559. * Some devices (like memory controllers) are always kept
  560. * enabled, and should not be idled even with no drivers.
  561. */
  562. for (i = 0; i < od->hwmods_cnt; i++)
  563. if (od->hwmods[i]->flags & HWMOD_INIT_NO_IDLE)
  564. return 0;
  565. if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER &&
  566. od->_driver_status != BUS_NOTIFY_BIND_DRIVER) {
  567. if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
  568. dev_warn(dev, "%s: enabled but no driver. Idling\n",
  569. __func__);
  570. omap_device_idle(pdev);
  571. }
  572. }
  573. return 0;
  574. }
  575. static int __init omap_device_late_init(void)
  576. {
  577. bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
  578. return 0;
  579. }
  580. omap_late_initcall_sync(omap_device_late_init);