]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/sound/sh_fsi.h
ASoC: multi-component - ASoC Multi-Component Support
[mv-sheeva.git] / include / sound / sh_fsi.h
index c0227361a876fc2f919aa9bc03276e20898b7a52..3fd6456d07d796696f99d65f73440c8443c0c9c1 100644 (file)
@@ -12,6 +12,9 @@
  * published by the Free Software Foundation.
  */
 
+#define FSI_PORT_A     0
+#define FSI_PORT_B     1
+
 /* flags format
 
  * 0xABCDEEFF
 #define SH_FSI_GET_IFMT(x)     ((x >> 8) & SH_FSI_FMT_MASK)
 #define SH_FSI_GET_OFMT(x)     ((x >> 0) & SH_FSI_FMT_MASK)
 
-#define SH_FSI_FMT_MONO                (1 << 0)
-#define SH_FSI_FMT_MONO_DELAY  (1 << 1)
-#define SH_FSI_FMT_PCM         (1 << 2)
-#define SH_FSI_FMT_I2S         (1 << 3)
-#define SH_FSI_FMT_TDM         (1 << 4)
-#define SH_FSI_FMT_TDM_DELAY   (1 << 5)
+#define SH_FSI_FMT_MONO                0
+#define SH_FSI_FMT_MONO_DELAY  1
+#define SH_FSI_FMT_PCM         2
+#define SH_FSI_FMT_I2S         3
+#define SH_FSI_FMT_TDM         4
+#define SH_FSI_FMT_TDM_DELAY   5
+#define SH_FSI_FMT_SPDIF       6
+
 
 #define SH_FSI_IFMT_TDM_CH(x) \
        (SH_FSI_IFMT(TDM)       | SH_FSI_SET_CH_I(x))
 #define SH_FSI_OFMT_TDM_DELAY_CH(x) \
        (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x))
 
+
+/*
+ * set_rate return value
+ *
+ * see ACKMD/BPFMD on
+ *     ACK_MD (FSI2)
+ *     CKG1   (FSI)
+ *
+ * err:  return value < 0
+ *
+ * 0x-00000AB
+ *
+ * A:  ACKMD value
+ * B:  BPFMD value
+ */
+
+#define SH_FSI_ACKMD_MASK      (0xF << 0)
+#define SH_FSI_ACKMD_512       (1 << 0)
+#define SH_FSI_ACKMD_256       (2 << 0)
+#define SH_FSI_ACKMD_128       (3 << 0)
+#define SH_FSI_ACKMD_64                (4 << 0)
+#define SH_FSI_ACKMD_32                (5 << 0)
+
+#define SH_FSI_BPFMD_MASK      (0xF << 4)
+#define SH_FSI_BPFMD_512       (1 << 4)
+#define SH_FSI_BPFMD_256       (2 << 4)
+#define SH_FSI_BPFMD_128       (3 << 4)
+#define SH_FSI_BPFMD_64                (4 << 4)
+#define SH_FSI_BPFMD_32                (5 << 4)
+#define SH_FSI_BPFMD_16                (6 << 4)
+
 struct sh_fsi_platform_info {
        unsigned long porta_flags;
        unsigned long portb_flags;
+       int (*set_rate)(int is_porta, int rate); /* for master mode */
 };
 
-extern struct snd_soc_dai fsi_soc_dai[2];
-extern struct snd_soc_platform fsi_soc_platform;
+extern struct snd_soc_dai_driver fsi_soc_dai[2];
+extern struct snd_soc_platform_driver fsi_soc_platform;
 
 #endif /* __SOUND_FSI_H */