devices-db8500.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. .coherent_dma_mask = DMA_BIT_MASK(32),
  47. },
  48. .name = "dma40",
  49. .id = 0,
  50. .num_resources = ARRAY_SIZE(dma40_resources),
  51. .resource = dma40_resources
  52. };
  53. struct resource keypad_resources[] = {
  54. [0] = {
  55. .start = U8500_SKE_BASE,
  56. .end = U8500_SKE_BASE + SZ_4K - 1,
  57. .flags = IORESOURCE_MEM,
  58. },
  59. [1] = {
  60. .start = IRQ_DB8500_KB,
  61. .end = IRQ_DB8500_KB,
  62. .flags = IORESOURCE_IRQ,
  63. },
  64. };
  65. struct platform_device u8500_ske_keypad_device = {
  66. .name = "nmk-ske-keypad",
  67. .id = -1,
  68. .num_resources = ARRAY_SIZE(keypad_resources),
  69. .resource = keypad_resources,
  70. };
  71. struct prcmu_pdata db8500_prcmu_pdata = {
  72. .ab_platdata = &ab8500_platdata,
  73. .ab_irq = IRQ_DB8500_AB8500,
  74. .irq_base = IRQ_PRCMU_BASE,
  75. .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
  76. .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
  77. };
  78. static struct resource db8500_prcmu_res[] = {
  79. {
  80. .name = "prcmu",
  81. .start = U8500_PRCMU_BASE,
  82. .end = U8500_PRCMU_BASE + SZ_8K - 1,
  83. .flags = IORESOURCE_MEM,
  84. },
  85. {
  86. .name = "prcmu-tcdm",
  87. .start = U8500_PRCMU_TCDM_BASE,
  88. .end = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
  89. .flags = IORESOURCE_MEM,
  90. },
  91. {
  92. .name = "irq",
  93. .start = IRQ_DB8500_PRCMU1,
  94. .end = IRQ_DB8500_PRCMU1,
  95. .flags = IORESOURCE_IRQ,
  96. },
  97. {
  98. .name = "prcmu-tcpm",
  99. .start = U8500_PRCMU_TCPM_BASE,
  100. .end = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
  101. .flags = IORESOURCE_MEM,
  102. },
  103. };
  104. struct platform_device db8500_prcmu_device = {
  105. .name = "db8500-prcmu",
  106. .resource = db8500_prcmu_res,
  107. .num_resources = ARRAY_SIZE(db8500_prcmu_res),
  108. .dev = {
  109. .platform_data = &db8500_prcmu_pdata,
  110. },
  111. };