Skip to content

Commit 2688366

Browse files
committed
Merge tag 'asoc-fix-v5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.0 A few small fixes, a driver fix for Samsung, a fix for refcounting of of_nodes in the simple-card driver that triggered on a lot of systems and a fix for topology error handling.
2 parents c8c6ee6 + 19dd077 commit 2688366

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

sound/soc/generic/simple-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
462462
conf_idx = 0;
463463
node = of_get_child_by_name(top, PREFIX "dai-link");
464464
if (!node) {
465-
node = dev->of_node;
465+
node = of_node_get(top);
466466
loop = 0;
467467
}
468468

sound/soc/samsung/i2s.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
604604
unsigned int fmt)
605605
{
606606
struct i2s_dai *i2s = to_info(dai);
607+
struct i2s_dai *other = get_other_dai(i2s);
607608
int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave;
608609
u32 mod, tmp = 0;
609610
unsigned long flags;
@@ -661,7 +662,8 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
661662
* CLK_I2S_RCLK_SRC clock is not exposed so we ensure any
662663
* clock configuration assigned in DT is not overwritten.
663664
*/
664-
if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL)
665+
if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL &&
666+
other->clk_data.clks == NULL)
665667
i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0,
666668
0, SND_SOC_CLOCK_IN);
667669
break;
@@ -699,6 +701,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
699701
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
700702
{
701703
struct i2s_dai *i2s = to_info(dai);
704+
struct i2s_dai *other = get_other_dai(i2s);
702705
u32 mod, mask = 0, val = 0;
703706
struct clk *rclksrc;
704707
unsigned long flags;
@@ -784,6 +787,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
784787
i2s->frmclk = params_rate(params);
785788

786789
rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC];
790+
if (!rclksrc || IS_ERR(rclksrc))
791+
rclksrc = other->clk_table[CLK_I2S_RCLK_SRC];
792+
787793
if (rclksrc && !IS_ERR(rclksrc))
788794
i2s->rclk_srcrate = clk_get_rate(rclksrc);
789795

sound/soc/soc-topology.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ int snd_soc_tplg_component_load(struct snd_soc_component *comp,
24872487
struct snd_soc_tplg_ops *ops, const struct firmware *fw, u32 id)
24882488
{
24892489
struct soc_tplg tplg;
2490+
int ret;
24902491

24912492
/* setup parsing context */
24922493
memset(&tplg, 0, sizeof(tplg));
@@ -2500,7 +2501,12 @@ int snd_soc_tplg_component_load(struct snd_soc_component *comp,
25002501
tplg.bytes_ext_ops = ops->bytes_ext_ops;
25012502
tplg.bytes_ext_ops_count = ops->bytes_ext_ops_count;
25022503

2503-
return soc_tplg_load(&tplg);
2504+
ret = soc_tplg_load(&tplg);
2505+
/* free the created components if fail to load topology */
2506+
if (ret)
2507+
snd_soc_tplg_component_remove(comp, SND_SOC_TPLG_INDEX_ALL);
2508+
2509+
return ret;
25042510
}
25052511
EXPORT_SYMBOL_GPL(snd_soc_tplg_component_load);
25062512

0 commit comments

Comments
 (0)