summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/devices.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-05-03 08:24:37 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-04 17:50:04 +0100
commitf9faf23799d0726afb56ee6c6c53fbea00ec7de3 (patch)
tree02145fb643743488cffd057a687ed3737c96d2ad /arch/arm/mach-ux500/devices.c
parent4b27aa4140c20380a67ecefaa48cf3714cc0b8ea (diff)
downloadblackbird-op-linux-f9faf23799d0726afb56ee6c6c53fbea00ec7de3.tar.gz
blackbird-op-linux-f9faf23799d0726afb56ee6c6c53fbea00ec7de3.zip
ARM: 6085/1: ux500: reorganize i2c devices
Move common i2c devices to devices.c and DB8500-specific I2C devices to devices-db8500.c. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ux500/devices.c')
-rw-r--r--arch/arm/mach-ux500/devices.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c
index 374fcceb10a9..8a268893cb7f 100644
--- a/arch/arm/mach-ux500/devices.c
+++ b/arch/arm/mach-ux500/devices.c
@@ -47,6 +47,36 @@ struct amba_device ux500_uart2_device = {
.irq = {IRQ_UART2, NO_IRQ},
};
+#define UX500_I2C_RESOURCES(id, size) \
+static struct resource ux500_i2c##id##_resources[] = { \
+ [0] = { \
+ .start = UX500_I2C##id##_BASE, \
+ .end = UX500_I2C##id##_BASE + size - 1, \
+ .flags = IORESOURCE_MEM, \
+ }, \
+ [1] = { \
+ .start = IRQ_I2C##id, \
+ .end = IRQ_I2C##id, \
+ .flags = IORESOURCE_IRQ \
+ } \
+}
+
+UX500_I2C_RESOURCES(1, SZ_4K);
+UX500_I2C_RESOURCES(2, SZ_4K);
+UX500_I2C_RESOURCES(3, SZ_4K);
+
+#define UX500_I2C_PDEVICE(cid) \
+struct platform_device ux500_i2c##cid##_device = { \
+ .name = "nmk-i2c", \
+ .id = cid, \
+ .num_resources = 2, \
+ .resource = ux500_i2c##cid##_resources, \
+}
+
+UX500_I2C_PDEVICE(1);
+UX500_I2C_PDEVICE(2);
+UX500_I2C_PDEVICE(3);
+
void __init amba_add_devices(struct amba_device *devs[], int num)
{
int i;
OpenPOWER on IntegriCloud