2380ebd9b7fdaacc3826bba245f5a547c71ee480
[releases.git] / bus.c
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/pm_domain.h>
19 #include <linux/amba/bus.h>
20 #include <linux/sizes.h>
21 #include <linux/limits.h>
22 #include <linux/clk/clk-conf.h>
23 #include <linux/platform_device.h>
24
25 #include <asm/irq.h>
26
27 #define to_amba_driver(d)       container_of(d, struct amba_driver, drv)
28
29 static const struct amba_id *
30 amba_lookup(const struct amba_id *table, struct amba_device *dev)
31 {
32         int ret = 0;
33
34         while (table->mask) {
35                 ret = (dev->periphid & table->mask) == table->id;
36                 if (ret)
37                         break;
38                 table++;
39         }
40
41         return ret ? table : NULL;
42 }
43
44 static int amba_match(struct device *dev, struct device_driver *drv)
45 {
46         struct amba_device *pcdev = to_amba_device(dev);
47         struct amba_driver *pcdrv = to_amba_driver(drv);
48
49         /* When driver_override is set, only bind to the matching driver */
50         if (pcdev->driver_override)
51                 return !strcmp(pcdev->driver_override, drv->name);
52
53         return amba_lookup(pcdrv->id_table, pcdev) != NULL;
54 }
55
56 static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
57 {
58         struct amba_device *pcdev = to_amba_device(dev);
59         int retval = 0;
60
61         retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid);
62         if (retval)
63                 return retval;
64
65         retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid);
66         return retval;
67 }
68
69 static ssize_t driver_override_show(struct device *_dev,
70                                     struct device_attribute *attr, char *buf)
71 {
72         struct amba_device *dev = to_amba_device(_dev);
73         ssize_t len;
74
75         device_lock(_dev);
76         len = sprintf(buf, "%s\n", dev->driver_override);
77         device_unlock(_dev);
78         return len;
79 }
80
81 static ssize_t driver_override_store(struct device *_dev,
82                                      struct device_attribute *attr,
83                                      const char *buf, size_t count)
84 {
85         struct amba_device *dev = to_amba_device(_dev);
86         char *driver_override, *old, *cp;
87
88         /* We need to keep extra room for a newline */
89         if (count >= (PAGE_SIZE - 1))
90                 return -EINVAL;
91
92         driver_override = kstrndup(buf, count, GFP_KERNEL);
93         if (!driver_override)
94                 return -ENOMEM;
95
96         cp = strchr(driver_override, '\n');
97         if (cp)
98                 *cp = '\0';
99
100         device_lock(_dev);
101         old = dev->driver_override;
102         if (strlen(driver_override)) {
103                 dev->driver_override = driver_override;
104         } else {
105                 kfree(driver_override);
106                 dev->driver_override = NULL;
107         }
108         device_unlock(_dev);
109
110         kfree(old);
111
112         return count;
113 }
114 static DEVICE_ATTR_RW(driver_override);
115
116 #define amba_attr_func(name,fmt,arg...)                                 \
117 static ssize_t name##_show(struct device *_dev,                         \
118                            struct device_attribute *attr, char *buf)    \
119 {                                                                       \
120         struct amba_device *dev = to_amba_device(_dev);                 \
121         return sprintf(buf, fmt, arg);                                  \
122 }                                                                       \
123 static DEVICE_ATTR_RO(name)
124
125 amba_attr_func(id, "%08x\n", dev->periphid);
126 amba_attr_func(irq0, "%u\n", dev->irq[0]);
127 amba_attr_func(irq1, "%u\n", dev->irq[1]);
128 amba_attr_func(resource, "\t%016llx\t%016llx\t%016lx\n",
129          (unsigned long long)dev->res.start, (unsigned long long)dev->res.end,
130          dev->res.flags);
131
132 static struct attribute *amba_dev_attrs[] = {
133         &dev_attr_id.attr,
134         &dev_attr_resource.attr,
135         &dev_attr_driver_override.attr,
136         NULL,
137 };
138 ATTRIBUTE_GROUPS(amba_dev);
139
140 #ifdef CONFIG_PM
141 /*
142  * Hooks to provide runtime PM of the pclk (bus clock).  It is safe to
143  * enable/disable the bus clock at runtime PM suspend/resume as this
144  * does not result in loss of context.
145  */
146 static int amba_pm_runtime_suspend(struct device *dev)
147 {
148         struct amba_device *pcdev = to_amba_device(dev);
149         int ret = pm_generic_runtime_suspend(dev);
150
151         if (ret == 0 && dev->driver) {
152                 if (pm_runtime_is_irq_safe(dev))
153                         clk_disable(pcdev->pclk);
154                 else
155                         clk_disable_unprepare(pcdev->pclk);
156         }
157
158         return ret;
159 }
160
161 static int amba_pm_runtime_resume(struct device *dev)
162 {
163         struct amba_device *pcdev = to_amba_device(dev);
164         int ret;
165
166         if (dev->driver) {
167                 if (pm_runtime_is_irq_safe(dev))
168                         ret = clk_enable(pcdev->pclk);
169                 else
170                         ret = clk_prepare_enable(pcdev->pclk);
171                 /* Failure is probably fatal to the system, but... */
172                 if (ret)
173                         return ret;
174         }
175
176         return pm_generic_runtime_resume(dev);
177 }
178 #endif /* CONFIG_PM */
179
180 static const struct dev_pm_ops amba_pm = {
181         .suspend        = pm_generic_suspend,
182         .resume         = pm_generic_resume,
183         .freeze         = pm_generic_freeze,
184         .thaw           = pm_generic_thaw,
185         .poweroff       = pm_generic_poweroff,
186         .restore        = pm_generic_restore,
187         SET_RUNTIME_PM_OPS(
188                 amba_pm_runtime_suspend,
189                 amba_pm_runtime_resume,
190                 NULL
191         )
192 };
193
194 /*
195  * Primecells are part of the Advanced Microcontroller Bus Architecture,
196  * so we call the bus "amba".
197  * DMA configuration for platform and AMBA bus is same. So here we reuse
198  * platform's DMA config routine.
199  */
200 struct bus_type amba_bustype = {
201         .name           = "amba",
202         .dev_groups     = amba_dev_groups,
203         .match          = amba_match,
204         .uevent         = amba_uevent,
205         .dma_configure  = platform_dma_configure,
206         .pm             = &amba_pm,
207 };
208 EXPORT_SYMBOL_GPL(amba_bustype);
209
210 static int __init amba_init(void)
211 {
212         return bus_register(&amba_bustype);
213 }
214
215 postcore_initcall(amba_init);
216
217 static int amba_get_enable_pclk(struct amba_device *pcdev)
218 {
219         int ret;
220
221         pcdev->pclk = clk_get(&pcdev->dev, "apb_pclk");
222         if (IS_ERR(pcdev->pclk))
223                 return PTR_ERR(pcdev->pclk);
224
225         ret = clk_prepare_enable(pcdev->pclk);
226         if (ret)
227                 clk_put(pcdev->pclk);
228
229         return ret;
230 }
231
232 static void amba_put_disable_pclk(struct amba_device *pcdev)
233 {
234         clk_disable_unprepare(pcdev->pclk);
235         clk_put(pcdev->pclk);
236 }
237
238 /*
239  * These are the device model conversion veneers; they convert the
240  * device model structures to our more specific structures.
241  */
242 static int amba_probe(struct device *dev)
243 {
244         struct amba_device *pcdev = to_amba_device(dev);
245         struct amba_driver *pcdrv = to_amba_driver(dev->driver);
246         const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
247         int ret;
248
249         do {
250                 ret = of_clk_set_defaults(dev->of_node, false);
251                 if (ret < 0)
252                         break;
253
254                 ret = dev_pm_domain_attach(dev, true);
255                 if (ret)
256                         break;
257
258                 ret = amba_get_enable_pclk(pcdev);
259                 if (ret) {
260                         dev_pm_domain_detach(dev, true);
261                         break;
262                 }
263
264                 pm_runtime_get_noresume(dev);
265                 pm_runtime_set_active(dev);
266                 pm_runtime_enable(dev);
267
268                 ret = pcdrv->probe(pcdev, id);
269                 if (ret == 0)
270                         break;
271
272                 pm_runtime_disable(dev);
273                 pm_runtime_set_suspended(dev);
274                 pm_runtime_put_noidle(dev);
275
276                 amba_put_disable_pclk(pcdev);
277                 dev_pm_domain_detach(dev, true);
278         } while (0);
279
280         return ret;
281 }
282
283 static int amba_remove(struct device *dev)
284 {
285         struct amba_device *pcdev = to_amba_device(dev);
286         struct amba_driver *drv = to_amba_driver(dev->driver);
287         int ret = 0;
288
289         pm_runtime_get_sync(dev);
290         if (drv->remove)
291                 ret = drv->remove(pcdev);
292         pm_runtime_put_noidle(dev);
293
294         /* Undo the runtime PM settings in amba_probe() */
295         pm_runtime_disable(dev);
296         pm_runtime_set_suspended(dev);
297         pm_runtime_put_noidle(dev);
298
299         amba_put_disable_pclk(pcdev);
300         dev_pm_domain_detach(dev, true);
301
302         return ret;
303 }
304
305 static void amba_shutdown(struct device *dev)
306 {
307         struct amba_driver *drv = to_amba_driver(dev->driver);
308
309         if (drv->shutdown)
310                 drv->shutdown(to_amba_device(dev));
311 }
312
313 /**
314  *      amba_driver_register - register an AMBA device driver
315  *      @drv: amba device driver structure
316  *
317  *      Register an AMBA device driver with the Linux device model
318  *      core.  If devices pre-exist, the drivers probe function will
319  *      be called.
320  */
321 int amba_driver_register(struct amba_driver *drv)
322 {
323         if (!drv->probe)
324                 return -EINVAL;
325
326         drv->drv.bus = &amba_bustype;
327         drv->drv.probe = amba_probe;
328         drv->drv.remove = amba_remove;
329         drv->drv.shutdown = amba_shutdown;
330
331         return driver_register(&drv->drv);
332 }
333
334 /**
335  *      amba_driver_unregister - remove an AMBA device driver
336  *      @drv: AMBA device driver structure to remove
337  *
338  *      Unregister an AMBA device driver from the Linux device
339  *      model.  The device model will call the drivers remove function
340  *      for each device the device driver is currently handling.
341  */
342 void amba_driver_unregister(struct amba_driver *drv)
343 {
344         driver_unregister(&drv->drv);
345 }
346
347
348 static void amba_device_release(struct device *dev)
349 {
350         struct amba_device *d = to_amba_device(dev);
351
352         if (d->res.parent)
353                 release_resource(&d->res);
354         kfree(d);
355 }
356
357 static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
358 {
359         u32 size;
360         void __iomem *tmp;
361         int i, ret;
362
363         WARN_ON(dev->irq[0] == (unsigned int)-1);
364         WARN_ON(dev->irq[1] == (unsigned int)-1);
365
366         ret = request_resource(parent, &dev->res);
367         if (ret)
368                 goto err_out;
369
370         /* Hard-coded primecell ID instead of plug-n-play */
371         if (dev->periphid != 0)
372                 goto skip_probe;
373
374         /*
375          * Dynamically calculate the size of the resource
376          * and use this for iomap
377          */
378         size = resource_size(&dev->res);
379         tmp = ioremap(dev->res.start, size);
380         if (!tmp) {
381                 ret = -ENOMEM;
382                 goto err_release;
383         }
384
385         ret = dev_pm_domain_attach(&dev->dev, true);
386         if (ret) {
387                 iounmap(tmp);
388                 goto err_release;
389         }
390
391         ret = amba_get_enable_pclk(dev);
392         if (ret == 0) {
393                 u32 pid, cid;
394
395                 /*
396                  * Read pid and cid based on size of resource
397                  * they are located at end of region
398                  */
399                 for (pid = 0, i = 0; i < 4; i++)
400                         pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) <<
401                                 (i * 8);
402                 for (cid = 0, i = 0; i < 4; i++)
403                         cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) <<
404                                 (i * 8);
405
406                 amba_put_disable_pclk(dev);
407
408                 if (cid == AMBA_CID || cid == CORESIGHT_CID)
409                         dev->periphid = pid;
410
411                 if (!dev->periphid)
412                         ret = -ENODEV;
413         }
414
415         iounmap(tmp);
416         dev_pm_domain_detach(&dev->dev, true);
417
418         if (ret)
419                 goto err_release;
420
421  skip_probe:
422         ret = device_add(&dev->dev);
423         if (ret)
424                 goto err_release;
425
426         if (dev->irq[0])
427                 ret = device_create_file(&dev->dev, &dev_attr_irq0);
428         if (ret == 0 && dev->irq[1])
429                 ret = device_create_file(&dev->dev, &dev_attr_irq1);
430         if (ret == 0)
431                 return ret;
432
433         device_unregister(&dev->dev);
434
435  err_release:
436         release_resource(&dev->res);
437  err_out:
438         return ret;
439 }
440
441 /*
442  * Registration of AMBA device require reading its pid and cid registers.
443  * To do this, the device must be turned on (if it is a part of power domain)
444  * and have clocks enabled. However in some cases those resources might not be
445  * yet available. Returning EPROBE_DEFER is not a solution in such case,
446  * because callers don't handle this special error code. Instead such devices
447  * are added to the special list and their registration is retried from
448  * periodic worker, until all resources are available and registration succeeds.
449  */
450 struct deferred_device {
451         struct amba_device *dev;
452         struct resource *parent;
453         struct list_head node;
454 };
455
456 static LIST_HEAD(deferred_devices);
457 static DEFINE_MUTEX(deferred_devices_lock);
458
459 static void amba_deferred_retry_func(struct work_struct *dummy);
460 static DECLARE_DELAYED_WORK(deferred_retry_work, amba_deferred_retry_func);
461
462 #define DEFERRED_DEVICE_TIMEOUT (msecs_to_jiffies(5 * 1000))
463
464 static void amba_deferred_retry_func(struct work_struct *dummy)
465 {
466         struct deferred_device *ddev, *tmp;
467
468         mutex_lock(&deferred_devices_lock);
469
470         list_for_each_entry_safe(ddev, tmp, &deferred_devices, node) {
471                 int ret = amba_device_try_add(ddev->dev, ddev->parent);
472
473                 if (ret == -EPROBE_DEFER)
474                         continue;
475
476                 list_del_init(&ddev->node);
477                 kfree(ddev);
478         }
479
480         if (!list_empty(&deferred_devices))
481                 schedule_delayed_work(&deferred_retry_work,
482                                       DEFERRED_DEVICE_TIMEOUT);
483
484         mutex_unlock(&deferred_devices_lock);
485 }
486
487 /**
488  *      amba_device_add - add a previously allocated AMBA device structure
489  *      @dev: AMBA device allocated by amba_device_alloc
490  *      @parent: resource parent for this devices resources
491  *
492  *      Claim the resource, and read the device cell ID if not already
493  *      initialized.  Register the AMBA device with the Linux device
494  *      manager.
495  */
496 int amba_device_add(struct amba_device *dev, struct resource *parent)
497 {
498         int ret = amba_device_try_add(dev, parent);
499
500         if (ret == -EPROBE_DEFER) {
501                 struct deferred_device *ddev;
502
503                 ddev = kmalloc(sizeof(*ddev), GFP_KERNEL);
504                 if (!ddev)
505                         return -ENOMEM;
506
507                 ddev->dev = dev;
508                 ddev->parent = parent;
509                 ret = 0;
510
511                 mutex_lock(&deferred_devices_lock);
512
513                 if (list_empty(&deferred_devices))
514                         schedule_delayed_work(&deferred_retry_work,
515                                               DEFERRED_DEVICE_TIMEOUT);
516                 list_add_tail(&ddev->node, &deferred_devices);
517
518                 mutex_unlock(&deferred_devices_lock);
519         }
520         return ret;
521 }
522 EXPORT_SYMBOL_GPL(amba_device_add);
523
524 static struct amba_device *
525 amba_aphb_device_add(struct device *parent, const char *name,
526                      resource_size_t base, size_t size, int irq1, int irq2,
527                      void *pdata, unsigned int periphid, u64 dma_mask,
528                      struct resource *resbase)
529 {
530         struct amba_device *dev;
531         int ret;
532
533         dev = amba_device_alloc(name, base, size);
534         if (!dev)
535                 return ERR_PTR(-ENOMEM);
536
537         dev->dev.coherent_dma_mask = dma_mask;
538         dev->irq[0] = irq1;
539         dev->irq[1] = irq2;
540         dev->periphid = periphid;
541         dev->dev.platform_data = pdata;
542         dev->dev.parent = parent;
543
544         ret = amba_device_add(dev, resbase);
545         if (ret) {
546                 amba_device_put(dev);
547                 return ERR_PTR(ret);
548         }
549
550         return dev;
551 }
552
553 struct amba_device *
554 amba_apb_device_add(struct device *parent, const char *name,
555                     resource_size_t base, size_t size, int irq1, int irq2,
556                     void *pdata, unsigned int periphid)
557 {
558         return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata,
559                                     periphid, 0, &iomem_resource);
560 }
561 EXPORT_SYMBOL_GPL(amba_apb_device_add);
562
563 struct amba_device *
564 amba_ahb_device_add(struct device *parent, const char *name,
565                     resource_size_t base, size_t size, int irq1, int irq2,
566                     void *pdata, unsigned int periphid)
567 {
568         return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata,
569                                     periphid, ~0ULL, &iomem_resource);
570 }
571 EXPORT_SYMBOL_GPL(amba_ahb_device_add);
572
573 struct amba_device *
574 amba_apb_device_add_res(struct device *parent, const char *name,
575                         resource_size_t base, size_t size, int irq1,
576                         int irq2, void *pdata, unsigned int periphid,
577                         struct resource *resbase)
578 {
579         return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata,
580                                     periphid, 0, resbase);
581 }
582 EXPORT_SYMBOL_GPL(amba_apb_device_add_res);
583
584 struct amba_device *
585 amba_ahb_device_add_res(struct device *parent, const char *name,
586                         resource_size_t base, size_t size, int irq1,
587                         int irq2, void *pdata, unsigned int periphid,
588                         struct resource *resbase)
589 {
590         return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata,
591                                     periphid, ~0ULL, resbase);
592 }
593 EXPORT_SYMBOL_GPL(amba_ahb_device_add_res);
594
595
596 static void amba_device_initialize(struct amba_device *dev, const char *name)
597 {
598         device_initialize(&dev->dev);
599         if (name)
600                 dev_set_name(&dev->dev, "%s", name);
601         dev->dev.release = amba_device_release;
602         dev->dev.bus = &amba_bustype;
603         dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
604         dev->res.name = dev_name(&dev->dev);
605 }
606
607 /**
608  *      amba_device_alloc - allocate an AMBA device
609  *      @name: sysfs name of the AMBA device
610  *      @base: base of AMBA device
611  *      @size: size of AMBA device
612  *
613  *      Allocate and initialize an AMBA device structure.  Returns %NULL
614  *      on failure.
615  */
616 struct amba_device *amba_device_alloc(const char *name, resource_size_t base,
617         size_t size)
618 {
619         struct amba_device *dev;
620
621         dev = kzalloc(sizeof(*dev), GFP_KERNEL);
622         if (dev) {
623                 amba_device_initialize(dev, name);
624                 dev->res.start = base;
625                 dev->res.end = base + size - 1;
626                 dev->res.flags = IORESOURCE_MEM;
627         }
628
629         return dev;
630 }
631 EXPORT_SYMBOL_GPL(amba_device_alloc);
632
633 /**
634  *      amba_device_register - register an AMBA device
635  *      @dev: AMBA device to register
636  *      @parent: parent memory resource
637  *
638  *      Setup the AMBA device, reading the cell ID if present.
639  *      Claim the resource, and register the AMBA device with
640  *      the Linux device manager.
641  */
642 int amba_device_register(struct amba_device *dev, struct resource *parent)
643 {
644         amba_device_initialize(dev, dev->dev.init_name);
645         dev->dev.init_name = NULL;
646
647         return amba_device_add(dev, parent);
648 }
649
650 /**
651  *      amba_device_put - put an AMBA device
652  *      @dev: AMBA device to put
653  */
654 void amba_device_put(struct amba_device *dev)
655 {
656         put_device(&dev->dev);
657 }
658 EXPORT_SYMBOL_GPL(amba_device_put);
659
660 /**
661  *      amba_device_unregister - unregister an AMBA device
662  *      @dev: AMBA device to remove
663  *
664  *      Remove the specified AMBA device from the Linux device
665  *      manager.  All files associated with this object will be
666  *      destroyed, and device drivers notified that the device has
667  *      been removed.  The AMBA device's resources including
668  *      the amba_device structure will be freed once all
669  *      references to it have been dropped.
670  */
671 void amba_device_unregister(struct amba_device *dev)
672 {
673         device_unregister(&dev->dev);
674 }
675
676
677 struct find_data {
678         struct amba_device *dev;
679         struct device *parent;
680         const char *busid;
681         unsigned int id;
682         unsigned int mask;
683 };
684
685 static int amba_find_match(struct device *dev, void *data)
686 {
687         struct find_data *d = data;
688         struct amba_device *pcdev = to_amba_device(dev);
689         int r;
690
691         r = (pcdev->periphid & d->mask) == d->id;
692         if (d->parent)
693                 r &= d->parent == dev->parent;
694         if (d->busid)
695                 r &= strcmp(dev_name(dev), d->busid) == 0;
696
697         if (r) {
698                 get_device(dev);
699                 d->dev = pcdev;
700         }
701
702         return r;
703 }
704
705 /**
706  *      amba_find_device - locate an AMBA device given a bus id
707  *      @busid: bus id for device (or NULL)
708  *      @parent: parent device (or NULL)
709  *      @id: peripheral ID (or 0)
710  *      @mask: peripheral ID mask (or 0)
711  *
712  *      Return the AMBA device corresponding to the supplied parameters.
713  *      If no device matches, returns NULL.
714  *
715  *      NOTE: When a valid device is found, its refcount is
716  *      incremented, and must be decremented before the returned
717  *      reference.
718  */
719 struct amba_device *
720 amba_find_device(const char *busid, struct device *parent, unsigned int id,
721                  unsigned int mask)
722 {
723         struct find_data data;
724
725         data.dev = NULL;
726         data.parent = parent;
727         data.busid = busid;
728         data.id = id;
729         data.mask = mask;
730
731         bus_for_each_dev(&amba_bustype, NULL, &data, amba_find_match);
732
733         return data.dev;
734 }
735
736 /**
737  *      amba_request_regions - request all mem regions associated with device
738  *      @dev: amba_device structure for device
739  *      @name: name, or NULL to use driver name
740  */
741 int amba_request_regions(struct amba_device *dev, const char *name)
742 {
743         int ret = 0;
744         u32 size;
745
746         if (!name)
747                 name = dev->dev.driver->name;
748
749         size = resource_size(&dev->res);
750
751         if (!request_mem_region(dev->res.start, size, name))
752                 ret = -EBUSY;
753
754         return ret;
755 }
756
757 /**
758  *      amba_release_regions - release mem regions associated with device
759  *      @dev: amba_device structure for device
760  *
761  *      Release regions claimed by a successful call to amba_request_regions.
762  */
763 void amba_release_regions(struct amba_device *dev)
764 {
765         u32 size;
766
767         size = resource_size(&dev->res);
768         release_mem_region(dev->res.start, size);
769 }
770
771 EXPORT_SYMBOL(amba_driver_register);
772 EXPORT_SYMBOL(amba_driver_unregister);
773 EXPORT_SYMBOL(amba_device_register);
774 EXPORT_SYMBOL(amba_device_unregister);
775 EXPORT_SYMBOL(amba_find_device);
776 EXPORT_SYMBOL(amba_request_regions);
777 EXPORT_SYMBOL(amba_release_regions);