platform-flexcan.c 769 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) 2010 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
  3. *
  4. * This program is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU General Public License version 2 as published by the
  6. * Free Software Foundation.
  7. */
  8. #include <mach/devices-common.h>
  9. struct platform_device *__init imx_add_flexcan(int id,
  10. resource_size_t iobase, resource_size_t iosize,
  11. resource_size_t irq,
  12. const struct flexcan_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("flexcan", id, res, ARRAY_SIZE(res),
  26. pdata, sizeof(*pdata));
  27. }