This commit is contained in:
Mark Brown 2017-12-08 18:53:18 +00:00
commit c046010a83
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 14 additions and 7 deletions

View File

@ -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;
}

View File

@ -125,6 +125,7 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod,
{
int hdmi = rsnd_ssi_hdmi_port(io);
int ret;
u32 mode = 0;
ret = rsnd_ssiu_init(mod, io, priv);
if (ret < 0)
@ -136,9 +137,11 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod,
* see
* rsnd_ssi_config_init()
*/
rsnd_mod_write(mod, SSI_MODE, 0x1);
mode = 0x1;
}
rsnd_mod_write(mod, SSI_MODE, mode);
if (rsnd_ssi_use_busif(io)) {
rsnd_mod_write(mod, SSI_BUSIF_ADINR,
rsnd_get_adinr_bit(mod, io) |