ALSA: asihpi: add format support check in snd_card_asihpi_capture_formats
Some Asihpi formats are not supported or invalid, and their mapping to ALSA format is set to -1. Before performing the format conversion into ALSA bitwise formats, add a consistency check for the requested format, as done in snd_card_asihpi_playback_formats(). Compile tested only. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Родитель
74c34ca1cc
Коммит
167d0a11d5
|
@ -1141,7 +1141,7 @@ static u64 snd_card_asihpi_capture_formats(struct snd_card_asihpi *asihpi,
|
||||||
format, sample_rate, 128000, 0);
|
format, sample_rate, 128000, 0);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = hpi_instream_query_format(h_stream, &hpi_format);
|
err = hpi_instream_query_format(h_stream, &hpi_format);
|
||||||
if (!err)
|
if (!err && (hpi_to_alsa_formats[format] != -1))
|
||||||
formats |= pcm_format_to_bits(hpi_to_alsa_formats[format]);
|
formats |= pcm_format_to_bits(hpi_to_alsa_formats[format]);
|
||||||
}
|
}
|
||||||
return formats;
|
return formats;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче