Skip to content

Commit

Permalink
ALSA: firewire-motu: remove invalid bitshift for register value
Browse files Browse the repository at this point in the history
In protocol version 3, drivers can read current sampling clock status from
register 0x'ffff'f000'0b14. 8 bits of LSB of this register represents type
of signal as source of clock.

Current driver code includes invalid bitshift to handle the parameter. This
commit fixes the bug.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 5992e30 ("ALSA: firewire-motu: add support for MOTU 828mk3 (FireWire/Hybrid) as a model with protocol version 3")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Sakamoto authored and Takashi Iwai committed Apr 5, 2017
1 parent fdb2b2e commit 5b33504
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/firewire/motu/motu-protocol-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define V3_CLOCK_RATE_MASK 0x0000ff00
#define V3_CLOCK_RATE_SHIFT 8
#define V3_CLOCK_SOURCE_MASK 0x000000ff
#define V3_CLOCK_SOURCE_SHIFT 8

#define V3_OPT_IFACE_MODE_OFFSET 0x0c94
#define V3_ENABLE_OPT_IN_IFACE_A 0x00000001
Expand Down Expand Up @@ -101,7 +100,7 @@ static int v3_get_clock_source(struct snd_motu *motu,
return err;
data = be32_to_cpu(reg);

val = (data & V3_CLOCK_SOURCE_MASK) >> V3_CLOCK_SOURCE_SHIFT;
val = data & V3_CLOCK_SOURCE_MASK;
if (val == 0x00) {
*src = SND_MOTU_CLOCK_SOURCE_INTERNAL;
} else if (val == 0x01) {
Expand Down

0 comments on commit 5b33504

Please sign in to comment.