[PATCH 05/11] ALSA: firewire-motu: parse messages for mixer output parameters in register DSP model

Takashi Sakamoto o-takashi at sakamocchi.jp
Fri Oct 15 10:08:20 CEST 2021


This commit parses message and cache current parameters of mixer output
function, commonly available for all of register DSP model

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 include/uapi/sound/firewire.h                 |  6 ++++++
 .../motu/motu-register-dsp-message-parser.c   | 20 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/include/uapi/sound/firewire.h b/include/uapi/sound/firewire.h
index bb5ecff73896..f663a26c5205 100644
--- a/include/uapi/sound/firewire.h
+++ b/include/uapi/sound/firewire.h
@@ -158,6 +158,8 @@ struct snd_firewire_motu_register_dsp_meter {
  *				 Audio Express.
  * @mixer.source.paired_width: The width of paired source to mixer, only for 4 pre and
  *			       Audio Express.
+ * @mixer.output.paired_volume: The volume of paired output from mixer.
+ * @mixer.output.paired_flag: The flag of paired output from mixer.
  *
  * The structure expresses the set of parameters for DSP controlled by register access.
  */
@@ -170,6 +172,10 @@ struct snd_firewire_motu_register_dsp_parameter {
 			__u8 paired_balance[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
 			__u8 paired_width[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
 		} source[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
+		struct {
+			__u8 paired_volume[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
+			__u8 paired_flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
+		} output;
 	} mixer;
 };
 
diff --git a/sound/firewire/motu/motu-register-dsp-message-parser.c b/sound/firewire/motu/motu-register-dsp-message-parser.c
index 6df40e5ee9db..867cb09a3521 100644
--- a/sound/firewire/motu/motu-register-dsp-message-parser.c
+++ b/sound/firewire/motu/motu-register-dsp-message-parser.c
@@ -190,6 +190,26 @@ void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const str
 				}
 				break;
 			}
+			case MIXER_OUTPUT_PAIRED_VOLUME:
+			case MIXER_OUTPUT_PAIRED_FLAG:
+			{
+				struct snd_firewire_motu_register_dsp_parameter *param = &parser->param;
+				u8 mixer_ch = parser->mixer_ch;
+
+				if (mixer_ch < SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT) {
+					switch (msg_type) {
+					case MIXER_OUTPUT_PAIRED_VOLUME:
+						param->mixer.output.paired_volume[mixer_ch] = val;
+						break;
+					case MIXER_OUTPUT_PAIRED_FLAG:
+						param->mixer.output.paired_flag[mixer_ch] = val;
+						break;
+					default:
+						break;
+					}
+				}
+				break;
+			}
 			case METER:
 			{
 				u8 pos;
-- 
2.30.2



More information about the Alsa-devel mailing list