From 7ba72ba1fe891a94b1e9d506236507e4dc50e872 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 6 Feb 2008 14:03:20 +0100 Subject: [ALSA] hda-intel - Fix PCM device number assignment In the current scheme, PCM device numbers are assigned incrementally in the order of codecs. This causes problems when the codec number is irregular, e.g. codec #0 for HDMI and codec #1 for analog. Then the HDMI becomes the first PCM, which is picked up as the default output device. Unfortuantely this doesn't work well with normal setups. This patch introduced the fixed device numbers for the PCM types, namely, analog, SPDIF, HDMI and modem. The PCM devices are assigned according to the corresponding PCM type. After this patch, HDMI will be always assigned to PCM #3, SPDIF to PCM #1, and the first analog to PCM #0, etc. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_via.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/pci/hda/patch_via.c') diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 4e5dd4cf36f..d9a5c6a2dd9 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -523,6 +523,7 @@ static int via_build_pcms(struct hda_codec *codec) codec->num_pcms++; info++; info->name = spec->stream_name_digital; + info->pcm_type = HDA_PCM_TYPE_SPDIF; if (spec->multiout.dig_out_nid) { info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_digital_playback); -- cgit v1.2.3 From 9a08160bdbe3148a405f72798f76e2a5d30bd243 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 12 Feb 2008 18:37:26 +0100 Subject: [ALSA] hda-codec - Add "IEC958 Default PCM" switch Added a new mixer switch to enable/disable the sharing of the default PCM stream with analog and SPDIF outputs. When "IEC958 Default PCM" switch is on, the PCM stream is routed both to analog and SPDIF outputs. This is the behavior in the earlier version. Turning this switch off has a merit for some codecs, though. Some codec chips don't support 24bit formats for SPDIF but only for analog outputs. In this case, you can use 24bit format by disabling this switch. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_via.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sound/pci/hda/patch_via.c') diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index d9a5c6a2dd9..3515a3fb5d9 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -357,7 +357,8 @@ static int via_playback_pcm_open(struct hda_pcm_stream *hinfo, struct snd_pcm_substream *substream) { struct via_spec *spec = codec->spec; - return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream); + return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream, + hinfo); } static int via_playback_pcm_prepare(struct hda_pcm_stream *hinfo, @@ -493,6 +494,11 @@ static int via_build_controls(struct hda_codec *codec) spec->multiout.dig_out_nid); if (err < 0) return err; + err = snd_hda_create_spdif_share_sw(codec, + &spec->multiout); + if (err < 0) + return err; + spec->multiout.share_spdif = 1; } if (spec->dig_in_nid) { err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid); -- cgit v1.2.3 From 3c9a3203ff9863fbe798030928f496347c2ed3bd Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Fri, 29 Feb 2008 11:59:26 +0100 Subject: [ALSA] sound: hda: missing includes of hda_patch.h Move the array declaration to hda_codec.c where it is used and add includes where the individual presets are declared. Fixes the following sparse warnings: sound/pci/hda/patch_realtek.c:13744:25: warning: symbol 'snd_hda_preset_realtek' was not declared. Should it be static? sound/pci/hda/patch_cmedia.c:729:25: warning: symbol 'snd_hda_preset_cmedia' was not declared. Should it be static? sound/pci/hda/patch_analog.c:3656:25: warning: symbol 'snd_hda_preset_analog' was not declared. Should it be static? sound/pci/hda/patch_sigmatel.c:3995:25: warning: symbol 'snd_hda_preset_sigmatel' was not declared. Should it be static? sound/pci/hda/patch_si3054.c:286:25: warning: symbol 'snd_hda_preset_si3054' was not declared. Should it be static? sound/pci/hda/patch_atihdmi.c:156:25: warning: symbol 'snd_hda_preset_atihdmi' was not declared. Should it be static? sound/pci/hda/patch_conexant.c:1721:25: warning: symbol 'snd_hda_preset_conexant' was not declared. Should it be static? sound/pci/hda/patch_via.c:1962:25: warning: symbol 'snd_hda_preset_via' was not declared. Should it be static? Signed-off-by: Harvey Harrison Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_via.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/pci/hda/patch_via.c') diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 3515a3fb5d9..09f1c25eb7e 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -39,7 +39,7 @@ #include #include "hda_codec.h" #include "hda_local.h" - +#include "hda_patch.h" /* amp values */ #define AMP_VAL_IDX_SHIFT 19 -- cgit v1.2.3 From 888afa15418f001896bc11f498f9348e029611bd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 18 Mar 2008 09:57:50 +0100 Subject: [ALSA] hda-codec - keep the format verb at closing PCM streams Keep the format verb at closing PCM streams. Introduced snd_hda_codec_cleanup_stream() for the parcicular purpose. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_via.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound/pci/hda/patch_via.c') diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 09f1c25eb7e..52b1d81a26f 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -431,8 +431,7 @@ static int via_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct snd_pcm_substream *substream) { struct via_spec *spec = codec->spec; - snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number], - 0, 0, 0); + snd_hda_codec_cleanup_stream(codec, spec->adc_nids[substream->number]); return 0; } -- cgit v1.2.3