diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-12-07 11:40:00 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-12-07 11:40:04 +0100 |
commit | 2bff7e97ebbb1119e9f22936706294f4e85d4db6 (patch) | |
tree | a2afac81b24649749d546feb6af966f813eb7dd2 /sound/soc/omap/omap-dmic.c | |
parent | 157ab88ef64a2edccd722f120464109ceba9bac1 (diff) | |
parent | bde1a7459623a66c2abec4d0a841e4b06cc88d9a (diff) |
Merge branch 'for-linus' into for-next
Back-merge for applying the more HD-audio quirks on top of the latest
code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/omap/omap-dmic.c')
-rw-r--r-- | sound/soc/omap/omap-dmic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index fe966272bd0c..cba9645b6487 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -48,6 +48,8 @@ struct omap_dmic { struct device *dev; void __iomem *io_base; struct clk *fclk; + struct pm_qos_request pm_qos_req; + int latency; int fclk_freq; int out_freq; int clk_div; @@ -124,6 +126,8 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream, mutex_lock(&dmic->mutex); + pm_qos_remove_request(&dmic->pm_qos_req); + if (!dai->active) dmic->active = 0; @@ -228,6 +232,8 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_substream *substream, /* packet size is threshold * channels */ dma_data = snd_soc_dai_get_dma_data(dai, substream); dma_data->maxburst = dmic->threshold * channels; + dmic->latency = (OMAP_DMIC_THRES_MAX - dmic->threshold) * USEC_PER_SEC / + params_rate(params); return 0; } @@ -238,6 +244,9 @@ static int omap_dmic_dai_prepare(struct snd_pcm_substream *substream, struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai); u32 ctrl; + if (pm_qos_request_active(&dmic->pm_qos_req)) + pm_qos_update_request(&dmic->pm_qos_req, dmic->latency); + /* Configure uplink threshold */ omap_dmic_write(dmic, OMAP_DMIC_FIFO_CTRL_REG, dmic->threshold); |