rtc.c 818 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Lemote Fuloong platform support
  4. *
  5. * Copyright(c) 2010 Arnaud Patard <[email protected]>
  6. */
  7. #include <linux/init.h>
  8. #include <linux/kernel.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/mc146818rtc.h>
  11. static struct resource loongson_rtc_resources[] = {
  12. {
  13. .start = RTC_PORT(0),
  14. .end = RTC_PORT(1),
  15. .flags = IORESOURCE_IO,
  16. }, {
  17. .start = RTC_IRQ,
  18. .end = RTC_IRQ,
  19. .flags = IORESOURCE_IRQ,
  20. }
  21. };
  22. static struct platform_device loongson_rtc_device = {
  23. .name = "rtc_cmos",
  24. .id = -1,
  25. .resource = loongson_rtc_resources,
  26. .num_resources = ARRAY_SIZE(loongson_rtc_resources),
  27. };
  28. static int __init loongson_rtc_platform_init(void)
  29. {
  30. platform_device_register(&loongson_rtc_device);
  31. return 0;
  32. }
  33. device_initcall(loongson_rtc_platform_init);