Uwe Kleine-König | 99a754d | 2010-06-16 14:37:51 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2009-2010 Pengutronix |
| 3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it under |
| 6 | * the terms of the GNU General Public License version 2 as published by the |
| 7 | * Free Software Foundation. |
| 8 | */ |
| 9 | #include <mach/devices-common.h> |
| 10 | |
| 11 | struct platform_device *__init imx_add_imx_i2c(int id, |
| 12 | resource_size_t iobase, resource_size_t iosize, int irq, |
| 13 | const struct imxi2c_platform_data *pdata) |
| 14 | { |
| 15 | struct resource res[] = { |
| 16 | { |
| 17 | .start = iobase, |
| 18 | .end = iobase + iosize - 1, |
| 19 | .flags = IORESOURCE_MEM, |
| 20 | }, { |
| 21 | .start = irq, |
| 22 | .end = irq, |
| 23 | .flags = IORESOURCE_IRQ, |
| 24 | }, |
| 25 | }; |
| 26 | |
| 27 | return imx_add_platform_device("imx-i2c", id, res, ARRAY_SIZE(res), |
| 28 | pdata, sizeof(*pdata)); |
| 29 | } |