aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sirf/sirf-usp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sirf/sirf-usp.c')
-rw-r--r--sound/soc/sirf/sirf-usp.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sound/soc/sirf/sirf-usp.c b/sound/soc/sirf/sirf-usp.c
index 3a730374e259..186dc7f33a55 100644
--- a/sound/soc/sirf/sirf-usp.c
+++ b/sound/soc/sirf/sirf-usp.c
@@ -100,6 +100,16 @@ static int sirf_usp_pcm_set_dai_fmt(struct snd_soc_dai *dai,
100 return -EINVAL; 100 return -EINVAL;
101 } 101 }
102 102
103 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
104 case SND_SOC_DAIFMT_NB_NF:
105 break;
106 case SND_SOC_DAIFMT_IB_NF:
107 usp->daifmt_format |= (fmt & SND_SOC_DAIFMT_INV_MASK);
108 break;
109 default:
110 return -EINVAL;
111 }
112
103 return 0; 113 return 0;
104} 114}
105 115
@@ -177,7 +187,7 @@ static int sirf_usp_pcm_hw_params(struct snd_pcm_substream *substream,
177 187
178 shifter_len = data_len; 188 shifter_len = data_len;
179 189
180 switch (usp->daifmt_format) { 190 switch (usp->daifmt_format & SND_SOC_DAIFMT_FORMAT_MASK) {
181 case SND_SOC_DAIFMT_I2S: 191 case SND_SOC_DAIFMT_I2S:
182 regmap_update_bits(usp->regmap, USP_RX_FRAME_CTRL, 192 regmap_update_bits(usp->regmap, USP_RX_FRAME_CTRL,
183 USP_I2S_SYNC_CHG, USP_I2S_SYNC_CHG); 193 USP_I2S_SYNC_CHG, USP_I2S_SYNC_CHG);
@@ -193,6 +203,18 @@ static int sirf_usp_pcm_hw_params(struct snd_pcm_substream *substream,
193 return -EINVAL; 203 return -EINVAL;
194 } 204 }
195 205
206 switch (usp->daifmt_format & SND_SOC_DAIFMT_INV_MASK) {
207 case SND_SOC_DAIFMT_NB_NF:
208 break;
209 case SND_SOC_DAIFMT_IB_NF:
210 regmap_update_bits(usp->regmap, USP_MODE1,
211 USP_RXD_ACT_EDGE_FALLING | USP_TXD_ACT_EDGE_FALLING,
212 USP_RXD_ACT_EDGE_FALLING);
213 break;
214 default:
215 return -EINVAL;
216 }
217
196 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 218 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
197 regmap_update_bits(usp->regmap, USP_TX_FRAME_CTRL, 219 regmap_update_bits(usp->regmap, USP_TX_FRAME_CTRL,
198 USP_TXC_DATA_LEN_MASK | USP_TXC_FRAME_LEN_MASK 220 USP_TXC_DATA_LEN_MASK | USP_TXC_FRAME_LEN_MASK