Merge branch 'asoc-5.1' into asoc-5.2

This commit is contained in:
Mark Brown 2019-04-26 11:02:03 +01:00
commit 93f38ef6a4
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
14 changed files with 74 additions and 19 deletions

View File

@ -802,8 +802,13 @@ struct snd_soc_component_driver {
int probe_order;
int remove_order;
/* signal if the module handling the component cannot be removed */
unsigned int ignore_module_refcount:1;
/*
* signal if the module handling the component should not be removed
* if a pcm is open. Setting this would prevent the module
* refcount being incremented in probe() but allow it be incremented
* when a pcm is opened and decremented when it is closed.
*/
unsigned int module_get_upon_open:1;
/* bits */
unsigned int idle_bias_on:1;

View File

@ -1635,6 +1635,16 @@ err:
return ret;
}
static int cs35l35_i2c_remove(struct i2c_client *i2c_client)
{
struct cs35l35_private *cs35l35 = i2c_get_clientdata(i2c_client);
regulator_bulk_disable(cs35l35->num_supplies, cs35l35->supplies);
gpiod_set_value_cansleep(cs35l35->reset_gpio, 0);
return 0;
}
static const struct of_device_id cs35l35_of_match[] = {
{.compatible = "cirrus,cs35l35"},
{},
@ -1655,6 +1665,7 @@ static struct i2c_driver cs35l35_i2c_driver = {
},
.id_table = cs35l35_id,
.probe = cs35l35_i2c_probe,
.remove = cs35l35_i2c_remove,
};
module_i2c_driver(cs35l35_i2c_driver);

View File

@ -1854,6 +1854,17 @@ static int hdmi_codec_probe(struct snd_soc_component *component)
/* Imp: Store the card pointer in hda_codec */
hdmi->card = dapm->card->snd_card;
/*
* Setup a device_link between card device and HDMI codec device.
* The card device is the consumer and the HDMI codec device is
* the supplier. With this setting, we can make sure that the audio
* domain in display power will be always turned on before operating
* on the HDMI audio codec registers.
* Let's use the flag DL_FLAG_AUTOREMOVE_CONSUMER. This can make
* sure the device link is freed when the machine driver is removed.
*/
device_link_add(component->card->dev, &hdev->dev, DL_FLAG_RPM_ACTIVE |
DL_FLAG_AUTOREMOVE_CONSUMER);
/*
* hdac_device core already sets the state to active and calls
* get_noresume. So enable runtime and set the device to suspend.

View File

@ -2588,6 +2588,7 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
rt5682_reset(rt5682->regmap);
mutex_init(&rt5682->calibrate_mutex);
rt5682_calibrate(rt5682);
ret = regmap_multi_reg_write(rt5682->regmap, patch_list,
@ -2654,7 +2655,6 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
INIT_DELAYED_WORK(&rt5682->jd_check_work,
rt5682_jd_check_handler);
mutex_init(&rt5682->calibrate_mutex);
if (i2c->irq) {
ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL,

View File

@ -1462,13 +1462,20 @@ static int skl_platform_soc_probe(struct snd_soc_component *component)
return 0;
}
static void skl_pcm_remove(struct snd_soc_component *component)
{
/* remove topology */
snd_soc_tplg_component_remove(component, SND_SOC_TPLG_INDEX_ALL);
}
static const struct snd_soc_component_driver skl_component = {
.name = "pcm",
.probe = skl_platform_soc_probe,
.remove = skl_pcm_remove,
.ops = &skl_platform_ops,
.pcm_new = skl_pcm_new,
.pcm_free = skl_pcm_free,
.ignore_module_refcount = 1, /* do not increase the refcount in core */
.module_get_upon_open = 1, /* increment refcount when a pcm is opened */
};
int skl_platform_register(struct device *dev)

View File

