Skip to contentSkip to conversation

sound fixes for 2.6.36

GIT PULL Takashi Iwai 1 participant 1 message Aug 15, 2010

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

Linus,

please pull sound fixes for v2.6.36 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git for-linus

One regression fix of HD-audio in the previous update, a generic fix for HDMI setup, AD8994 fixes and a few trivial changes.

Thanks!

Takashi

===

Andrea Gelmini (1):
sound: oss: sh_dac_audio.c removed duplicated #include

Dan Carpenter (1):
ALSA: sound/usb/format: silence uninitialized variable warnings

Mark Brown (4):
ASoC: Optimise DSP performance for WM8994
ASoC: Only tweak WM8994 chip configuration on devices up to rev D
MAINTAINERS: Make Wolfson entry also cover CODEC drivers
MAINTAINERS: Add Ian Lartey as comaintaner for Wolfson devices

Takashi Iwai (2):
ALSA: hda - Restrict PCM parameters per ELD information over HDMI
ALSA: hda - Fix dynamic ADC change working again

---
 MAINTAINERS                     |    7 +++--
 sound/oss/sh_dac_audio.c        |    1 -
 sound/pci/hda/hda_codec.c       |   26 ++++++++++++++------
 sound/pci/hda/hda_codec.h       |    5 +++-
 sound/pci/hda/hda_eld.c         |   49 +++++++++++++++++++++++++++++++++++++++
 sound/pci/hda/hda_local.h       |    2 +
 sound/pci/hda/patch_cirrus.c    |    2 +-
 sound/pci/hda/patch_conexant.c  |    2 +-
 sound/pci/hda/patch_hdmi.c      |   42 +++++++++++++++++++++++++++++++++
 sound/pci/hda/patch_intelhdmi.c |    1 +
 sound/pci/hda/patch_nvhdmi.c    |    4 +--
 sound/pci/hda/patch_realtek.c   |    2 +-
 sound/soc/codecs/wm8994.c       |   23 ++++++++++++------
 sound/usb/format.c              |    8 ++++++
 14 files changed, 147 insertions(+), 27 deletions(-)
MAINTAINERS +4 -3
index 99b6f82..b5b8baa 100644
@@ -6402,8 +6402,9 @@ S:	Supported
 F:	drivers/input/touchscreen/*wm97*
 F:	include/linux/wm97xx.h
 
-WOLFSON MICROELECTRONICS PMIC DRIVERS
+WOLFSON MICROELECTRONICS DRIVERS
 M:	Mark Brown <[email protected]>
+M:	Ian Lartey <[email protected]>
 T:	git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
 W:	http://opensource.wolfsonmicro.com/node/8
 S:	Supported
@@ -6418,8 +6419,8 @@ F:	drivers/watchdog/wm83*_wdt.c
 F:	include/linux/mfd/wm831x/
 F:	include/linux/mfd/wm8350/
 F:	include/linux/mfd/wm8400*
-F:	sound/soc/codecs/wm8350.*
-F:	sound/soc/codecs/wm8400.*
+F:	include/sound/wm????.h
+F:	sound/soc/codecs/wm*
 
 X.25 NETWORK LAYER
 M:	Andrew Hendry <[email protected]>
sound/oss/sh_dac_audio.c +0 -1
index fdb58eb..479e302 100644
@@ -15,7 +15,6 @@
 #include <linux/linkage.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
-#include <linux/smp_lock.h>
 #include <linux/sound.h>
 #include <linux/smp_lock.h>
 #include <linux/soundcard.h>
sound/pci/hda/hda_codec.c +18 -8
index 720a81d..dd8fb86 100644
@@ -1261,12 +1261,17 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
 }
 EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream);
 
+static void really_cleanup_stream(struct hda_codec *codec,
+				  struct hda_cvt_setup *q);
+
 /**
- * snd_hda_codec_cleanup_stream - clean up the codec for closing
+ * __snd_hda_codec_cleanup_stream - clean up the codec for closing
  * @codec: the CODEC to clean up
  * @nid: the NID to clean up
+ * @do_now: really clean up the stream instead of clearing the active flag
  */
