summaryrefslogtreecommitdiff
path: root/sound/firewire/motu/motu-register-dsp-message-parser.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2021-10-15 11:08:24 +0300
committerTakashi Iwai <tiwai@suse.de>2021-10-15 18:52:15 +0300
commitca15a09ccc5bd2731c5fcb667e6ea3bbbf8f5772 (patch)
treeb8d001f21f86125a1fc33ef1a3276059036a54fd /sound/firewire/motu/motu-register-dsp-message-parser.c
parent7d843c494a9b69d07bc0588124599e3f665a1496 (diff)
downloadlinux-ca15a09ccc5bd2731c5fcb667e6ea3bbbf8f5772.tar.xz
ALSA: firewire-motu: add ioctl command to read cached parameters in register DSP model
This patch adds new ioctl command for userspace applications to read cached parameters of register DSP. The structured data includes model-dependent parameters. Userspace application should be carefully programmed so that what parameter is common and specific. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20211015080826.34847-10-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu-register-dsp-message-parser.c')
-rw-r--r--sound/firewire/motu/motu-register-dsp-message-parser.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/firewire/motu/motu-register-dsp-message-parser.c b/sound/firewire/motu/motu-register-dsp-message-parser.c
index d94ca4875714..ed9fd0cef200 100644
--- a/sound/firewire/motu/motu-register-dsp-message-parser.c
+++ b/sound/firewire/motu/motu-register-dsp-message-parser.c
@@ -299,3 +299,14 @@ void snd_motu_register_dsp_message_parser_copy_meter(struct snd_motu *motu,
memcpy(meter, &parser->meter, sizeof(*meter));
spin_unlock_irqrestore(&parser->lock, flags);
}
+
+void snd_motu_register_dsp_message_parser_copy_parameter(struct snd_motu *motu,
+ struct snd_firewire_motu_register_dsp_parameter *param)
+{
+ struct msg_parser *parser = motu->message_parser;
+ unsigned long flags;
+
+ spin_lock_irqsave(&parser->lock, flags);
+ memcpy(param, &parser->param, sizeof(*param));
+ spin_unlock_irqrestore(&parser->lock, flags);
+}