Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8c0d9649babcf7379dc94cb148bbd2a6d8792984
Commit:     8c0d9649babcf7379dc94cb148bbd2a6d8792984
Parent:     4444704cdcd44bb3534ead01d3318f0db858cb9f
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 28 12:30:17 2008 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:30:19 2008 +0100

    [ALSA] hda-codec - Add SPDIF output support to AD1986a laptop-eapd model
    
    The SPDIF output on AD1986A laptop-eapd model is disabled although
    some Samsung laptops have SPDIF output.  Enable it after checking the
    pin default config.
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/patch_analog.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 4914032..845e949 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -925,6 +925,13 @@ static struct hda_amp_list ad1986a_loopbacks[] = {
 };
 #endif
 
+static int is_jack_available(struct hda_codec *codec, hda_nid_t nid)
+{
+       unsigned int conf = snd_hda_codec_read(codec, nid, 0,
+                                              AC_VERB_GET_CONFIG_DEFAULT, 0);
+       return get_defcfg_connect(conf) != AC_JACK_PORT_NONE;
+}
+
 static int patch_ad1986a(struct hda_codec *codec)
 {
        struct ad198x_spec *spec;
@@ -984,7 +991,8 @@ static int patch_ad1986a(struct hda_codec *codec)
                spec->multiout.max_channels = 2;
                spec->multiout.num_dacs = 1;
                spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
-               spec->multiout.dig_out_nid = 0;
+               if (!is_jack_available(codec, 0x25))
+                       spec->multiout.dig_out_nid = 0;
                spec->input_mux = &ad1986a_laptop_eapd_capture_source;
                break;
        case AD1986A_LAPTOP_AUTOMUTE:
@@ -995,7 +1003,8 @@ static int patch_ad1986a(struct hda_codec *codec)
                spec->multiout.max_channels = 2;
                spec->multiout.num_dacs = 1;
                spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
-               spec->multiout.dig_out_nid = 0;
+               if (!is_jack_available(codec, 0x25))
+                       spec->multiout.dig_out_nid = 0;
                spec->input_mux = &ad1986a_laptop_eapd_capture_source;
                codec->patch_ops.unsol_event = ad1986a_hp_unsol_event;
                codec->patch_ops.init = ad1986a_hp_init;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to