Lines Matching +full:output +full:- +full:specific

1 // SPDX-License-Identifier: GPL-2.0-only
3 // motu-register-dsp-message-parser.c - a part of driver for MOTU FireWire series
5 // Copyright (c) 2021 Takashi Sakamoto <o-takashi@sakamocchi.jp>
60 // Specific to 828mk2, 896hd, Traveler.
62 // Specific to 828mk2, Traveler, and 896hd (not functional).
64 // Specific to 828mk2, Traveler, and 896hd (not functional).
66 // Specific to Ultralite, 4 pre, Audio express, and 8 pre (not functional).
68 // Specific to 4 pre, and Audio express.
70 // Specific to 4 pre, and Audio express.
72 // Specific to 4 pre, and Audio express.
104 parser = devm_kzalloc(&motu->card->card_dev, sizeof(*parser), GFP_KERNEL);
106 return -ENOMEM;
107 spin_lock_init(&parser->lock);
108 if (motu->spec == &snd_motu_spec_4pre || motu->spec == &snd_motu_spec_audio_express)
109 parser->meter_pos_quirk = true;
110 motu->message_parser = parser;
116 struct msg_parser *parser = motu->message_parser;
118 parser->prev_mixer_src_type = INVALID;
119 parser->mixer_ch = 0xff;
120 parser->mixer_src_ch = 0xff;
121 parser->prev_msg_type = INVALID;
129 struct msg_parser *parser = motu->message_parser;
130 unsigned int pos = parser->push_pos;
133 if (!motu->hwdep || motu->hwdep->used == 0)
137 parser->event_queue[pos] = entry;
142 parser->push_pos = pos;
149 unsigned int data_block_quadlets = s->data_block_quadlets;
150 struct msg_parser *parser = motu->message_parser;
151 bool meter_pos_quirk = parser->meter_pos_quirk;
152 unsigned int pos = parser->push_pos;
155 guard(spinlock_irqsave)(&parser->lock);
158 __be32 *buffer = desc->ctx_payload;
159 unsigned int data_blocks = desc->data_blocks;
176 parser->mixer_src_ch = 0;
177 parser->mixer_ch = mixer_ch;
187 struct snd_firewire_motu_register_dsp_parameter *param = &parser->param;
188 u8 mixer_ch = parser->mixer_ch;
189 u8 mixer_src_ch = parser->mixer_src_ch;
191 if (msg_type != parser->prev_mixer_src_type)
195 parser->prev_mixer_src_type = msg_type;
199 u8 mixer_ch = parser->mixer_ch;
203 if (param->mixer.source[mixer_ch].gain[mixer_src_ch] != val) {
205 param->mixer.source[mixer_ch].gain[mixer_src_ch] = val;
209 if (param->mixer.source[mixer_ch].pan[mixer_src_ch] != val) {
211 param->mixer.source[mixer_ch].pan[mixer_src_ch] = val;
215 if (param->mixer.source[mixer_ch].flag[mixer_src_ch] != val) {
217 param->mixer.source[mixer_ch].flag[mixer_src_ch] = val;
221 if (param->mixer.source[mixer_ch].paired_balance[mixer_src_ch] != val) {
223 param->mixer.source[mixer_ch].paired_balance[mixer_src_ch] = val;
227 if (param->mixer.source[mixer_ch].paired_width[mixer_src_ch] != val) {
229 param->mixer.source[mixer_ch].paired_width[mixer_src_ch] = val;
236 parser->mixer_src_ch = mixer_src_ch;
243 struct snd_firewire_motu_register_dsp_parameter *param = &parser->param;
244 u8 mixer_ch = parser->mixer_ch;
249 if (param->mixer.output.paired_volume[mixer_ch] != val) {
251 param->mixer.output.paired_volume[mixer_ch] = val;
255 if (param->mixer.output.paired_flag[mixer_ch] != val) {
257 param->mixer.output.paired_flag[mixer_ch] = val;
267 if (parser->param.output.main_paired_volume != val) {
269 parser->param.output.main_paired_volume = val;
273 if (parser->param.output.hp_paired_volume != val) {
275 parser->param.output.hp_paired_volume = val;
279 if (parser->param.output.hp_paired_assignment != val) {
281 parser->param.output.hp_paired_assignment = val;
285 if (parser->param.line_input.boost_flag != val) {
287 parser->param.line_input.boost_flag = val;
291 if (parser->param.line_input.nominal_level_flag != val) {
293 parser->param.line_input.nominal_level_flag = val;
299 struct snd_firewire_motu_register_dsp_parameter *param = &parser->param;
300 u8 input_ch = parser->input_ch;
302 if (parser->prev_msg_type != msg_type)
310 if (param->input.gain_and_invert[input_ch] != val) {
312 param->input.gain_and_invert[input_ch] = val;
316 if (param->input.flag[input_ch] != val) {
318 param->input.flag[input_ch] = val;
324 parser->input_ch = input_ch;
341 parser->meter.data[pos] = val;
343 pos -= (0x80 - SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_INPUT_COUNT);
346 parser->meter.data[pos] = val;
359 parser->prev_msg_type = msg_type;
363 if (pos != parser->push_pos)
364 wake_up(&motu->hwdep_wait);
370 struct msg_parser *parser = motu->message_parser;
372 guard(spinlock_irqsave)(&parser->lock);
373 memcpy(meter, &parser->meter, sizeof(*meter));
379 struct msg_parser *parser = motu->message_parser;
381 guard(spinlock_irqsave)(&parser->lock);
382 memcpy(param, &parser->param, sizeof(*param));
387 struct msg_parser *parser = motu->message_parser;
389 if (parser->pull_pos > parser->push_pos)
390 return EVENT_QUEUE_SIZE - parser->pull_pos + parser->push_pos;
392 return parser->push_pos - parser->pull_pos;
397 struct msg_parser *parser = motu->message_parser;
398 unsigned int pos = parser->pull_pos;
400 if (pos == parser->push_pos)
403 guard(spinlock_irqsave)(&parser->lock);
405 *event = parser->event_queue[pos];
410 parser->pull_pos = pos;