sh_fsi.h 2.0 KB

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