diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-12-16 11:32:29 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-12-16 12:18:23 +0300 |
commit | d4a0b6cbf26ce7c22bcb070595957590736fec85 (patch) | |
tree | 01b3b3a506d9176c57cb5e8e72623a54d3626967 /sound/firewire/fireface/ff-protocol-ff400.c | |
parent | 3d16200a3e55a39caa1c88419cb559c00316f721 (diff) | |
download | linux-d4a0b6cbf26ce7c22bcb070595957590736fec85.tar.xz |
ALSA: fireface: share helper function to switch fetching mode
Both of Fireface 400/800 have the same register to switch frame fetching
mode regardless of difference of available number of PCM frames in
rx isochronous packet.
This commit moves a helper function from model-dependent implementation.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface/ff-protocol-ff400.c')
-rw-r--r-- | sound/firewire/fireface/ff-protocol-ff400.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/sound/firewire/fireface/ff-protocol-ff400.c b/sound/firewire/fireface/ff-protocol-ff400.c index fd257051d4a4..374009545936 100644 --- a/sound/firewire/fireface/ff-protocol-ff400.c +++ b/sound/firewire/fireface/ff-protocol-ff400.c @@ -76,35 +76,6 @@ static void ff400_finish_session(struct snd_ff *ff) FF400_ISOC_COMM_STOP, ®, sizeof(reg), 0); } -static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable) -{ - __le32 *reg; - int i; - int err; - - reg = kcalloc(18, sizeof(__le32), GFP_KERNEL); - if (reg == NULL) - return -ENOMEM; - - if (!enable) { - /* - * Each quadlet is corresponding to data channels in a data - * blocks in reverse order. Precisely, quadlets for available - * data channels should be enabled. Here, I take second best - * to fetch PCM frames from all of data channels regardless of - * stf. - */ - for (i = 0; i < 18; ++i) - reg[i] = cpu_to_le32(0x00000001); - } - - err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, - SND_FF_REG_FETCH_PCM_FRAMES, reg, - sizeof(__le32) * 18, 0); - kfree(reg); - return err; -} - static void ff400_handle_midi_msg(struct snd_ff *ff, __le32 *buf, size_t length) { int i; @@ -146,5 +117,4 @@ const struct snd_ff_protocol snd_ff_protocol_ff400 = { .handle_midi_msg = ff400_handle_midi_msg, .begin_session = ff400_begin_session, .finish_session = ff400_finish_session, - .switch_fetching_mode = ff400_switch_fetching_mode, }; |