diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-10-22 04:02:57 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-10-22 04:02:57 -0400 |
commit | 861e66d3418a90f57b31a50110fc70b23569c551 (patch) | |
tree | ffa0d5bf8dc3e4b82b88d8942390a11d827423f9 /sound/firewire/speakers.c | |
parent | b55447a7301b12d509df4b2909ed38d125ad83d4 (diff) | |
parent | b20be8de1b3972ccf9af72850b045214faa8d830 (diff) |
Merge branch 'dice-driver-playback-only' of git://git.alsa-project.org/alsa-kprivate into for-next
Diffstat (limited to 'sound/firewire/speakers.c')
-rw-r--r-- | sound/firewire/speakers.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/firewire/speakers.c b/sound/firewire/speakers.c index fe9e6e2f2c5b..cc8bc3a51bc1 100644 --- a/sound/firewire/speakers.c +++ b/sound/firewire/speakers.c | |||
@@ -52,7 +52,6 @@ struct fwspk { | |||
52 | struct mutex mutex; | 52 | struct mutex mutex; |
53 | struct cmp_connection connection; | 53 | struct cmp_connection connection; |
54 | struct amdtp_out_stream stream; | 54 | struct amdtp_out_stream stream; |
55 | bool stream_running; | ||
56 | bool mute; | 55 | bool mute; |
57 | s16 volume[6]; | 56 | s16 volume[6]; |
58 | s16 volume_min; | 57 | s16 volume_min; |
@@ -188,10 +187,9 @@ static int fwspk_close(struct snd_pcm_substream *substream) | |||
188 | 187 | ||
189 | static void fwspk_stop_stream(struct fwspk *fwspk) | 188 | static void fwspk_stop_stream(struct fwspk *fwspk) |
190 | { | 189 | { |
191 | if (fwspk->stream_running) { | 190 | if (amdtp_out_stream_running(&fwspk->stream)) { |
192 | amdtp_out_stream_stop(&fwspk->stream); | 191 | amdtp_out_stream_stop(&fwspk->stream); |
193 | cmp_connection_break(&fwspk->connection); | 192 | cmp_connection_break(&fwspk->connection); |
194 | fwspk->stream_running = false; | ||
195 | } | 193 | } |
196 | } | 194 | } |
197 | 195 | ||
@@ -246,8 +244,10 @@ static int fwspk_hw_params(struct snd_pcm_substream *substream, | |||
246 | if (err < 0) | 244 | if (err < 0) |
247 | goto error; | 245 | goto error; |
248 | 246 | ||
249 | amdtp_out_stream_set_rate(&fwspk->stream, params_rate(hw_params)); | 247 | amdtp_out_stream_set_parameters(&fwspk->stream, |
250 | amdtp_out_stream_set_pcm(&fwspk->stream, params_channels(hw_params)); | 248 | params_rate(hw_params), |
249 | params_channels(hw_params), | ||
250 | 0); | ||
251 | 251 | ||
252 | amdtp_out_stream_set_pcm_format(&fwspk->stream, | 252 | amdtp_out_stream_set_pcm_format(&fwspk->stream, |
253 | params_format(hw_params)); | 253 | params_format(hw_params)); |
@@ -285,7 +285,7 @@ static int fwspk_prepare(struct snd_pcm_substream *substream) | |||
285 | if (amdtp_out_streaming_error(&fwspk->stream)) | 285 | if (amdtp_out_streaming_error(&fwspk->stream)) |
286 | fwspk_stop_stream(fwspk); | 286 | fwspk_stop_stream(fwspk); |
287 | 287 | ||
288 | if (!fwspk->stream_running) { | 288 | if (!amdtp_out_stream_running(&fwspk->stream)) { |
289 | err = cmp_connection_establish(&fwspk->connection, | 289 | err = cmp_connection_establish(&fwspk->connection, |
290 | amdtp_out_stream_get_max_payload(&fwspk->stream)); | 290 | amdtp_out_stream_get_max_payload(&fwspk->stream)); |
291 | if (err < 0) | 291 | if (err < 0) |
@@ -296,8 +296,6 @@ static int fwspk_prepare(struct snd_pcm_substream *substream) | |||
296 | fwspk->connection.speed); | 296 | fwspk->connection.speed); |
297 | if (err < 0) | 297 | if (err < 0) |
298 | goto err_connection; | 298 | goto err_connection; |
299 | |||
300 | fwspk->stream_running = true; | ||
301 | } | 299 | } |
302 | 300 | ||
303 | mutex_unlock(&fwspk->mutex); | 301 | mutex_unlock(&fwspk->mutex); |
@@ -647,7 +645,7 @@ static u32 fwspk_read_firmware_version(struct fw_unit *unit) | |||
647 | int err; | 645 | int err; |
648 | 646 | ||
649 | err = snd_fw_transaction(unit, TCODE_READ_QUADLET_REQUEST, | 647 | err = snd_fw_transaction(unit, TCODE_READ_QUADLET_REQUEST, |
650 | OXFORD_FIRMWARE_ID_ADDRESS, &data, 4); | 648 | OXFORD_FIRMWARE_ID_ADDRESS, &data, 4, 0); |
651 | return err >= 0 ? be32_to_cpu(data) : 0; | 649 | return err >= 0 ? be32_to_cpu(data) : 0; |
652 | } | 650 | } |
653 | 651 | ||