diff options
author | Misael Lopez Cruz | 2013-07-30 15:27:03 -0500 |
---|---|---|
committer | Gerrit Code Review | 2013-08-05 15:54:27 -0500 |
commit | 299d9b7c0213d2e87dc428b6df4f89dd6504b438 (patch) | |
tree | 99cce9fcad9e88fc8a9e68b1b31e40ff6a8ffe91 | |
parent | 0f6c53e3e00168fb4d0fc500ffbd2b990ee30fad (diff) | |
download | kernel-audio-299d9b7c0213d2e87dc428b6df4f89dd6504b438.tar.gz kernel-audio-299d9b7c0213d2e87dc428b6df4f89dd6504b438.tar.xz kernel-audio-299d9b7c0213d2e87dc428b6df4f89dd6504b438.zip |
ASoC: DRA7: dra7-evm: Add support for always on
There are environments where power resources are not a concern, but having
the best quality in terms of artifacts is more important. For those scenarios,
allow keeping the analog codecs always on, set via DT. This is achieved by
simply using a very high pmdown_time value.
Change-Id: I91bda710096427a9d5ec4c998eea40efb87ff123
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r-- | Documentation/devicetree/bindings/sound/dra7-evm.txt | 4 | ||||
-rw-r--r-- | sound/soc/omap/dra7-evm.c | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/sound/dra7-evm.txt b/Documentation/devicetree/bindings/sound/dra7-evm.txt index 1eeed6e6d67a..cf19d4b4ba4d 100644 --- a/Documentation/devicetree/bindings/sound/dra7-evm.txt +++ b/Documentation/devicetree/bindings/sound/dra7-evm.txt | |||
@@ -11,6 +11,10 @@ Required properties: | |||
11 | Each entry is a pair of strings, the first being the connection's sink, | 11 | Each entry is a pair of strings, the first being the connection's sink, |
12 | the second being the connection's source. | 12 | the second being the connection's source. |
13 | 13 | ||
14 | Optional properties: | ||
15 | - ti,always-on: Keep analog codecs always on to minimize artifacts. Use it | ||
16 | if power is not a concern. | ||
17 | |||
14 | Available audio endpoints for the audio-routing table: | 18 | Available audio endpoints for the audio-routing table: |
15 | 19 | ||
16 | Board connectors: | 20 | Board connectors: |
diff --git a/sound/soc/omap/dra7-evm.c b/sound/soc/omap/dra7-evm.c index 4076638c09dc..2a6b17009f64 100644 --- a/sound/soc/omap/dra7-evm.c +++ b/sound/soc/omap/dra7-evm.c | |||
@@ -33,6 +33,7 @@ | |||
33 | struct dra7_snd_data { | 33 | struct dra7_snd_data { |
34 | unsigned int media_mclk_freq; | 34 | unsigned int media_mclk_freq; |
35 | int media_slots; | 35 | int media_slots; |
36 | int always_on; | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | static int dra7_mcasp_reparent(struct snd_soc_card *card, | 39 | static int dra7_mcasp_reparent(struct snd_soc_card *card, |
@@ -139,6 +140,20 @@ static struct snd_soc_ops dra7_snd_media_ops = { | |||
139 | .hw_params = dra7_snd_media_hw_params, | 140 | .hw_params = dra7_snd_media_hw_params, |
140 | }; | 141 | }; |
141 | 142 | ||
143 | static int dra7_dai_init(struct snd_soc_pcm_runtime *rtd) | ||
144 | { | ||
145 | struct snd_soc_card *card = rtd->card; | ||
146 | struct dra7_snd_data *card_data = snd_soc_card_get_drvdata(card); | ||
147 | |||
148 | /* Minimize artifacts as much as possible if can be afforded */ | ||
149 | if (card_data->always_on) | ||
150 | rtd->pmdown_time = INT_MAX; | ||
151 | else | ||
152 | rtd->pmdown_time = 0; | ||
153 | |||
154 | return 0; | ||
155 | } | ||
156 | |||
142 | static struct snd_soc_dai_link dra7_snd_dai[] = { | 157 | static struct snd_soc_dai_link dra7_snd_dai[] = { |
143 | { | 158 | { |
144 | /* Media: McASP3 + tlv320aic3106 */ | 159 | /* Media: McASP3 + tlv320aic3106 */ |
@@ -146,6 +161,7 @@ static struct snd_soc_dai_link dra7_snd_dai[] = { | |||
146 | .codec_dai_name = "tlv320aic3x-hifi", | 161 | .codec_dai_name = "tlv320aic3x-hifi", |
147 | .platform_name = "omap-pcm-audio", | 162 | .platform_name = "omap-pcm-audio", |
148 | .ops = &dra7_snd_media_ops, | 163 | .ops = &dra7_snd_media_ops, |
164 | .init = dra7_dai_init, | ||
149 | }, | 165 | }, |
150 | }; | 166 | }; |
151 | 167 | ||
@@ -256,6 +272,9 @@ static int dra7_snd_probe(struct platform_device *pdev) | |||
256 | 272 | ||
257 | snd_soc_card_set_drvdata(card, card_data); | 273 | snd_soc_card_set_drvdata(card, card_data); |
258 | 274 | ||
275 | if (of_find_property(node, "ti,always-on", NULL)) | ||
276 | card_data->always_on = 1; | ||
277 | |||
259 | ret = dra7_snd_add_dai_link(card, &dra7_snd_dai[0], "ti,media"); | 278 | ret = dra7_snd_add_dai_link(card, &dra7_snd_dai[0], "ti,media"); |
260 | if (ret) { | 279 | if (ret) { |
261 | dev_err(card->dev, "failed to add media dai link %d\n", ret); | 280 | dev_err(card->dev, "failed to add media dai link %d\n", ret); |