devices-db8500.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
  5. * License terms: GNU General Public License (GPL) version 2
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/io.h>
  11. #include <linux/gpio.h>
  12. #include <linux/amba/bus.h>
  13. #include <mach/hardware.h>
  14. #include <mach/setup.h>
  15. static struct nmk_gpio_platform_data u8500_gpio_data[] = {
  16. GPIO_DATA("GPIO-0-31", 0),
  17. GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */
  18. GPIO_DATA("GPIO-64-95", 64),
  19. GPIO_DATA("GPIO-96-127", 96), /* 98..127 not routed to pin */
  20. GPIO_DATA("GPIO-128-159", 128),
  21. GPIO_DATA("GPIO-160-191", 160), /* 172..191 not routed to pin */
  22. GPIO_DATA("GPIO-192-223", 192),
  23. GPIO_DATA("GPIO-224-255", 224), /* 231..255 not routed to pin */
  24. GPIO_DATA("GPIO-256-288", 256), /* 268..288 not routed to pin */
  25. };
  26. static struct resource u8500_gpio_resources[] = {
  27. GPIO_RESOURCE(0),
  28. GPIO_RESOURCE(1),
  29. GPIO_RESOURCE(2),
  30. GPIO_RESOURCE(3),
  31. GPIO_RESOURCE(4),
  32. GPIO_RESOURCE(5),
  33. GPIO_RESOURCE(6),
  34. GPIO_RESOURCE(7),
  35. GPIO_RESOURCE(8),
  36. };
  37. struct platform_device u8500_gpio_devs[] = {
  38. GPIO_DEVICE(0),
  39. GPIO_DEVICE(1),
  40. GPIO_DEVICE(2),
  41. GPIO_DEVICE(3),
  42. GPIO_DEVICE(4),
  43. GPIO_DEVICE(5),
  44. GPIO_DEVICE(6),
  45. GPIO_DEVICE(7),
  46. GPIO_DEVICE(8),
  47. };
  48. struct amba_device u8500_ssp0_device = {
  49. .dev = {
  50. .coherent_dma_mask = ~0,
  51. .init_name = "ssp0",
  52. },
  53. .res = {
  54. .start = U8500_SSP0_BASE,
  55. .end = U8500_SSP0_BASE + SZ_4K - 1,
  56. .flags = IORESOURCE_MEM,
  57. },
  58. .irq = {IRQ_SSP0, NO_IRQ },
  59. /* ST-Ericsson modified id */
  60. .periphid = SSP_PER_ID,
  61. };
  62. static struct resource u8500_i2c0_resources[] = {
  63. [0] = {
  64. .start = U8500_I2C0_BASE,
  65. .end = U8500_I2C0_BASE + SZ_4K - 1,
  66. .flags = IORESOURCE_MEM,
  67. },
  68. [1] = {
  69. .start = IRQ_I2C0,
  70. .end = IRQ_I2C0,
  71. .flags = IORESOURCE_IRQ,
  72. }
  73. };
  74. struct platform_device u8500_i2c0_device = {
  75. .name = "nmk-i2c",
  76. .id = 0,
  77. .resource = u8500_i2c0_resources,
  78. .num_resources = ARRAY_SIZE(u8500_i2c0_resources),
  79. };
  80. static struct resource u8500_i2c4_resources[] = {
  81. [0] = {
  82. .start = U8500_I2C4_BASE,
  83. .end = U8500_I2C4_BASE + SZ_4K - 1,
  84. .flags = IORESOURCE_MEM,
  85. },
  86. [1] = {
  87. .start = IRQ_I2C4,
  88. .end = IRQ_I2C4,
  89. .flags = IORESOURCE_IRQ,
  90. }
  91. };
  92. struct platform_device u8500_i2c4_device = {
  93. .name = "nmk-i2c",
  94. .id = 4,
  95. .resource = u8500_i2c4_resources,
  96. .num_resources = ARRAY_SIZE(u8500_i2c4_resources),
  97. };