From: mac.chiang@intel.com
To: alsa-devel@alsa-project.org
Cc: harshapriya.n@intel.com, pierre-louis.bossart@linux.intel.com,
jenny.tc@intel.com
Subject: [PATCH] ASoC: Intel: boards: kbl_da7219_max98927: add dai_trigger function
Date: Sat, 2 Mar 2019 01:14:11 +0800 [thread overview]
Message-ID: <1551460451-24540-1-git-send-email-mac.chiang@intel.com> (raw)
From: Mac Chiang <mac.chiang@intel.com>
s0ix entry failure is root cause by default speaker/vi sense path activate all the time
that result in the audio IPs are not power gated(checked by pch_ip_power_gating_status).
Adding the run time speaker control ensure playback widgets are going to free and off
eventually. With this func, counter works in s0ix subsequently (checked by slp_s0_residency_usc).
Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Harshapriya.n <harshapriya.n@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
---
sound/soc/intel/boards/kbl_da7219_max98927.c | 50 ++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/sound/soc/intel/boards/kbl_da7219_max98927.c b/sound/soc/intel/boards/kbl_da7219_max98927.c
index 723a493..e01ca9a 100644
--- a/sound/soc/intel/boards/kbl_da7219_max98927.c
+++ b/sound/soc/intel/boards/kbl_da7219_max98927.c
@@ -195,8 +195,58 @@ static int kabylake_ssp0_hw_params(struct snd_pcm_substream *substream,
return 0;
}
+static int kabylake_ssp0_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ int j, ret;
+
+ for (j = 0; j < rtd->num_codecs; j++) {
+ struct snd_soc_dai *codec_dai = rtd->codec_dais[j];
+ const char *name = codec_dai->component->name;
+ struct snd_soc_component *component = codec_dai->component;
+ struct snd_soc_dapm_context *dapm =
+ snd_soc_component_get_dapm(component);
+ char pin_name[20];
+
+ if (strcmp(name, MAXIM_DEV0_NAME) &&
+ strcmp(name, MAXIM_DEV1_NAME))
+ continue;
+
+ snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",
+ codec_dai->component->name_prefix);
+
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ ret = snd_soc_dapm_enable_pin(dapm, pin_name);
+ if (ret) {
+ dev_err(rtd->dev, "failed to enable %s: %d\n",
+ pin_name, ret);
+ return ret;
+ }
+ snd_soc_dapm_sync(dapm);
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ ret = snd_soc_dapm_disable_pin(dapm, pin_name);
+ if (ret) {
+ dev_err(rtd->dev, "failed to disable %s: %d\n",
+ pin_name, ret);
+ return ret;
+ }
+ snd_soc_dapm_sync(dapm);
+ break;
+ }
+ }
+
+ return 0;
+}
+
static struct snd_soc_ops kabylake_ssp0_ops = {
.hw_params = kabylake_ssp0_hw_params,
+ .trigger = kabylake_ssp0_trigger,
};
static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
--
2.7.4
next reply other threads:[~2019-03-01 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 17:14 mac.chiang [this message]
2019-03-01 18:06 ` [PATCH] ASoC: Intel: boards: kbl_da7219_max98927: add dai_trigger function Pierre-Louis Bossart
2019-03-04 2:33 ` Chiang, Mac
2019-03-05 2:22 ` [PATCH v2] " mac.chiang
2019-03-05 4:03 ` Pierre-Louis Bossart
2019-03-05 5:42 ` Chiang, Mac
2019-03-05 15:07 ` Pierre-Louis Bossart
2019-03-08 5:16 ` [PATCH v3] " mac.chiang
2019-03-08 15:31 ` Pierre-Louis Bossart
-- strict thread matches above, loose matches on Subject: below --
2019-05-02 7:06 [PATCH] " mac.chiang
2019-05-02 16:08 ` Pierre-Louis Bossart
2019-05-03 2:50 ` Chiang, Mac
2019-05-03 2:27 mac.chiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1551460451-24540-1-git-send-email-mac.chiang@intel.com \
--to=mac.chiang@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=harshapriya.n@intel.com \
--cc=jenny.tc@intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).