summaryrefslogtreecommitdiff
path: root/sound/firewire/oxfw/oxfw.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-12-09 00:10:42 +0900
committerTakashi Iwai <tiwai@suse.de>2014-12-10 10:47:37 +0100
commit5cd1d3f47a6321612a51ab88ffe8ef65120fcbe0 (patch)
treef2f537e9ec9185754441c37f7896788a76795312 /sound/firewire/oxfw/oxfw.c
parent5b59d8098d2a3fa8ea4ad07b96f62c00c3b3e8d3 (diff)
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>
Diffstat (limited to 'sound/firewire/oxfw/oxfw.c')
-rw-r--r--sound/firewire/oxfw/oxfw.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index dd576bf61c37..a8f9062b2884 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -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,