From: Mark Brown Date: Wed, 18 Jan 2023 15:33:51 +0000 (+0000) Subject: ASoC: Merge up 6.2 fixes X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=309d401452b96f23abe2572d290c51c548d9f728;p=linux.git ASoC: Merge up 6.2 fixes To resolve a conflict and support further development. --- 309d401452b96f23abe2572d290c51c548d9f728 diff --cc sound/soc/sof/pm.c index e7fce9e4a0d23,8722bbd7fd3d7..8d3383085d12c --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@@ -179,10 -179,10 +179,10 @@@ static int sof_resume(struct device *de static int sof_suspend(struct device *dev, bool runtime_suspend) { struct snd_sof_dev *sdev = dev_get_drvdata(dev); - const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; - const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg; + const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm); + const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg); pm_message_t pm_state; - u32 target_state = 0; + u32 target_state = snd_sof_dsp_power_target(sdev); int ret; /* do nothing if dsp suspend callback is not set */ diff --cc sound/soc/sof/sof-audio.c index e1ab8380e7d84,275b1ae453062..f17d405a9da9e --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@@ -268,17 -266,16 +268,17 @@@ static int sof_setup_pipeline_connectio static void sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget) { - const struct sof_ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg; - const struct sof_ipc_tplg_widget_ops *widget_ops = ipc_tplg_ops->widget; + const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg); struct snd_sof_widget *swidget = widget->dobj.private; + const struct sof_ipc_tplg_widget_ops *widget_ops; struct snd_soc_dapm_path *p; - /* return if the widget is in use or if it is already unprepared */ - if (!swidget->prepared || swidget->use_count > 1) - return; + /* skip if the widget is in use or if it is already unprepared */ + if (!swidget || !swidget->prepared || swidget->use_count > 0) + goto sink_unprepare; - if (widget_ops[widget->id].ipc_unprepare) + widget_ops = tplg_ops ? tplg_ops->widget : NULL; + if (widget_ops && widget_ops[widget->id].ipc_unprepare) /* unprepare the source widget */ widget_ops[widget->id].ipc_unprepare(swidget); @@@ -306,11 -304,7 +307,11 @@@ sof_prepare_widgets_in_path(struct snd_ struct snd_soc_dapm_path *p; int ret; + widget_ops = tplg_ops ? tplg_ops->widget : NULL; + if (!widget_ops) + return 0; + - if (!widget_ops[widget->id].ipc_prepare || swidget->prepared) + if (!swidget || !widget_ops[widget->id].ipc_prepare || swidget->prepared) goto sink_prepare; /* prepare the source widget */