diff options
Diffstat (limited to 'include/sound/soc-dai.h')
-rw-r--r-- | include/sound/soc-dai.h | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 352d7eee9b6d..97ca9af414dc 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -27,8 +27,8 @@ struct snd_pcm_substream; | |||
27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ |
28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ |
29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ |
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ |
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
33 | 33 | ||
34 | /* left and right justified also known as MSB and LSB respectively */ | 34 | /* left and right justified also known as MSB and LSB respectively */ |
@@ -38,7 +38,7 @@ struct snd_pcm_substream; | |||
38 | /* | 38 | /* |
39 | * DAI Clock gating. | 39 | * DAI Clock gating. |
40 | * | 40 | * |
41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | 41 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
42 | * sending or receiving PCM data in a frame. This can be used to save power. | 42 | * sending or receiving PCM data in a frame. This can be used to save power. |
43 | */ | 43 | */ |
44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ |
@@ -51,21 +51,21 @@ struct snd_pcm_substream; | |||
51 | * format. | 51 | * format. |
52 | */ | 52 | */ |
53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ |
54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ |
55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ |
56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * DAI hardware clock masters. | 59 | * DAI hardware clock masters. |
60 | * | 60 | * |
61 | * This is wrt the codec, the inverse is true for the interface | 61 | * This is wrt the codec, the inverse is true for the interface |
62 | * i.e. if the codec is clk and frm master then the interface is | 62 | * i.e. if the codec is clk and FRM master then the interface is |
63 | * clk and frame slave. | 63 | * clk and frame slave. |
64 | */ | 64 | */ |
65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ |
66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ |
67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ |
68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ |
69 | 69 | ||
70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
@@ -78,7 +78,13 @@ struct snd_pcm_substream; | |||
78 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
79 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
80 | 80 | ||
81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\ | 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S8 |\ |
82 | SNDRV_PCM_FMTBIT_S16_LE |\ | ||
83 | SNDRV_PCM_FMTBIT_S16_BE |\ | ||
84 | SNDRV_PCM_FMTBIT_S20_3LE |\ | ||
85 | SNDRV_PCM_FMTBIT_S20_3BE |\ | ||
86 | SNDRV_PCM_FMTBIT_S24_3LE |\ | ||
87 | SNDRV_PCM_FMTBIT_S24_3BE |\ | ||
82 | SNDRV_PCM_FMTBIT_S32_LE |\ | 88 | SNDRV_PCM_FMTBIT_S32_LE |\ |
83 | SNDRV_PCM_FMTBIT_S32_BE) | 89 | SNDRV_PCM_FMTBIT_S32_BE) |
84 | 90 | ||
@@ -106,7 +112,7 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | |||
106 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
107 | 113 | ||
108 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
109 | unsigned int mask, int slots); | 115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
110 | 116 | ||
111 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
112 | 118 | ||
@@ -116,12 +122,12 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | |||
116 | /* | 122 | /* |
117 | * Digital Audio Interface. | 123 | * Digital Audio Interface. |
118 | * | 124 | * |
119 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | 125 | * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 |
120 | * operations an capabilities. Codec and platfom drivers will register a this | 126 | * operations and capabilities. Codec and platform drivers will register this |
121 | * structure for every DAI they have. | 127 | * structure for every DAI they have. |
122 | * | 128 | * |
123 | * This structure covers the clocking, formating and ALSA operations for each | 129 | * This structure covers the clocking, formating and ALSA operations for each |
124 | * interface a | 130 | * interface. |
125 | */ | 131 | */ |
126 | struct snd_soc_dai_ops { | 132 | struct snd_soc_dai_ops { |
127 | /* | 133 | /* |
@@ -140,7 +146,8 @@ struct snd_soc_dai_ops { | |||
140 | */ | 146 | */ |
141 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | 147 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); |
142 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
143 | unsigned int mask, int slots); | 149 | unsigned int tx_mask, unsigned int rx_mask, |
150 | int slots, int slot_width); | ||
144 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
145 | 152 | ||
146 | /* | 153 | /* |
@@ -179,6 +186,7 @@ struct snd_soc_dai { | |||
179 | int ac97_control; | 186 | int ac97_control; |
180 | 187 | ||
181 | struct device *dev; | 188 | struct device *dev; |
189 | void *ac97_pdata; /* platform_data for the ac97 codec */ | ||
182 | 190 | ||
183 | /* DAI callbacks */ | 191 | /* DAI callbacks */ |
184 | int (*probe)(struct platform_device *pdev, | 192 | int (*probe)(struct platform_device *pdev, |