summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/omap_devices.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-18 15:22:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-19 21:52:36 +0100
commitbc872dbe79d839ff34544b378bd14c14184e5bd5 (patch)
tree9c7b299a83d4b81608110bb93d062345b8351767 /arch/arm/mach-omap/omap_devices.c
parent19b6121a56c947d2bb86cd9bef5c6a902cee4fe7 (diff)
downloadbarebox-bc872dbe79d839ff34544b378bd14c14184e5bd5.tar.gz
barebox-bc872dbe79d839ff34544b378bd14c14184e5bd5.tar.xz
ARM omap: Add device register convenience functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap/omap_devices.c')
-rw-r--r--arch/arm/mach-omap/omap_devices.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-omap/omap_devices.c b/arch/arm/mach-omap/omap_devices.c
new file mode 100644
index 0000000000..acf029d9c1
--- /dev/null
+++ b/arch/arm/mach-omap/omap_devices.c
@@ -0,0 +1,27 @@
+#include <driver.h>
+#include <ns16550.h>
+#include <mach/omap3-devices.h>
+
+static struct NS16550_plat serial_plat = {
+ .clock = 48000000, /* 48MHz (APLL96/2) */
+ .shift = 2,
+};
+
+struct device_d *omap_add_uart(int id, unsigned long base)
+{
+ return add_ns16550_device(id, base, 1024,
+ IORESOURCE_MEM_8BIT, &serial_plat);
+}
+
+struct device_d *omap_add_mmc(int id, unsigned long base,
+ struct omap_hsmmc_platform_data *pdata)
+{
+ return add_generic_device("omap-hsmmc", id, NULL,
+ base, SZ_4K, IORESOURCE_MEM, pdata);
+}
+
+struct device_d *omap_add_i2c(int id, unsigned long base, void *pdata)
+{
+ return add_generic_device("i2c-omap", id, NULL, base, SZ_4K,
+ IORESOURCE_MEM, pdata);
+}