Skip to content

Commit 6bf5f9a

Browse files
committed
Merge tag 'asoc-v6.2-3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v6.2 Some more small fixes and board quirks that came in since my last update, the main one being the fixes from Kai for issues around the attempts to get kexec working well on SOF based systems.
2 parents fd28941 + a12a383 commit 6bf5f9a

File tree

12 files changed

+138
-15
lines changed

12 files changed

+138
-15
lines changed

sound/soc/codecs/lochnagar-sc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ MODULE_DEVICE_TABLE(of, lochnagar_of_match);
253253
static struct platform_driver lochnagar_sc_codec_driver = {
254254
.driver = {
255255
.name = "lochnagar-soundcard",
256-
.of_match_table = of_match_ptr(lochnagar_of_match),
256+
.of_match_table = lochnagar_of_match,
257257
},
258258

259259
.probe = lochnagar_sc_probe,

sound/soc/codecs/rt5670.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3311,8 +3311,6 @@ static int rt5670_i2c_probe(struct i2c_client *i2c)
33113311
if (ret < 0)
33123312
goto err;
33133313

3314-
pm_runtime_put(&i2c->dev);
3315-
33163314
return 0;
33173315
err:
33183316
pm_runtime_disable(&i2c->dev);

sound/soc/codecs/wm8994.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,7 +3853,12 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
38533853
} else {
38543854
dev_dbg(component->dev, "Jack not detected\n");
38553855

3856+
/* Release wm8994->accdet_lock to avoid deadlock:
3857+
* cancel_delayed_work_sync() takes wm8994->mic_work internal
3858+
* lock and wm1811_mic_work takes wm8994->accdet_lock */
3859+
mutex_unlock(&wm8994->accdet_lock);
38563860
cancel_delayed_work_sync(&wm8994->mic_work);
3861+
mutex_lock(&wm8994->accdet_lock);
38573862

38583863
snd_soc_component_update_bits(component, WM8958_MICBIAS2,
38593864
WM8958_MICB2_DISCH, WM8958_MICB2_DISCH);

sound/soc/intel/boards/bytcr_rt5640.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,21 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
570570
BYT_RT5640_SSP0_AIF1 |
571571
BYT_RT5640_MCLK_EN),
572572
},
573+
{
574+
/* Advantech MICA-071 */
575+
.matches = {
576+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Advantech"),
577+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MICA-071"),
578+
},
579+
/* OVCD Th = 1500uA to reliable detect head-phones vs -set */
580+
.driver_data = (void *)(BYT_RT5640_IN3_MAP |
581+
BYT_RT5640_JD_SRC_JD2_IN4N |
582+
BYT_RT5640_OVCD_TH_1500UA |
583+
BYT_RT5640_OVCD_SF_0P75 |
584+
BYT_RT5640_MONO_SPEAKER |
585+
BYT_RT5640_DIFF_MIC |
586+
BYT_RT5640_MCLK_EN),
587+
},
573588
{
574589
.matches = {
575590
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ARCHOS"),
@@ -796,6 +811,16 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
796811
BYT_RT5640_SSP0_AIF1 |
797812
BYT_RT5640_MCLK_EN),
798813
},
814+
{ /* HP Stream 8 */
815+
.matches = {
816+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
817+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP Stream 8 Tablet"),
818+
},
819+
.driver_data = (void *)(BYTCR_INPUT_DEFAULTS |
820+
BYT_RT5640_JD_NOT_INV |
821+
BYT_RT5640_SSP0_AIF1 |
822+
BYT_RT5640_MCLK_EN),
823+
},
799824
{ /* I.T.Works TW891 */
800825
.matches = {
801826
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),

sound/soc/intel/common/soc-acpi-intel-rpl-match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static const struct snd_soc_acpi_adr_device rt1316_1_group2_adr[] = {
112112

113113
static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
114114
{
115-
.adr = 0x000131025D131801ull,
115+
.adr = 0x000132025D131801ull,
116116
.num_endpoints = 1,
117117
.endpoints = &spk_l_endpoint,
118118
.name_prefix = "rt1318-1"

sound/soc/mediatek/mt8195/mt8195-mt6359.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,32 @@ static const struct snd_soc_ops mt8195_rt1011_etdm_ops = {
633633
.hw_params = mt8195_rt1011_etdm_hw_params,
634634
};
635635

636+
static int mt8195_sof_be_hw_params(struct snd_pcm_substream *substream,
637+
struct snd_pcm_hw_params *params)
638+
{
639+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
640+
struct snd_soc_component *cmpnt_afe = NULL;
641+
struct snd_soc_pcm_runtime *runtime;
642+
643+
/* find afe component */
644+
for_each_card_rtds(rtd->card, runtime) {
645+
cmpnt_afe = snd_soc_rtdcom_lookup(runtime, AFE_PCM_NAME);
646+
if (cmpnt_afe)
647+
break;
648+
}
649+
650+
if (cmpnt_afe && !pm_runtime_active(cmpnt_afe->dev)) {
651+
dev_err(rtd->dev, "afe pm runtime is not active!!\n");
652+
return -EINVAL;
653+
}
654+
655+
return 0;
656+
}
657+
658+
static const struct snd_soc_ops mt8195_sof_be_ops = {
659+
.hw_params = mt8195_sof_be_hw_params,
660+
};
661+
636662
static int mt8195_rt1011_init(struct snd_soc_pcm_runtime *rtd)
637663
{
638664
struct snd_soc_card *card = rtd->card;
@@ -1272,24 +1298,28 @@ static struct snd_soc_dai_link mt8195_mt6359_dai_links[] = {
12721298
.name = "AFE_SOF_DL2",
12731299
.no_pcm = 1,
12741300
.dpcm_playback = 1,
1301+
.ops = &mt8195_sof_be_ops,
12751302
SND_SOC_DAILINK_REG(AFE_SOF_DL2),
12761303
},
12771304
[DAI_LINK_SOF_DL3_BE] = {
12781305
.name = "AFE_SOF_DL3",
12791306
.no_pcm = 1,
12801307
.dpcm_playback = 1,
1308+
.ops = &mt8195_sof_be_ops,
12811309
SND_SOC_DAILINK_REG(AFE_SOF_DL3),
12821310
},
12831311
[DAI_LINK_SOF_UL4_BE] = {
12841312
.name = "AFE_SOF_UL4",
12851313
.no_pcm = 1,
12861314
.dpcm_capture = 1,
1315+
.ops = &mt8195_sof_be_ops,
12871316
SND_SOC_DAILINK_REG(AFE_SOF_UL4),
12881317
},
12891318
[DAI_LINK_SOF_UL5_BE] = {
12901319
.name = "AFE_SOF_UL5",
12911320
.no_pcm = 1,
12921321
.dpcm_capture = 1,
1322+
.ops = &mt8195_sof_be_ops,
12931323
SND_SOC_DAILINK_REG(AFE_SOF_UL5),
12941324
},
12951325
};

sound/soc/rockchip/rockchip_spdif.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static int __maybe_unused rk_spdif_runtime_resume(struct device *dev)
8888

8989
ret = clk_prepare_enable(spdif->hclk);
9090
if (ret) {
91+
clk_disable_unprepare(spdif->mclk);
9192
dev_err(spdif->dev, "hclk clock enable failed %d\n", ret);
9293
return ret;
9394
}

sound/soc/sof/core.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -475,19 +475,10 @@ EXPORT_SYMBOL(snd_sof_device_remove);
475475
int snd_sof_device_shutdown(struct device *dev)
476476
{
477477
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
478-
struct snd_sof_pdata *pdata = sdev->pdata;
479478

480479
if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
481480
cancel_work_sync(&sdev->probe_work);
482481

483-
/*
484-
* make sure clients and machine driver(s) are unregistered to force
485-
* all userspace devices to be closed prior to the DSP shutdown sequence
486-
*/
487-
sof_unregister_clients(sdev);
488-
489-
snd_sof_machine_unregister(sdev, pdata);
490-
491482
if (sdev->fw_state == SOF_FW_BOOT_COMPLETE)
492483
return snd_sof_shutdown(sdev);
493484

sound/soc/sof/intel/hda-dsp.c

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,78 @@ int hda_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state)
878878
return snd_sof_dsp_set_power_state(sdev, &target_dsp_state);
879879
}
880880

881+
static unsigned int hda_dsp_check_for_dma_streams(struct snd_sof_dev *sdev)
882+
{
883+
struct hdac_bus *bus = sof_to_bus(sdev);
884+
struct hdac_stream *s;
885+
unsigned int active_streams = 0;
886+
int sd_offset;
887+
u32 val;
888+
889+
list_for_each_entry(s, &bus->stream_list, list) {
890+
sd_offset = SOF_STREAM_SD_OFFSET(s);
891+
val = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR,
892+
sd_offset);
893+
if (val & SOF_HDA_SD_CTL_DMA_START)
894+
active_streams |= BIT(s->index);
895+
}
896+
897+
return active_streams;
898+
}
899+
900+
static int hda_dsp_s5_quirk(struct snd_sof_dev *sdev)
901+
{
902+
int ret;
903+
904+
/*
905+
* Do not assume a certain timing between the prior
906+
* suspend flow, and running of this quirk function.
907+
* This is needed if the controller was just put
908+
* to reset before calling this function.
909+
*/
910+
usleep_range(500, 1000);
911+
912+
/*
913+
* Take controller out of reset to flush DMA
914+
* transactions.
915+
*/
916+
ret = hda_dsp_ctrl_link_reset(sdev, false);
917+
if (ret < 0)
918+
return ret;
919+
920+
usleep_range(500, 1000);
921+
922+
/* Restore state for shutdown, back to reset */
923+
ret = hda_dsp_ctrl_link_reset(sdev, true);
924+
if (ret < 0)
925+
return ret;
926+
927+
return ret;
928+
}
929+
930+
int hda_dsp_shutdown_dma_flush(struct snd_sof_dev *sdev)
931+
{
932+
unsigned int active_streams;
933+
int ret, ret2;
934+
935+
/* check if DMA cleanup has been successful */
936+
active_streams = hda_dsp_check_for_dma_streams(sdev);
937+
938+
sdev->system_suspend_target = SOF_SUSPEND_S3;
939+
ret = snd_sof_suspend(sdev->dev);
940+
941+
if (active_streams) {
942+
dev_warn(sdev->dev,
943+
"There were active DSP streams (%#x) at shutdown, trying to recover\n",
944+
active_streams);
945+
ret2 = hda_dsp_s5_quirk(sdev);
946+
if (ret2 < 0)
947+
dev_err(sdev->dev, "shutdown recovery failed (%d)\n", ret2);
948+
}
949+
950+
return ret;
951+
}
952+
881953
int hda_dsp_shutdown(struct snd_sof_dev *sdev)
882954
{
883955
sdev->system_suspend_target = SOF_SUSPEND_S3;

sound/soc/sof/intel/hda.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ int hda_dsp_resume(struct snd_sof_dev *sdev);
592592
int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev);
593593
int hda_dsp_runtime_resume(struct snd_sof_dev *sdev);
594594
int hda_dsp_runtime_idle(struct snd_sof_dev *sdev);
595+
int hda_dsp_shutdown_dma_flush(struct snd_sof_dev *sdev);
595596
int hda_dsp_shutdown(struct snd_sof_dev *sdev);
596597
int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev);
597598
void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags);

0 commit comments

Comments
 (0)