aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/ssi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-12-20 17:36:04 +0100
committerTakashi Iwai <tiwai@suse.de>2017-12-20 17:36:04 +0100
commit1e9a328e4b35af22c23ce9357c2c2a77159e74bb (patch)
treed04364bc2f892e1db6a4ec0edaccfbb782acd243 /sound/soc/sh/rcar/ssi.c
parentALSA: usb-audio: Fix the missing ctl name suffix at parsing SU (diff)
parentMerge remote-tracking branches 'asoc/fix/rt5663', 'asoc/fix/tlv320aic31xx' and 'asoc/fix/twl4030' into asoc-linus (diff)
downloadlinux-dev-1e9a328e4b35af22c23ce9357c2c2a77159e74bb.tar.xz
linux-dev-1e9a328e4b35af22c23ce9357c2c2a77159e74bb.zip
Merge tag 'asoc-fix-v4.15-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.15 This is a fairly large set of fixes, they've been delayed partly as more and more keep coming in. Most of them are very small driver specific fixes, the biggest individual thing is the revert of the rcar IOMMU support - it was causing problems and there wasn't the confidence that it could be resolved sensibly. There's also a relatively large change in the Freescale SSI controller which resolves some issues with the AC'97 mode, these aren't that large in the grand scheme of things and reflect some fairly thorough review and testing.
Diffstat (limited to 'sound/soc/sh/rcar/ssi.c')
-rw-r--r--sound/soc/sh/rcar/ssi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index fece1e5f582f..cbf3bf312d23 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -446,25 +446,29 @@ static bool rsnd_ssi_pointer_update(struct rsnd_mod *mod,
int byte)
{
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+ bool ret = false;
+ int byte_pos;
- ssi->byte_pos += byte;
+ byte_pos = ssi->byte_pos + byte;
- if (ssi->byte_pos >= ssi->next_period_byte) {
+ if (byte_pos >= ssi->next_period_byte) {
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
ssi->period_pos++;
ssi->next_period_byte += ssi->byte_per_period;
if (ssi->period_pos >= runtime->periods) {
- ssi->byte_pos = 0;
+ byte_pos = 0;
ssi->period_pos = 0;
ssi->next_period_byte = ssi->byte_per_period;
}
- return true;
+ ret = true;
}
- return false;
+ WRITE_ONCE(ssi->byte_pos, byte_pos);
+
+ return ret;
}
/*
@@ -838,7 +842,7 @@ static int rsnd_ssi_pointer(struct rsnd_mod *mod,
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
- *pointer = bytes_to_frames(runtime, ssi->byte_pos);
+ *pointer = bytes_to_frames(runtime, READ_ONCE(ssi->byte_pos));
return 0;
}