提交 63442604 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

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: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 b7ede5de
...@@ -231,9 +231,9 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai) ...@@ -231,9 +231,9 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
return 0; return 0;
#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) #if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
ret = sport_set_multichannel(sport, 16, 0x3FF, 1); ret = sport_set_multichannel(sport, 16, 0x3FF, 0x3FF, 1);
#else #else
ret = sport_set_multichannel(sport, 16, 0x1F, 1); ret = sport_set_multichannel(sport, 16, 0x1F, 0x1F, 1);
#endif #endif
if (ret) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
...@@ -311,9 +311,9 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev) ...@@ -311,9 +311,9 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
/*SPORT works in TDM mode to simulate AC97 transfers*/ /*SPORT works in TDM mode to simulate AC97 transfers*/
#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) #if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 1); ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 0x3FF, 1);
#else #else
ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1); ret = sport_set_multichannel(sport_handle, 16, 0x1F, 0x1F, 1);
#endif #endif
if (ret) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
/* note: multichannel is in units of 8 channels, /* note: multichannel is in units of 8 channels,
* tdm_count is # channels NOT / 8 ! */ * tdm_count is # channels NOT / 8 ! */
int sport_set_multichannel(struct sport_device *sport, int sport_set_multichannel(struct sport_device *sport,
int tdm_count, u32 mask, int packed) int tdm_count, u32 tx_mask, u32 rx_mask, int packed)
{ {
pr_debug("%s tdm_count=%d mask:0x%08x packed=%d\n", __func__, pr_debug("%s tdm_count=%d tx_mask:0x%08x rx_mask:0x%08x packed=%d\n",
tdm_count, mask, packed); __func__, tdm_count, tx_mask, rx_mask, packed);
if ((sport->regs->tcr1 & TSPEN) || (sport->regs->rcr1 & RSPEN)) if ((sport->regs->tcr1 & TSPEN) || (sport->regs->rcr1 & RSPEN))
return -EBUSY; return -EBUSY;
...@@ -65,8 +65,8 @@ int sport_set_multichannel(struct sport_device *sport, ...@@ -65,8 +65,8 @@ int sport_set_multichannel(struct sport_device *sport,
sport->regs->mcmc2 = FRAME_DELAY | MCMEN | \ sport->regs->mcmc2 = FRAME_DELAY | MCMEN | \
(packed ? (MCDTXPE|MCDRXPE) : 0); (packed ? (MCDTXPE|MCDRXPE) : 0);
sport->regs->mtcs0 = mask; sport->regs->mtcs0 = tx_mask;
sport->regs->mrcs0 = mask; sport->regs->mrcs0 = rx_mask;
sport->regs->mtcs1 = 0; sport->regs->mtcs1 = 0;
sport->regs->mrcs1 = 0; sport->regs->mrcs1 = 0;
sport->regs->mtcs2 = 0; sport->regs->mtcs2 = 0;
......
...@@ -128,7 +128,7 @@ void sport_done(struct sport_device *sport); ...@@ -128,7 +128,7 @@ void sport_done(struct sport_device *sport);
/* note: multichannel is in units of 8 channels, tdm_count is number of channels /* note: multichannel is in units of 8 channels, tdm_count is number of channels
* NOT / 8 ! all channels are enabled by default */ * NOT / 8 ! all channels are enabled by default */
int sport_set_multichannel(struct sport_device *sport, int tdm_count, int sport_set_multichannel(struct sport_device *sport, int tdm_count,
u32 mask, int packed); u32 tx_mask, u32 rx_mask, int packed);
int sport_config_rx(struct sport_device *sport, int sport_config_rx(struct sport_device *sport,
unsigned int rcr1, unsigned int rcr2, unsigned int rcr1, unsigned int rcr2,
......
...@@ -198,7 +198,7 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai) ...@@ -198,7 +198,7 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai)
int ret; int ret;
struct sport_device *sport = snd_soc_dai_get_drvdata(dai); struct sport_device *sport = snd_soc_dai_get_drvdata(dai);
ret = sport_set_multichannel(sport, 8, 0xFF, 1); ret = sport_set_multichannel(sport, 8, 0xFF, 0xFF, 1);
if (ret) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
ret = -EBUSY; ret = -EBUSY;
...@@ -265,7 +265,7 @@ static int bfin_tdm_probe(struct platform_device *pdev) ...@@ -265,7 +265,7 @@ static int bfin_tdm_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
/* SPORT works in TDM mode */ /* SPORT works in TDM mode */
ret = sport_set_multichannel(sport_handle, 8, 0xFF, 1); ret = sport_set_multichannel(sport_handle, 8, 0xFF, 0xFF, 1);
if (ret) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
ret = -EBUSY; ret = -EBUSY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册