sh_fsi.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __SOUND_FSI_H
  2. #define __SOUND_FSI_H
  3. /*
  4. * Fifo-attached Serial Interface (FSI) support for SH7724
  5. *
  6. * Copyright (C) 2009 Renesas Solutions Corp.
  7. * Kuninori Morimoto <morimoto.kuninori@renesas.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #define FSI_PORT_A 0
  14. #define FSI_PORT_B 1
  15. #include <linux/clk.h>
  16. #include <sound/soc.h>
  17. /*
  18. * flags format
  19. *
  20. * 0x00000CBA
  21. *
  22. * A: inversion
  23. * B: format mode
  24. * C: chip specific
  25. * D: clock selecter if master mode
  26. */
  27. /* A: clock inversion */
  28. #define SH_FSI_INVERSION_MASK 0x0000000F
  29. #define SH_FSI_LRM_INV (1 << 0)
  30. #define SH_FSI_BRM_INV (1 << 1)
  31. #define SH_FSI_LRS_INV (1 << 2)
  32. #define SH_FSI_BRS_INV (1 << 3)
  33. /* B: format mode */
  34. #define SH_FSI_FMT_MASK 0x000000F0
  35. #define SH_FSI_FMT_DAI (0 << 4)
  36. #define SH_FSI_FMT_SPDIF (1 << 4)
  37. /* C: chip specific */
  38. #define SH_FSI_OPTION_MASK 0x00000F00
  39. #define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */
  40. /* D: clock selecter if master mode */
  41. #define SH_FSI_CLK_MASK 0x0000F000
  42. #define SH_FSI_CLK_EXTERNAL (0 << 12)
  43. #define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */
  44. struct sh_fsi_port_info {
  45. unsigned long flags;
  46. int tx_id;
  47. int rx_id;
  48. };
  49. struct sh_fsi_platform_info {
  50. struct sh_fsi_port_info port_a;
  51. struct sh_fsi_port_info port_b;
  52. };
  53. #endif /* __SOUND_FSI_H */