Komal Shah | d395e6a | 2008-09-07 23:41:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * mach-davinci/devices.c |
| 3 | * |
| 4 | * DaVinci platform device setup/initialization |
| 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 as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/module.h> |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/dma-mapping.h> |
| 17 | #include <linux/io.h> |
| 18 | |
| 19 | #include <asm/mach/map.h> |
| 20 | |
| 21 | #include <mach/hardware.h> |
| 22 | #include <mach/i2c.h> |
Russell King | 80b02c1 | 2009-01-08 10:01:47 +0000 | [diff] [blame] | 23 | #include <mach/irqs.h> |
Komal Shah | d395e6a | 2008-09-07 23:41:28 -0700 | [diff] [blame] | 24 | |
| 25 | static struct resource i2c_resources[] = { |
| 26 | { |
| 27 | .start = DAVINCI_I2C_BASE, |
| 28 | .end = DAVINCI_I2C_BASE + 0x40, |
| 29 | .flags = IORESOURCE_MEM, |
| 30 | }, |
| 31 | { |
| 32 | .start = IRQ_I2C, |
| 33 | .flags = IORESOURCE_IRQ, |
| 34 | }, |
| 35 | }; |
| 36 | |
| 37 | static struct platform_device davinci_i2c_device = { |
| 38 | .name = "i2c_davinci", |
| 39 | .id = 1, |
| 40 | .num_resources = ARRAY_SIZE(i2c_resources), |
| 41 | .resource = i2c_resources, |
| 42 | }; |
| 43 | |
| 44 | void __init davinci_init_i2c(struct davinci_i2c_platform_data *pdata) |
| 45 | { |
| 46 | davinci_i2c_device.dev.platform_data = pdata; |
| 47 | (void) platform_device_register(&davinci_i2c_device); |
| 48 | } |
| 49 | |