diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-12-22 13:38:50 +1300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-12-22 08:13:10 +0100 |
commit | c1d70dd9c44d7554b97f38b5ce8001d3cbe10f61 (patch) | |
tree | 662d6e1189ee639daa88d4f0303b33a0fb3fff0e /sound/pci/asihpi | |
parent | 8637bc94f6a36c138229ac1ea09faca343f48bd7 (diff) | |
download | linux-c1d70dd9c44d7554b97f38b5ce8001d3cbe10f61.tar.bz2 |
ALSA: asihpi - Use valid channel count in format enumeration.
Since introduction of mono and low latency modes, fixed channel count of 2
is not always valid. Use reported max_channels instead.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi')
-rw-r--r-- | sound/pci/asihpi/asihpi.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index c94d5d554c02..fdec4aa05c8a 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -961,14 +961,12 @@ static void snd_card_asihpi_playback_format(struct snd_card_asihpi *asihpi, for (format = HPI_FORMAT_PCM8_UNSIGNED; format <= HPI_FORMAT_PCM24_SIGNED; format++) { - err = hpi_format_create(&hpi_format, - 2, format, sample_rate, 128000, 0); + err = hpi_format_create(&hpi_format, asihpi->out_max_chans, + format, sample_rate, 128000, 0); if (!err) - err = hpi_outstream_query_format(h_stream, - &hpi_format); + err = hpi_outstream_query_format(h_stream, &hpi_format); if (!err && (hpi_to_alsa_formats[format] != -1)) - pcmhw->formats |= - (1ULL << hpi_to_alsa_formats[format]); + pcmhw->formats |= (1ULL << hpi_to_alsa_formats[format]); } } @@ -1141,14 +1139,12 @@ static void snd_card_asihpi_capture_format(struct snd_card_asihpi *asihpi, for (format = HPI_FORMAT_PCM8_UNSIGNED; format <= HPI_FORMAT_PCM24_SIGNED; format++) { - err = hpi_format_create(&hpi_format, 2, format, - sample_rate, 128000, 0); + err = hpi_format_create(&hpi_format, asihpi->in_max_chans, + format, sample_rate, 128000, 0); if (!err) - err = hpi_instream_query_format(h_stream, - &hpi_format); + err = hpi_instream_query_format(h_stream, &hpi_format); if (!err) - pcmhw->formats |= - (1ULL << hpi_to_alsa_formats[format]); + pcmhw->formats |= (1ULL << hpi_to_alsa_formats[format]); } } |