dev-wdt.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2008 Florian Fainelli <[email protected]>
  7. */
  8. #include <linux/init.h>
  9. #include <linux/kernel.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/platform_data/bcm7038_wdt.h>
  12. #include <bcm63xx_cpu.h>
  13. static struct resource wdt_resources[] = {
  14. {
  15. .start = -1, /* filled at runtime */
  16. .end = -1, /* filled at runtime */
  17. .flags = IORESOURCE_MEM,
  18. },
  19. };
  20. static struct bcm7038_wdt_platform_data bcm63xx_wdt_pdata = {
  21. .clk_name = "periph",
  22. };
  23. static struct platform_device bcm63xx_wdt_device = {
  24. .name = "bcm63xx-wdt",
  25. .id = -1,
  26. .num_resources = ARRAY_SIZE(wdt_resources),
  27. .resource = wdt_resources,
  28. .dev = {
  29. .platform_data = &bcm63xx_wdt_pdata,
  30. },
  31. };
  32. int __init bcm63xx_wdt_register(void)
  33. {
  34. wdt_resources[0].start = bcm63xx_regset_address(RSET_WDT);
  35. wdt_resources[0].end = wdt_resources[0].start;
  36. wdt_resources[0].end += RSET_WDT_SIZE - 1;
  37. return platform_device_register(&bcm63xx_wdt_device);
  38. }
  39. arch_initcall(bcm63xx_wdt_register);