bus.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. /*
  2. * linux/arch/arm/common/amba.c
  3. *
  4. * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
  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 version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/module.h>
  11. #include <linux/init.h>
  12. #include <linux/device.h>
  13. #include <linux/string.h>
  14. #include <linux/slab.h>
  15. #include <linux/io.h>
  16. #include <linux/pm.h>
  17. #include <linux/pm_runtime.h>
  18. #include <linux/amba/bus.h>
  19. #include <asm/irq.h>
  20. #include <asm/sizes.h>
  21. #define to_amba_driver(d) container_of(d, struct amba_driver, drv)
  22. static const struct amba_id *
  23. amba_lookup(const struct amba_id *table, struct amba_device *dev)
  24. {
  25. int ret = 0;
  26. while (table->mask) {
  27. ret = (dev->periphid & table->mask) == table->id;
  28. if (ret)
  29. break;
  30. table++;
  31. }
  32. return ret ? table : NULL;
  33. }
  34. static int amba_match(struct device *dev, struct device_driver *drv)
  35. {
  36. struct amba_device *pcdev = to_amba_device(dev);
  37. struct amba_driver *pcdrv = to_amba_driver(drv);
  38. return amba_lookup(pcdrv->id_table, pcdev) != NULL;
  39. }
  40. #ifdef CONFIG_HOTPLUG
  41. static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
  42. {
  43. struct amba_device *pcdev = to_amba_device(dev);
  44. int retval = 0;
  45. retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid);
  46. if (retval)
  47. return retval;
  48. retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid);
  49. return retval;
  50. }
  51. #else
  52. #define amba_uevent NULL
  53. #endif
  54. #define amba_attr_func(name,fmt,arg...) \
  55. static ssize_t name##_show(struct device *_dev, \
  56. struct device_attribute *attr, char *buf) \
  57. { \
  58. struct amba_device *dev = to_amba_device(_dev); \
  59. return sprintf(buf, fmt, arg); \
  60. }
  61. #define amba_attr(name,fmt,arg...) \
  62. amba_attr_func(name,fmt,arg) \
  63. static DEVICE_ATTR(name, S_IRUGO, name##_show, NULL)
  64. amba_attr_func(id, "%08x\n", dev->periphid);
  65. amba_attr(irq0, "%u\n", dev->irq[0]);
  66. amba_attr(irq1, "%u\n", dev->irq[1]);
  67. amba_attr_func(resource, "\t%016llx\t%016llx\t%016lx\n",
  68. (unsigned long long)dev->res.start, (unsigned long long)dev->res.end,
  69. dev->res.flags);
  70. static struct device_attribute amba_dev_attrs[] = {
  71. __ATTR_RO(id),
  72. __ATTR_RO(resource),
  73. __ATTR_NULL,
  74. };
  75. #ifdef CONFIG_PM_SLEEP
  76. static int amba_legacy_suspend(struct device *dev, pm_message_t mesg)
  77. {
  78. struct amba_driver *adrv = to_amba_driver(dev->driver);
  79. struct amba_device *adev = to_amba_device(dev);
  80. int ret = 0;
  81. if (dev->driver && adrv->suspend)
  82. ret = adrv->suspend(adev, mesg);
  83. return ret;
  84. }
  85. static int amba_legacy_resume(struct device *dev)
  86. {
  87. struct amba_driver *adrv = to_amba_driver(dev->driver);
  88. struct amba_device *adev = to_amba_device(dev);
  89. int ret = 0;
  90. if (dev->driver && adrv->resume)
  91. ret = adrv->resume(adev);
  92. return ret;
  93. }
  94. #endif /* CONFIG_PM_SLEEP */
  95. #ifdef CONFIG_SUSPEND
  96. static int amba_pm_suspend(struct device *dev)
  97. {
  98. struct device_driver *drv = dev->driver;
  99. int ret = 0;
  100. if (!drv)
  101. return 0;
  102. if (drv->pm) {
  103. if (drv->pm->suspend)
  104. ret = drv->pm->suspend(dev);
  105. } else {
  106. ret = amba_legacy_suspend(dev, PMSG_SUSPEND);
  107. }
  108. return ret;
  109. }
  110. static int amba_pm_resume(struct device *dev)
  111. {
  112. struct device_driver *drv = dev->driver;
  113. int ret = 0;
  114. if (!drv)
  115. return 0;
  116. if (drv->pm) {
  117. if (drv->pm->resume)
  118. ret = drv->pm->resume(dev);
  119. } else {
  120. ret = amba_legacy_resume(dev);
  121. }
  122. return ret;
  123. }
  124. #else /* !CONFIG_SUSPEND */
  125. #define amba_pm_suspend NULL
  126. #define amba_pm_resume NULL
  127. #endif /* !CONFIG_SUSPEND */
  128. #ifdef CONFIG_HIBERNATE_CALLBACKS
  129. static int amba_pm_freeze(struct device *dev)
  130. {
  131. struct device_driver *drv = dev->driver;
  132. int ret = 0;
  133. if (!drv)
  134. return 0;
  135. if (drv->pm) {
  136. if (drv->pm->freeze)
  137. ret = drv->pm->freeze(dev);
  138. } else {
  139. ret = amba_legacy_suspend(dev, PMSG_FREEZE);
  140. }
  141. return ret;
  142. }
  143. static int amba_pm_thaw(struct device *dev)
  144. {
  145. struct device_driver *drv = dev->driver;
  146. int ret = 0;
  147. if (!drv)
  148. return 0;
  149. if (drv->pm) {
  150. if (drv->pm->thaw)
  151. ret = drv->pm->thaw(dev);
  152. } else {
  153. ret = amba_legacy_resume(dev);
  154. }
  155. return ret;
  156. }
  157. static int amba_pm_poweroff(struct device *dev)
  158. {
  159. struct device_driver *drv = dev->driver;
  160. int ret = 0;
  161. if (!drv)
  162. return 0;
  163. if (drv->pm) {
  164. if (drv->pm->poweroff)
  165. ret = drv->pm->poweroff(dev);
  166. } else {
  167. ret = amba_legacy_suspend(dev, PMSG_HIBERNATE);
  168. }
  169. return ret;
  170. }
  171. static int amba_pm_restore(struct device *dev)
  172. {
  173. struct device_driver *drv = dev->driver;
  174. int ret = 0;
  175. if (!drv)
  176. return 0;
  177. if (drv->pm) {
  178. if (drv->pm->restore)
  179. ret = drv->pm->restore(dev);
  180. } else {
  181. ret = amba_legacy_resume(dev);
  182. }
  183. return ret;
  184. }
  185. #else /* !CONFIG_HIBERNATE_CALLBACKS */
  186. #define amba_pm_freeze NULL
  187. #define amba_pm_thaw NULL
  188. #define amba_pm_poweroff NULL
  189. #define amba_pm_restore NULL
  190. #endif /* !CONFIG_HIBERNATE_CALLBACKS */
  191. #ifdef CONFIG_PM_RUNTIME
  192. /*
  193. * Hooks to provide runtime PM of the pclk (bus clock). It is safe to
  194. * enable/disable the bus clock at runtime PM suspend/resume as this
  195. * does not result in loss of context. However, disabling vcore power
  196. * would do, so we leave that to the driver.
  197. */
  198. static int amba_pm_runtime_suspend(struct device *dev)
  199. {
  200. struct amba_device *pcdev = to_amba_device(dev);
  201. int ret = pm_generic_runtime_suspend(dev);
  202. if (ret == 0 && dev->driver)
  203. clk_disable(pcdev->pclk);
  204. return ret;
  205. }
  206. static int amba_pm_runtime_resume(struct device *dev)
  207. {
  208. struct amba_device *pcdev = to_amba_device(dev);
  209. int ret;
  210. if (dev->driver) {
  211. ret = clk_enable(pcdev->pclk);
  212. /* Failure is probably fatal to the system, but... */
  213. if (ret)
  214. return ret;
  215. }
  216. return pm_generic_runtime_resume(dev);
  217. }
  218. #endif
  219. #ifdef CONFIG_PM
  220. static const struct dev_pm_ops amba_pm = {
  221. .suspend = amba_pm_suspend,
  222. .resume = amba_pm_resume,
  223. .freeze = amba_pm_freeze,
  224. .thaw = amba_pm_thaw,
  225. .poweroff = amba_pm_poweroff,
  226. .restore = amba_pm_restore,
  227. SET_RUNTIME_PM_OPS(
  228. amba_pm_runtime_suspend,
  229. amba_pm_runtime_resume,
  230. pm_generic_runtime_idle
  231. )
  232. };
  233. #define AMBA_PM (&amba_pm)
  234. #else /* !CONFIG_PM */
  235. #define AMBA_PM NULL
  236. #endif /* !CONFIG_PM */
  237. /*
  238. * Primecells are part of the Advanced Microcontroller Bus Architecture,
  239. * so we call the bus "amba".
  240. */
  241. struct bus_type amba_bustype = {
  242. .name = "amba",
  243. .dev_attrs = amba_dev_attrs,
  244. .match = amba_match,
  245. .uevent = amba_uevent,
  246. .pm = AMBA_PM,
  247. };
  248. static int __init amba_init(void)
  249. {
  250. return bus_register(&amba_bustype);
  251. }
  252. postcore_initcall(amba_init);
  253. static int amba_get_enable_pclk(struct amba_device *pcdev)
  254. {
  255. struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
  256. int ret;
  257. pcdev->pclk = pclk;
  258. if (IS_ERR(pclk))
  259. return PTR_ERR(pclk);
  260. ret = clk_prepare(pclk);
  261. if (ret) {
  262. clk_put(pclk);
  263. return ret;
  264. }
  265. ret = clk_enable(pclk);
  266. if (ret) {
  267. clk_unprepare(pclk);
  268. clk_put(pclk);
  269. }
  270. return ret;
  271. }
  272. static void amba_put_disable_pclk(struct amba_device *pcdev)
  273. {
  274. struct clk *pclk = pcdev->pclk;
  275. clk_disable(pclk);
  276. clk_unprepare(pclk);
  277. clk_put(pclk);
  278. }
  279. static int amba_get_enable_vcore(struct amba_device *pcdev)
  280. {
  281. struct regulator *vcore = regulator_get(&pcdev->dev, "vcore");
  282. int ret;
  283. pcdev->vcore = vcore;
  284. if (IS_ERR(vcore)) {
  285. /* It is OK not to supply a vcore regulator */
  286. if (PTR_ERR(vcore) == -ENODEV)
  287. return 0;
  288. return PTR_ERR(vcore);
  289. }
  290. ret = regulator_enable(vcore);
  291. if (ret) {
  292. regulator_put(vcore);
  293. pcdev->vcore = ERR_PTR(-ENODEV);
  294. }
  295. return ret;
  296. }
  297. static void amba_put_disable_vcore(struct amba_device *pcdev)
  298. {
  299. struct regulator *vcore = pcdev->vcore;
  300. if (!IS_ERR(vcore)) {
  301. regulator_disable(vcore);
  302. regulator_put(vcore);
  303. }
  304. }
  305. /*
  306. * These are the device model conversion veneers; they convert the
  307. * device model structures to our more specific structures.
  308. */
  309. static int amba_probe(struct device *dev)
  310. {
  311. struct amba_device *pcdev = to_amba_device(dev);
  312. struct amba_driver *pcdrv = to_amba_driver(dev->driver);
  313. const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
  314. int ret;
  315. do {
  316. ret = amba_get_enable_vcore(pcdev);
  317. if (ret)
  318. break;
  319. ret = amba_get_enable_pclk(pcdev);
  320. if (ret)
  321. break;
  322. pm_runtime_get_noresume(dev);
  323. pm_runtime_set_active(dev);
  324. pm_runtime_enable(dev);
  325. ret = pcdrv->probe(pcdev, id);
  326. if (ret == 0)
  327. break;
  328. pm_runtime_disable(dev);
  329. pm_runtime_set_suspended(dev);
  330. pm_runtime_put_noidle(dev);
  331. amba_put_disable_pclk(pcdev);
  332. amba_put_disable_vcore(pcdev);
  333. } while (0);
  334. return ret;
  335. }
  336. static int amba_remove(struct device *dev)
  337. {
  338. struct amba_device *pcdev = to_amba_device(dev);
  339. struct amba_driver *drv = to_amba_driver(dev->driver);
  340. int ret;
  341. pm_runtime_get_sync(dev);
  342. ret = drv->remove(pcdev);
  343. pm_runtime_put_noidle(dev);
  344. /* Undo the runtime PM settings in amba_probe() */
  345. pm_runtime_disable(dev);
  346. pm_runtime_set_suspended(dev);
  347. pm_runtime_put_noidle(dev);
  348. amba_put_disable_pclk(pcdev);
  349. amba_put_disable_vcore(pcdev);
  350. return ret;
  351. }
  352. static void amba_shutdown(struct device *dev)
  353. {
  354. struct amba_driver *drv = to_amba_driver(dev->driver);
  355. drv->shutdown(to_amba_device(dev));
  356. }
  357. /**
  358. * amba_driver_register - register an AMBA device driver
  359. * @drv: amba device driver structure
  360. *
  361. * Register an AMBA device driver with the Linux device model
  362. * core. If devices pre-exist, the drivers probe function will
  363. * be called.
  364. */
  365. int amba_driver_register(struct amba_driver *drv)
  366. {
  367. drv->drv.bus = &amba_bustype;
  368. #define SETFN(fn) if (drv->fn) drv->drv.fn = amba_##fn
  369. SETFN(probe);
  370. SETFN(remove);
  371. SETFN(shutdown);
  372. return driver_register(&drv->drv);
  373. }
  374. /**
  375. * amba_driver_unregister - remove an AMBA device driver
  376. * @drv: AMBA device driver structure to remove
  377. *
  378. * Unregister an AMBA device driver from the Linux device
  379. * model. The device model will call the drivers remove function
  380. * for each device the device driver is currently handling.
  381. */
  382. void amba_driver_unregister(struct amba_driver *drv)
  383. {
  384. driver_unregister(&drv->drv);
  385. }
  386. static void amba_device_release(struct device *dev)
  387. {
  388. struct amba_device *d = to_amba_device(dev);
  389. if (d->res.parent)
  390. release_resource(&d->res);
  391. kfree(d);
  392. }
  393. /**
  394. * amba_device_add - add a previously allocated AMBA device structure
  395. * @dev: AMBA device allocated by amba_device_alloc
  396. * @parent: resource parent for this devices resources
  397. *
  398. * Claim the resource, and read the device cell ID if not already
  399. * initialized. Register the AMBA device with the Linux device
  400. * manager.
  401. */
  402. int amba_device_add(struct amba_device *dev, struct resource *parent)
  403. {
  404. u32 size;
  405. void __iomem *tmp;
  406. int i, ret;
  407. WARN_ON(dev->irq[0] == (unsigned int)-1);
  408. WARN_ON(dev->irq[1] == (unsigned int)-1);
  409. ret = request_resource(parent, &dev->res);
  410. if (ret)
  411. goto err_out;
  412. /* Hard-coded primecell ID instead of plug-n-play */
  413. if (dev->periphid != 0)
  414. goto skip_probe;
  415. /*
  416. * Dynamically calculate the size of the resource
  417. * and use this for iomap
  418. */
  419. size = resource_size(&dev->res);
  420. tmp = ioremap(dev->res.start, size);
  421. if (!tmp) {
  422. ret = -ENOMEM;
  423. goto err_release;
  424. }
  425. ret = amba_get_enable_pclk(dev);
  426. if (ret == 0) {
  427. u32 pid, cid;
  428. /*
  429. * Read pid and cid based on size of resource
  430. * they are located at end of region
  431. */
  432. for (pid = 0, i = 0; i < 4; i++)
  433. pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) <<
  434. (i * 8);
  435. for (cid = 0, i = 0; i < 4; i++)
  436. cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) <<
  437. (i * 8);
  438. amba_put_disable_pclk(dev);
  439. if (cid == AMBA_CID)
  440. dev->periphid = pid;
  441. if (!dev->periphid)
  442. ret = -ENODEV;
  443. }
  444. iounmap(tmp);
  445. if (ret)
  446. goto err_release;
  447. skip_probe:
  448. ret = device_add(&dev->dev);
  449. if (ret)
  450. goto err_release;
  451. if (dev->irq[0] && dev->irq[0] != NO_IRQ)
  452. ret = device_create_file(&dev->dev, &dev_attr_irq0);
  453. if (ret == 0 && dev->irq[1] && dev->irq[1] != NO_IRQ)
  454. ret = device_create_file(&dev->dev, &dev_attr_irq1);
  455. if (ret == 0)
  456. return ret;
  457. device_unregister(&dev->dev);
  458. err_release:
  459. release_resource(&dev->res);
  460. err_out:
  461. return ret;
  462. }
  463. EXPORT_SYMBOL_GPL(amba_device_add);
  464. static void amba_device_initialize(struct amba_device *dev, const char *name)
  465. {
  466. device_initialize(&dev->dev);
  467. if (name)
  468. dev_set_name(&dev->dev, "%s", name);
  469. dev->dev.release = amba_device_release;
  470. dev->dev.bus = &amba_bustype;
  471. dev->dev.dma_mask = &dev->dma_mask;
  472. dev->res.name = dev_name(&dev->dev);
  473. }
  474. /**
  475. * amba_device_alloc - allocate an AMBA device
  476. * @name: sysfs name of the AMBA device
  477. * @base: base of AMBA device
  478. * @size: size of AMBA device
  479. *
  480. * Allocate and initialize an AMBA device structure. Returns %NULL
  481. * on failure.
  482. */
  483. struct amba_device *amba_device_alloc(const char *name, resource_size_t base,
  484. size_t size)
  485. {
  486. struct amba_device *dev;
  487. dev = kzalloc(sizeof(*dev), GFP_KERNEL);
  488. if (dev) {
  489. amba_device_initialize(dev, name);
  490. dev->res.start = base;
  491. dev->res.end = base + size - 1;
  492. dev->res.flags = IORESOURCE_MEM;
  493. }
  494. return dev;
  495. }
  496. EXPORT_SYMBOL_GPL(amba_device_alloc);
  497. /**
  498. * amba_device_register - register an AMBA device
  499. * @dev: AMBA device to register
  500. * @parent: parent memory resource
  501. *
  502. * Setup the AMBA device, reading the cell ID if present.
  503. * Claim the resource, and register the AMBA device with
  504. * the Linux device manager.
  505. */
  506. int amba_device_register(struct amba_device *dev, struct resource *parent)
  507. {
  508. amba_device_initialize(dev, dev->dev.init_name);
  509. dev->dev.init_name = NULL;
  510. if (!dev->dev.coherent_dma_mask && dev->dma_mask)
  511. dev_warn(&dev->dev, "coherent dma mask is unset\n");
  512. return amba_device_add(dev, parent);
  513. }
  514. /**
  515. * amba_device_put - put an AMBA device
  516. * @dev: AMBA device to put
  517. */
  518. void amba_device_put(struct amba_device *dev)
  519. {
  520. put_device(&dev->dev);
  521. }
  522. EXPORT_SYMBOL_GPL(amba_device_put);
  523. /**
  524. * amba_device_unregister - unregister an AMBA device
  525. * @dev: AMBA device to remove
  526. *
  527. * Remove the specified AMBA device from the Linux device
  528. * manager. All files associated with this object will be
  529. * destroyed, and device drivers notified that the device has
  530. * been removed. The AMBA device's resources including
  531. * the amba_device structure will be freed once all
  532. * references to it have been dropped.
  533. */
  534. void amba_device_unregister(struct amba_device *dev)
  535. {
  536. device_unregister(&dev->dev);
  537. }
  538. struct find_data {
  539. struct amba_device *dev;
  540. struct device *parent;
  541. const char *busid;
  542. unsigned int id;
  543. unsigned int mask;
  544. };
  545. static int amba_find_match(struct device *dev, void *data)
  546. {
  547. struct find_data *d = data;
  548. struct amba_device *pcdev = to_amba_device(dev);
  549. int r;
  550. r = (pcdev->periphid & d->mask) == d->id;
  551. if (d->parent)
  552. r &= d->parent == dev->parent;
  553. if (d->busid)
  554. r &= strcmp(dev_name(dev), d->busid) == 0;
  555. if (r) {
  556. get_device(dev);
  557. d->dev = pcdev;
  558. }
  559. return r;
  560. }
  561. /**
  562. * amba_find_device - locate an AMBA device given a bus id
  563. * @busid: bus id for device (or NULL)
  564. * @parent: parent device (or NULL)
  565. * @id: peripheral ID (or 0)
  566. * @mask: peripheral ID mask (or 0)
  567. *
  568. * Return the AMBA device corresponding to the supplied parameters.
  569. * If no device matches, returns NULL.
  570. *
  571. * NOTE: When a valid device is found, its refcount is
  572. * incremented, and must be decremented before the returned
  573. * reference.
  574. */
  575. struct amba_device *
  576. amba_find_device(const char *busid, struct device *parent, unsigned int id,
  577. unsigned int mask)
  578. {
  579. struct find_data data;
  580. data.dev = NULL;
  581. data.parent = parent;
  582. data.busid = busid;
  583. data.id = id;
  584. data.mask = mask;
  585. bus_for_each_dev(&amba_bustype, NULL, &data, amba_find_match);
  586. return data.dev;
  587. }
  588. /**
  589. * amba_request_regions - request all mem regions associated with device
  590. * @dev: amba_device structure for device
  591. * @name: name, or NULL to use driver name
  592. */
  593. int amba_request_regions(struct amba_device *dev, const char *name)
  594. {
  595. int ret = 0;
  596. u32 size;
  597. if (!name)
  598. name = dev->dev.driver->name;
  599. size = resource_size(&dev->res);
  600. if (!request_mem_region(dev->res.start, size, name))
  601. ret = -EBUSY;
  602. return ret;
  603. }
  604. /**
  605. * amba_release_regions - release mem regions associated with device
  606. * @dev: amba_device structure for device
  607. *
  608. * Release regions claimed by a successful call to amba_request_regions.
  609. */
  610. void amba_release_regions(struct amba_device *dev)
  611. {
  612. u32 size;
  613. size = resource_size(&dev->res);
  614. release_mem_region(dev->res.start, size);
  615. }
  616. EXPORT_SYMBOL(amba_driver_register);
  617. EXPORT_SYMBOL(amba_driver_unregister);
  618. EXPORT_SYMBOL(amba_device_register);
  619. EXPORT_SYMBOL(amba_device_unregister);
  620. EXPORT_SYMBOL(amba_find_device);
  621. EXPORT_SYMBOL(amba_request_regions);
  622. EXPORT_SYMBOL(amba_release_regions);