devices-db8500.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 <linux/amba/pl022.h>
  14. #include <linux/platform_data/dma-ste-dma40.h>
  15. #include <linux/mfd/dbx500-prcmu.h>
  16. #include "setup.h"
  17. #include "irqs.h"
  18. #include "db8500-regs.h"
  19. #include "devices-db8500.h"
  20. #include "ste-dma40-db8500.h"
  21. static struct resource dma40_resources[] = {
  22. [0] = {
  23. .start = U8500_DMA_BASE,
  24. .end = U8500_DMA_BASE + SZ_4K - 1,
  25. .flags = IORESOURCE_MEM,
  26. .name = "base",
  27. },
  28. [1] = {
  29. .start = U8500_DMA_LCPA_BASE,
  30. .end = U8500_DMA_LCPA_BASE + 2 * SZ_1K - 1,
  31. .flags = IORESOURCE_MEM,
  32. .name = "lcpa",
  33. },
  34. [2] = {
  35. .start = IRQ_DB8500_DMA,
  36. .end = IRQ_DB8500_DMA,
  37. .flags = IORESOURCE_IRQ,
  38. }
  39. };
  40. struct stedma40_platform_data dma40_plat_data = {
  41. .disabled_channels = {-1},
  42. };
  43. struct platform_device u8500_dma40_device = {
  44. .dev = {
  45. .platform_data = &dma40_plat_data,
  46. },
  47. .name = "dma40",
  48. .id = 0,
  49. .num_resources = ARRAY_SIZE(dma40_resources),
  50. .resource = dma40_resources
  51. };
  52. struct resource keypad_resources[] = {
  53. [0] = {
  54. .start = U8500_SKE_BASE,
  55. .end = U8500_SKE_BASE + SZ_4K - 1,
  56. .flags = IORESOURCE_MEM,
  57. },
  58. [1] = {
  59. .start = IRQ_DB8500_KB,
  60. .end = IRQ_DB8500_KB,
  61. .flags = IORESOURCE_IRQ,
  62. },
  63. };
  64. struct platform_device u8500_ske_keypad_device = {
  65. .name = "nmk-ske-keypad",
  66. .id = -1,
  67. .num_resources = ARRAY_SIZE(keypad_resources),
  68. .resource = keypad_resources,
  69. };
  70. struct prcmu_pdata db8500_prcmu_pdata = {
  71. .ab_platdata = &ab8500_platdata,
  72. .ab_irq = IRQ_DB8500_AB8500,
  73. .irq_base = IRQ_PRCMU_BASE,
  74. .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
  75. .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
  76. };
  77. static struct resource db8500_prcmu_res[] = {
  78. {
  79. .name = "prcmu",
  80. .start = U8500_PRCMU_BASE,
  81. .end = U8500_PRCMU_BASE + SZ_8K - 1,
  82. .flags = IORESOURCE_MEM,
  83. },
  84. {
  85. .name = "prcmu-tcdm",
  86. .start = U8500_PRCMU_TCDM_BASE,
  87. .end = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
  88. .flags = IORESOURCE_MEM,
  89. },
  90. {
  91. .name = "irq",
  92. .start = IRQ_DB8500_PRCMU1,
  93. .end = IRQ_DB8500_PRCMU1,
  94. .flags = IORESOURCE_IRQ,
  95. },
  96. {
  97. .name = "prcmu-tcpm",
  98. .start = U8500_PRCMU_TCPM_BASE,
  99. .end = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
  100. .flags = IORESOURCE_MEM,
  101. },
  102. };
  103. struct platform_device db8500_prcmu_device = {
  104. .name = "db8500-prcmu",
  105. .resource = db8500_prcmu_res,
  106. .num_resources = ARRAY_SIZE(db8500_prcmu_res),
  107. .dev = {
  108. .platform_data = &db8500_prcmu_pdata,
  109. },
  110. };