forked from Minki/linux
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. -----BEGIN PGP SIGNATURE----- iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl5iebkTHGJyb29uaWVA a2VybmVsLm9yZwAKCRAk1otyXVSH0MR4B/wJq8zrpsPAA2jCoBfN0qMzrVBEt9QD 5oF/r36ZH5G6x0QZzyiwVOUbapNT1TVs51tw0S5esxJ+npkT2kgABPlIMYF2tgp6 rmLOaFEPC+Bgf/dNGIWLV21B+EZCHDxTz1zD7VjfaXLDPRop+sZg1VfXLR7IvXos 1VQLVx1y6vFJRr56EU5xQo1CAeFGB1x5K52aF4D90ALL7lYT6dt7m/soBmxImEpq aZUCE6xwX8WMH4OX6sTfqOvB+g6q+DzshCP2+Fas/0OIQZQA9mmIKId+/xpb6QcY A0AzMlSv49uAsBsa3CZmSingGVqL/PEMkCI4wvJPl/paQXUsMi9HYV0E =YlPP -----END PGP SIGNATURE----- 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.
This commit is contained in:
commit
5a56996b0f
@ -1157,7 +1157,7 @@ struct snd_soc_pcm_runtime {
|
||||
((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
|
||||
(i)++)
|
||||
#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);
|
||||
|
||||
|
@ -1406,7 +1406,7 @@ config SND_SOC_WM8737
|
||||
depends on SND_SOC_I2C_AND_SPI
|
||||
|
||||
config SND_SOC_WM8741
|
||||
tristate "Wolfson Microelectronics WM8737 DAC"
|
||||
tristate "Wolfson Microelectronics WM8741 DAC"
|
||||
depends on SND_SOC_I2C_AND_SPI
|
||||
|
||||
config SND_SOC_WM8750
|
||||
|
@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
|
||||
}
|
||||
|
||||
pcm512x->sclk = devm_clk_get(dev, NULL);
|
||||
if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER)
|
||||
return -EPROBE_DEFER;
|
||||
if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) {
|
||||
ret = -EPROBE_DEFER;
|
||||
goto err;
|
||||
}
|
||||
if (!IS_ERR(pcm512x->sclk)) {
|
||||
ret = clk_prepare_enable(pcm512x->sclk);
|
||||
if (ret != 0) {
|
||||
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,
|
||||
snd_soc_component_update_bits(component, RT1015_TDM_MASTER,
|
||||
RT1015_I2S_DL_MASK, val_len);
|
||||
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;
|
||||
}
|
||||
@ -857,6 +857,7 @@ struct snd_soc_dai_driver rt1015_dai[] = {
|
||||
.rates = RT1015_STEREO_RATES,
|
||||
.formats = RT1015_FORMATS,
|
||||
},
|
||||
.ops = &rt1015_aif_dai_ops,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -215,7 +215,8 @@ static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
|
||||
break;
|
||||
|
||||
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,
|
||||
@ -251,7 +252,7 @@ static int tas2562_hw_params(struct snd_pcm_substream *substream,
|
||||
|
||||
ret = tas2562_set_samplerate(tas2562, params_rate(params));
|
||||
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;
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf,
|
||||
int i;
|
||||
ssize_t ret = 0;
|
||||
|
||||
for (i = 0; i < max_pin; i++)
|
||||
ret += snprintf(buf + size, MOD_BUF - size,
|
||||
for (i = 0; i < max_pin; i++) {
|
||||
ret += scnprintf(buf + size, MOD_BUF - size,
|
||||
"%s %d\n\tModule %d\n\tInstance %d\n\t"
|
||||
"In-used %s\n\tType %s\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,
|
||||
m_pin[i].in_use ? "Used" : "Unused",
|
||||
m_pin[i].is_dynamic ? "Dynamic" : "Static",
|
||||
m_pin[i].pin_state, i);
|
||||
size += ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t skl_print_fmt(struct skl_module_fmt *fmt, char *buf,
|
||||
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"
|
||||
"Valid bit depth %d\n\tCh config %#x\n\tInterleaving %d\n\t"
|
||||
"Sample Type %d\n\tCh Map %#x\n",
|
||||
@ -75,16 +77,16 @@ static ssize_t module_read(struct file *file, char __user *user_buf,
|
||||
if (!buf)
|
||||
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,
|
||||
mconfig->id.module_id, mconfig->id.instance_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",
|
||||
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"
|
||||
"Out queue %d\n\tType %s\n",
|
||||
mconfig->core_id, mconfig->max_in_queue,
|
||||
@ -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->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",
|
||||
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",
|
||||
mconfig->dev_type, mconfig->vbus_id,
|
||||
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"
|
||||
"Pages %#x\n", mconfig->pipe->ppl_id,
|
||||
mconfig->pipe->pipe_priority, mconfig->pipe->conn_type,
|
||||
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",
|
||||
mconfig->pipe->p_params->host_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",
|
||||
mconfig->pipe->p_params->ch,
|
||||
mconfig->pipe->p_params->s_freq,
|
||||
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",
|
||||
mconfig->pipe->p_params->linktype,
|
||||
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",
|
||||
mconfig->pipe->state,
|
||||
mconfig->pipe->passthru ? "true" : "false");
|
||||
@ -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,
|
||||
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"
|
||||
"Homogeneous Output %s\n\tIn Queue Mask %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,
|
||||
__ioread32_copy(d->fw_read_buff, fw_reg_addr, w0_stat_sz >> 2);
|
||||
|
||||
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,
|
||||
tmp + ret, FW_REG_BUF - ret, 0);
|
||||
ret += strlen(tmp + ret);
|
||||
|
@ -384,9 +384,11 @@ static int skl_clk_dev_probe(struct platform_device *pdev)
|
||||
&clks[i], clk_pdata, i);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
data->avail_clk_cnt++;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, data);
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-dai.h>
|
||||
|
||||
@ -378,6 +379,11 @@ static int g12a_tohdmitx_probe(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
void __iomem *regs;
|
||||
struct regmap *map;
|
||||
int ret;
|
||||
|
||||
ret = device_reset(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(regs))
|
||||
|
@ -451,7 +451,7 @@ int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
|
||||
int i, ret;
|
||||
|
||||
for_each_rtd_components(rtd, i, component) {
|
||||
if (component->driver->ioctl) {
|
||||
if (component->driver->sync_stop) {
|
||||
ret = component->driver->sync_stop(component,
|
||||
substream);
|
||||
if (ret < 0)
|
||||
|
@ -299,7 +299,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream)
|
||||
for_each_dpcm_be(fe, stream, dpcm)
|
||||
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].runtime_update = SND_SOC_DPCM_UPDATE_NO;
|
||||
|
@ -4772,7 +4772,7 @@ static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm)
|
||||
continue;
|
||||
if (w->power) {
|
||||
dapm_seq_insert(w, &down_list, false);
|
||||
w->power = 0;
|
||||
w->new_power = 0;
|
||||
powerdown = 1;
|
||||
}
|
||||
}
|
||||
|
@ -2006,7 +2006,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
|
||||
soc_pcm_close(substream);
|
||||
|
||||
/* 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;
|
||||
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,
|
||||
unsigned long flags;
|
||||
|
||||
/* FE state */
|
||||
offset += snprintf(buf + offset, size - offset,
|
||||
offset += scnprintf(buf + offset, size - offset,
|
||||
"[%s - %s]\n", fe->dai_link->name,
|
||||
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));
|
||||
|
||||
if ((fe->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) &&
|
||||
(fe->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP))
|
||||
offset += snprintf(buf + offset, size - offset,
|
||||
offset += scnprintf(buf + offset, size - offset,
|
||||
"Hardware Params: "
|
||||
"Format = %s, Channels = %d, Rate = %d\n",
|
||||
snd_pcm_format_name(params_format(params)),
|
||||
@ -3188,10 +3188,10 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
|
||||
params_rate(params));
|
||||
|
||||
/* 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)) {
|
||||
offset += snprintf(buf + offset, size - offset,
|
||||
offset += scnprintf(buf + offset, size - offset,
|
||||
" No active DSP links\n");
|
||||
goto out;
|
||||
}
|
||||
@ -3201,16 +3201,16 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
|
||||
struct snd_soc_pcm_runtime *be = dpcm->be;
|
||||
params = &dpcm->hw_params;
|
||||
|
||||
offset += snprintf(buf + offset, size - offset,
|
||||
offset += scnprintf(buf + offset, size - offset,
|
||||
"- %s\n", be->dai_link->name);
|
||||
|
||||
offset += snprintf(buf + offset, size - offset,
|
||||
offset += scnprintf(buf + offset, size - offset,
|
||||
" State: %s\n",
|
||||
dpcm_state_string(be->dpcm[stream].state));
|
||||
|
||||
if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) &&
|
||||
(be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP))
|
||||
offset += snprintf(buf + offset, size - offset,
|
||||
offset += scnprintf(buf + offset, size - offset,
|
||||
" Hardware Params: "
|
||||
"Format = %s, Channels = %d, Rate = %d\n",
|
||||
snd_pcm_format_name(params_format(params)),
|
||||
|
@ -2377,8 +2377,11 @@ static int soc_tplg_link_elems_load(struct soc_tplg *tplg,
|
||||
}
|
||||
|
||||
ret = soc_tplg_link_config(tplg, _link);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
if (!abi_match)
|
||||
kfree(_link);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* offset by version-specific struct size and
|
||||
* real priv data size
|
||||
@ -2542,7 +2545,7 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg,
|
||||
{
|
||||
struct snd_soc_tplg_manifest *manifest, *_manifest;
|
||||
bool abi_match;
|
||||
int err;
|
||||
int ret = 0;
|
||||
|
||||
if (tplg->pass != SOC_TPLG_PASS_MANIFEST)
|
||||
return 0;
|
||||
@ -2555,19 +2558,19 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg,
|
||||
_manifest = manifest;
|
||||
} else {
|
||||
abi_match = false;
|
||||
err = manifest_new_ver(tplg, manifest, &_manifest);
|
||||
if (err < 0)
|
||||
return err;
|
||||
ret = manifest_new_ver(tplg, manifest, &_manifest);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* pass control to component driver for optional further init */
|
||||
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 */
|
||||
kfree(_manifest);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* validate header magic, size and type */
|
||||
|
@ -499,7 +499,7 @@ int snd_sof_ipc_stream_posn(struct snd_soc_component *scomp,
|
||||
|
||||
/* send IPC to the DSP */
|
||||
err = sof_ipc_tx_message(sdev->ipc,
|
||||
stream.hdr.cmd, &stream, sizeof(stream), &posn,
|
||||
stream.hdr.cmd, &stream, sizeof(stream), posn,
|
||||
sizeof(*posn));
|
||||
if (err < 0) {
|
||||
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)
|
||||
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);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -1551,12 +1557,6 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
|
||||
if (STM_SAI_PROTOCOL_IS_SPDIF(sai))
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
clk_unprepare(sai->pdata->pclk);
|
||||
snd_dmaengine_pcm_unregister(&pdev->dev);
|
||||
snd_soc_unregister_component(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user