ALSA: ymfpci: allow to disable the SRC
authorClemens Ladisch <clemens@ladisch.de>
Fri, 16 Sep 2011 21:08:28 +0000 (23:08 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 20 Sep 2011 06:56:56 +0000 (08:56 +0200)
Add the PCM rules to allow disabling the PCM playback and capture SRCs.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ymfpci/ymfpci_main.c

index 88c5c5c..66ea71b 100644 (file)
@@ -906,6 +906,9 @@ static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream)
                                           5334, UINT_MAX);
        if (err < 0)
                return err;
+       err = snd_pcm_hw_rule_noresample(runtime, 48000);
+       if (err < 0)
+               return err;
 
        ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL);
        if (ypcm == NULL)
@@ -1028,6 +1031,9 @@ static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream,
                                           5334, UINT_MAX);
        if (err < 0)
                return err;
+       err = snd_pcm_hw_rule_noresample(runtime, 48000);
+       if (err < 0)
+               return err;
 
        ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL);
        if (ypcm == NULL)