summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-10-26 22:49:45 +0900
committerTakashi Iwai <tiwai@suse.de>2014-10-27 08:39:11 +0100
commit7ce5c9268bacbe5ceca7849450c80e280aacd4c0 (patch)
tree39fcbfaed2f3836ad2ea6d335ced878ff6d3415e /sound
parent56779864f135b309c11dd18156784f83ddc1571e (diff)
downloadlinux-7ce5c9268bacbe5ceca7849450c80e280aacd4c0.tar.gz
linux-7ce5c9268bacbe5ceca7849450c80e280aacd4c0.tar.bz2
linux-7ce5c9268bacbe5ceca7849450c80e280aacd4c0.zip
ALSA: bebob: fix wrong decoding of clock information for Terratec PHASE 88 Rack FW
Terratec PHASE 88 rack fw has two registers for source of clock, one is for internal/external, and another is for wordclock/spdif for external. When clock source is internal, information in another register has no meaning. Thus it must be ignored, but current implementation decodes it. This causes over-indexing reference to labels. Reported-by: András Murányi <muranyia@gmail.com> Tested-by: András Murányi <muranyia@gmail.com> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/bebob/bebob_terratec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c
index 0e4c0bfc463b..9940611f2e1b 100644
--- a/sound/firewire/bebob/bebob_terratec.c
+++ b/sound/firewire/bebob/bebob_terratec.c
@@ -24,7 +24,12 @@ phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
if (err < 0)
goto end;
- *id = (enable_ext & 0x01) | ((enable_word & 0x01) << 1);
+ if (enable_ext == 0)
+ *id = 0;
+ else if (enable_word == 0)
+ *id = 1;
+ else
+ *id = 2;
end:
return err;
}