rcar_snd.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_SRU 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_CLK_FROM_ADG (1 << 30) /* clock parent is master */
  32. #define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
  33. #define RSND_SSI_PLAY (1 << 24)
  34. #define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \
  35. { .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
  36. #define RSND_SSI_UNUSED \
  37. { .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 }
  38. struct rsnd_ssi_platform_info {
  39. int dai_id;
  40. int dma_id;
  41. int pio_irq;
  42. u32 flags;
  43. };
  44. /*
  45. * flags
  46. */
  47. #define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
  48. struct rsnd_scu_platform_info {
  49. u32 flags;
  50. };
  51. /*
  52. * flags
  53. *
  54. * 0x0000000A
  55. *
  56. * A : generation
  57. */
  58. #define RSND_GEN_MASK (0xF << 0)
  59. #define RSND_GEN1 (1 << 0) /* fixme */
  60. #define RSND_GEN2 (2 << 0) /* fixme */
  61. struct rcar_snd_info {
  62. u32 flags;
  63. struct rsnd_ssi_platform_info *ssi_info;
  64. int ssi_info_nr;
  65. struct rsnd_scu_platform_info *scu_info;
  66. int scu_info_nr;
  67. int (*start)(int id);
  68. int (*stop)(int id);
  69. };
  70. #endif