devices-db8500.h 4.3 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. #ifndef __DEVICES_DB8500_H
  8. #define __DEVICES_DB8500_H
  9. #include "devices-common.h"
  10. struct ske_keypad_platform_data;
  11. struct pl022_ssp_controller;
  12. static inline struct platform_device *
  13. db8500_add_ske_keypad(struct device *parent,
  14. struct ske_keypad_platform_data *pdata,
  15. size_t size)
  16. {
  17. struct resource resources[] = {
  18. DEFINE_RES_MEM(U8500_SKE_BASE, SZ_4K),
  19. DEFINE_RES_IRQ(IRQ_DB8500_KB),
  20. };
  21. return platform_device_register_resndata(parent, "nmk-ske-keypad", -1,
  22. resources, 2, pdata, size);
  23. }
  24. static inline struct amba_device *
  25. db8500_add_ssp(struct device *parent, const char *name, resource_size_t base,
  26. int irq, struct pl022_ssp_controller *pdata)
  27. {
  28. return amba_ahb_device_add(parent, name, base, SZ_4K, irq, 0, pdata, 0);
  29. }
  30. #define db8500_add_i2c0(parent, pdata) \
  31. dbx500_add_i2c(parent, 0, U8500_I2C0_BASE, IRQ_DB8500_I2C0, pdata)
  32. #define db8500_add_i2c1(parent, pdata) \
  33. dbx500_add_i2c(parent, 1, U8500_I2C1_BASE, IRQ_DB8500_I2C1, pdata)
  34. #define db8500_add_i2c2(parent, pdata) \
  35. dbx500_add_i2c(parent, 2, U8500_I2C2_BASE, IRQ_DB8500_I2C2, pdata)
  36. #define db8500_add_i2c3(parent, pdata) \
  37. dbx500_add_i2c(parent, 3, U8500_I2C3_BASE, IRQ_DB8500_I2C3, pdata)
  38. #define db8500_add_i2c4(parent, pdata) \
  39. dbx500_add_i2c(parent, 4, U8500_I2C4_BASE, IRQ_DB8500_I2C4, pdata)
  40. #define db8500_add_msp0_spi(parent, pdata) \
  41. dbx500_add_msp_spi(parent, "msp0", U8500_MSP0_BASE, \
  42. IRQ_DB8500_MSP0, pdata)
  43. #define db8500_add_msp1_spi(parent, pdata) \
  44. dbx500_add_msp_spi(parent, "msp1", U8500_MSP1_BASE, \
  45. IRQ_DB8500_MSP1, pdata)
  46. #define db8500_add_msp2_spi(parent, pdata) \
  47. dbx500_add_msp_spi(parent, "msp2", U8500_MSP2_BASE, \
  48. IRQ_DB8500_MSP2, pdata)
  49. #define db8500_add_msp3_spi(parent, pdata) \
  50. dbx500_add_msp_spi(parent, "msp3", U8500_MSP3_BASE, \
  51. IRQ_DB8500_MSP1, pdata)
  52. #define db8500_add_rtc(parent) \
  53. dbx500_add_rtc(parent, U8500_RTC_BASE, IRQ_DB8500_RTC);
  54. #define db8500_add_usb(parent, rx_cfg, tx_cfg) \
  55. ux500_add_usb(parent, U8500_USBOTG_BASE, \
  56. IRQ_DB8500_USBOTG, rx_cfg, tx_cfg)
  57. #define db8500_add_sdi0(parent, pdata, pid) \
  58. dbx500_add_sdi(parent, "sdi0", U8500_SDI0_BASE, \
  59. IRQ_DB8500_SDMMC0, pdata, pid)
  60. #define db8500_add_sdi1(parent, pdata, pid) \
  61. dbx500_add_sdi(parent, "sdi1", U8500_SDI1_BASE, \
  62. IRQ_DB8500_SDMMC1, pdata, pid)
  63. #define db8500_add_sdi2(parent, pdata, pid) \
  64. dbx500_add_sdi(parent, "sdi2", U8500_SDI2_BASE, \
  65. IRQ_DB8500_SDMMC2, pdata, pid)
  66. #define db8500_add_sdi3(parent, pdata, pid) \
  67. dbx500_add_sdi(parent, "sdi3", U8500_SDI3_BASE, \
  68. IRQ_DB8500_SDMMC3, pdata, pid)
  69. #define db8500_add_sdi4(parent, pdata, pid) \
  70. dbx500_add_sdi(parent, "sdi4", U8500_SDI4_BASE, \
  71. IRQ_DB8500_SDMMC4, pdata, pid)
  72. #define db8500_add_sdi5(parent, pdata, pid) \
  73. dbx500_add_sdi(parent, "sdi5", U8500_SDI5_BASE, \
  74. IRQ_DB8500_SDMMC5, pdata, pid)
  75. #define db8500_add_ssp0(parent, pdata) \
  76. db8500_add_ssp(parent, "ssp0", U8500_SSP0_BASE, \
  77. IRQ_DB8500_SSP0, pdata)
  78. #define db8500_add_ssp1(parent, pdata) \
  79. db8500_add_ssp(parent, "ssp1", U8500_SSP1_BASE, \
  80. IRQ_DB8500_SSP1, pdata)
  81. #define db8500_add_spi0(parent, pdata) \
  82. dbx500_add_spi(parent, "spi0", U8500_SPI0_BASE, \
  83. IRQ_DB8500_SPI0, pdata, 0)
  84. #define db8500_add_spi1(parent, pdata) \
  85. dbx500_add_spi(parent, "spi1", U8500_SPI1_BASE, \
  86. IRQ_DB8500_SPI1, pdata, 0)
  87. #define db8500_add_spi2(parent, pdata) \
  88. dbx500_add_spi(parent, "spi2", U8500_SPI2_BASE, \
  89. IRQ_DB8500_SPI2, pdata, 0)
  90. #define db8500_add_spi3(parent, pdata) \
  91. dbx500_add_spi(parent, "spi3", U8500_SPI3_BASE, \
  92. IRQ_DB8500_SPI3, pdata, 0)
  93. #define db8500_add_uart0(parent, pdata) \
  94. dbx500_add_uart(parent, "uart0", U8500_UART0_BASE, \
  95. IRQ_DB8500_UART0, pdata)
  96. #define db8500_add_uart1(parent, pdata) \
  97. dbx500_add_uart(parent, "uart1", U8500_UART1_BASE, \
  98. IRQ_DB8500_UART1, pdata)
  99. #define db8500_add_uart2(parent, pdata) \
  100. dbx500_add_uart(parent, "uart2", U8500_UART2_BASE, \
  101. IRQ_DB8500_UART2, pdata)
  102. #define db8500_add_cryp1(parent, pdata) \
  103. dbx500_add_cryp1(parent, -1, U8500_CRYP1_BASE, IRQ_DB8500_CRYP1, pdata)
  104. #define db8500_add_hash1(parent, pdata) \
  105. dbx500_add_hash1(parent, -1, U8500_HASH1_BASE, pdata)
  106. #endif