1
0

ALSA: oxfw: Change the way to make PCM rules/constraints

In previous commit, this driver can get to know stream formations at
each supported sampling rates. This commit uses it to make PCM
rules/constraints and obsoletes hard-coded rules/constraints.

For this purpose, this commit adds 'struct snd_oxfw_stream_formation' and
snd_oxfw_stream_parse_format() to parse data channel formation of data
block.

According to datasheet of OXFW970/971, they support 32.0kHz to 196.0kHz.

As long as developers investigate, some devices are confirmed to have
several formats for the same sampling rate.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Este cometimento está contido em:
Takashi Sakamoto
2014-12-09 00:10:42 +09:00
cometido por Takashi Iwai
ascendente 5b59d8098d
cometimento 5cd1d3f47a
4 ficheiros modificados com 415 adições e 91 eliminações

Ver ficheiro

@@ -58,6 +58,10 @@ end:
static void oxfw_card_free(struct snd_card *card)
{
struct snd_oxfw *oxfw = card->private_data;
unsigned int i;
for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++)
kfree(oxfw->rx_stream_formats[i]);
mutex_destroy(&oxfw->mutex);
}
@@ -81,6 +85,10 @@ static int oxfw_probe(struct fw_unit *unit,
oxfw->unit = unit;
oxfw->device_info = (const struct device_info *)id->driver_data;
err = snd_oxfw_stream_discover(oxfw);
if (err < 0)
goto error;
err = name_card(oxfw);
if (err < 0)
goto error;
@@ -136,7 +144,6 @@ static const struct device_info griffin_firewave = {
.driver_name = "FireWave",
.vendor_name = "Griffin",
.model_name = "FireWave",
.pcm_constraints = firewave_constraints,
.mixer_channels = 6,
.mute_fb_id = 0x01,
.volume_fb_id = 0x02,
@@ -146,7 +153,6 @@ static const struct device_info lacie_speakers = {
.driver_name = "FWSpeakers",
.vendor_name = "LaCie",
.model_name = "FireWire Speakers",
.pcm_constraints = lacie_speakers_constraints,
.mixer_channels = 1,
.mute_fb_id = 0x01,
.volume_fb_id = 0x01,