-void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
+void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
+				    int do_now)
 {
 	struct hda_cvt_setup *p;
 
@@ -1274,14 +1279,19 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
 		return;
 
 	snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid);
-	/* here we just clear the active flag; actual clean-ups will be done
-	 * in purify_inactive_streams()
-	 */
 	p = get_hda_cvt_setup(codec, nid);
-	if (p)
-		p->active = 0;
+	if (p) {
+		/* here we just clear the active flag when do_now isn't set;
+		 * actual clean-ups will be done later in
+		 * purify_inactive_streams() called from snd_hda_codec_prpapre()
+		 */
+		if (do_now)
+			really_cleanup_stream(codec, p);
+		else
+			p->active = 0;
+	}
 }
-EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream);
+EXPORT_SYMBOL_HDA(__snd_hda_codec_cleanup_stream);
 
 static void really_cleanup_stream(struct hda_codec *codec,
 				  struct hda_cvt_setup *q)
sound/pci/hda/hda_codec.h +4 -1
index 3f7a479..4303353 100644
@@ -963,7 +963,10 @@ void snd_hda_codec_cleanup(struct hda_codec *codec,
 void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
 				u32 stream_tag,
 				int channel_id, int format);
-void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid);
+void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
+				    int do_now);
+#define snd_hda_codec_cleanup_stream(codec, nid) \
+	__snd_hda_codec_cleanup_stream(codec, nid, 0)
 unsigned int snd_hda_calc_stream_format(unsigned int rate,
 					unsigned int channels,
 					unsigned int format,
sound/pci/hda/hda_eld.c +49 -0

53 lines not on this page · raw message

sound/pci/hda/hda_local.h +2 -0
index 7a97f12..28ab4ae 100644
@@ -604,6 +604,8 @@ struct hdmi_eld {
 int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid);
 int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t);
 void snd_hdmi_show_eld(struct hdmi_eld *eld);
+void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
+			      struct hda_pcm_stream *codec_pars);
 
 #ifdef CONFIG_PROC_FS
 int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld,
sound/pci/hda/patch_cirrus.c +1 -1
index 350ee8a..4ef5efa 100644
@@ -656,7 +656,7 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx,
 		return 0;
 	if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) {
 		/* stream is running, let's swap the current ADC */
-		snd_hda_codec_cleanup_stream(codec, spec->cur_adc);
+		__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1);
 		spec->cur_adc = spec->adc_nid[idx];
 		snd_hda_codec_setup_stream(codec, spec->cur_adc,
 					   spec->cur_adc_stream_tag, 0,
sound/pci/hda/patch_conexant.c +1 -1
index f7e234e..31b5d9e 100644
@@ -1733,7 +1733,7 @@ static void cxt5051_portc_automic(struct hda_codec *codec)
 	new_adc = spec->adc_nids[spec->cur_adc_idx];
 	if (spec->cur_adc && spec->cur_adc != new_adc) {
 		/* stream is running, let's swap the current ADC */
-		snd_hda_codec_cleanup_stream(codec, spec->cur_adc);
+		__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1);
 		spec->cur_adc = new_adc;
 		snd_hda_codec_setup_stream(codec, new_adc,
 					   spec->cur_adc_stream_tag, 0,
sound/pci/hda/patch_hdmi.c +42 -0

54 lines not on this page · raw message

sound/pci/hda/patch_intelhdmi.c +1 -0
index 5972d5e..d382d3c 100644
@@ -80,6 +80,7 @@ static struct hda_pcm_stream intel_hdmi_pcm_playback = {
 	.substreams = 1,
 	.channels_min = 2,
 	.ops = {
+		.open = hdmi_pcm_open,
 		.prepare = intel_hdmi_playback_pcm_prepare,
 		.cleanup = intel_hdmi_playback_pcm_cleanup,
 	},
sound/pci/hda/patch_nvhdmi.c +1 -3
index 77e2b40..f636870 100644
@@ -347,10 +347,8 @@ static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
 static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = {
 	.substreams = 1,
 	.channels_min = 2,
-	.rates = SUPPORTED_RATES,
-	.maxbps = SUPPORTED_MAXBPS,
-	.formats = SUPPORTED_FORMATS,
 	.ops = {
+		.open = hdmi_pcm_open,
 		.prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89,
 		.cleanup = nvhdmi_playback_pcm_cleanup,
 	},
sound/pci/hda/patch_realtek.c +1 -1
index 55d6e5b..2cd1ae8 100644
@@ -1037,7 +1037,7 @@ static void alc_dual_mic_adc_auto_switch(struct hda_codec *codec)
 	new_adc = spec->adc_nids[spec->cur_adc_idx];
 	if (spec->cur_adc && spec->cur_adc != new_adc) {
 		/* stream is running, let's swap the current ADC */
-		snd_hda_codec_cleanup_stream(codec, spec->cur_adc);
+		__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1);
 		spec->cur_adc = new_adc;
 		snd_hda_codec_setup_stream(codec, new_adc,
 					   spec->cur_adc_stream_tag, 0,
sound/soc/codecs/wm8994.c +15 -8
index a87046a..522249d 100644
@@ -95,6 +95,7 @@ struct wm8994_priv {
 
 	struct wm8994_micdet micdet[2];
 
+	int revision;
 	struct wm8994_pdata *pdata;
 };
 
@@ -3070,6 +3071,8 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
 static int wm8994_set_bias_level(struct snd_soc_codec *codec,
 				 enum snd_soc_bias_level level)
 {
+	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+
 	switch (level) {
 	case SND_SOC_BIAS_ON:
 		break;
@@ -3082,11 +3085,16 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
 
 	case SND_SOC_BIAS_STANDBY:
 		if (codec->bias_level == SND_SOC_BIAS_OFF) {
-			/* Tweak DC servo configuration for improved
-			 * performance. */
-			snd_soc_write(codec, 0x102, 0x3);
-			snd_soc_write(codec, 0x56, 0x3);
-			snd_soc_write(codec, 0x102, 0);
+			/* Tweak DC servo and DSP configuration for
+			 * improved performance. */
+			if (wm8994->revision < 4) {
+				/* Tweak DC servo and DSP configuration for
+				 * improved performance. */
+				snd_soc_write(codec, 0x102, 0x3);
+				snd_soc_write(codec, 0x56, 0x3);
+				snd_soc_write(codec, 0x817, 0);
+				snd_soc_write(codec, 0x102, 0);
+			}
 
 			/* Discharge LINEOUT1 & 2 */
 			snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
@@ -3919,7 +3927,6 @@ static int wm8994_codec_probe(struct platform_device *pdev)
 	struct wm8994_priv *wm8994;
 	struct snd_soc_codec *codec;
 	int i;
-	u16 rev;
 
 	if (wm8994_codec) {
 		dev_err(&pdev->dev, "Another WM8994 is registered\n");
@@ -3973,8 +3980,8 @@ static int wm8994_codec_probe(struct platform_device *pdev)
 			wm8994->reg_cache[i] = 0;
 
 	/* Set revision-specific configuration */
-	rev = snd_soc_read(codec, WM8994_CHIP_REVISION);
-	switch (rev) {
+	wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION);
+	switch (wm8994->revision) {
 	case 2:
 	case 3:
 		wm8994->hubs.dcs_codes = -5;
sound/usb/format.c +8 -0
index 4387f54..3a13754 100644
@@ -392,6 +392,10 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
 		/* fp->channels is already set in this case */
 		ret = parse_audio_format_rates_v2(chip, fp);
 		break;
+	default:
+		snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n",
+			   chip->dev->devnum, fp->iface, fp->altsetting, protocol);
+		return -EINVAL;
 	}
 
 	if (fp->channels < 1) {
@@ -452,6 +456,10 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
 		ret = parse_audio_format_rates_v2(chip, fp);
 		break;
 	}
+	default:
+		snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n",
+			   chip->dev->devnum, fp->iface, fp->altsetting, protocol);
+		return -EINVAL;
 	}
 
 	return ret;