linux/sound/firewire/motu
Takashi Sakamoto 407359d44e ALSA: firewire-motu: export meter information to userspace as float value
In command DSP models, one meter information consists of 4 bytes for
IEEE 764 floating point (binary32). In previous patch, it is exported
to userspace as 32 bit storage since the storage is also handled in
ALSA firewire-motu driver as well in kernel space in which floating point
arithmetic is not preferable. On the other hand, ALSA firewire-motu driver
doesn't perform floating point calculation. The driver just gather meter
information from isochronous packets and fill structure fields for
userspace.

In 'header' target of Kbuild, UAPI headers are processed before installed.
In this timing, #ifdef macro with __KERNEL__ is removed. This mechanism
is useful in the case so that the 32 bit storage can be accessible as u32
type in kernel space and float type in user space. We can see the same
usage in ''struct acct_v3' in 'include/uapi/linux/acct.h'.

This commit is for the above idea. Additionally, due to message
protocol, meter information is filled with 0xffffffff in the end of
period but 0xffffffff is invalid as binary32. To avoid confusion in
userspace application, the last two elements are left without any
assignment.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20211027125529.54295-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-28 09:10:41 +02:00
..
amdtp-motu-trace.h ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
amdtp-motu.c ALSA: firewire-motu: add message parser for meter information in command DSP model 2021-10-15 17:52:07 +02:00
Makefile ALSA: firewire-motu: add message parser for meter information in command DSP model 2021-10-15 17:52:07 +02:00
motu-command-dsp-message-parser.c ALSA: firewire-motu: export meter information to userspace as float value 2021-10-28 09:10:41 +02:00
motu-hwdep.c ALSA: firewire-motu: fix null pointer dereference when polling hwdep character device 2021-10-28 09:10:33 +02:00
motu-midi.c ALSA: firewire-motu: share PCM buffer size for both direction 2019-10-18 04:35:51 +02:00
motu-pcm.c ALSA: firewire-motu: use table-based calculation of packet formats for proc 2020-05-22 16:52:16 +02:00
motu-proc.c ALSA: firewire-motu: use table-based calculation of packet formats for proc 2020-05-22 16:52:16 +02:00
motu-protocol-v1.c ALSA: firewire-motu: fix register handling for 896 2021-06-23 10:17:29 +02:00
motu-protocol-v2.c ALSA: firewire-motu: add message parser to gather meter information in register DSP model 2021-10-15 17:52:05 +02:00
motu-protocol-v3.c ALSA: firewire-motu: add message parser for meter information in command DSP model 2021-10-15 17:52:07 +02:00
motu-register-dsp-message-parser.c ALSA: firewire-motu: refine parser for meter information in register DSP models 2021-10-28 09:10:34 +02:00
motu-stream.c ALSA: firewire-motu: add message parser for meter information in command DSP model 2021-10-15 17:52:07 +02:00
motu-transaction.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345 2019-06-05 17:37:08 +02:00
motu.c ALSA: firewire-motu: add message parser for meter information in command DSP model 2021-10-15 17:52:07 +02:00
motu.h ALSA: firewire-motu: notify event for parameter change in register DSP model 2021-10-15 17:52:19 +02:00