Commit 5a56996b authored by Takashi Iwai's avatar Takashi Iwai

Merge tag 'asoc-fix-v5.6-rc4' of...

Merge tag 'asoc-fix-v5.6-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.6

More fixes that have arrived since the merge window, spread out all
over.  There's a few things like the operation callback addition for
rt1015 and the meson reset addition which add small new bits of
functionality to fix non-working systems, they're all very small and for
parts of newly added functionality.
parents 95dbf14b 3fb83cbe
...@@ -1157,7 +1157,7 @@ struct snd_soc_pcm_runtime { ...@@ -1157,7 +1157,7 @@ struct snd_soc_pcm_runtime {
((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \ ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
(i)++) (i)++)
#define for_each_rtd_codec_dai_rollback(rtd, i, dai) \ #define for_each_rtd_codec_dai_rollback(rtd, i, dai) \
for (; ((--i) >= 0) && ((dai) = rtd->codec_dais[i]);) for (; (--(i) >= 0) && ((dai) = rtd->codec_dais[i]);)
void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd); void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
......
...@@ -1406,7 +1406,7 @@ config SND_SOC_WM8737 ...@@ -1406,7 +1406,7 @@ config SND_SOC_WM8737
depends on SND_SOC_I2C_AND_SPI depends on SND_SOC_I2C_AND_SPI
config SND_SOC_WM8741 config SND_SOC_WM8741
tristate "Wolfson Microelectronics WM8737 DAC" tristate "Wolfson Microelectronics WM8741 DAC"
depends on SND_SOC_I2C_AND_SPI depends on SND_SOC_I2C_AND_SPI
config SND_SOC_WM8750 config SND_SOC_WM8750
......
...@@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap) ...@@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
} }
pcm512x->sclk = devm_clk_get(dev, NULL); pcm512x->sclk = devm_clk_get(dev, NULL);
if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) {
return -EPROBE_DEFER; ret = -EPROBE_DEFER;
goto err;
}
if (!IS_ERR(pcm512x->sclk)) { if (!IS_ERR(pcm512x->sclk)) {
ret = clk_prepare_enable(pcm512x->sclk); ret = clk_prepare_enable(pcm512x->sclk);
if (ret != 0) { if (ret != 0) {
dev_err(dev, "Failed to enable SCLK: %d\n", ret); dev_err(dev, "Failed to enable SCLK: %d\n", ret);
return ret; goto err;
} }
} }
......
...@@ -664,7 +664,7 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream, ...@@ -664,7 +664,7 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
snd_soc_component_update_bits(component, RT1015_TDM_MASTER, snd_soc_component_update_bits(component, RT1015_TDM_MASTER,
RT1015_I2S_DL_MASK, val_len); RT1015_I2S_DL_MASK, val_len);
snd_soc_component_update_bits(component, RT1015_CLK2, snd_soc_component_update_bits(component, RT1015_CLK2,
RT1015_FS_PD_MASK, pre_div); RT1015_FS_PD_MASK, pre_div << RT1015_FS_PD_SFT);
return 0; return 0;
} }
...@@ -857,6 +857,7 @@ struct snd_soc_dai_driver rt1015_dai[] = { ...@@ -857,6 +857,7 @@ struct snd_soc_dai_driver rt1015_dai[] = {
.rates = RT1015_STEREO_RATES, .rates = RT1015_STEREO_RATES,
.formats = RT1015_FORMATS, .formats = RT1015_FORMATS,
}, },
.ops = &rt1015_aif_dai_ops,
} }
}; };
......
...@@ -215,7 +215,8 @@ static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth) ...@@ -215,7 +215,8 @@ static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
break; break;
default: default:
dev_info(tas2562->dev, "Not supported params format\n"); dev_info(tas2562->dev, "Unsupported bitwidth format\n");
return -EINVAL;
} }
ret = snd_soc_component_update_bits(tas2562->component, ret = snd_soc_component_update_bits(tas2562->component,
...@@ -251,7 +252,7 @@ static int tas2562_hw_params(struct snd_pcm_substream *substream, ...@@ -251,7 +252,7 @@ static int tas2562_hw_params(struct snd_pcm_substream *substream,
ret = tas2562_set_samplerate(tas2562, params_rate(params)); ret = tas2562_set_samplerate(tas2562, params_rate(params));
if (ret) if (ret)
dev_err(tas2562->dev, "set bitwidth failed, %d\n", ret); dev_err(tas2562->dev, "set sample rate failed, %d\n", ret);
return ret; return ret;
} }
......
...@@ -34,8 +34,8 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf, ...@@ -34,8 +34,8 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf,
int i; int i;
ssize_t ret = 0; ssize_t ret = 0;
for (i = 0; i < max_pin; i++) for (i = 0; i < max_pin; i++) {
ret += snprintf(buf + size, MOD_BUF - size, ret += scnprintf(buf + size, MOD_BUF - size,
"%s %d\n\tModule %d\n\tInstance %d\n\t" "%s %d\n\tModule %d\n\tInstance %d\n\t"
"In-used %s\n\tType %s\n" "In-used %s\n\tType %s\n"
"\tState %d\n\tIndex %d\n", "\tState %d\n\tIndex %d\n",
...@@ -45,13 +45,15 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf, ...@@ -45,13 +45,15 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf,
m_pin[i].in_use ? "Used" : "Unused", m_pin[i].in_use ? "Used" : "Unused",
m_pin[i].is_dynamic ? "Dynamic" : "Static", m_pin[i].is_dynamic ? "Dynamic" : "Static",
m_pin[i].pin_state, i); m_pin[i].pin_state, i);
size += ret;
}
return ret; return ret;
} }
static ssize_t skl_print_fmt(struct skl_module_fmt *fmt, char *buf, static ssize_t skl_print_fmt(struct skl_module_fmt *fmt, char *buf,
ssize_t size, bool direction) ssize_t size, bool direction)
{ {
return snprintf(buf + size, MOD_BUF - size, return scnprintf(buf + size, MOD_BUF - size,
"%s\n\tCh %d\n\tFreq %d\n\tBit depth %d\n\t" "%s\n\tCh %d\n\tFreq %d\n\tBit depth %d\n\t"
"Valid bit depth %d\n\tCh config %#x\n\tInterleaving %d\n\t" "Valid bit depth %d\n\tCh config %#x\n\tInterleaving %d\n\t"
"Sample Type %d\n\tCh Map %#x\n", "Sample Type %d\n\tCh Map %#x\n",
...@@ -75,16 +77,16 @@ static ssize_t module_read(struct file *file, char __user *user_buf, ...@@ -75,16 +77,16 @@ static ssize_t module_read(struct file *file, char __user *user_buf,
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
ret = snprintf(buf, MOD_BUF, "Module:\n\tUUID %pUL\n\tModule id %d\n" ret = scnprintf(buf, MOD_BUF, "Module:\n\tUUID %pUL\n\tModule id %d\n"
"\tInstance id %d\n\tPvt_id %d\n", mconfig->guid, "\tInstance id %d\n\tPvt_id %d\n", mconfig->guid,
mconfig->id.module_id, mconfig->id.instance_id, mconfig->id.module_id, mconfig->id.instance_id,
mconfig->id.pvt_id); mconfig->id.pvt_id);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"Resources:\n\tCPC %#x\n\tIBS %#x\n\tOBS %#x\t\n", "Resources:\n\tCPC %#x\n\tIBS %#x\n\tOBS %#x\t\n",
res->cpc, res->ibs, res->obs); res->cpc, res->ibs, res->obs);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"Module data:\n\tCore %d\n\tIn queue %d\n\t" "Module data:\n\tCore %d\n\tIn queue %d\n\t"
"Out queue %d\n\tType %s\n", "Out queue %d\n\tType %s\n",
mconfig->core_id, mconfig->max_in_queue, mconfig->core_id, mconfig->max_in_queue,
...@@ -94,38 +96,38 @@ static ssize_t module_read(struct file *file, char __user *user_buf, ...@@ -94,38 +96,38 @@ static ssize_t module_read(struct file *file, char __user *user_buf,
ret += skl_print_fmt(mconfig->in_fmt, buf, ret, true); ret += skl_print_fmt(mconfig->in_fmt, buf, ret, true);
ret += skl_print_fmt(mconfig->out_fmt, buf, ret, false); ret += skl_print_fmt(mconfig->out_fmt, buf, ret, false);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"Fixup:\n\tParams %#x\n\tConverter %#x\n", "Fixup:\n\tParams %#x\n\tConverter %#x\n",
mconfig->params_fixup, mconfig->converter); mconfig->params_fixup, mconfig->converter);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"Module Gateway:\n\tType %#x\n\tVbus %#x\n\tHW conn %#x\n\tSlot %#x\n", "Module Gateway:\n\tType %#x\n\tVbus %#x\n\tHW conn %#x\n\tSlot %#x\n",
mconfig->dev_type, mconfig->vbus_id, mconfig->dev_type, mconfig->vbus_id,
mconfig->hw_conn_type, mconfig->time_slot); mconfig->hw_conn_type, mconfig->time_slot);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"Pipeline:\n\tID %d\n\tPriority %d\n\tConn Type %d\n\t" "Pipeline:\n\tID %d\n\tPriority %d\n\tConn Type %d\n\t"
"Pages %#x\n", mconfig->pipe->ppl_id, "Pages %#x\n", mconfig->pipe->ppl_id,
mconfig->pipe->pipe_priority, mconfig->pipe->conn_type, mconfig->pipe->pipe_priority, mconfig->pipe->conn_type,
mconfig->pipe->memory_pages); mconfig->pipe->memory_pages);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"\tParams:\n\t\tHost DMA %d\n\t\tLink DMA %d\n", "\tParams:\n\t\tHost DMA %d\n\t\tLink DMA %d\n",
mconfig->pipe->p_params->host_dma_id, mconfig->pipe->p_params->host_dma_id,
mconfig->pipe->p_params->link_dma_id); mconfig->pipe->p_params->link_dma_id);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"\tPCM params:\n\t\tCh %d\n\t\tFreq %d\n\t\tFormat %d\n", "\tPCM params:\n\t\tCh %d\n\t\tFreq %d\n\t\tFormat %d\n",
mconfig->pipe->p_params->ch, mconfig->pipe->p_params->ch,
mconfig->pipe->p_params->s_freq, mconfig->pipe->p_params->s_freq,
mconfig->pipe->p_params->s_fmt); mconfig->pipe->p_params->s_fmt);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"\tLink %#x\n\tStream %#x\n", "\tLink %#x\n\tStream %#x\n",
mconfig->pipe->p_params->linktype, mconfig->pipe->p_params->linktype,
mconfig->pipe->p_params->stream); mconfig->pipe->p_params->stream);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"\tState %d\n\tPassthru %s\n", "\tState %d\n\tPassthru %s\n",
mconfig->pipe->state, mconfig->pipe->state,
mconfig->pipe->passthru ? "true" : "false"); mconfig->pipe->passthru ? "true" : "false");
...@@ -135,7 +137,7 @@ static ssize_t module_read(struct file *file, char __user *user_buf, ...@@ -135,7 +137,7 @@ static ssize_t module_read(struct file *file, char __user *user_buf,
ret += skl_print_pins(mconfig->m_out_pin, buf, ret += skl_print_pins(mconfig->m_out_pin, buf,
mconfig->max_out_queue, ret, false); mconfig->max_out_queue, ret, false);
ret += snprintf(buf + ret, MOD_BUF - ret, ret += scnprintf(buf + ret, MOD_BUF - ret,
"Other:\n\tDomain %d\n\tHomogeneous Input %s\n\t" "Other:\n\tDomain %d\n\tHomogeneous Input %s\n\t"
"Homogeneous Output %s\n\tIn Queue Mask %d\n\t" "Homogeneous Output %s\n\tIn Queue Mask %d\n\t"
"Out Queue Mask %d\n\tDMA ID %d\n\tMem Pages %d\n\t" "Out Queue Mask %d\n\tDMA ID %d\n\tMem Pages %d\n\t"
...@@ -191,7 +193,7 @@ static ssize_t fw_softreg_read(struct file *file, char __user *user_buf, ...@@ -191,7 +193,7 @@ static ssize_t fw_softreg_read(struct file *file, char __user *user_buf,
__ioread32_copy(d->fw_read_buff, fw_reg_addr, w0_stat_sz >> 2); __ioread32_copy(d->fw_read_buff, fw_reg_addr, w0_stat_sz >> 2);
for (offset = 0; offset < FW_REG_SIZE; offset += 16) { for (offset = 0; offset < FW_REG_SIZE; offset += 16) {
ret += snprintf(tmp + ret, FW_REG_BUF - ret, "%#.4x: ", offset); ret += scnprintf(tmp + ret, FW_REG_BUF - ret, "%#.4x: ", offset);
hex_dump_to_buffer(d->fw_read_buff + offset, 16, 16, 4, hex_dump_to_buffer(d->fw_read_buff + offset, 16, 16, 4,
tmp + ret, FW_REG_BUF - ret, 0); tmp + ret, FW_REG_BUF - ret, 0);
ret += strlen(tmp + ret); ret += strlen(tmp + ret);
......
...@@ -384,9 +384,11 @@ static int skl_clk_dev_probe(struct platform_device *pdev) ...@@ -384,9 +384,11 @@ static int skl_clk_dev_probe(struct platform_device *pdev)
&clks[i], clk_pdata, i); &clks[i], clk_pdata, i);
if (IS_ERR(data->clk[data->avail_clk_cnt])) { if (IS_ERR(data->clk[data->avail_clk_cnt])) {
ret = PTR_ERR(data->clk[data->avail_clk_cnt++]); ret = PTR_ERR(data->clk[data->avail_clk_cnt]);
goto err_unreg_skl_clk; goto err_unreg_skl_clk;
} }
data->avail_clk_cnt++;
} }
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/reset.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/soc-dai.h> #include <sound/soc-dai.h>
...@@ -378,6 +379,11 @@ static int g12a_tohdmitx_probe(struct platform_device *pdev) ...@@ -378,6 +379,11 @@ static int g12a_tohdmitx_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
void __iomem *regs; void __iomem *regs;
struct regmap *map; struct regmap *map;
int ret;
ret = device_reset(dev);
if (ret)
return ret;
regs = devm_platform_ioremap_resource(pdev, 0); regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(regs)) if (IS_ERR(regs))
......
...@@ -451,7 +451,7 @@ int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream) ...@@ -451,7 +451,7 @@ int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
int i, ret; int i, ret;
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (component->driver->ioctl) { if (component->driver->sync_stop) {
ret = component->driver->sync_stop(component, ret = component->driver->sync_stop(component,
substream); substream);
if (ret < 0) if (ret < 0)
......
...@@ -299,7 +299,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream) ...@@ -299,7 +299,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream)
for_each_dpcm_be(fe, stream, dpcm) for_each_dpcm_be(fe, stream, dpcm)
dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
snd_soc_dapm_stream_stop(fe, stream); dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP);
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
......
...@@ -4772,7 +4772,7 @@ static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm) ...@@ -4772,7 +4772,7 @@ static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm)
continue; continue;
if (w->power) { if (w->power) {
dapm_seq_insert(w, &down_list, false); dapm_seq_insert(w, &down_list, false);
w->power = 0; w->new_power = 0;
powerdown = 1; powerdown = 1;
} }
} }
......
...@@ -2006,7 +2006,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream) ...@@ -2006,7 +2006,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
soc_pcm_close(substream); soc_pcm_close(substream);
/* run the stream event for each BE */ /* run the stream event for each BE */
snd_soc_dapm_stream_stop(fe, stream); dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP);
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
...@@ -3171,16 +3171,16 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe, ...@@ -3171,16 +3171,16 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
unsigned long flags; unsigned long flags;
/* FE state */ /* FE state */
offset += snprintf(buf + offset, size - offset, offset += scnprintf(buf + offset, size - offset,
"[%s - %s]\n", fe->dai_link->name, "[%s - %s]\n", fe->dai_link->name,
stream ? "Capture" : "Playback"); stream ? "Capture" : "Playback");
offset += snprintf(buf + offset, size - offset, "State: %s\n", offset += scnprintf(buf + offset, size - offset, "State: %s\n",
dpcm_state_string(fe->dpcm[stream].state)); dpcm_state_string(fe->dpcm[stream].state));
if ((fe->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && if ((fe->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) &&
(fe->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) (fe->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP))
offset += snprintf(buf + offset, size - offset, offset += scnprintf(buf + offset, size - offset,
"Hardware Params: " "Hardware Params: "
"Format = %s, Channels = %d, Rate = %d\n", "Format = %s, Channels = %d, Rate = %d\n",
snd_pcm_format_name(params_format(params)), snd_pcm_format_name(params_format(params)),
...@@ -3188,10 +3188,10 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe, ...@@ -3188,10 +3188,10 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
params_rate(params)); params_rate(params));
/* BEs state */ /* BEs state */
offset += snprintf(buf + offset, size - offset, "Backends:\n"); offset += scnprintf(buf + offset, size - offset, "Backends:\n");
if (list_empty(&fe->dpcm[stream].be_clients)) { if (list_empty(&fe->dpcm[stream].be_clients)) {
offset += snprintf(buf + offset, size - offset, offset += scnprintf(buf + offset, size - offset,
" No active DSP links\n"); " No active DSP links\n");
goto out; goto out;
} }
...@@ -3201,16 +3201,16 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe, ...@@ -3201,16 +3201,16 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
struct snd_soc_pcm_runtime *be = dpcm->be; struct snd_soc_pcm_runtime *be = dpcm->be;
params = &dpcm->hw_params; params = &dpcm->hw_params;
offset += snprintf(buf + offset, size - offset, offset += scnprintf(buf + offset, size - offset,
"- %s\n", be->dai_link->name); "- %s\n", be->dai_link->name);
offset += snprintf(buf + offset, size - offset, offset += scnprintf(buf + offset, size - offset,
" State: %s\n", " State: %s\n",
dpcm_state_string(be->dpcm[stream].state)); dpcm_state_string(be->dpcm[stream].state));
if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) &&
(be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP))
offset += snprintf(buf + offset, size - offset, offset += scnprintf(buf + offset, size - offset,
" Hardware Params: " " Hardware Params: "
"Format = %s, Channels = %d, Rate = %d\n", "Format = %s, Channels = %d, Rate = %d\n",
snd_pcm_format_name(params_format(params)), snd_pcm_format_name(params_format(params)),
......
...@@ -2377,8 +2377,11 @@ static int soc_tplg_link_elems_load(struct soc_tplg *tplg, ...@@ -2377,8 +2377,11 @@ static int soc_tplg_link_elems_load(struct soc_tplg *tplg,
} }
ret = soc_tplg_link_config(tplg, _link); ret = soc_tplg_link_config(tplg, _link);
if (ret < 0) if (ret < 0) {
if (!abi_match)
kfree(_link);
return ret; return ret;
}
/* offset by version-specific struct size and /* offset by version-specific struct size and
* real priv data size * real priv data size
...@@ -2542,7 +2545,7 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, ...@@ -2542,7 +2545,7 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg,
{ {
struct snd_soc_tplg_manifest *manifest, *_manifest; struct snd_soc_tplg_manifest *manifest, *_manifest;
bool abi_match; bool abi_match;
int err; int ret = 0;
if (tplg->pass != SOC_TPLG_PASS_MANIFEST) if (tplg->pass != SOC_TPLG_PASS_MANIFEST)
return 0; return 0;
...@@ -2555,19 +2558,19 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, ...@@ -2555,19 +2558,19 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg,
_manifest = manifest; _manifest = manifest;
} else { } else {
abi_match = false; abi_match = false;
err = manifest_new_ver(tplg, manifest, &_manifest); ret = manifest_new_ver(tplg, manifest, &_manifest);
if (err < 0) if (ret < 0)
return err; return ret;
} }
/* pass control to component driver for optional further init */ /* pass control to component driver for optional further init */
if (tplg->comp && tplg->ops && tplg->ops->manifest) if (tplg->comp && tplg->ops && tplg->ops->manifest)
return tplg->ops->manifest(tplg->comp, tplg->index, _manifest); ret = tplg->ops->manifest(tplg->comp, tplg->index, _manifest);
if (!abi_match) /* free the duplicated one */ if (!abi_match) /* free the duplicated one */
kfree(_manifest); kfree(_manifest);
return 0; return ret;
} }
/* validate header magic, size and type */ /* validate header magic, size and type */
......
...@@ -499,7 +499,7 @@ int snd_sof_ipc_stream_posn(struct snd_soc_component *scomp, ...@@ -499,7 +499,7 @@ int snd_sof_ipc_stream_posn(struct snd_soc_component *scomp,
/* send IPC to the DSP */ /* send IPC to the DSP */
err = sof_ipc_tx_message(sdev->ipc, err = sof_ipc_tx_message(sdev->ipc,
stream.hdr.cmd, &stream, sizeof(stream), &posn, stream.hdr.cmd, &stream, sizeof(stream), posn,
sizeof(*posn)); sizeof(*posn));
if (err < 0) { if (err < 0) {
dev_err(sdev->dev, "error: failed to get stream %d position\n", dev_err(sdev->dev, "error: failed to get stream %d position\n",
......
...@@ -1543,7 +1543,13 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) ...@@ -1543,7 +1543,13 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
return ret; return ret;
} }
ret = devm_snd_soc_register_component(&pdev->dev, &stm32_component, ret = snd_dmaengine_pcm_register(&pdev->dev, conf, 0);
if (ret) {
dev_err(&pdev->dev, "Could not register pcm dma\n");
return ret;
}
ret = snd_soc_register_component(&pdev->dev, &stm32_component,
&sai->cpu_dai_drv, 1); &sai->cpu_dai_drv, 1);
if (ret) if (ret)
return ret; return ret;
...@@ -1551,12 +1557,6 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) ...@@ -1551,12 +1557,6 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) if (STM_SAI_PROTOCOL_IS_SPDIF(sai))
conf = &stm32_sai_pcm_config_spdif; conf = &stm32_sai_pcm_config_spdif;
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, conf, 0);
if (ret) {
dev_err(&pdev->dev, "Could not register pcm dma\n");
return ret;
}
return 0; return 0;
} }
...@@ -1565,6 +1565,8 @@ static int stm32_sai_sub_remove(struct platform_device *pdev) ...@@ -1565,6 +1565,8 @@ static int stm32_sai_sub_remove(struct platform_device *pdev)
struct stm32_sai_sub_data *sai = dev_get_drvdata(&pdev->dev); struct stm32_sai_sub_data *sai = dev_get_drvdata(&pdev->dev);
clk_unprepare(sai->pdata->pclk); clk_unprepare(sai->pdata->pclk);
snd_dmaengine_pcm_unregister(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment