Commit a8e99234 authored by Mark Brown's avatar Mark Brown

Merge branch 'asoc-5.2' into asoc-5.3

parents adb76b5b 04268bf2
...@@ -170,7 +170,6 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init); ...@@ -170,7 +170,6 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init);
void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev) void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev)
{ {
snd_hdac_device_exit(hdev); snd_hdac_device_exit(hdev);
kfree(hdev);
} }
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit); EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);
......
...@@ -1909,6 +1909,21 @@ static int max98090_configure_dmic(struct max98090_priv *max98090, ...@@ -1909,6 +1909,21 @@ static int max98090_configure_dmic(struct max98090_priv *max98090,
return 0; return 0;
} }
static int max98090_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
unsigned int fmt = max98090->dai_fmt;
/* Remove 24-bit format support if it is not in right justified mode. */
if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_RIGHT_J) {
substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
snd_pcm_hw_constraint_msbits(substream->runtime, 0, 16, 16);
}
return 0;
}
static int max98090_dai_hw_params(struct snd_pcm_substream *substream, static int max98090_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
...@@ -2316,6 +2331,7 @@ EXPORT_SYMBOL_GPL(max98090_mic_detect); ...@@ -2316,6 +2331,7 @@ EXPORT_SYMBOL_GPL(max98090_mic_detect);
#define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
static const struct snd_soc_dai_ops max98090_dai_ops = { static const struct snd_soc_dai_ops max98090_dai_ops = {
.startup = max98090_dai_startup,
.set_sysclk = max98090_dai_set_sysclk, .set_sysclk = max98090_dai_set_sysclk,
.set_fmt = max98090_dai_set_fmt, .set_fmt = max98090_dai_set_fmt,
.set_tdm_slot = max98090_set_tdm_slot, .set_tdm_slot = max98090_set_tdm_slot,
......
...@@ -405,6 +405,8 @@ static int rt274_mic_detect(struct snd_soc_component *component, ...@@ -405,6 +405,8 @@ static int rt274_mic_detect(struct snd_soc_component *component,
{ {
struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component);
rt274->jack = jack;
if (jack == NULL) { if (jack == NULL) {
/* Disable jack detection */ /* Disable jack detection */
regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL,
...@@ -412,7 +414,6 @@ static int rt274_mic_detect(struct snd_soc_component *component, ...@@ -412,7 +414,6 @@ static int rt274_mic_detect(struct snd_soc_component *component,
return 0; return 0;
} }
rt274->jack = jack;
regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL,
RT274_IRQ_EN, RT274_IRQ_EN); RT274_IRQ_EN, RT274_IRQ_EN);
......
...@@ -496,6 +496,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -496,6 +496,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
} }
/* override plaform name, if required */ /* override plaform name, if required */
byt_cht_es8316_card.dev = dev;
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;
ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card, ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card,
...@@ -576,7 +577,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -576,7 +577,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
(quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
mic_name[BYT_CHT_ES8316_MAP(quirk)]); mic_name[BYT_CHT_ES8316_MAP(quirk)]);
byt_cht_es8316_card.long_name = long_name; byt_cht_es8316_card.long_name = long_name;
byt_cht_es8316_card.dev = dev;
snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card); ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card);
......
...@@ -462,6 +462,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -462,6 +462,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
} }
/* override plaform name, if required */ /* override plaform name, if required */
snd_soc_card_cht.dev = &pdev->dev;
mach = (&pdev->dev)->platform_data; mach = (&pdev->dev)->platform_data;
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;
...@@ -471,7 +472,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -471,7 +472,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
return ret_val; return ret_val;
/* register the soc card */ /* register the soc card */
snd_soc_card_cht.dev = &pdev->dev;
snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
if (drv->quirks & QUIRK_PMC_PLT_CLK_0) if (drv->quirks & QUIRK_PMC_PLT_CLK_0)
......
...@@ -266,6 +266,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -266,6 +266,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
/* override plaform name, if required */ /* override plaform name, if required */
snd_soc_card_cht.dev = &pdev->dev;
mach = (&pdev->dev)->platform_data; mach = (&pdev->dev)->platform_data;
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;
...@@ -275,7 +276,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -275,7 +276,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
return ret_val; return ret_val;
/* register the soc card */ /* register the soc card */
snd_soc_card_cht.dev = &pdev->dev;
ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht); ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
if (ret_val) { if (ret_val) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
......
...@@ -435,6 +435,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -435,6 +435,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
} }
/* override plaform name, if required */ /* override plaform name, if required */
snd_soc_card_cht.dev = &pdev->dev;
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;
ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht, ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht,
...@@ -452,7 +453,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -452,7 +453,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
/* register the soc card */ /* register the soc card */
snd_soc_card_cht.dev = &pdev->dev;
ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht); ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
if (ret_val) { if (ret_val) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
......
...@@ -132,7 +132,7 @@ config SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A ...@@ -132,7 +132,7 @@ config SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A
config SND_SOC_MT8183_DA7219_MAX98357A config SND_SOC_MT8183_DA7219_MAX98357A
tristate "ASoC Audio driver for MT8183 with DA7219 MAX98357A codec" tristate "ASoC Audio driver for MT8183 with DA7219 MAX98357A codec"
depends on SND_SOC_MT8183 depends on SND_SOC_MT8183 && I2C
select SND_SOC_MT6358 select SND_SOC_MT6358
select SND_SOC_MAX98357A select SND_SOC_MAX98357A
select SND_SOC_DA7219 select SND_SOC_DA7219
......
...@@ -1983,6 +1983,16 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1983,6 +1983,16 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
int ret, i, order; int ret, i, order;
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
for_each_card_prelinks(card, i, dai_link) {
ret = soc_init_dai_link(card, dai_link);
if (ret) {
soc_cleanup_card_resources(card);
dev_err(card->dev, "ASoC: failed to init link %s: %d\n",
dai_link->name, ret);
mutex_unlock(&client_mutex);
return ret;
}
}
mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT); mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
card->dapm.bias_level = SND_SOC_BIAS_OFF; card->dapm.bias_level = SND_SOC_BIAS_OFF;
...@@ -2707,25 +2717,9 @@ static int snd_soc_bind_card(struct snd_soc_card *card) ...@@ -2707,25 +2717,9 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
*/ */
int snd_soc_register_card(struct snd_soc_card *card) int snd_soc_register_card(struct snd_soc_card *card)
{ {
int i, ret;
struct snd_soc_dai_link *link;
if (!card->name || !card->dev) if (!card->name || !card->dev)
return -EINVAL; return -EINVAL;
mutex_lock(&client_mutex);
for_each_card_prelinks(card, i, link) {
ret = soc_init_dai_link(card, link);
if (ret) {
dev_err(card->dev, "ASoC: failed to init link %s\n",
link->name);
mutex_unlock(&client_mutex);
return ret;
}
}
mutex_unlock(&client_mutex);
dev_set_drvdata(card->dev, card); dev_set_drvdata(card->dev, card);
snd_soc_initialize_card_lists(card); snd_soc_initialize_card_lists(card);
......
...@@ -227,7 +227,9 @@ static int hda_init(struct snd_sof_dev *sdev) ...@@ -227,7 +227,9 @@ static int hda_init(struct snd_sof_dev *sdev)
/* initialise hdac bus */ /* initialise hdac bus */
bus->addr = pci_resource_start(pci, 0); bus->addr = pci_resource_start(pci, 0);
#if IS_ENABLED(CONFIG_PCI)
bus->remap_addr = pci_ioremap_bar(pci, 0); bus->remap_addr = pci_ioremap_bar(pci, 0);
#endif
if (!bus->remap_addr) { if (!bus->remap_addr) {
dev_err(bus->dev, "error: ioremap error\n"); dev_err(bus->dev, "error: ioremap error\n");
return -ENXIO; return -ENXIO;
...@@ -454,7 +456,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) ...@@ -454,7 +456,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
goto hdac_bus_unmap; goto hdac_bus_unmap;
/* DSP base */ /* DSP base */
#if IS_ENABLED(CONFIG_PCI)
sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR); sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR);
#endif
if (!sdev->bar[HDA_DSP_BAR]) { if (!sdev->bar[HDA_DSP_BAR]) {
dev_err(sdev->dev, "error: ioremap error\n"); dev_err(sdev->dev, "error: ioremap error\n");
ret = -ENXIO; ret = -ENXIO;
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
#define SUN8I_I2S_TX_CHAN_MAP_REG 0x44 #define SUN8I_I2S_TX_CHAN_MAP_REG 0x44
#define SUN8I_I2S_TX_CHAN_SEL_REG 0x34 #define SUN8I_I2S_TX_CHAN_SEL_REG 0x34
#define SUN8I_I2S_TX_CHAN_OFFSET_MASK GENMASK(13, 11) #define SUN8I_I2S_TX_CHAN_OFFSET_MASK GENMASK(13, 12)
#define SUN8I_I2S_TX_CHAN_OFFSET(offset) (offset << 12) #define SUN8I_I2S_TX_CHAN_OFFSET(offset) (offset << 12)
#define SUN8I_I2S_TX_CHAN_EN_MASK GENMASK(11, 4) #define SUN8I_I2S_TX_CHAN_EN_MASK GENMASK(11, 4)
#define SUN8I_I2S_TX_CHAN_EN(num_chan) (((1 << num_chan) - 1) << 4) #define SUN8I_I2S_TX_CHAN_EN(num_chan) (((1 << num_chan) - 1) << 4)
...@@ -490,6 +490,10 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -490,6 +490,10 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
regmap_update_bits(i2s->regmap, SUN8I_I2S_TX_CHAN_SEL_REG, regmap_update_bits(i2s->regmap, SUN8I_I2S_TX_CHAN_SEL_REG,
SUN8I_I2S_TX_CHAN_OFFSET_MASK, SUN8I_I2S_TX_CHAN_OFFSET_MASK,
SUN8I_I2S_TX_CHAN_OFFSET(offset)); SUN8I_I2S_TX_CHAN_OFFSET(offset));
regmap_update_bits(i2s->regmap, SUN8I_I2S_RX_CHAN_SEL_REG,
SUN8I_I2S_TX_CHAN_OFFSET_MASK,
SUN8I_I2S_TX_CHAN_OFFSET(offset));
} }
regmap_field_write(i2s->field_fmt_mode, val); regmap_field_write(i2s->field_fmt_mode, val);
......
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