Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…/git/broonie/sound into asoc-5.1
  • Loading branch information
broonie committed Feb 13, 2019
2 parents 7196c64 + 323fb7b commit 3636887
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions sound/soc/samsung/i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
unsigned int fmt)
{
struct i2s_dai *i2s = to_info(dai);
struct i2s_dai *other = get_other_dai(i2s);
int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave;
u32 mod, tmp = 0;
unsigned long flags;
Expand Down Expand Up @@ -686,7 +687,8 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
* CLK_I2S_RCLK_SRC clock is not exposed so we ensure any
* clock configuration assigned in DT is not overwritten.
*/
if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL)
if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL &&
other->clk_data.clks == NULL)
i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0,
0, SND_SOC_CLOCK_IN);
break;
Expand Down Expand Up @@ -724,7 +726,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{
struct i2s_dai *i2s = to_info(dai);
struct i2s_dai *other = get_other_dai(i2s);
u32 mod, mask = 0, val = 0;
struct clk *rclksrc;
unsigned long flags;

WARN_ON(!pm_runtime_active(dai->dev));
Expand Down Expand Up @@ -807,6 +811,13 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,

i2s->frmclk = params_rate(params);

rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC];
if (!rclksrc || IS_ERR(rclksrc))
rclksrc = other->clk_table[CLK_I2S_RCLK_SRC];

if (rclksrc && !IS_ERR(rclksrc))
i2s->rclk_srcrate = clk_get_rate(rclksrc);

return 0;
}

Expand Down Expand Up @@ -911,11 +922,6 @@ static int config_setup(struct i2s_dai *i2s)
return 0;

if (!(i2s->quirks & QUIRK_NO_MUXPSR)) {
struct clk *rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC];

if (rclksrc && !IS_ERR(rclksrc))
i2s->rclk_srcrate = clk_get_rate(rclksrc);

psr = i2s->rclk_srcrate / i2s->frmclk / rfs;
writel(((psr - 1) << 8) | PSR_PSREN, i2s->addr + I2SPSR);
dev_dbg(&i2s->pdev->dev,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
if (rsnd_ssi_is_multi_slave(mod, io))
return 0;

if (ssi->usrcnt > 1) {
if (ssi->usrcnt > 0) {
if (ssi->rate != rate) {
dev_err(dev, "SSI parent/child should use same rate\n");
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/ssiu.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod,
break;
case 9:
for (i = 0; i < 4; i++)
rsnd_mod_write(mod, SSI_SYS_STATUS((i * 2) + 1), 0xf << (id * 4));
rsnd_mod_write(mod, SSI_SYS_STATUS((i * 2) + 1), 0xf << 4);
break;
}

Expand Down

0 comments on commit 3636887

Please sign in to comment.