Skip to contentSkip to conversation

ASoC: Blackfin AC97: add a few missing multichannel define handling

PATCH Applied Mike Frysinger 3 participants 8 messages Sep 17, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ASoC: Blackfin AC97: add a few missing multichannel define handling

From: Cliff Cai <[email protected]>

Somewhere along the line, most of SND_BF5XX_MULTICHAN_SUPPORT handling was merged, but two places were missed (the probe/resume functions). Restore handling of this option so it gets initialized properly.

---
 sound/soc/blackfin/bf5xx-ac97.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
sound/soc/blackfin/bf5xx-ac97.c +8 -0
index 2758b90..e693229 100644
@@ -277,7 +277,11 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
 	if (!dai->active)
 		return 0;
 
+#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
+	ret = sport_set_multichannel(sport, 16, 0x3FF, 1);
+#else
 	ret = sport_set_multichannel(sport, 16, 0x1F, 1);
+#endif
 	if (ret) {
 		pr_err("SPORT is busy!\n");
 		return -EBUSY;
@@ -334,7 +338,11 @@ static int bf5xx_ac97_probe(struct platform_device *pdev,
 		goto sport_err;
 	}
 	/*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);
+#else
 	ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
+#endif
 	if (ret) {
 		pr_err("SPORT is busy!\n");
 		ret = -EBUSY;
Signature · 1 line
1.6.5.rc1
#1 lore raw

PATCH 2/5 ASoC: bf5xx-sport: the irq save/restore funcs take an unsigned long

---
 sound/soc/blackfin/bf5xx-sport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/blackfin/bf5xx-sport.c +1 -1
index 469ce7f..99051ff 100644
@@ -326,7 +326,7 @@ static inline int sport_hook_tx_dummy(struct sport_device *sport)
 
 int sport_tx_start(struct sport_device *sport)
 {
-	unsigned flags;
+	unsigned long flags;
 	pr_debug("%s: tx_run:%d, rx_run:%d\n", __func__,
 			sport->tx_run, sport->rx_run);
 	if (sport->tx_run)
Signature · 1 line
1.6.5.rc1
#2 lore raw

PATCH 3/5 ASoC: fix typos in Blackfin headers

In reply to Mike Frysinger

From: Barry Song <[email protected]>

---
 sound/soc/blackfin/bf5xx-ac97.h |    2 +-
 sound/soc/blackfin/bf5xx-i2s.h  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/blackfin/bf5xx-ac97.h +1 -1
index 3f2a911..a1f97dd 100644
@@ -1,5 +1,5 @@
 /*
- * linux/sound/arm/bf5xx-ac97.h
+ * sound/soc/blackfin/bf5xx-ac97.h
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
sound/soc/blackfin/bf5xx-i2s.h +1 -1
index 7107d1a..264ecdc 100644
@@ -1,5 +1,5 @@
 /*
- * linux/sound/arm/bf5xx-i2s.h
+ * sound/soc/blackfin/bf5xx-i2s.h
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
Signature · 1 line
1.6.5.rc1
#3 lore raw

PATCH 4/5 ASoC: Blackfin I2S: add lost platform_device parameter to resume function

In reply to Mike Frysinger

From: Barry Song <[email protected]>

Commit dc7d7b830ee1 trimmed the platform_device parameter from all of the suspend functions, but it also accidentally removed it from the resume function in the Blackfin I2S driver. So restore it.

---
 sound/soc/blackfin/bf5xx-i2s.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
sound/soc/blackfin/bf5xx-i2s.c +2 -1
index 876abad..19539c6 100644
@@ -227,7 +227,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev,
 	return 0;
 }
 
-static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
+static void bf5xx_i2s_remove(struct platform_device *pdev,
+			struct snd_soc_dai *dai)
 {
 	pr_debug("%s enter\n", __func__);
 	peripheral_free_list(&sport_req[sport_num][0]);
Signature · 1 line
1.6.5.rc1
#4 lore raw

PATCH 5/5 ASoC: Blackfin I2S: fix resuming when device hasn't been used

In reply to Mike Frysinger

From: Cliff Cai <[email protected]>

If the sound system hasn't been utilized yet and we suspend, then we attempt to save/restore using state that doesn't exist. So use a global handle instead to reconfigure properly.

---
 sound/soc/blackfin/bf5xx-i2s.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)
sound/soc/blackfin/bf5xx-i2s.c +7 -12
index 19539c6..1e9d161 100644
@@ -237,36 +237,31 @@ static void bf5xx_i2s_remove(struct platform_device *pdev,
 #ifdef CONFIG_PM
 static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
 {
-	struct sport_device *sport =
-		(struct sport_device *)dai->private_data;
 
 	pr_debug("%s : sport %d\n", __func__, dai->id);
-	if (!dai->active)
-		return 0;
+
 	if (dai->capture.active)
-		sport_rx_stop(sport);
+		sport_rx_stop(sport_handle);
 	if (dai->playback.active)
-		sport_tx_stop(sport);
+		sport_tx_stop(sport_handle);
 	return 0;
 }
 
 static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
 {
 	int ret;
-	struct sport_device *sport =
-		(struct sport_device *)dai->private_data;
 
 	pr_debug("%s : sport %d\n", __func__, dai->id);
-	if (!dai->active)
-		return 0;
 
-	ret = sport_config_rx(sport, RFSR | RCKFE, RSFSE|0x1f, 0, 0);
+	ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1,
+				      bf5xx_i2s.rcr2, 0, 0);
 	if (ret) {
 		pr_err("SPORT is busy!\n");
 		return -EBUSY;
 	}
 
-	ret = sport_config_tx(sport, TFSR | TCKFE, TSFSE|0x1f, 0, 0);
+	ret = sport_config_tx(sport_handle, bf5xx_i2s.tcr1,
+				      bf5xx_i2s.tcr2, 0, 0);
 	if (ret) {
 		pr_err("SPORT is busy!\n");
 		return -EBUSY;
Signature · 1 line
1.6.5.rc1
Applied
#5 lore raw

Re: [PATCH 5/5] ASoC: Blackfin I2S: fix resuming when device hasn't been used

Quoted 5 lines · Mike Frysinger

From: Cliff Cai <[email protected]>

If the sound system hasn't been utilized yet and we suspend, then we attempt to save/restore using state that doesn't exist. So use a global handle instead to reconfigure properly.

I expect that this will break if more than one DAI is in use, which can happen if people are using multiple DACs to do 5.1 or hardware mixing. Would it not make sense to allocate the SPORT when the DAI is probed?

I've applied the other four patches - thanks.

#6 lore raw

Re: [Uclinux-dist-devel] [PATCH 5/5] ASoC: Blackfin I2S: fix resuming when device hasn't been used

Quoted 10 lines · Mark Brown
Quoted 5 lines · Mike Frysinger

From: Cliff Cai <[email protected]>

If the sound system hasn't been utilized yet and we suspend, then we attempt to save/restore using state that doesn't exist.  So use a global handle instead to reconfigure properly.

I expect that this will break if more than one DAI is in use, which can happen if people are using multiple DACs to do 5.1 or hardware mixing. Would it not make sense to allocate the SPORT when the DAI is probed?

unfortunately, the system is already completely broken when more than one is used. ive opened an item to get this fixed, but it's going to require a few core pieces to be rewritten. so i'd like to have this merged since it improves the current situation.
-mike
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw

Re: [Uclinux-dist-devel] [PATCH 5/5] ASoC: Blackfin I2S: fix resuming when device hasn't been used

Quoted 4 lines · Mike Frysinger

unfortunately, the system is already completely broken when more than one is used. ive opened an item to get this fixed, but it's going to require a few core pieces to be rewritten. so i'd like to have this merged since it improves the current situation.

OK, I suspected something like that was going on. I'll apply the patch.