aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-12-19 09:19:11 -0500
committerTakashi Iwai <tiwai@suse.de>2008-12-19 09:19:11 -0500
commitd4d9cd0338892e7f0d65f8a110473d175535cd5d (patch)
tree6bfc5b0f497f7a9e4ff7391e056a1656b05add68 /sound/pci/hda/hda_codec.c
parent03c6901ea22bbb532586334d5b79941ccf56d5b0 (diff)
ALSA: hda - Add probe_only option
Added probe_only module option to hd-audio driver. This option specifies whether the driver creates and initializes the codec-parser after probing. When this option is set, the driver skips the codec parsing and initialization but gives you proc and other accesses. It's useful to see the initial codec state for debugging. The default of this value is off, so the default behavior is as same as before. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 625fe5984dd6..e16cf63821ae 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -709,7 +709,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
709 * Returns 0 if successful, or a negative error code. 709 * Returns 0 if successful, or a negative error code.
710 */ 710 */
711int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, 711int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
712 struct hda_codec **codecp) 712 int do_init, struct hda_codec **codecp)
713{ 713{
714 struct hda_codec *codec; 714 struct hda_codec *codec;
715 char component[31]; 715 char component[31];
@@ -793,10 +793,12 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr
793 if (bus->modelname) 793 if (bus->modelname)
794 codec->modelname = kstrdup(bus->modelname, GFP_KERNEL); 794 codec->modelname = kstrdup(bus->modelname, GFP_KERNEL);
795 795
796 err = snd_hda_codec_configure(codec); 796 if (do_init) {
797 if (err < 0) { 797 err = snd_hda_codec_configure(codec);
798 snd_hda_codec_free(codec); 798 if (err < 0) {
799 return err; 799 snd_hda_codec_free(codec);
800 return err;
801 }
800 } 802 }
801 snd_hda_codec_proc_new(codec); 803 snd_hda_codec_proc_new(codec);
802 804