mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
ASoC: Merge up fixes
We need some of the AMD fixes as a base for new work.
This commit is contained in:
commit
de7a09dec4
@ -18210,6 +18210,7 @@ QCOM AUDIO (ASoC) DRIVERS
|
||||
M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
M: Banajit Goswami <bgoswami@quicinc.com>
|
||||
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
S: Supported
|
||||
F: Documentation/devicetree/bindings/soc/qcom/qcom,apr*
|
||||
F: Documentation/devicetree/bindings/sound/qcom,*
|
||||
|
@ -36,6 +36,7 @@ snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream
|
||||
int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
|
||||
struct dma_chan *chan);
|
||||
int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
|
||||
int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream);
|
||||
|
||||
int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream,
|
||||
dma_filter_fn filter_fn, void *filter_data);
|
||||
|
@ -349,6 +349,16 @@ int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_chan);
|
||||
|
||||
int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
|
||||
|
||||
dmaengine_synchronize(prtd->dma_chan);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_sync_stop);
|
||||
|
||||
/**
|
||||
* snd_dmaengine_pcm_close - Close a dmaengine based PCM substream
|
||||
* @substream: PCM substream
|
||||
|
@ -588,20 +588,12 @@ static int acp_i2s_probe(struct snd_soc_dai *dai)
|
||||
{
|
||||
struct device *dev = dai->component->dev;
|
||||
struct acp_dev_data *adata = dev_get_drvdata(dev);
|
||||
struct acp_resource *rsrc = adata->rsrc;
|
||||
unsigned int val;
|
||||
|
||||
if (!adata->acp_base) {
|
||||
dev_err(dev, "I2S base is NULL\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
val = readl(adata->acp_base + rsrc->i2s_pin_cfg_offset);
|
||||
if (val != rsrc->i2s_mode) {
|
||||
dev_err(dev, "I2S Mode not supported val %x\n", val);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -100,6 +100,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
|
||||
ret = -EINVAL;
|
||||
goto release_regions;
|
||||
}
|
||||
chip->flag = flag;
|
||||
dmic_dev = platform_device_register_data(dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0);
|
||||
if (IS_ERR(dmic_dev)) {
|
||||
dev_err(dev, "failed to create DMIC device\n");
|
||||
@ -139,7 +140,6 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
|
||||
}
|
||||
}
|
||||
|
||||
chip->flag = flag;
|
||||
memset(&pdevinfo, 0, sizeof(pdevinfo));
|
||||
|
||||
pdevinfo.name = chip->name;
|
||||
@ -199,10 +199,12 @@ static int __maybe_unused snd_acp_resume(struct device *dev)
|
||||
ret = acp_init(chip);
|
||||
if (ret)
|
||||
dev_err(dev, "ACP init failed\n");
|
||||
child = chip->chip_pdev->dev;
|
||||
adata = dev_get_drvdata(&child);
|
||||
if (adata)
|
||||
acp_enable_interrupts(adata);
|
||||
if (chip->chip_pdev) {
|
||||
child = chip->chip_pdev->dev;
|
||||
adata = dev_get_drvdata(&child);
|
||||
if (adata)
|
||||
acp_enable_interrupts(adata);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -473,19 +473,22 @@ static int atmel_classd_asoc_card_init(struct device *dev,
|
||||
if (!dai_link)
|
||||
return -ENOMEM;
|
||||
|
||||
comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
|
||||
comp = devm_kzalloc(dev, 2 * sizeof(*comp), GFP_KERNEL);
|
||||
if (!comp)
|
||||
return -ENOMEM;
|
||||
|
||||
dai_link->cpus = comp;
|
||||
dai_link->cpus = &comp[0];
|
||||
dai_link->codecs = &snd_soc_dummy_dlc;
|
||||
dai_link->platforms = &comp[1];
|
||||
|
||||
dai_link->num_cpus = 1;
|
||||
dai_link->num_codecs = 1;
|
||||
dai_link->num_platforms = 1;
|
||||
|
||||
dai_link->name = "CLASSD";
|
||||
dai_link->stream_name = "CLASSD PCM";
|
||||
dai_link->cpus->dai_name = dev_name(dev);
|
||||
dai_link->platforms->name = dev_name(dev);
|
||||
|
||||
card->dai_link = dai_link;
|
||||
card->num_links = 1;
|
||||
|
@ -215,6 +215,10 @@ static const struct reg_sequence cs35l56_asp1_defaults[] = {
|
||||
REG_SEQ0(CS35L56_ASP1_FRAME_CONTROL5, 0x00020100),
|
||||
REG_SEQ0(CS35L56_ASP1_DATA_CONTROL1, 0x00000018),
|
||||
REG_SEQ0(CS35L56_ASP1_DATA_CONTROL5, 0x00000018),
|
||||
REG_SEQ0(CS35L56_ASP1TX1_INPUT, 0x00000000),
|
||||
REG_SEQ0(CS35L56_ASP1TX2_INPUT, 0x00000000),
|
||||
REG_SEQ0(CS35L56_ASP1TX3_INPUT, 0x00000000),
|
||||
REG_SEQ0(CS35L56_ASP1TX4_INPUT, 0x00000000),
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -121,7 +121,7 @@ int cs42l43_set_jack(struct snd_soc_component *component,
|
||||
priv->buttons[3] = 735;
|
||||
}
|
||||
|
||||
ret = cs42l43_find_index(priv, "cirrus,detect-us", 1000, &priv->detect_us,
|
||||
ret = cs42l43_find_index(priv, "cirrus,detect-us", 50000, &priv->detect_us,
|
||||
cs42l43_accdet_us, ARRAY_SIZE(cs42l43_accdet_us));
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
@ -433,7 +433,7 @@ irqreturn_t cs42l43_button_press(int irq, void *data)
|
||||
|
||||
// Wait for 2 full cycles of comb filter to ensure good reading
|
||||
queue_delayed_work(system_wq, &priv->button_press_work,
|
||||
msecs_to_jiffies(10));
|
||||
msecs_to_jiffies(20));
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
@ -857,12 +857,16 @@ static void es8326_jack_detect_handler(struct work_struct *work)
|
||||
* set auto-check mode, then restart jack_detect_work after 400ms.
|
||||
* Don't report jack status.
|
||||
*/
|
||||
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
|
||||
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
|
||||
regmap_write(es8326->regmap, ES8326_INT_SOURCE, 0x00);
|
||||
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
|
||||
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x10, 0x00);
|
||||
es8326_enable_micbias(es8326->component);
|
||||
usleep_range(50000, 70000);
|
||||
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x00);
|
||||
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x10, 0x10);
|
||||
usleep_range(50000, 70000);
|
||||
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
|
||||
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
|
||||
regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x1f);
|
||||
regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x08);
|
||||
queue_delayed_work(system_wq, &es8326->jack_detect_work,
|
||||
|
@ -68,6 +68,7 @@ static bool rt722_sdca_mbq_readable_register(struct device *dev, unsigned int re
|
||||
case 0x200007f:
|
||||
case 0x2000082 ... 0x200008e:
|
||||
case 0x2000090 ... 0x2000094:
|
||||
case 0x3110000:
|
||||
case 0x5300000 ... 0x5300002:
|
||||
case 0x5400002:
|
||||
case 0x5600000 ... 0x5600007:
|
||||
@ -125,6 +126,7 @@ static bool rt722_sdca_mbq_volatile_register(struct device *dev, unsigned int re
|
||||
case 0x2000067:
|
||||
case 0x2000084:
|
||||
case 0x2000086:
|
||||
case 0x3110000:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -350,7 +352,7 @@ static int rt722_sdca_interrupt_callback(struct sdw_slave *slave,
|
||||
|
||||
if (status->sdca_cascade && !rt722->disable_irq)
|
||||
mod_delayed_work(system_power_efficient_wq,
|
||||
&rt722->jack_detect_work, msecs_to_jiffies(30));
|
||||
&rt722->jack_detect_work, msecs_to_jiffies(280));
|
||||
|
||||
mutex_unlock(&rt722->disable_irq_lock);
|
||||
|
||||
|
@ -559,6 +559,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->pdev = pdev;
|
||||
|
||||
cpu_np = of_parse_phandle(np, "audio-cpu", 0);
|
||||
/* Give a chance to old DT binding */
|
||||
if (!cpu_np)
|
||||
@ -787,7 +789,6 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Initialize sound card */
|
||||
priv->pdev = pdev;
|
||||
priv->card.dev = &pdev->dev;
|
||||
priv->card.owner = THIS_MODULE;
|
||||
ret = snd_soc_of_parse_card_name(&priv->card, "model");
|
||||
|
@ -50,4 +50,5 @@ int imx_pcm_dma_init(struct platform_device *pdev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(imx_pcm_dma_init);
|
||||
|
||||
MODULE_DESCRIPTION("Freescale i.MX PCM DMA interface");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -1545,8 +1545,8 @@ static int avs_route_load(struct snd_soc_component *comp, int index,
|
||||
{
|
||||
struct snd_soc_acpi_mach *mach = dev_get_platdata(comp->card->dev);
|
||||
size_t len = SNDRV_CTL_ELEM_ID_NAME_MAXLEN;
|
||||
char buf[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
||||
int ssp_port, tdm_slot;
|
||||
char *buf;
|
||||
|
||||
/* See parse_link_formatted_string() for dynamic naming when(s). */
|
||||
if (!avs_mach_singular_ssp(mach))
|
||||
@ -1557,13 +1557,24 @@ static int avs_route_load(struct snd_soc_component *comp, int index,
|
||||
return 0;
|
||||
tdm_slot = avs_mach_ssp_tdm(mach, ssp_port);
|
||||
|
||||
buf = devm_kzalloc(comp->card->dev, len, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
avs_ssp_sprint(buf, len, route->source, ssp_port, tdm_slot);
|
||||
strscpy((char *)route->source, buf, len);
|
||||
route->source = buf;
|
||||
|
||||
buf = devm_kzalloc(comp->card->dev, len, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
avs_ssp_sprint(buf, len, route->sink, ssp_port, tdm_slot);
|
||||
strscpy((char *)route->sink, buf, len);
|
||||
route->sink = buf;
|
||||
|
||||
if (route->control) {
|
||||
buf = devm_kzalloc(comp->card->dev, len, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
avs_ssp_sprint(buf, len, route->control, ssp_port, tdm_slot);
|
||||
strscpy((char *)route->control, buf, len);
|
||||
route->control = buf;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -610,6 +610,17 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
|
||||
BYT_RT5640_SSP0_AIF1 |
|
||||
BYT_RT5640_MCLK_EN),
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ARCHOS"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ARCHOS 101 CESIUM"),
|
||||
},
|
||||
.driver_data = (void *)(BYTCR_INPUT_DEFAULTS |
|
||||
BYT_RT5640_JD_NOT_INV |
|
||||
BYT_RT5640_DIFF_MIC |
|
||||
BYT_RT5640_SSP0_AIF1 |
|
||||
BYT_RT5640_MCLK_EN),
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ARCHOS"),
|
||||
|
@ -293,7 +293,7 @@ static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = {
|
||||
.adr = 0x000130025D131801,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &single_endpoint,
|
||||
.name_prefix = "rt1318"
|
||||
.name_prefix = "rt1318-1"
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,7 @@ struct mt8183_da7219_max98357_priv {
|
||||
|
||||
static struct snd_soc_jack_pin mt8183_da7219_max98357_jack_pins[] = {
|
||||
{
|
||||
.pin = "Headphone",
|
||||
.pin = "Headphones",
|
||||
.mask = SND_JACK_HEADPHONE,
|
||||
},
|
||||
{
|
||||
@ -626,7 +626,7 @@ static struct snd_soc_codec_conf mt6358_codec_conf[] = {
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new mt8183_da7219_max98357_snd_controls[] = {
|
||||
SOC_DAPM_PIN_SWITCH("Headphone"),
|
||||
SOC_DAPM_PIN_SWITCH("Headphones"),
|
||||
SOC_DAPM_PIN_SWITCH("Headset Mic"),
|
||||
SOC_DAPM_PIN_SWITCH("Speakers"),
|
||||
SOC_DAPM_PIN_SWITCH("Line Out"),
|
||||
@ -634,7 +634,7 @@ static const struct snd_kcontrol_new mt8183_da7219_max98357_snd_controls[] = {
|
||||
|
||||
static const
|
||||
struct snd_soc_dapm_widget mt8183_da7219_max98357_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_HP("Headphone", NULL),
|
||||
SND_SOC_DAPM_HP("Headphones", NULL),
|
||||
SND_SOC_DAPM_MIC("Headset Mic", NULL),
|
||||
SND_SOC_DAPM_SPK("Speakers", NULL),
|
||||
SND_SOC_DAPM_SPK("Line Out", NULL),
|
||||
@ -680,7 +680,7 @@ static struct snd_soc_codec_conf mt8183_da7219_rt1015_codec_conf[] = {
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new mt8183_da7219_rt1015_snd_controls[] = {
|
||||
SOC_DAPM_PIN_SWITCH("Headphone"),
|
||||
SOC_DAPM_PIN_SWITCH("Headphones"),
|
||||
SOC_DAPM_PIN_SWITCH("Headset Mic"),
|
||||
SOC_DAPM_PIN_SWITCH("Left Spk"),
|
||||
SOC_DAPM_PIN_SWITCH("Right Spk"),
|
||||
@ -689,7 +689,7 @@ static const struct snd_kcontrol_new mt8183_da7219_rt1015_snd_controls[] = {
|
||||
|
||||
static const
|
||||
struct snd_soc_dapm_widget mt8183_da7219_rt1015_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_HP("Headphone", NULL),
|
||||
SND_SOC_DAPM_HP("Headphones", NULL),
|
||||
SND_SOC_DAPM_MIC("Headset Mic", NULL),
|
||||
SND_SOC_DAPM_SPK("Left Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Right Spk", NULL),
|
||||
|
@ -43,4 +43,5 @@ int mxs_pcm_platform_register(struct device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mxs_pcm_platform_register);
|
||||
|
||||
MODULE_DESCRIPTION("MXS ASoC PCM driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -146,14 +146,17 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_substream *substream, struct
|
||||
struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev);
|
||||
int rc;
|
||||
|
||||
if (!dai_data->is_port_started[dai->id])
|
||||
return;
|
||||
rc = q6apm_graph_stop(dai_data->graph[dai->id]);
|
||||
if (rc < 0)
|
||||
dev_err(dai->dev, "fail to close APM port (%d)\n", rc);
|
||||
if (dai_data->is_port_started[dai->id]) {
|
||||
rc = q6apm_graph_stop(dai_data->graph[dai->id]);
|
||||
dai_data->is_port_started[dai->id] = false;
|
||||
if (rc < 0)
|
||||
dev_err(dai->dev, "fail to close APM port (%d)\n", rc);
|
||||
}
|
||||
|
||||
q6apm_graph_close(dai_data->graph[dai->id]);
|
||||
dai_data->is_port_started[dai->id] = false;
|
||||
if (dai_data->graph[dai->id]) {
|
||||
q6apm_graph_close(dai_data->graph[dai->id]);
|
||||
dai_data->graph[dai->id] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
|
||||
@ -168,8 +171,10 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s
|
||||
q6apm_graph_stop(dai_data->graph[dai->id]);
|
||||
dai_data->is_port_started[dai->id] = false;
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
q6apm_graph_close(dai_data->graph[dai->id]);
|
||||
dai_data->graph[dai->id] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,26 +193,29 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s
|
||||
|
||||
cfg->direction = substream->stream;
|
||||
rc = q6apm_graph_media_format_pcm(dai_data->graph[dai->id], cfg);
|
||||
|
||||
if (rc) {
|
||||
dev_err(dai->dev, "Failed to set media format %d\n", rc);
|
||||
return rc;
|
||||
goto err;
|
||||
}
|
||||
|
||||
rc = q6apm_graph_prepare(dai_data->graph[dai->id]);
|
||||
if (rc) {
|
||||
dev_err(dai->dev, "Failed to prepare Graph %d\n", rc);
|
||||
return rc;
|
||||
goto err;
|
||||
}
|
||||
|
||||
rc = q6apm_graph_start(dai_data->graph[dai->id]);
|
||||
if (rc < 0) {
|
||||
dev_err(dai->dev, "fail to start APM port %x\n", dai->id);
|
||||
return rc;
|
||||
goto err;
|
||||
}
|
||||
dai_data->is_port_started[dai->id] = true;
|
||||
|
||||
return 0;
|
||||
err:
|
||||
q6apm_graph_close(dai_data->graph[dai->id]);
|
||||
dai_data->graph[dai->id] = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int q6apm_lpass_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
|
||||
|
@ -160,4 +160,5 @@ int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream,
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_free);
|
||||
MODULE_DESCRIPTION("Qualcomm ASoC SoundWire helper functions");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -655,8 +655,17 @@ static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream,
|
||||
int err;
|
||||
|
||||
if (i2s_tdm->is_master_mode) {
|
||||
struct clk *mclk = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
|
||||
i2s_tdm->mclk_tx : i2s_tdm->mclk_rx;
|
||||
struct clk *mclk;
|
||||
|
||||
if (i2s_tdm->clk_trcm == TRCM_TX) {
|
||||
mclk = i2s_tdm->mclk_tx;
|
||||
} else if (i2s_tdm->clk_trcm == TRCM_RX) {
|
||||
mclk = i2s_tdm->mclk_rx;
|
||||
} else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
mclk = i2s_tdm->mclk_tx;
|
||||
} else {
|
||||
mclk = i2s_tdm->mclk_rx;
|
||||
}
|
||||
|
||||
err = clk_set_rate(mclk, DEFAULT_MCLK_FS * params_rate(params));
|
||||
if (err)
|
||||
|
@ -318,6 +318,12 @@ static int dmaengine_copy(struct snd_soc_component *component,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dmaengine_pcm_sync_stop(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
return snd_dmaengine_pcm_sync_stop(substream);
|
||||
}
|
||||
|
||||
static const struct snd_soc_component_driver dmaengine_pcm_component = {
|
||||
.name = SND_DMAENGINE_PCM_DRV_NAME,
|
||||
.probe_order = SND_SOC_COMP_ORDER_LATE,
|
||||
@ -327,6 +333,7 @@ static const struct snd_soc_component_driver dmaengine_pcm_component = {
|
||||
.trigger = dmaengine_pcm_trigger,
|
||||
.pointer = dmaengine_pcm_pointer,
|
||||
.pcm_construct = dmaengine_pcm_new,
|
||||
.sync_stop = dmaengine_pcm_sync_stop,
|
||||
};
|
||||
|
||||
static const struct snd_soc_component_driver dmaengine_pcm_component_process = {
|
||||
@ -339,6 +346,7 @@ static const struct snd_soc_component_driver dmaengine_pcm_component_process = {
|
||||
.pointer = dmaengine_pcm_pointer,
|
||||
.copy = dmaengine_copy,
|
||||
.pcm_construct = dmaengine_pcm_new,
|
||||
.sync_stop = dmaengine_pcm_sync_stop,
|
||||
};
|
||||
|
||||
static const char * const dmaengine_pcm_dma_channel_names[] = {
|
||||
|
@ -1021,6 +1021,7 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
|
||||
struct snd_soc_tplg_hdr *hdr)
|
||||
{
|
||||
struct snd_soc_dapm_context *dapm = &tplg->comp->dapm;
|
||||
const size_t maxlen = SNDRV_CTL_ELEM_ID_NAME_MAXLEN;
|
||||
struct snd_soc_tplg_dapm_graph_elem *elem;
|
||||
struct snd_soc_dapm_route *route;
|
||||
int count, i;
|
||||
@ -1044,31 +1045,27 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
|
||||
tplg->pos += sizeof(struct snd_soc_tplg_dapm_graph_elem);
|
||||
|
||||
/* validate routes */
|
||||
if (strnlen(elem->source, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
|
||||
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (strnlen(elem->sink, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
|
||||
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (strnlen(elem->control, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
|
||||
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) {
|
||||
if ((strnlen(elem->source, maxlen) == maxlen) ||
|
||||
(strnlen(elem->sink, maxlen) == maxlen) ||
|
||||
(strnlen(elem->control, maxlen) == maxlen)) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
route->source = elem->source;
|
||||
route->sink = elem->sink;
|
||||
route->source = devm_kstrdup(tplg->dev, elem->source, GFP_KERNEL);
|
||||
route->sink = devm_kstrdup(tplg->dev, elem->sink, GFP_KERNEL);
|
||||
if (!route->source || !route->sink) {
|
||||
ret = -ENOMEM;
|
||||
break;
|
||||
}
|
||||
|
||||
/* set to NULL atm for tplg users */
|
||||
route->connected = NULL;
|
||||
if (strnlen(elem->control, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0)
|
||||
route->control = NULL;
|
||||
else
|
||||
route->control = elem->control;
|
||||
if (strnlen(elem->control, maxlen) != 0) {
|
||||
route->control = devm_kstrdup(tplg->dev, elem->control, GFP_KERNEL);
|
||||
if (!route->control) {
|
||||
ret = -ENOMEM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* add route dobj to dobj_list */
|
||||
route->dobj.type = SND_SOC_DOBJ_GRAPH;
|
||||
|
@ -379,7 +379,7 @@ static int non_hda_dai_hw_params_data(struct snd_pcm_substream *substream,
|
||||
|
||||
sdev = widget_to_sdev(w);
|
||||
if (sdev->dspless_mode_selected)
|
||||
goto skip_tlv;
|
||||
return 0;
|
||||
|
||||
/* get stream_id */
|
||||
hext_stream = ops->get_hext_stream(sdev, cpu_dai, substream);
|
||||
@ -423,7 +423,6 @@ static int non_hda_dai_hw_params_data(struct snd_pcm_substream *substream,
|
||||
dma_config->dma_stream_channel_map.device_count = 1;
|
||||
dma_config->dma_priv_config_size = 0;
|
||||
|
||||
skip_tlv:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -525,6 +524,9 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (sdev->dspless_mode_selected)
|
||||
return 0;
|
||||
|
||||
ipc4_copier = widget_to_copier(w);
|
||||
dma_config_tlv = &ipc4_copier->dma_config_tlv[cpu_dai_id];
|
||||
dma_config = &dma_config_tlv->dma_config;
|
||||
|
@ -485,7 +485,7 @@ sink_prepare:
|
||||
if (ret < 0) {
|
||||
/* unprepare the source widget */
|
||||
if (widget_ops[widget->id].ipc_unprepare &&
|
||||
swidget && swidget->prepared) {
|
||||
swidget && swidget->prepared && swidget->use_count == 0) {
|
||||
widget_ops[widget->id].ipc_unprepare(swidget);
|
||||
swidget->prepared = false;
|
||||
}
|
||||
|
@ -1472,10 +1472,11 @@ static int davinci_mcasp_hw_rule_min_periodsize(
|
||||
{
|
||||
struct snd_interval *period_size = hw_param_interval(params,
|
||||
SNDRV_PCM_HW_PARAM_PERIOD_SIZE);
|
||||
u8 numevt = *((u8 *)rule->private);
|
||||
struct snd_interval frames;
|
||||
|
||||
snd_interval_any(&frames);
|
||||
frames.min = 64;
|
||||
frames.min = numevt;
|
||||
frames.integer = 1;
|
||||
|
||||
return snd_interval_refine(period_size, &frames);
|
||||
@ -1490,6 +1491,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
|
||||
u32 max_channels = 0;
|
||||
int i, dir, ret;
|
||||
int tdm_slots = mcasp->tdm_slots;
|
||||
u8 *numevt;
|
||||
|
||||
/* Do not allow more then one stream per direction */
|
||||
if (mcasp->substreams[substream->stream])
|
||||
@ -1589,9 +1591,12 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
|
||||
return ret;
|
||||
}
|
||||
|
||||
numevt = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
|
||||
&mcasp->txnumevt :
|
||||
&mcasp->rxnumevt;
|
||||
snd_pcm_hw_rule_add(substream->runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
|
||||
davinci_mcasp_hw_rule_min_periodsize, NULL,
|
||||
davinci_mcasp_hw_rule_min_periodsize, numevt,
|
||||
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
|
||||
|
||||
return 0;
|
||||
|
@ -354,11 +354,7 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
|
||||
card->name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"HDMI %s", dev_name(ad->dssdev));
|
||||
if (!card->name)
|
||||
return -ENOMEM;
|
||||
|
||||
card->name = "HDMI";
|
||||
card->owner = THIS_MODULE;
|
||||
card->dai_link =
|
||||
devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KERNEL);
|
||||
|
Loading…
Reference in New Issue
Block a user