devices-common.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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_COMMON_H
  8. #define __DEVICES_COMMON_H
  9. extern struct amba_device *
  10. dbx500_add_amba_device(const char *name, resource_size_t base,
  11. int irq, void *pdata, unsigned int periphid);
  12. extern struct platform_device *
  13. dbx500_add_platform_device_4k1irq(const char *name, int id,
  14. resource_size_t base,
  15. int irq, void *pdata);
  16. struct spi_master_cntlr;
  17. static inline struct amba_device *
  18. dbx500_add_msp_spi(const char *name, resource_size_t base, int irq,
  19. struct spi_master_cntlr *pdata)
  20. {
  21. return dbx500_add_amba_device(name, base, irq, pdata, 0);
  22. }
  23. static inline struct amba_device *
  24. dbx500_add_spi(const char *name, resource_size_t base, int irq,
  25. struct spi_master_cntlr *pdata,
  26. u32 periphid)
  27. {
  28. return dbx500_add_amba_device(name, base, irq, pdata, periphid);
  29. }
  30. struct mmci_platform_data;
  31. static inline struct amba_device *
  32. dbx500_add_sdi(const char *name, resource_size_t base, int irq,
  33. struct mmci_platform_data *pdata,
  34. u32 periphid)
  35. {
  36. return dbx500_add_amba_device(name, base, irq, pdata, periphid);
  37. }
  38. struct amba_pl011_data;
  39. static inline struct amba_device *
  40. dbx500_add_uart(const char *name, resource_size_t base, int irq,
  41. struct amba_pl011_data *pdata)
  42. {
  43. return dbx500_add_amba_device(name, base, irq, pdata, 0);
  44. }
  45. struct nmk_i2c_controller;
  46. static inline struct platform_device *
  47. dbx500_add_i2c(int id, resource_size_t base, int irq,
  48. struct nmk_i2c_controller *pdata)
  49. {
  50. return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
  51. pdata);
  52. }
  53. struct msp_i2s_platform_data;
  54. static inline struct platform_device *
  55. dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
  56. struct msp_i2s_platform_data *pdata)
  57. {
  58. return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq,
  59. pdata);
  60. }
  61. static inline struct amba_device *
  62. dbx500_add_rtc(resource_size_t base, int irq)
  63. {
  64. return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0);
  65. }
  66. struct nmk_gpio_platform_data;
  67. void dbx500_add_gpios(resource_size_t *base, int num, int irq,
  68. struct nmk_gpio_platform_data *pdata);
  69. #endif