]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: More unification of PCM transfer codes
authorTakashi Iwai <tiwai@suse.de>
Wed, 24 May 2017 16:15:26 +0000 (18:15 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Jun 2017 17:38:22 +0000 (19:38 +0200)
commit04d999e0746a7c6f4df728f2bbb0e2e9419d618c
tree780af35592fc93b2e600c13b661a37ed0e5e7923
parent0af94671581563fae4f400b7aefe2e5d82a69bf3
ALSA: pcm: More unification of PCM transfer codes

This patch proceeds more abstraction of PCM read/write loop codes.

For both interleaved and non-interleaved transfers, the same copy or
silence transfer code (which is defined as pcm_transfer_f) is used
now.  This became possible since we switched to byte size to copy_*
and fill_silence ops argument instead of frames.

And, for both read and write, we can use the same copy function (which
is defined as pcm_copy_f), just depending on whether interleaved or
non-interleaved mode.

The transfer function is determined at the beginning of the loop,
depending on whether the driver gives the specific copy ops or it's
the standard read/write.

Another bonus by this change is that we now guarantee the silencing
behavior when NULL buffer is passed to write helpers.  It'll simplify
some codes later.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_lib.c