rcar_snd.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Renesas R-Car SRU/SCU/SSIU/SSI support
  3. *
  4. * Copyright (C) 2013 Renesas Solutions Corp.
  5. * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef RCAR_SND_H
  12. #define RCAR_SND_H
  13. #include <linux/sh_clk.h>
  14. #define RSND_GEN1_SRU 0
  15. #define RSND_GEN1_ADG 1
  16. #define RSND_GEN1_SSI 2
  17. #define RSND_GEN2_SCU 0
  18. #define RSND_GEN2_ADG 1
  19. #define RSND_GEN2_SSIU 2
  20. #define RSND_GEN2_SSI 3
  21. #define RSND_BASE_MAX 4
  22. /*
  23. * flags
  24. *
  25. * 0xAB000000
  26. *
  27. * A : clock sharing settings
  28. * B : SSI direction
  29. */
  30. #define RSND_SSI_CLK_PIN_SHARE (1 << 31)
  31. #define RSND_SSI_NO_BUSIF (1 << 30) /* SSI+DMA without BUSIF */
  32. #define RSND_SSI(_dma_id, _irq, _flags) \
  33. { .dma_id = _dma_id, .irq = _irq, .flags = _flags }
  34. #define RSND_SSI_UNUSED \
  35. { .dma_id = -1, .irq = -1, .flags = 0 }
  36. struct rsnd_ssi_platform_info {
  37. int dma_id;
  38. int irq;
  39. u32 flags;
  40. };
  41. #define RSND_SRC(rate, _dma_id) \
  42. { .convert_rate = rate, .dma_id = _dma_id, }
  43. #define RSND_SRC_UNUSED \
  44. { .convert_rate = 0, .dma_id = -1, }
  45. struct rsnd_src_platform_info {
  46. u32 convert_rate; /* sampling rate convert */
  47. int dma_id; /* for Gen2 SCU */
  48. int irq;
  49. };
  50. /*
  51. * flags
  52. */
  53. struct rsnd_dvc_platform_info {
  54. u32 flags;
  55. };
  56. struct rsnd_dai_path_info {
  57. struct rsnd_ssi_platform_info *ssi;
  58. struct rsnd_src_platform_info *src;
  59. struct rsnd_dvc_platform_info *dvc;
  60. };
  61. struct rsnd_dai_platform_info {
  62. struct rsnd_dai_path_info playback;
  63. struct rsnd_dai_path_info capture;
  64. };
  65. /*
  66. * flags
  67. *
  68. * 0x0000000A
  69. *
  70. * A : generation
  71. */
  72. #define RSND_GEN_MASK (0xF << 0)
  73. #define RSND_GEN1 (1 << 0) /* fixme */
  74. #define RSND_GEN2 (2 << 0) /* fixme */
  75. struct rcar_snd_info {
  76. u32 flags;
  77. struct rsnd_ssi_platform_info *ssi_info;
  78. int ssi_info_nr;
  79. struct rsnd_src_platform_info *src_info;
  80. int src_info_nr;
  81. struct rsnd_dvc_platform_info *dvc_info;
  82. int dvc_info_nr;
  83. struct rsnd_dai_platform_info *dai_info;
  84. int dai_info_nr;
  85. int (*start)(int id);
  86. int (*stop)(int id);
  87. };
  88. #endif