devices-common.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. {
  27. return dbx500_add_amba_device(name, base, irq, pdata, 0);
  28. }
  29. struct mmci_platform_data;
  30. static inline struct amba_device *
  31. dbx500_add_sdi(const char *name, resource_size_t base, int irq,
  32. struct mmci_platform_data *pdata)
  33. {
  34. return dbx500_add_amba_device(name, base, irq, pdata, 0);
  35. }
  36. struct amba_pl011_data;
  37. static inline struct amba_device *
  38. dbx500_add_uart(const char *name, resource_size_t base, int irq,
  39. struct amba_pl011_data *pdata)
  40. {
  41. return dbx500_add_amba_device(name, base, irq, pdata, 0);
  42. }
  43. struct nmk_i2c_controller;
  44. static inline struct platform_device *
  45. dbx500_add_i2c(int id, resource_size_t base, int irq,
  46. struct nmk_i2c_controller *pdata)
  47. {
  48. return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
  49. pdata);
  50. }
  51. struct msp_i2s_platform_data;
  52. static inline struct platform_device *
  53. dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
  54. struct msp_i2s_platform_data *pdata)
  55. {
  56. return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq,
  57. pdata);
  58. }
  59. static inline struct amba_device *
  60. dbx500_add_rtc(resource_size_t base, int irq)
  61. {
  62. return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0);
  63. }
  64. struct nmk_gpio_platform_data;
  65. void dbx500_add_gpios(resource_size_t *base, int num, int irq,
  66. struct nmk_gpio_platform_data *pdata);
  67. #endif