Lines Matching refs:err

43 	int err;  in set_rate()  local
45 err = avc_general_set_sig_fmt(oxfw->unit, rate, in set_rate()
47 if (err < 0) in set_rate()
51 err = avc_general_set_sig_fmt(oxfw->unit, rate, in set_rate()
54 return err; in set_rate()
64 int i, err; in set_stream_format() local
76 err = snd_oxfw_stream_parse_format(formats[i], &formation); in set_stream_format()
77 if (err < 0) in set_stream_format()
78 return err; in set_stream_format()
93 err = avc_stream_set_format(oxfw->unit, dir, 0, formats[i], len); in set_stream_format()
94 if (err < 0) in set_stream_format()
95 return err; in set_stream_format()
106 int err; in start_stream() local
113 err = cmp_connection_establish(conn); in start_stream()
114 if (err < 0) in start_stream()
115 return err; in start_stream()
117 err = amdtp_domain_add_stream(&oxfw->domain, stream, in start_stream()
119 if (err < 0) { in start_stream()
121 return err; in start_stream()
132 int err; in check_connection_used_by_others() local
139 err = cmp_connection_check_used(conn, &used); in check_connection_used_by_others()
140 if ((err >= 0) && used && !amdtp_stream_running(stream)) { in check_connection_used_by_others()
145 err = -EBUSY; in check_connection_used_by_others()
148 return err; in check_connection_used_by_others()
156 int err; in init_stream() local
168 err = cmp_connection_init(conn, oxfw->unit, c_dir, 0); in init_stream()
169 if (err < 0) in init_stream()
170 return err; in init_stream()
172 err = amdtp_am824_init(stream, oxfw->unit, s_dir, CIP_NONBLOCKING); in init_stream()
173 if (err < 0) { in init_stream()
175 return err; in init_stream()
200 int err; in keep_resources() local
212 err = snd_oxfw_stream_get_current_formation(oxfw, dir, &formation); in keep_resources()
213 if (err < 0) in keep_resources()
214 return err; in keep_resources()
222 err = snd_oxfw_stream_parse_format(formats[i], &fmt); in keep_resources()
223 if (err < 0) in keep_resources()
224 return err; in keep_resources()
237 err = amdtp_am824_set_parameters(stream, formation.rate, formation.pcm, in keep_resources()
239 if (err < 0) in keep_resources()
240 return err; in keep_resources()
253 int err; in snd_oxfw_stream_reserve_duplex() local
257 err = check_connection_used_by_others(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_reserve_duplex()
258 if (err < 0) in snd_oxfw_stream_reserve_duplex()
259 return err; in snd_oxfw_stream_reserve_duplex()
261 err = check_connection_used_by_others(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_reserve_duplex()
262 if (err < 0) in snd_oxfw_stream_reserve_duplex()
263 return err; in snd_oxfw_stream_reserve_duplex()
271 err = snd_oxfw_stream_get_current_formation(oxfw, dir, &formation); in snd_oxfw_stream_reserve_duplex()
272 if (err < 0) in snd_oxfw_stream_reserve_duplex()
273 return err; in snd_oxfw_stream_reserve_duplex()
292 err = set_stream_format(oxfw, stream, rate, pcm_channels); in snd_oxfw_stream_reserve_duplex()
293 if (err < 0) { in snd_oxfw_stream_reserve_duplex()
295 "fail to set stream format: %d\n", err); in snd_oxfw_stream_reserve_duplex()
296 return err; in snd_oxfw_stream_reserve_duplex()
299 err = keep_resources(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_reserve_duplex()
300 if (err < 0) in snd_oxfw_stream_reserve_duplex()
301 return err; in snd_oxfw_stream_reserve_duplex()
304 err = keep_resources(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_reserve_duplex()
305 if (err < 0) { in snd_oxfw_stream_reserve_duplex()
307 return err; in snd_oxfw_stream_reserve_duplex()
311 err = amdtp_domain_set_events_per_period(&oxfw->domain, in snd_oxfw_stream_reserve_duplex()
313 if (err < 0) { in snd_oxfw_stream_reserve_duplex()
317 return err; in snd_oxfw_stream_reserve_duplex()
326 int err; in snd_oxfw_stream_start_duplex() local
341 err = start_stream(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_start_duplex()
342 if (err < 0) { in snd_oxfw_stream_start_duplex()
344 "fail to prepare rx stream: %d\n", err); in snd_oxfw_stream_start_duplex()
350 err = start_stream(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_start_duplex()
351 if (err < 0) { in snd_oxfw_stream_start_duplex()
353 "fail to prepare tx stream: %d\n", err); in snd_oxfw_stream_start_duplex()
358 err = amdtp_domain_start(&oxfw->domain, 0); in snd_oxfw_stream_start_duplex()
359 if (err < 0) in snd_oxfw_stream_start_duplex()
365 err = -ETIMEDOUT; in snd_oxfw_stream_start_duplex()
372 err = -ETIMEDOUT; in snd_oxfw_stream_start_duplex()
386 return err; in snd_oxfw_stream_start_duplex()
419 int err; in snd_oxfw_stream_init_duplex() local
421 err = init_stream(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_init_duplex()
422 if (err < 0) in snd_oxfw_stream_init_duplex()
423 return err; in snd_oxfw_stream_init_duplex()
426 err = init_stream(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_init_duplex()
427 if (err < 0) { in snd_oxfw_stream_init_duplex()
429 return err; in snd_oxfw_stream_init_duplex()
433 err = amdtp_domain_init(&oxfw->domain); in snd_oxfw_stream_init_duplex()
434 if (err < 0) { in snd_oxfw_stream_init_duplex()
440 return err; in snd_oxfw_stream_init_duplex()
476 int err; in snd_oxfw_stream_get_current_formation() local
483 err = avc_stream_get_format_single(oxfw->unit, dir, 0, format, &len); in snd_oxfw_stream_get_current_formation()
484 if (err < 0) in snd_oxfw_stream_get_current_formation()
487 err = -EIO; in snd_oxfw_stream_get_current_formation()
491 err = snd_oxfw_stream_parse_format(format, formation); in snd_oxfw_stream_get_current_formation()
494 return err; in snd_oxfw_stream_get_current_formation()
586 int err; in assume_stream_formats() local
589 err = avc_stream_get_format_single(oxfw->unit, dir, pid, buf, len); in assume_stream_formats()
590 if (err < 0) { in assume_stream_formats()
594 pid, err); in assume_stream_formats()
600 err = snd_oxfw_stream_parse_format(buf, &formation); in assume_stream_formats()
601 if (err < 0) in assume_stream_formats()
607 err = -ENOMEM; in assume_stream_formats()
616 err = avc_general_inquiry_sig_fmt(oxfw->unit, in assume_stream_formats()
619 if (err < 0) in assume_stream_formats()
626 err = -ENOMEM; in assume_stream_formats()
632 err = 0; in assume_stream_formats()
635 return err; in assume_stream_formats()
645 int err; in fill_stream_formats() local
658 err = avc_stream_get_format_list(oxfw->unit, dir, 0, buf, &len, 0); in fill_stream_formats()
659 if (err == -ENXIO) { in fill_stream_formats()
662 err = assume_stream_formats(oxfw, dir, pid, buf, &len, in fill_stream_formats()
665 } else if (err < 0) { in fill_stream_formats()
669 pid, err); in fill_stream_formats()
677 err = -EIO; in fill_stream_formats()
682 err = snd_oxfw_stream_parse_format(buf, &dummy); in fill_stream_formats()
683 if (err < 0) in fill_stream_formats()
689 err = -ENOMEM; in fill_stream_formats()
695 err = avc_stream_get_format_list(oxfw->unit, dir, 0, in fill_stream_formats()
698 if (err == -EINVAL) { in fill_stream_formats()
699 err = 0; in fill_stream_formats()
701 } else if (err < 0) { in fill_stream_formats()
706 pid, err); in fill_stream_formats()
712 return err; in fill_stream_formats()
721 int err; in snd_oxfw_stream_discover() local
724 err = avc_general_get_plug_info(oxfw->unit, 0x1f, 0x07, 0x00, plugs); in snd_oxfw_stream_discover()
725 if (err < 0) { in snd_oxfw_stream_discover()
728 err); in snd_oxfw_stream_discover()
731 err = -ENXIO; in snd_oxfw_stream_discover()
737 err = fill_stream_formats(oxfw, AVC_GENERAL_PLUG_DIR_OUT, 0); in snd_oxfw_stream_discover()
738 if (err < 0) { in snd_oxfw_stream_discover()
739 if (err != -ENXIO) in snd_oxfw_stream_discover()
740 return err; in snd_oxfw_stream_discover()
743 err = 0; in snd_oxfw_stream_discover()
749 err = snd_oxfw_stream_parse_format(format, in snd_oxfw_stream_discover()
751 if (err < 0) in snd_oxfw_stream_discover()
765 err = fill_stream_formats(oxfw, AVC_GENERAL_PLUG_DIR_IN, 0); in snd_oxfw_stream_discover()
766 if (err < 0) { in snd_oxfw_stream_discover()
767 if (err != -ENXIO) in snd_oxfw_stream_discover()
768 return err; in snd_oxfw_stream_discover()
771 err = 0; in snd_oxfw_stream_discover()
777 err = snd_oxfw_stream_parse_format(format, in snd_oxfw_stream_discover()
779 if (err < 0) in snd_oxfw_stream_discover()
791 return err; in snd_oxfw_stream_discover()
802 int err; in snd_oxfw_stream_lock_try() local
808 err = -EBUSY; in snd_oxfw_stream_lock_try()
815 err = 0; in snd_oxfw_stream_lock_try()
818 return err; in snd_oxfw_stream_lock_try()