Skip to contentSkip to conversation

soc - Fix s3c24xx-i2s LR sync while timer ticks are disabled

PATCH Applied Mark Brown 2 participants 4 messages Apr 14, 2008

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/2 soc - Fix s3c24xx-i2s LR sync while timer ticks are disabled

From: Werner Almesberger <[email protected]>

When timer ticks are disabled when calling sound/soc/s3c24xx/s3c24xx-i2s.c:s3c24xx_snd_lrsync and the LR signal never happens, we loop forever.

This has been observed in the following call chain:
snd_pcm_common_ioctl1 -> snd_pcm_action_lock_irq -> snd_pcm_action_single
-> snd_pcm_do_resume -> soc_pcm_trigger -> s3c24xx_i2s_trigger

The patch below changes the timeout mechanism to use udelay, which doesn't need timer ticks.

---
 sound/soc/s3c24xx/s3c24xx-i2s.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/s3c24xx/s3c24xx-i2s.c +3 -2
index 0a3c630..6b3cbbf 100644
@@ -180,7 +180,7 @@ static void s3c24xx_snd_rxctrl(int on)
 static int s3c24xx_snd_lrsync(void)
 {
 	u32 iiscon;
-	unsigned long timeout = jiffies + msecs_to_jiffies(5);
+	int timeout = 50; /* 5ms */
 
 	DBG("Entered %s\n", __FUNCTION__);
 
@@ -189,8 +189,9 @@ static int s3c24xx_snd_lrsync(void)
 		if (iiscon & S3C2410_IISCON_LRINDEX)
 			break;
 
-		if (time_after(jiffies, timeout))
+		if (!timeout--)
 			return -ETIMEDOUT;
+		udelay(100);
 	}
 
 	return 0;
Signature · 1 line
1.5.5
author
#1 lore raw

PATCH 2/2 wm9713: Don't control touch screen power on suspend

Leave the power bit for the touch screen alone when suspending the WM9713 so that the touch screen driver can handle it. This allows the touch screen to be used as a wakeup source when the system is suspended.

---
 sound/soc/codecs/wm9713.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
sound/soc/codecs/wm9713.c +10 -1
index e3174c4..1f24116 100644
@@ -1132,8 +1132,17 @@ static int wm9713_soc_suspend(struct platform_device *pdev,
 {
 	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
 	struct snd_soc_codec *codec = socdev->codec;
+	u16 reg;
+
+	/* Disable everything except touchpanel - that will be handled
+	 * by the touch driver and left disabled if touch is not in
+	 * use. */
+	reg = ac97_read(codec, AC97_EXTENDED_MID);
+	ac97_write(codec, AC97_EXTENDED_MID, reg | 0x7fff);
+	ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff);
+	ac97_write(codec, AC97_POWERDOWN, 0x6f00);
+	ac97_write(codec, AC97_POWERDOWN, 0xffff);
 
-	wm9713_dapm_event(codec, SNDRV_CTL_POWER_D3cold);
 	return 0;
 }
 
Signature · 1 line
1.5.5
Applied
#3 lore raw
In reply to Mark Brown

At Mon, 14 Apr 2008 12:01:42 +0100,

Quoted 12 lines · Mark Brown

From: Werner Almesberger <[email protected]>

When timer ticks are disabled when calling sound/soc/s3c24xx/s3c24xx-i2s.c:s3c24xx_snd_lrsync and the LR signal never happens, we loop forever.

This has been observed in the following call chain:
snd_pcm_common_ioctl1 -> snd_pcm_action_lock_irq -> snd_pcm_action_single
-> snd_pcm_do_resume -> soc_pcm_trigger -> s3c24xx_i2s_trigger

Quoted 5 lines

The patch below changes the timeout mechanism to use udelay, which doesn't need timer ticks.

Applied to ALSA tree. Thanks.

Takashi

Applied
#2 lore raw

Re: [PATCH 2/2] wm9713: Don't control touch screen power on suspend

In reply to Mark Brown

At Mon, 14 Apr 2008 12:01:43 +0100,

Quoted 6 lines · Mark Brown

Leave the power bit for the touch screen alone when suspending the WM9713 so that the touch screen driver can handle it. This allows the touch screen to be used as a wakeup source when the system is suspended.

Applied this, too. Thanks.

Takashi