aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-05-28 13:22:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-30 07:33:40 -0400
commit634426048462373aba69c201390c3e75bc9d00d1 (patch)
tree857b95fdff06dab99d54a0cf7db837e2e4ad4c82 /sound/soc/blackfin
parentb7ede5dea0746611a75cf49cd3b2f64097c53ef5 (diff)
ASoC: blackfin: bf5xx-sport: Allow setting rx and tx mask independently
Since the hardware supports it there is no need to artificially limit this to just being able to set the same mask for both tx and rx. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin')
-rw-r--r--sound/soc/blackfin/bf5xx-ac97.c8
-rw-r--r--sound/soc/blackfin/bf5xx-sport.c10
-rw-r--r--sound/soc/blackfin/bf5xx-sport.h2
-rw-r--r--sound/soc/blackfin/bf5xx-tdm.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c
index 490217325975..c66bef826ac5 100644
--- a/sound/soc/blackfin/bf5xx-ac97.c
+++ b/sound/soc/blackfin/bf5xx-ac97.c
@@ -231,9 +231,9 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
231 return 0; 231 return 0;
232 232
233#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) 233#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
234 ret = sport_set_multichannel(sport, 16, 0x3FF, 1); 234 ret = sport_set_multichannel(sport, 16, 0x3FF, 0x3FF, 1);
235#else 235#else
236 ret = sport_set_multichannel(sport, 16, 0x1F, 1); 236 ret = sport_set_multichannel(sport, 16, 0x1F, 0x1F, 1);
237#endif 237#endif
238 if (ret) { 238 if (ret) {
239 pr_err("SPORT is busy!\n"); 239 pr_err("SPORT is busy!\n");
@@ -311,9 +311,9 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
311 311
312 /*SPORT works in TDM mode to simulate AC97 transfers*/ 312 /*SPORT works in TDM mode to simulate AC97 transfers*/
313#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) 313#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
314 ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 1); 314 ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 0x3FF, 1);
315#else 315#else
316 ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1); 316 ret = sport_set_multichannel(sport_handle, 16, 0x1F, 0x1F, 1);
317#endif 317#endif
318 if (ret) { 318 if (ret) {
319 pr_err("SPORT is busy!\n"); 319 pr_err("SPORT is busy!\n");
diff --git a/sound/soc/blackfin/bf5xx-sport.c b/sound/soc/blackfin/bf5xx-sport.c
index 2fd9f2a06968..695351241db8 100644
--- a/sound/soc/blackfin/bf5xx-sport.c
+++ b/sound/soc/blackfin/bf5xx-sport.c
@@ -46,10 +46,10 @@
46/* note: multichannel is in units of 8 channels, 46/* note: multichannel is in units of 8 channels,
47 * tdm_count is # channels NOT / 8 ! */ 47 * tdm_count is # channels NOT / 8 ! */
48int sport_set_multichannel(struct sport_device *sport, 48int sport_set_multichannel(struct sport_device *sport,
49 int tdm_count, u32 mask, int packed) 49 int tdm_count, u32 tx_mask, u32 rx_mask, int packed)
50{ 50{
51 pr_debug("%s tdm_count=%d mask:0x%08x packed=%d\n", __func__, 51 pr_debug("%s tdm_count=%d tx_mask:0x%08x rx_mask:0x%08x packed=%d\n",
52 tdm_count, mask, packed); 52 __func__, tdm_count, tx_mask, rx_mask, packed);
53 53
54 if ((sport->regs->tcr1 & TSPEN) || (sport->regs->rcr1 & RSPEN)) 54 if ((sport->regs->tcr1 & TSPEN) || (sport->regs->rcr1 & RSPEN))
55 return -EBUSY; 55 return -EBUSY;
@@ -65,8 +65,8 @@ int sport_set_multichannel(struct sport_device *sport,
65 sport->regs->mcmc2 = FRAME_DELAY | MCMEN | \ 65 sport->regs->mcmc2 = FRAME_DELAY | MCMEN | \
66 (packed ? (MCDTXPE|MCDRXPE) : 0); 66 (packed ? (MCDTXPE|MCDRXPE) : 0);
67 67
68 sport->regs->mtcs0 = mask; 68 sport->regs->mtcs0 = tx_mask;
69 sport->regs->mrcs0 = mask; 69 sport->regs->mrcs0 = rx_mask;
70 sport->regs->mtcs1 = 0; 70 sport->regs->mtcs1 = 0;
71 sport->regs->mrcs1 = 0; 71 sport->regs->mrcs1 = 0;
72 sport->regs->mtcs2 = 0; 72 sport->regs->mtcs2 = 0;
diff --git a/sound/soc/blackfin/bf5xx-sport.h b/sound/soc/blackfin/bf5xx-sport.h
index 5ab60bd613ea..9fc2192feb3b 100644
--- a/sound/soc/blackfin/bf5xx-sport.h
+++ b/sound/soc/blackfin/bf5xx-sport.h
@@ -128,7 +128,7 @@ void sport_done(struct sport_device *sport);
128/* note: multichannel is in units of 8 channels, tdm_count is number of channels 128/* note: multichannel is in units of 8 channels, tdm_count is number of channels
129 * NOT / 8 ! all channels are enabled by default */ 129 * NOT / 8 ! all channels are enabled by default */
130int sport_set_multichannel(struct sport_device *sport, int tdm_count, 130int sport_set_multichannel(struct sport_device *sport, int tdm_count,
131 u32 mask, int packed); 131 u32 tx_mask, u32 rx_mask, int packed);
132 132
133int sport_config_rx(struct sport_device *sport, 133int sport_config_rx(struct sport_device *sport,
134 unsigned int rcr1, unsigned int rcr2, 134 unsigned int rcr1, unsigned int rcr2,
diff --git a/sound/soc/blackfin/bf5xx-tdm.c b/sound/soc/blackfin/bf5xx-tdm.c
index 69e9a3e935bd..aa0851650b56 100644
--- a/sound/soc/blackfin/bf5xx-tdm.c
+++ b/sound/soc/blackfin/bf5xx-tdm.c
@@ -198,7 +198,7 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai)
198 int ret; 198 int ret;
199 struct sport_device *sport = snd_soc_dai_get_drvdata(dai); 199 struct sport_device *sport = snd_soc_dai_get_drvdata(dai);
200 200
201 ret = sport_set_multichannel(sport, 8, 0xFF, 1); 201 ret = sport_set_multichannel(sport, 8, 0xFF, 0xFF, 1);
202 if (ret) { 202 if (ret) {
203 pr_err("SPORT is busy!\n"); 203 pr_err("SPORT is busy!\n");
204 ret = -EBUSY; 204 ret = -EBUSY;
@@ -265,7 +265,7 @@ static int bfin_tdm_probe(struct platform_device *pdev)
265 return -ENODEV; 265 return -ENODEV;
266 266
267 /* SPORT works in TDM mode */ 267 /* SPORT works in TDM mode */
268 ret = sport_set_multichannel(sport_handle, 8, 0xFF, 1); 268 ret = sport_set_multichannel(sport_handle, 8, 0xFF, 0xFF, 1);
269 if (ret) { 269 if (ret) {
270 pr_err("SPORT is busy!\n"); 270 pr_err("SPORT is busy!\n");
271 ret = -EBUSY; 271 ret = -EBUSY;