summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2021-06-23 16:59:33 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 16:05:45 +0200
commitff8f11860e4376c27a43dd37d171f380906542a0 (patch)
treefada8e6630cc11a6c2f0f38af1150d3d702be3e1 /sound
parent9ada4baae6393bcb3740a5b4b2d7bb209854b8e5 (diff)
downloadlinux-stable-ff8f11860e4376c27a43dd37d171f380906542a0.tar.gz
linux-stable-ff8f11860e4376c27a43dd37d171f380906542a0.tar.bz2
linux-stable-ff8f11860e4376c27a43dd37d171f380906542a0.zip
ALSA: firewire-motu: fix detection for S/PDIF source on optical interface in v2 protocol
[ Upstream commit fa4db23233eb912234bdfb0b26a38be079c6b5ea ] The devices in protocol version 2 has a register with flag for IEC 60958 signal detection as source of sampling clock without discrimination between coaxial and optical interfaces. On the other hand, current implementation of driver manage to interpret type of signal on optical interface instead. This commit fixes the detection of optical/coaxial interface for S/PDIF signal. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210623075941.72562-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/motu/motu-protocol-v2.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c
index 784073aa1026..f0a0ecad4d74 100644
--- a/sound/firewire/motu/motu-protocol-v2.c
+++ b/sound/firewire/motu/motu-protocol-v2.c
@@ -86,24 +86,23 @@ static int detect_clock_source_optical_model(struct snd_motu *motu, u32 data,
*src = SND_MOTU_CLOCK_SOURCE_INTERNAL;
break;
case 1:
+ *src = SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT;
+ break;
+ case 2:
{
__be32 reg;
// To check the configuration of optical interface.
- int err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET,
- &reg, sizeof(reg));
+ int err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, &reg, sizeof(reg));
if (err < 0)
return err;
- if (be32_to_cpu(reg) & 0x00000200)
+ if (((data & V2_OPT_IN_IFACE_MASK) >> V2_OPT_IN_IFACE_SHIFT) == V2_OPT_IFACE_MODE_SPDIF)
*src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_OPT;
else
- *src = SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT;
+ *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX;
break;
}
- case 2:
- *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX;
- break;
case 3:
*src = SND_MOTU_CLOCK_SOURCE_SPH;
break;