@ -193,13 +193,13 @@ static const u8 table_msbc_silence[SCO_PACKET_180] = {
static void mtk_btcvsd_snd_irq_enable(struct mtk_btcvsd_snd *bt)
{
regmap_update_bits(bt->infra, bt->infra_misc_offset,
bt->conn_bt_cvsd_mask, bt->conn_bt_cvsd_mask);
bt->conn_bt_cvsd_mask, 0);
}
static void mtk_btcvsd_snd_irq_disable(struct mtk_btcvsd_snd *bt)
{
regmap_update_bits(bt->infra, bt->infra_misc_offset,
bt->conn_bt_cvsd_mask, 0);
bt->conn_bt_cvsd_mask, bt->conn_bt_cvsd_mask);
}
static void mtk_btcvsd_snd_set_state(struct mtk_btcvsd_snd *bt,

View File

@ -300,6 +300,18 @@ int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io,
return chan;
}
int rsnd_channel_normalization(int chan)
{
if ((chan > 8) || (chan < 0))
return 0;
/* TDM Extend Mode needs 8ch */
if (chan == 6)
chan = 8;
return chan;
}
int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
struct snd_pcm_hw_params *params)
{
@ -312,11 +324,7 @@ int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
if (rsnd_runtime_is_multi_ssi(io))
chan /= rsnd_rdai_ssi_lane_get(rdai);
/* TDM Extend Mode needs 8ch */
if (chan == 6)
chan = 8;
return chan;
return rsnd_channel_normalization(chan);
}
int rsnd_runtime_is_multi_ssi(struct rsnd_dai_stream *io)

View File

@ -446,6 +446,7 @@ void rsnd_parse_connect_common(struct rsnd_dai *rdai,
struct device_node *playback,
struct device_node *capture);
int rsnd_channel_normalization(int chan);
#define rsnd_runtime_channel_original(io) \
rsnd_runtime_channel_original_with_params(io, NULL)
int rsnd_runtime_channel_original_with_params(struct rsnd_dai_stream *io,

View File

@ -303,6 +303,8 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
if (rsnd_runtime_is_tdm_split(io))
chan = rsnd_io_converted_chan(io);
chan = rsnd_channel_normalization(chan);
main_rate = rsnd_ssi_clk_query(rdai, rate, chan, &idx);
if (!main_rate) {
dev_err(dev, "unsupported clock rate\n");

View File

@ -947,7 +947,7 @@ static void soc_cleanup_component(struct snd_soc_component *component)
snd_soc_dapm_free(snd_soc_component_get_dapm(component));
soc_cleanup_component_debugfs(component);
component->card = NULL;
if (!component->driver->ignore_module_refcount)
if (!component->driver->module_get_upon_open)
module_put(component->dev->driver->owner);
}
@ -1381,7 +1381,7 @@ static int soc_probe_component(struct snd_soc_card *card,
return 0;
}
if (!component->driver->ignore_module_refcount &&
if (!component->driver->module_get_upon_open &&
!try_module_get(component->dev->driver->owner))
return -ENODEV;

View File

@ -15,6 +15,7 @@
#include <linux/delay.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/export.h>
@ -463,6 +464,9 @@ static int soc_pcm_components_close(struct snd_pcm_substream *substream,
continue;
component->driver->ops->close(substream);
if (component->driver->module_get_upon_open)
module_put(component->dev->driver->owner);
}
return 0;
@ -513,6 +517,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
!component->driver->ops->open)
continue;
if (component->driver->module_get_upon_open &&
!try_module_get(component->dev->driver->owner))
return -ENODEV;
ret = component->driver->ops->open(substream);
if (ret < 0) {
dev_err(component->dev,

View File

@ -484,10 +484,11 @@ static void remove_widget(struct snd_soc_component *comp,
snd_ctl_remove(card, kcontrol);
kfree(dobj->control.dvalues);
/* free enum kcontrol's dvalues and dtexts */
kfree(se->dobj.control.dvalues);
for (j = 0; j < se->items; j++)
kfree(dobj->control.dtexts[j]);
kfree(dobj->control.dtexts);
kfree(se->dobj.control.dtexts[j]);
kfree(se->dobj.control.dtexts);
kfree(se);
kfree(w->kcontrol_news[i].name);

View File

@ -838,8 +838,9 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
/* Get irqs */
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
if (irq != -EPROBE_DEFER)
dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
return -ENOENT;
return irq;
}
ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT,

View File

@ -1420,7 +1420,6 @@ static int stm32_sai_sub_dais_init(struct platform_device *pdev,
if (!sai->cpu_dai_drv)
return -ENOMEM;
sai->cpu_dai_drv->name = dev_name(&pdev->dev);
if (STM_SAI_IS_PLAYBACK(sai)) {
memcpy(sai->cpu_dai_drv, &stm32_sai_playback_dai,
sizeof(stm32_sai_playback_dai));
@ -1430,6 +1429,7 @@ static int stm32_sai_sub_dais_init(struct platform_device *pdev,
sizeof(stm32_sai_capture_dai));
sai->cpu_dai_drv->capture.stream_name = sai->cpu_dai_drv->name;
}
sai->cpu_dai_drv->name = dev_name(&pdev->dev);
return 0;
}