platform-imx-i2c.c 769 B

1234567891011121314151617181920212223242526272829
  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. struct platform_device *__init imx_add_imx_i2c(int id,
  11. resource_size_t iobase, resource_size_t iosize, int irq,
  12. const struct imxi2c_platform_data *pdata)
  13. {
  14. struct resource res[] = {
  15. {
  16. .start = iobase,
  17. .end = iobase + iosize - 1,
  18. .flags = IORESOURCE_MEM,
  19. }, {
  20. .start = irq,
  21. .end = irq,
  22. .flags = IORESOURCE_IRQ,
  23. },
  24. };
  25. return imx_add_platform_device("imx-i2c", id, res, ARRAY_SIZE(res),
  26. pdata, sizeof(*pdata));
  27. }