aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireface
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-07-22 12:37:03 +0900
committerTakashi Iwai <tiwai@suse.de>2019-07-22 16:05:06 +0200
commitd2c104a3426be9991b35c65f0f260a107c4b2942 (patch)
treefd9255ce06b2dc7149051fc03b1050154c18e85d /sound/firewire/fireface
parentALSA: firewire-lib: code refactoring to process context payloads (diff)
downloadlinux-dev-d2c104a3426be9991b35c65f0f260a107c4b2942.tar.xz
linux-dev-d2c104a3426be9991b35c65f0f260a107c4b2942.zip
ALSA: firewire-lib: pass packet descriptor to data block processing layer
This commit changes signature of callback function to call data block processing layer with packet descriptor. At present, the layer is called per packet. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface')
-rw-r--r--sound/firewire/fireface/amdtp-ff.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/firewire/fireface/amdtp-ff.c b/sound/firewire/fireface/amdtp-ff.c
index 31a60dff94ac..c36232fc4d3e 100644
--- a/sound/firewire/fireface/amdtp-ff.c
+++ b/sound/firewire/fireface/amdtp-ff.c
@@ -103,17 +103,18 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
}
static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
- __be32 *buffer, unsigned int data_blocks,
- unsigned int data_block_counter)
+ const struct pkt_desc *desc,
+ struct snd_pcm_substream *pcm)
{
- struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
unsigned int pcm_frames;
if (pcm) {
- write_pcm_s32(s, pcm, (__le32 *)buffer, data_blocks);
- pcm_frames = data_blocks;
+ write_pcm_s32(s, pcm, (__le32 *)desc->ctx_payload,
+ desc->data_blocks);
+ pcm_frames = desc->data_blocks;
} else {
- write_pcm_silence(s, (__le32 *)buffer, data_blocks);
+ write_pcm_silence(s, (__le32 *)desc->ctx_payload,
+ desc->data_blocks);
pcm_frames = 0;
}
@@ -121,15 +122,15 @@ static unsigned int process_rx_data_blocks(struct amdtp_stream *s,
}
static unsigned int process_tx_data_blocks(struct amdtp_stream *s,
- __be32 *buffer, unsigned int data_blocks,
- unsigned int data_block_counter)
+ const struct pkt_desc *desc,
+ struct snd_pcm_substream *pcm)
{
- struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
unsigned int pcm_frames;
if (pcm) {
- read_pcm_s32(s, pcm, (__le32 *)buffer, data_blocks);
- pcm_frames = data_blocks;
+ read_pcm_s32(s, pcm, (__le32 *)desc->ctx_payload,
+ desc->data_blocks);
+ pcm_frames = desc->data_blocks;
} else {
pcm_frames = 0;
}