diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2021-06-11 05:50:03 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-11 10:30:16 +0200 |
commit | 93cd12d6e88a4c6f9204633ff07781cde741e89e (patch) | |
tree | a644f20b83b2adf7928d18101ca6b53fc9a4833b /sound/firewire/bebob/bebob_stream.c | |
parent | ALSA: bebob: delete workaround for protocol version 3 (diff) | |
download | linux-93cd12d6e88a4c6f9204633ff07781cde741e89e.tar.xz linux-93cd12d6e88a4c6f9204633ff07781cde741e89e.zip |
ALSA: bebob: code refactoring for model-dependent quirks
This commit adds enumeration and structure member as code refactoring
regarding to model-dependent quirks.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210611035003.26852-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to '')
-rw-r--r-- | sound/firewire/bebob/bebob_stream.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 02972b32e170..e3e23e42add3 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -430,6 +430,7 @@ static int start_stream(struct snd_bebob *bebob, struct amdtp_stream *stream) static int init_stream(struct snd_bebob *bebob, struct amdtp_stream *stream) { + unsigned int flags = CIP_BLOCKING; enum amdtp_stream_direction dir_stream; struct cmp_connection *conn; enum cmp_direction dir_conn; @@ -445,24 +446,21 @@ static int init_stream(struct snd_bebob *bebob, struct amdtp_stream *stream) dir_conn = CMP_INPUT; } + if (stream == &bebob->tx_stream) { + if (bebob->quirks & SND_BEBOB_QUIRK_WRONG_DBC) + flags |= CIP_EMPTY_HAS_WRONG_DBC; + } + err = cmp_connection_init(conn, bebob->unit, dir_conn, 0); if (err < 0) return err; - err = amdtp_am824_init(stream, bebob->unit, dir_stream, CIP_BLOCKING); + err = amdtp_am824_init(stream, bebob->unit, dir_stream, flags); if (err < 0) { cmp_connection_destroy(conn); return err; } - if (stream == &bebob->tx_stream) { - // At high sampling rate, M-Audio special firmware transmits - // empty packet with the value of dbc incremented by 8 but the - // others are valid to IEC 61883-1. - if (bebob->maudio_special_quirk) - bebob->tx_stream.flags |= CIP_EMPTY_HAS_WRONG_DBC; - } - return 0; } @@ -630,7 +628,7 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob) if (err < 0) goto error; - if (!bebob->discontinuity_quirk) + if (!(bebob->quirks & SND_BEBOB_QUIRK_INITIAL_DISCONTINUOUS_DBC)) tx_init_skip_cycles = 0; else tx_init_skip_cycles = 16000; |