Commit 9250673c authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge tag 'asoc-fix-v7.0-rc3' of...

Merge tag 'asoc-fix-v7.0-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v7.0

Quite a large pull request, but nothing too concerning here - everything
is fairly small.  We've got a couple of smaller core fixes for races on
card teardown from Matteo Cotifava, a fix for handling dodgy DMI
information generated by u-boot, some driver specific fixes and some new
device IDs for Tegra.
parents 5182e5ec 30c64fb9
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -1610,11 +1610,17 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware,
			   region_name);

		if (reg) {
			/*
			 * Although we expect the underlying bus does not require
			 * physically-contiguous buffers, we pessimistically use
			 * a temporary buffer instead of trusting that the
			 * alignment of region->data is ok.
			 */
			region_len = le32_to_cpu(region->len);
			if (region_len > buf_len) {
				buf_len = round_up(region_len, PAGE_SIZE);
				kfree(buf);
				buf = kmalloc(buf_len, GFP_KERNEL | GFP_DMA);
				vfree(buf);
				buf = vmalloc(buf_len);
				if (!buf) {
					ret = -ENOMEM;
					goto out_fw;
@@ -1643,7 +1649,7 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware,

	ret = 0;
out_fw:
	kfree(buf);
	vfree(buf);

	if (ret == -EOVERFLOW)
		cs_dsp_err(dsp, "%s: file content overflows file data\n", file);
@@ -2331,11 +2337,17 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
		}

		if (reg) {
			/*
			 * Although we expect the underlying bus does not require
			 * physically-contiguous buffers, we pessimistically use
			 * a temporary buffer instead of trusting that the
			 * alignment of blk->data is ok.
			 */
			region_len = le32_to_cpu(blk->len);
			if (region_len > buf_len) {
				buf_len = round_up(region_len, PAGE_SIZE);
				kfree(buf);
				buf = kmalloc(buf_len, GFP_KERNEL | GFP_DMA);
				vfree(buf);
				buf = vmalloc(buf_len);
				if (!buf) {
					ret = -ENOMEM;
					goto out_fw;
@@ -2366,7 +2378,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware

	ret = 0;
out_fw:
	kfree(buf);
	vfree(buf);

	if (ret == -EOVERFLOW)
		cs_dsp_err(dsp, "%s: file content overflows file data\n", file);
+14 −4
Original line number Diff line number Diff line
@@ -127,8 +127,13 @@ static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd)
	if (drvdata->hs_codec_id != RT5682)
		return -EINVAL;

	drvdata->wclk = clk_get(component->dev, "rt5682-dai-wclk");
	drvdata->bclk = clk_get(component->dev, "rt5682-dai-bclk");
	drvdata->wclk = devm_clk_get(component->dev, "rt5682-dai-wclk");
	if (IS_ERR(drvdata->wclk))
		return PTR_ERR(drvdata->wclk);

	drvdata->bclk = devm_clk_get(component->dev, "rt5682-dai-bclk");
	if (IS_ERR(drvdata->bclk))
		return PTR_ERR(drvdata->bclk);

	ret = snd_soc_dapm_new_controls(dapm, rt5682_widgets,
					ARRAY_SIZE(rt5682_widgets));
@@ -370,8 +375,13 @@ static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
		return -EINVAL;

	if (!drvdata->soc_mclk) {
		drvdata->wclk = clk_get(component->dev, "rt5682-dai-wclk");
		drvdata->bclk = clk_get(component->dev, "rt5682-dai-bclk");
		drvdata->wclk = devm_clk_get(component->dev, "rt5682-dai-wclk");
		if (IS_ERR(drvdata->wclk))
			return PTR_ERR(drvdata->wclk);

		drvdata->bclk = devm_clk_get(component->dev, "rt5682-dai-bclk");
		if (IS_ERR(drvdata->bclk))
			return PTR_ERR(drvdata->bclk);
	}

	ret = snd_soc_dapm_new_controls(dapm, rt5682s_widgets,
+7 −2
Original line number Diff line number Diff line
@@ -94,8 +94,13 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
		return ret;
	}

	rt5682_dai_wclk = clk_get(component->dev, "rt5682-dai-wclk");
	rt5682_dai_bclk = clk_get(component->dev, "rt5682-dai-bclk");
	rt5682_dai_wclk = devm_clk_get(component->dev, "rt5682-dai-wclk");
	if (IS_ERR(rt5682_dai_wclk))
		return PTR_ERR(rt5682_dai_wclk);

	rt5682_dai_bclk = devm_clk_get(component->dev, "rt5682-dai-bclk");
	if (IS_ERR(rt5682_dai_bclk))
		return PTR_ERR(rt5682_dai_bclk);

	ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
					 SND_JACK_HEADSET |
+1 −1
Original line number Diff line number Diff line
@@ -1047,7 +1047,7 @@ static int rt1011_recv_spk_mode_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
	struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
	struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
	struct rt1011_priv *rt1011 =
		snd_soc_component_get_drvdata(component);

+8 −4
Original line number Diff line number Diff line
@@ -1039,10 +1039,14 @@ int graph_util_is_ports0(struct device_node *np)
		port = np;

	struct device_node *ports __free(device_node) = of_get_parent(port);
	struct device_node *top    __free(device_node) = of_get_parent(ports);
	struct device_node *ports0 __free(device_node) = of_get_child_by_name(top, "ports");
	const char *at = strchr(kbasename(ports->full_name), '@');

	return ports0 == ports;
	/*
	 * Since child iteration order may differ
	 * between a base DT and DT overlays,
	 * string match "ports" or "ports@0" in the node name instead.
	 */
	return !at || !strcmp(at, "@0");
}
EXPORT_SYMBOL_GPL(graph_util_is_ports0);

Loading