rcar_snd.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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, _pio_irq, _flags) \
  35. { .dai_id = _dai_id, .pio_irq = _pio_irq, .flags = _flags }
  36. #define RSND_SSI_UNUSED \
  37. { .dai_id = -1, .pio_irq = -1, .flags = 0 }
  38. struct rsnd_ssi_platform_info {
  39. int dai_id;
  40. int pio_irq;
  41. u32 flags;
  42. };
  43. struct rsnd_scu_platform_info {
  44. u32 flags;
  45. };
  46. /*
  47. * flags
  48. *
  49. * 0x0000000A
  50. *
  51. * A : generation
  52. */
  53. #define RSND_GEN1 (1 << 0) /* fixme */
  54. #define RSND_GEN2 (2 << 0) /* fixme */
  55. struct rcar_snd_info {
  56. u32 flags;
  57. struct rsnd_ssi_platform_info *ssi_info;
  58. int ssi_info_nr;
  59. struct rsnd_scu_platform_info *scu_info;
  60. int scu_info_nr;
  61. int (*start)(int id);
  62. int (*stop)(int id);
  63. };
  64. #endif