Lines Matching refs:parser
103 struct msg_parser *parser; in snd_motu_register_dsp_message_parser_new() local
104 parser = devm_kzalloc(&motu->card->card_dev, sizeof(*parser), GFP_KERNEL); in snd_motu_register_dsp_message_parser_new()
105 if (!parser) in snd_motu_register_dsp_message_parser_new()
107 spin_lock_init(&parser->lock); in snd_motu_register_dsp_message_parser_new()
109 parser->meter_pos_quirk = true; in snd_motu_register_dsp_message_parser_new()
110 motu->message_parser = parser; in snd_motu_register_dsp_message_parser_new()
116 struct msg_parser *parser = motu->message_parser; in snd_motu_register_dsp_message_parser_init() local
118 parser->prev_mixer_src_type = INVALID; in snd_motu_register_dsp_message_parser_init()
119 parser->mixer_ch = 0xff; in snd_motu_register_dsp_message_parser_init()
120 parser->mixer_src_ch = 0xff; in snd_motu_register_dsp_message_parser_init()
121 parser->prev_msg_type = INVALID; in snd_motu_register_dsp_message_parser_init()
129 struct msg_parser *parser = motu->message_parser; in queue_event() local
130 unsigned int pos = parser->push_pos; in queue_event()
137 parser->event_queue[pos] = entry; in queue_event()
142 parser->push_pos = pos; in queue_event()
150 struct msg_parser *parser = motu->message_parser; in snd_motu_register_dsp_message_parser_parse() local
151 bool meter_pos_quirk = parser->meter_pos_quirk; in snd_motu_register_dsp_message_parser_parse()
152 unsigned int pos = parser->push_pos; in snd_motu_register_dsp_message_parser_parse()
156 spin_lock_irqsave(&parser->lock, flags); in snd_motu_register_dsp_message_parser_parse()
177 parser->mixer_src_ch = 0; in snd_motu_register_dsp_message_parser_parse()
178 parser->mixer_ch = mixer_ch; in snd_motu_register_dsp_message_parser_parse()
188 struct snd_firewire_motu_register_dsp_parameter *param = &parser->param; in snd_motu_register_dsp_message_parser_parse()
189 u8 mixer_ch = parser->mixer_ch; in snd_motu_register_dsp_message_parser_parse()
190 u8 mixer_src_ch = parser->mixer_src_ch; in snd_motu_register_dsp_message_parser_parse()
192 if (msg_type != parser->prev_mixer_src_type) in snd_motu_register_dsp_message_parser_parse()
196 parser->prev_mixer_src_type = msg_type; in snd_motu_register_dsp_message_parser_parse()
200 u8 mixer_ch = parser->mixer_ch; in snd_motu_register_dsp_message_parser_parse()
237 parser->mixer_src_ch = mixer_src_ch; in snd_motu_register_dsp_message_parser_parse()
244 struct snd_firewire_motu_register_dsp_parameter *param = &parser->param; in snd_motu_register_dsp_message_parser_parse()
245 u8 mixer_ch = parser->mixer_ch; in snd_motu_register_dsp_message_parser_parse()
268 if (parser->param.output.main_paired_volume != val) { in snd_motu_register_dsp_message_parser_parse()
270 parser->param.output.main_paired_volume = val; in snd_motu_register_dsp_message_parser_parse()
274 if (parser->param.output.hp_paired_volume != val) { in snd_motu_register_dsp_message_parser_parse()
276 parser->param.output.hp_paired_volume = val; in snd_motu_register_dsp_message_parser_parse()
280 if (parser->param.output.hp_paired_assignment != val) { in snd_motu_register_dsp_message_parser_parse()
282 parser->param.output.hp_paired_assignment = val; in snd_motu_register_dsp_message_parser_parse()
286 if (parser->param.line_input.boost_flag != val) { in snd_motu_register_dsp_message_parser_parse()
288 parser->param.line_input.boost_flag = val; in snd_motu_register_dsp_message_parser_parse()
292 if (parser->param.line_input.nominal_level_flag != val) { in snd_motu_register_dsp_message_parser_parse()
294 parser->param.line_input.nominal_level_flag = val; in snd_motu_register_dsp_message_parser_parse()
300 struct snd_firewire_motu_register_dsp_parameter *param = &parser->param; in snd_motu_register_dsp_message_parser_parse()
301 u8 input_ch = parser->input_ch; in snd_motu_register_dsp_message_parser_parse()
303 if (parser->prev_msg_type != msg_type) in snd_motu_register_dsp_message_parser_parse()
325 parser->input_ch = input_ch; in snd_motu_register_dsp_message_parser_parse()
342 parser->meter.data[pos] = val; in snd_motu_register_dsp_message_parser_parse()
347 parser->meter.data[pos] = val; in snd_motu_register_dsp_message_parser_parse()
360 parser->prev_msg_type = msg_type; in snd_motu_register_dsp_message_parser_parse()
364 if (pos != parser->push_pos) in snd_motu_register_dsp_message_parser_parse()
367 spin_unlock_irqrestore(&parser->lock, flags); in snd_motu_register_dsp_message_parser_parse()
373 struct msg_parser *parser = motu->message_parser; in snd_motu_register_dsp_message_parser_copy_meter() local
376 spin_lock_irqsave(&parser->lock, flags); in snd_motu_register_dsp_message_parser_copy_meter()
377 memcpy(meter, &parser->meter, sizeof(*meter)); in snd_motu_register_dsp_message_parser_copy_meter()
378 spin_unlock_irqrestore(&parser->lock, flags); in snd_motu_register_dsp_message_parser_copy_meter()
384 struct msg_parser *parser = motu->message_parser; in snd_motu_register_dsp_message_parser_copy_parameter() local
387 spin_lock_irqsave(&parser->lock, flags); in snd_motu_register_dsp_message_parser_copy_parameter()
388 memcpy(param, &parser->param, sizeof(*param)); in snd_motu_register_dsp_message_parser_copy_parameter()
389 spin_unlock_irqrestore(&parser->lock, flags); in snd_motu_register_dsp_message_parser_copy_parameter()
394 struct msg_parser *parser = motu->message_parser; in snd_motu_register_dsp_message_parser_count_event() local
396 if (parser->pull_pos > parser->push_pos) in snd_motu_register_dsp_message_parser_count_event()
397 return EVENT_QUEUE_SIZE - parser->pull_pos + parser->push_pos; in snd_motu_register_dsp_message_parser_count_event()
399 return parser->push_pos - parser->pull_pos; in snd_motu_register_dsp_message_parser_count_event()
404 struct msg_parser *parser = motu->message_parser; in snd_motu_register_dsp_message_parser_copy_event() local
405 unsigned int pos = parser->pull_pos; in snd_motu_register_dsp_message_parser_copy_event()
408 if (pos == parser->push_pos) in snd_motu_register_dsp_message_parser_copy_event()
411 spin_lock_irqsave(&parser->lock, flags); in snd_motu_register_dsp_message_parser_copy_event()
413 *event = parser->event_queue[pos]; in snd_motu_register_dsp_message_parser_copy_event()
418 parser->pull_pos = pos; in snd_motu_register_dsp_message_parser_copy_event()
420 spin_unlock_irqrestore(&parser->lock, flags); in snd_motu_register_dsp_message_parser_copy_event()