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()
157 int err; in init_stream() local
186 err = cmp_connection_init(conn, oxfw->unit, c_dir, 0); in init_stream()
187 if (err < 0) in init_stream()
188 return err; in init_stream()
190 err = amdtp_am824_init(stream, oxfw->unit, s_dir, flags); in init_stream()
191 if (err < 0) { in init_stream()
193 return err; in init_stream()
206 int err; in keep_resources() local
218 err = snd_oxfw_stream_get_current_formation(oxfw, dir, &formation); in keep_resources()
219 if (err < 0) in keep_resources()
220 return err; in keep_resources()
228 err = snd_oxfw_stream_parse_format(formats[i], &fmt); in keep_resources()
229 if (err < 0) in keep_resources()
230 return err; in keep_resources()
243 err = amdtp_am824_set_parameters(stream, formation.rate, formation.pcm, in keep_resources()
245 if (err < 0) in keep_resources()
246 return err; in keep_resources()
259 int err; in snd_oxfw_stream_reserve_duplex() local
263 err = check_connection_used_by_others(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_reserve_duplex()
264 if (err < 0) in snd_oxfw_stream_reserve_duplex()
265 return err; in snd_oxfw_stream_reserve_duplex()
267 err = check_connection_used_by_others(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_reserve_duplex()
268 if (err < 0) in snd_oxfw_stream_reserve_duplex()
269 return err; in snd_oxfw_stream_reserve_duplex()
277 err = snd_oxfw_stream_get_current_formation(oxfw, dir, &formation); in snd_oxfw_stream_reserve_duplex()
278 if (err < 0) in snd_oxfw_stream_reserve_duplex()
279 return err; in snd_oxfw_stream_reserve_duplex()
298 err = set_stream_format(oxfw, stream, rate, pcm_channels); in snd_oxfw_stream_reserve_duplex()
299 if (err < 0) { in snd_oxfw_stream_reserve_duplex()
301 "fail to set stream format: %d\n", err); in snd_oxfw_stream_reserve_duplex()
302 return err; in snd_oxfw_stream_reserve_duplex()
305 err = keep_resources(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_reserve_duplex()
306 if (err < 0) in snd_oxfw_stream_reserve_duplex()
307 return err; in snd_oxfw_stream_reserve_duplex()
310 err = keep_resources(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_reserve_duplex()
311 if (err < 0) { in snd_oxfw_stream_reserve_duplex()
313 return err; in snd_oxfw_stream_reserve_duplex()
317 err = amdtp_domain_set_events_per_period(&oxfw->domain, in snd_oxfw_stream_reserve_duplex()
319 if (err < 0) { in snd_oxfw_stream_reserve_duplex()
323 return err; in snd_oxfw_stream_reserve_duplex()
332 int err; in snd_oxfw_stream_start_duplex() local
350 err = start_stream(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_start_duplex()
351 if (err < 0) { in snd_oxfw_stream_start_duplex()
353 "fail to prepare rx stream: %d\n", err); in snd_oxfw_stream_start_duplex()
359 err = start_stream(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_start_duplex()
360 if (err < 0) { in snd_oxfw_stream_start_duplex()
362 "fail to prepare tx stream: %d\n", err); in snd_oxfw_stream_start_duplex()
383 err = amdtp_domain_start(&oxfw->domain, tx_init_skip_cycles, replay_seq, false); in snd_oxfw_stream_start_duplex()
384 if (err < 0) in snd_oxfw_stream_start_duplex()
388 err = -ETIMEDOUT; in snd_oxfw_stream_start_duplex()
401 return err; in snd_oxfw_stream_start_duplex()
434 int err; in snd_oxfw_stream_init_duplex() local
436 err = init_stream(oxfw, &oxfw->rx_stream); in snd_oxfw_stream_init_duplex()
437 if (err < 0) in snd_oxfw_stream_init_duplex()
438 return err; in snd_oxfw_stream_init_duplex()
441 err = init_stream(oxfw, &oxfw->tx_stream); in snd_oxfw_stream_init_duplex()
442 if (err < 0) { in snd_oxfw_stream_init_duplex()
444 return err; in snd_oxfw_stream_init_duplex()
448 err = amdtp_domain_init(&oxfw->domain); in snd_oxfw_stream_init_duplex()
449 if (err < 0) { in snd_oxfw_stream_init_duplex()
455 return err; in snd_oxfw_stream_init_duplex()
491 int err; in snd_oxfw_stream_get_current_formation() local
498 err = avc_stream_get_format_single(oxfw->unit, dir, 0, format, &len); in snd_oxfw_stream_get_current_formation()
499 if (err < 0) in snd_oxfw_stream_get_current_formation()
502 err = -EIO; in snd_oxfw_stream_get_current_formation()
506 err = snd_oxfw_stream_parse_format(format, formation); in snd_oxfw_stream_get_current_formation()
509 return err; in snd_oxfw_stream_get_current_formation()
601 int err; in assume_stream_formats() local
604 err = avc_stream_get_format_single(oxfw->unit, dir, pid, buf, len); in assume_stream_formats()
605 if (err < 0) { in assume_stream_formats()
609 pid, err); in assume_stream_formats()
615 err = snd_oxfw_stream_parse_format(buf, &formation); in assume_stream_formats()
616 if (err < 0) in assume_stream_formats()
622 err = -ENOMEM; in assume_stream_formats()
631 err = avc_general_inquiry_sig_fmt(oxfw->unit, in assume_stream_formats()
634 if (err < 0) in assume_stream_formats()
641 err = -ENOMEM; in assume_stream_formats()
647 err = 0; in assume_stream_formats()
650 return err; in assume_stream_formats()
660 int err; in fill_stream_formats() local
673 err = avc_stream_get_format_list(oxfw->unit, dir, 0, buf, &len, 0); in fill_stream_formats()
674 if (err == -ENXIO) { in fill_stream_formats()
677 err = assume_stream_formats(oxfw, dir, pid, buf, &len, in fill_stream_formats()
680 } else if (err < 0) { in fill_stream_formats()
684 pid, err); in fill_stream_formats()
692 err = -EIO; in fill_stream_formats()
697 err = snd_oxfw_stream_parse_format(buf, &dummy); in fill_stream_formats()
698 if (err < 0) in fill_stream_formats()
704 err = -ENOMEM; in fill_stream_formats()
710 err = avc_stream_get_format_list(oxfw->unit, dir, 0, in fill_stream_formats()
713 if (err == -EINVAL) { in fill_stream_formats()
714 err = 0; in fill_stream_formats()
716 } else if (err < 0) { in fill_stream_formats()
721 pid, err); in fill_stream_formats()
727 return err; in fill_stream_formats()
736 int err; in snd_oxfw_stream_discover() local
739 err = avc_general_get_plug_info(oxfw->unit, 0x1f, 0x07, 0x00, plugs); in snd_oxfw_stream_discover()
740 if (err < 0) { in snd_oxfw_stream_discover()
743 err); in snd_oxfw_stream_discover()
746 err = -ENXIO; in snd_oxfw_stream_discover()
752 err = fill_stream_formats(oxfw, AVC_GENERAL_PLUG_DIR_OUT, 0); in snd_oxfw_stream_discover()
753 if (err < 0) { in snd_oxfw_stream_discover()
754 if (err != -ENXIO) in snd_oxfw_stream_discover()
755 return err; in snd_oxfw_stream_discover()
758 err = 0; in snd_oxfw_stream_discover()
764 err = snd_oxfw_stream_parse_format(format, in snd_oxfw_stream_discover()
766 if (err < 0) in snd_oxfw_stream_discover()
780 err = fill_stream_formats(oxfw, AVC_GENERAL_PLUG_DIR_IN, 0); in snd_oxfw_stream_discover()
781 if (err < 0) { in snd_oxfw_stream_discover()
782 if (err != -ENXIO) in snd_oxfw_stream_discover()
783 return err; in snd_oxfw_stream_discover()
786 err = 0; in snd_oxfw_stream_discover()
792 err = snd_oxfw_stream_parse_format(format, in snd_oxfw_stream_discover()
794 if (err < 0) in snd_oxfw_stream_discover()
806 return err; in snd_oxfw_stream_discover()
817 int err; in snd_oxfw_stream_lock_try() local
823 err = -EBUSY; in snd_oxfw_stream_lock_try()
830 err = 0; in snd_oxfw_stream_lock_try()
833 return err; in snd_oxfw_stream_lock_try()