mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
Revert "ASoC: rockchip: vad: enable vad when system suspend"
This reverts commit 6e1f2fba64.
Change-Id: I08fb911dd2b4abbc188af350dd8ad7e9ebcee795
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
@@ -66,8 +66,6 @@ struct rockchip_vad {
|
||||
struct dentry *debugfs_dir;
|
||||
void *buf;
|
||||
bool acodec_cfg;
|
||||
struct snd_soc_dai *cpu_dai;
|
||||
struct snd_pcm_substream *substream;
|
||||
};
|
||||
|
||||
struct audio_src_addr_map {
|
||||
@@ -537,8 +535,6 @@ static void rockchip_vad_params_fixup(struct snd_pcm_substream *substream,
|
||||
int i;
|
||||
|
||||
cpu_dai = rtd->cpu_dai;
|
||||
vad->cpu_dai = cpu_dai;
|
||||
vad->substream = substream;
|
||||
np = cpu_dai->dev->of_node;
|
||||
if (of_device_is_compatible(np, "rockchip,multi-dais")) {
|
||||
audio_src_dai = rockchip_vad_find_dai(vad->audio_node);
|
||||
@@ -631,17 +627,18 @@ static int rockchip_vad_hw_params(struct snd_pcm_substream *substream,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rockchip_vad_enable_cpudai(struct rockchip_vad *vad)
|
||||
static int rockchip_vad_enable_cpudai(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai;
|
||||
struct snd_pcm_substream *substream;
|
||||
int ret = 0;
|
||||
|
||||
cpu_dai = vad->cpu_dai;
|
||||
substream = vad->substream;
|
||||
if (PCM_RUNTIME_CHECK(substream))
|
||||
return -EFAULT;
|
||||
if (!rtd)
|
||||
return -EFAULT;
|
||||
|
||||
if (!cpu_dai || !substream)
|
||||
return 0;
|
||||
cpu_dai = rtd->cpu_dai;
|
||||
|
||||
pm_runtime_get_sync(cpu_dai->dev);
|
||||
|
||||
@@ -664,6 +661,21 @@ static int rockchip_vad_pcm_startup(struct snd_pcm_substream *substream,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rockchip_vad_pcm_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_codec *codec = dai->codec;
|
||||
struct rockchip_vad *vad = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
return;
|
||||
|
||||
rockchip_vad_enable_cpudai(substream);
|
||||
rockchip_vad_setup(vad);
|
||||
|
||||
vad_substream = NULL;
|
||||
}
|
||||
|
||||
static int rockchip_vad_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
@@ -691,6 +703,7 @@ static int rockchip_vad_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
|
||||
static struct snd_soc_dai_ops rockchip_vad_dai_ops = {
|
||||
.hw_params = rockchip_vad_hw_params,
|
||||
.shutdown = rockchip_vad_pcm_shutdown,
|
||||
.startup = rockchip_vad_pcm_startup,
|
||||
.trigger = rockchip_vad_trigger,
|
||||
};
|
||||
@@ -791,19 +804,6 @@ static void rockchip_vad_init(struct rockchip_vad *vad)
|
||||
regmap_update_bits(vad->regmap, VAD_CTRL, mask, val);
|
||||
}
|
||||
|
||||
static int rockchip_vad_suspend(struct device *dev)
|
||||
{
|
||||
struct rockchip_vad *vad = dev_get_drvdata(dev);
|
||||
|
||||
rockchip_vad_enable_cpudai(vad);
|
||||
rockchip_vad_setup(vad);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops rockchip_vad_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(rockchip_vad_suspend, NULL)
|
||||
};
|
||||
|
||||
static int rockchip_vad_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
@@ -913,7 +913,6 @@ static struct platform_driver rockchip_vad_driver = {
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.of_match_table = of_match_ptr(rockchip_vad_match),
|
||||
.pm = &rockchip_vad_pm_ops,
|
||||
},
|
||||
};
|
||||
module_platform_driver(rockchip_vad_driver);
|
||||
|
||||
Reference in New Issue
Block a user