aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2011-12-21 19:38:50 -0500
committerTakashi Iwai <tiwai@suse.de>2011-12-22 02:13:10 -0500
commitc1d70dd9c44d7554b97f38b5ce8001d3cbe10f61 (patch)
tree662d6e1189ee639daa88d4f0303b33a0fb3fff0e /sound
parent8637bc94f6a36c138229ac1ea09faca343f48bd7 (diff)
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')
-rw-r--r--sound/pci/asihpi/asihpi.c20
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,
961 961
962 for (format = HPI_FORMAT_PCM8_UNSIGNED; 962 for (format = HPI_FORMAT_PCM8_UNSIGNED;
963 format <= HPI_FORMAT_PCM24_SIGNED; format++) { 963 format <= HPI_FORMAT_PCM24_SIGNED; format++) {
964 err = hpi_format_create(&hpi_format, 964 err = hpi_format_create(&hpi_format, asihpi->out_max_chans,
965 2, format, sample_rate, 128000, 0); 965 format, sample_rate, 128000, 0);
966 if (!err) 966 if (!err)
967 err = hpi_outstream_query_format(h_stream, 967 err = hpi_outstream_query_format(h_stream, &hpi_format);
968 &hpi_format);
969 if (!err && (hpi_to_alsa_formats[format] != -1)) 968 if (!err && (hpi_to_alsa_formats[format] != -1))
970 pcmhw->formats |= 969 pcmhw->formats |= (1ULL << hpi_to_alsa_formats[format]);
971 (1ULL << hpi_to_alsa_formats[format]);
972 } 970 }
973} 971}
974 972
@@ -1141,14 +1139,12 @@ static void snd_card_asihpi_capture_format(struct snd_card_asihpi *asihpi,
1141 for (format = HPI_FORMAT_PCM8_UNSIGNED; 1139 for (format = HPI_FORMAT_PCM8_UNSIGNED;
1142 format <= HPI_FORMAT_PCM24_SIGNED; format++) { 1140 format <= HPI_FORMAT_PCM24_SIGNED; format++) {
1143 1141
1144 err = hpi_format_create(&hpi_format, 2, format, 1142 err = hpi_format_create(&hpi_format, asihpi->in_max_chans,
1145 sample_rate, 128000, 0); 1143 format, sample_rate, 128000, 0);
1146 if (!err) 1144 if (!err)
1147 err = hpi_instream_query_format(h_stream, 1145 err = hpi_instream_query_format(h_stream, &hpi_format);
1148 &hpi_format);
1149 if (!err) 1146 if (!err)
1150 pcmhw->formats |= 1147 pcmhw->formats |= (1ULL << hpi_to_alsa_formats[format]);
1151 (1ULL << hpi_to_alsa_formats[format]);
1152 } 1148 }
1153} 1149}
1154 1150