bnx2x: Use helpers instead of direct access to the shinfo(skb) fields
[linux-2.6/x86.git] / arch / arm / mach-ux500 / devices.c
blob8a268893cb7fb8315c51732cce455b6a5fe6d4c9
1 /*
2 * Copyright (C) ST-Ericsson SA 2010
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
8 #include <linux/kernel.h>
9 #include <linux/platform_device.h>
10 #include <linux/interrupt.h>
11 #include <linux/io.h>
12 #include <linux/amba/bus.h>
14 #include <mach/hardware.h>
15 #include <mach/setup.h>
17 #define __MEM_4K_RESOURCE(x) \
18 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
20 struct amba_device ux500_pl031_device = {
21 .dev = {
22 .init_name = "pl031",
24 .res = {
25 .start = UX500_RTC_BASE,
26 .end = UX500_RTC_BASE + SZ_4K - 1,
27 .flags = IORESOURCE_MEM,
29 .irq = {IRQ_RTC_RTT, NO_IRQ},
32 struct amba_device ux500_uart0_device = {
33 .dev = { .init_name = "uart0" },
34 __MEM_4K_RESOURCE(UX500_UART0_BASE),
35 .irq = {IRQ_UART0, NO_IRQ},
38 struct amba_device ux500_uart1_device = {
39 .dev = { .init_name = "uart1" },
40 __MEM_4K_RESOURCE(UX500_UART1_BASE),
41 .irq = {IRQ_UART1, NO_IRQ},
44 struct amba_device ux500_uart2_device = {
45 .dev = { .init_name = "uart2" },
46 __MEM_4K_RESOURCE(UX500_UART2_BASE),
47 .irq = {IRQ_UART2, NO_IRQ},
50 #define UX500_I2C_RESOURCES(id, size) \
51 static struct resource ux500_i2c##id##_resources[] = { \
52 [0] = { \
53 .start = UX500_I2C##id##_BASE, \
54 .end = UX500_I2C##id##_BASE + size - 1, \
55 .flags = IORESOURCE_MEM, \
56 }, \
57 [1] = { \
58 .start = IRQ_I2C##id, \
59 .end = IRQ_I2C##id, \
60 .flags = IORESOURCE_IRQ \
61 } \
64 UX500_I2C_RESOURCES(1, SZ_4K);
65 UX500_I2C_RESOURCES(2, SZ_4K);
66 UX500_I2C_RESOURCES(3, SZ_4K);
68 #define UX500_I2C_PDEVICE(cid) \
69 struct platform_device ux500_i2c##cid##_device = { \
70 .name = "nmk-i2c", \
71 .id = cid, \
72 .num_resources = 2, \
73 .resource = ux500_i2c##cid##_resources, \
76 UX500_I2C_PDEVICE(1);
77 UX500_I2C_PDEVICE(2);
78 UX500_I2C_PDEVICE(3);
80 void __init amba_add_devices(struct amba_device *devs[], int num)
82 int i;
84 for (i = 0; i < num; i++) {
85 struct amba_device *d = devs[i];
86 amba_device_register(d, &iomem_resource);