sh_fsi.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. */
  26. /* A: clock inversion */
  27. #define SH_FSI_INVERSION_MASK 0x0000000F
  28. #define SH_FSI_LRM_INV (1 << 0)
  29. #define SH_FSI_BRM_INV (1 << 1)
  30. #define SH_FSI_LRS_INV (1 << 2)
  31. #define SH_FSI_BRS_INV (1 << 3)
  32. /* B: format mode */
  33. #define SH_FSI_FMT_MASK 0x000000F0
  34. #define SH_FSI_FMT_DAI (0 << 4)
  35. #define SH_FSI_FMT_SPDIF (1 << 4)
  36. /* C: chip specific */
  37. #define SH_FSI_OPTION_MASK 0x00000F00
  38. #define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */
  39. /*
  40. * set_rate return value
  41. *
  42. * see ACKMD/BPFMD on
  43. * ACK_MD (FSI2)
  44. * CKG1 (FSI)
  45. *
  46. * err : return value < 0
  47. * no change : return value == 0
  48. * change xMD : return value > 0
  49. *
  50. * 0x-00000AB
  51. *
  52. * A: ACKMD value
  53. * B: BPFMD value
  54. */
  55. #define SH_FSI_ACKMD_MASK (0xF << 0)
  56. #define SH_FSI_ACKMD_512 (1 << 0)
  57. #define SH_FSI_ACKMD_256 (2 << 0)
  58. #define SH_FSI_ACKMD_128 (3 << 0)
  59. #define SH_FSI_ACKMD_64 (4 << 0)
  60. #define SH_FSI_ACKMD_32 (5 << 0)
  61. #define SH_FSI_BPFMD_MASK (0xF << 4)
  62. #define SH_FSI_BPFMD_512 (1 << 4)
  63. #define SH_FSI_BPFMD_256 (2 << 4)
  64. #define SH_FSI_BPFMD_128 (3 << 4)
  65. #define SH_FSI_BPFMD_64 (4 << 4)
  66. #define SH_FSI_BPFMD_32 (5 << 4)
  67. #define SH_FSI_BPFMD_16 (6 << 4)
  68. struct sh_fsi_port_info {
  69. unsigned long flags;
  70. int tx_id;
  71. int rx_id;
  72. int (*set_rate)(struct device *dev, int rate, int enable);
  73. };
  74. struct sh_fsi_platform_info {
  75. struct sh_fsi_port_info port_a;
  76. struct sh_fsi_port_info port_b;
  77. };
  78. #endif /* __SOUND_FSI_H */