platform.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * XXS1500 board platform device registration
  3. *
  4. * Copyright (C) 2009 Manuel Lauss
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <linux/init.h>
  21. #include <linux/platform_device.h>
  22. #include <asm/mach-au1x00/au1000.h>
  23. static struct resource xxs1500_pcmcia_res[] = {
  24. {
  25. .name = "pcmcia-io",
  26. .flags = IORESOURCE_MEM,
  27. .start = PCMCIA_IO_PHYS_ADDR,
  28. .end = PCMCIA_IO_PHYS_ADDR + 0x000400000 - 1,
  29. },
  30. {
  31. .name = "pcmcia-attr",
  32. .flags = IORESOURCE_MEM,
  33. .start = PCMCIA_ATTR_PHYS_ADDR,
  34. .end = PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
  35. },
  36. {
  37. .name = "pcmcia-mem",
  38. .flags = IORESOURCE_MEM,
  39. .start = PCMCIA_MEM_PHYS_ADDR,
  40. .end = PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
  41. },
  42. };
  43. static struct platform_device xxs1500_pcmcia_dev = {
  44. .name = "xxs1500_pcmcia",
  45. .id = -1,
  46. .num_resources = ARRAY_SIZE(xxs1500_pcmcia_res),
  47. .resource = xxs1500_pcmcia_res,
  48. };
  49. static struct platform_device *xxs1500_devs[] __initdata = {
  50. &xxs1500_pcmcia_dev,
  51. };
  52. static int __init xxs1500_dev_init(void)
  53. {
  54. return platform_add_devices(xxs1500_devs,
  55. ARRAY_SIZE(xxs1500_devs));
  56. }
  57. device_initcall(xxs1500_dev_init);