platform-rtc-stmp3xxx.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2011 Pengutronix, Wolfram Sang <w.sang@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 <asm/sizes.h>
  9. #include <mach/mx23.h>
  10. #include <mach/mx28.h>
  11. #include <mach/devices-common.h>
  12. #ifdef CONFIG_SOC_IMX23
  13. struct platform_device *__init mx23_add_rtc_stmp3xxx(void)
  14. {
  15. struct resource res[] = {
  16. {
  17. .start = MX23_RTC_BASE_ADDR,
  18. .end = MX23_RTC_BASE_ADDR + SZ_8K - 1,
  19. .flags = IORESOURCE_MEM,
  20. }, {
  21. .start = MX23_INT_RTC_ALARM,
  22. .end = MX23_INT_RTC_ALARM,
  23. .flags = IORESOURCE_IRQ,
  24. },
  25. };
  26. return mxs_add_platform_device("stmp3xxx-rtc", 0, res, ARRAY_SIZE(res),
  27. NULL, 0);
  28. }
  29. #endif /* CONFIG_SOC_IMX23 */
  30. #ifdef CONFIG_SOC_IMX28
  31. struct platform_device *__init mx28_add_rtc_stmp3xxx(void)
  32. {
  33. struct resource res[] = {
  34. {
  35. .start = MX28_RTC_BASE_ADDR,
  36. .end = MX28_RTC_BASE_ADDR + SZ_8K - 1,
  37. .flags = IORESOURCE_MEM,
  38. }, {
  39. .start = MX28_INT_RTC_ALARM,
  40. .end = MX28_INT_RTC_ALARM,
  41. .flags = IORESOURCE_IRQ,
  42. },
  43. };
  44. return mxs_add_platform_device("stmp3xxx-rtc", 0, res, ARRAY_SIZE(res),
  45. NULL, 0);
  46. }
  47. #endif /* CONFIG_SOC_IMX28 */