From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org, lee.jones@linaro.org
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
sameo@linux.intel.com, lgirdwood@gmail.com
Subject: [PATCH 2/2 v2] ASoC: arizona: Improve ultrasonic frequency response
Date: Fri, 31 Jan 2014 16:16:18 +0000 [thread overview]
Message-ID: <1391184978-14516-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1391184978-14516-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>
Evaluation of the device has given some settings to improve the
ultrasonic frequency response. However, this may cause sub-optimal
performance in system designs with high output gains on the headphone
path (0dB or -2dB), and as the frequencies are inaudible anyway some
users may not desire higher frequency response at those frequencies.
So allow the user the option to select it if it is appopriate for
their system design.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
include/linux/mfd/arizona/pdata.h | 3 +++
sound/soc/codecs/arizona.c | 15 +++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 12a5c13..3df0ed5 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -177,6 +177,9 @@ struct arizona_pdata {
/** Mode for outputs */
bool out_mono[ARIZONA_MAX_OUTPUT];
+ /** Provide improved ultrasonic frequency response */
+ bool ultrasonic_response;
+
/** PDM speaker mute setting */
unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index e4295fe..f2e1ffe 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1134,6 +1134,21 @@ static int arizona_hw_params_rate(struct snd_pcm_substream *substream,
}
sr_val = i;
+ switch (priv->arizona->type) {
+ case WM5102:
+ if (priv->arizona->pdata.ultrasonic_response) {
+ snd_soc_write(codec, 0x80, 0x3);
+ if (params_rate(params) >= 176400)
+ snd_soc_write(codec, 0x4dd, 0x1);
+ else
+ snd_soc_write(codec, 0x4dd, 0x0);
+ snd_soc_write(codec, 0x80, 0x0);
+ }
+ break;
+ default:
+ break;
+ }
+
switch (dai_priv->clk) {
case ARIZONA_CLK_SYSCLK:
snd_soc_update_bits(codec, ARIZONA_SAMPLE_RATE_1,
--
1.7.2.5
next prev parent reply other threads:[~2014-01-31 16:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 16:16 [PATCH 1/2 v2] mfd: wm5102: Update register patch Charles Keepax
2014-01-31 16:16 ` Charles Keepax [this message]
2014-02-04 0:17 ` [PATCH 2/2 v2] ASoC: arizona: Improve ultrasonic frequency response Mark Brown
2014-02-04 9:17 ` Charles Keepax
2014-02-03 8:35 ` [PATCH 1/2 v2] mfd: wm5102: Update register patch Lee Jones
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=1391184978-14516-2-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=sameo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.