ASoC: blackfin: bf5xx-sport: Allow setting rx and tx mask independently
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 28 May 2013 17:22:11 +0000 (19:22 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 30 May 2013 11:33:40 +0000 (12:33 +0100)
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>
sound/soc/blackfin/bf5xx-ac97.c
sound/soc/blackfin/bf5xx-sport.c
sound/soc/blackfin/bf5xx-sport.h
sound/soc/blackfin/bf5xx-tdm.c

index 490217325975ab47f9c393fc66d01365e16410b1..c66bef826ac556225677bef2f7ba824841bd8b44 100644 (file)
@@ -231,9 +231,9 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
                return 0;
 
 #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
-       ret = sport_set_multichannel(sport, 16, 0x1F, 1);
+       ret = sport_set_multichannel(sport, 16, 0x1F, 0x1F, 1);
 #endif
        if (ret) {
                pr_err("SPORT is busy!\n");
@@ -311,9 +311,9 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
 
        /*SPORT works in TDM mode to simulate AC97 transfers*/
 #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
-       ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
+       ret = sport_set_multichannel(sport_handle, 16, 0x1F, 0x1F, 1);
 #endif
        if (ret) {
                pr_err("SPORT is busy!\n");
index 2fd9f2a06968b8122f83325eccc4cbe1d885e751..695351241db89cb1ab0f4ec0c1d114edbdb501e9 100644 (file)
 /* note: multichannel is in units of 8 channels,
  * tdm_count is # channels NOT / 8 ! */
 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__,
-                       tdm_count, mask, packed);
+       pr_debug("%s tdm_count=%d tx_mask:0x%08x rx_mask:0x%08x packed=%d\n",
+                       __func__, tdm_count, tx_mask, rx_mask, packed);
 
        if ((sport->regs->tcr1 & TSPEN) || (sport->regs->rcr1 & RSPEN))
                return -EBUSY;
@@ -65,8 +65,8 @@ int sport_set_multichannel(struct sport_device *sport,
                sport->regs->mcmc2 = FRAME_DELAY | MCMEN | \
                                (packed ? (MCDTXPE|MCDRXPE) : 0);
 
-               sport->regs->mtcs0 = mask;
-               sport->regs->mrcs0 = mask;
+               sport->regs->mtcs0 = tx_mask;
+               sport->regs->mrcs0 = rx_mask;
                sport->regs->mtcs1 = 0;
                sport->regs->mrcs1 = 0;
                sport->regs->mtcs2 = 0;
index 5ab60bd613ea314cfc73b3219f07282b8945f8f2..9fc2192feb3bde2e0a5bc7b48e5498a43e7ac357 100644 (file)
@@ -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
  *  NOT / 8 ! all channels are enabled by default */
 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,
                unsigned int rcr1, unsigned int rcr2,
index 69e9a3e935bd13e008125c58100dc664e9e87009..aa0851650b5619a44e0b7ea8efc35f375d34806e 100644 (file)
@@ -198,7 +198,7 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai)
        int ret;
        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) {
                pr_err("SPORT is busy!\n");
                ret = -EBUSY;
@@ -265,7 +265,7 @@ static int bfin_tdm_probe(struct platform_device *pdev)
                return -ENODEV;
 
        /* 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) {
                pr_err("SPORT is busy!\n");
                ret = -EBUSY;