sh_fsi.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_platform_info {
  65. unsigned long porta_flags;
  66. unsigned long portb_flags;
  67. int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
  68. };
  69. #endif /* __SOUND_FSI_H */