From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Samuel Ortiz <sameo@linux.intel.com>, Liam Girdwood <lrg@ti.com>
Cc: alsa-devel@alsa-project.org, linux-input@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 3/4] ASoC: wm5102: Implement haptics support
Date: Tue, 27 Nov 2012 12:40:24 +0000 [thread overview]
Message-ID: <1354020025-23881-3-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1354020025-23881-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Provide a haptics widget for use by the haptics driver and expose the DAPM
context for it.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm5102.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index b18fd2e..63c24a3 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -860,6 +860,7 @@ SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0),
SND_SOC_DAPM_SIGGEN("TONE"),
SND_SOC_DAPM_SIGGEN("NOISE"),
+SND_SOC_DAPM_SIGGEN("HAPTICS"),
SND_SOC_DAPM_INPUT("IN1L"),
SND_SOC_DAPM_INPUT("IN1R"),
@@ -1094,6 +1095,7 @@ SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
{ name, "Noise Generator", "Noise Generator" }, \
{ name, "Tone Generator 1", "Tone Generator 1" }, \
{ name, "Tone Generator 2", "Tone Generator 2" }, \
+ { name, "Haptics", "HAPTICS" }, \
{ name, "AEC", "AEC Loopback" }, \
{ name, "IN1L", "IN1L PGA" }, \
{ name, "IN1R", "IN1R PGA" }, \
@@ -1385,9 +1387,28 @@ static struct snd_soc_dai_driver wm5102_dai[] = {
static int wm5102_codec_probe(struct snd_soc_codec *codec)
{
struct wm5102_priv *priv = snd_soc_codec_get_drvdata(codec);
+ int ret;
codec->control_data = priv->core.arizona->regmap;
- return snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
+
+ ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
+ if (ret != 0)
+ return ret;
+
+ snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS");
+
+ priv->core.arizona->dapm = &codec->dapm;
+
+ return 0;
+}
+
+static int wm5102_codec_remove(struct snd_soc_codec *codec)
+{
+ struct wm5102_priv *priv = snd_soc_codec_get_drvdata(codec);
+
+ priv->core.arizona->dapm = NULL;
+
+ return 0;
}
#define WM5102_DIG_VU 0x0200
@@ -1414,6 +1435,7 @@ static unsigned int wm5102_digital_vu[] = {
static struct snd_soc_codec_driver soc_codec_dev_wm5102 = {
.probe = wm5102_codec_probe,
+ .remove = wm5102_codec_remove,
.idle_bias_off = true,
--
1.7.10.4
next prev parent reply other threads:[~2012-11-27 12:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-27 12:40 [PATCH 1/4] mfd: arizona: Allow the CODEC DAPM context to be accessed elsewhere Mark Brown
2012-11-27 12:40 ` [PATCH 2/4] Input - arizona-haptics: Add driver haptics module on Arizona CODECs Mark Brown
2012-11-27 19:56 ` Dmitry Torokhov
2012-11-27 20:00 ` Mark Brown
2012-11-28 7:11 ` Dmitry Torokhov
2012-11-28 13:49 ` Mark Brown
2012-11-27 12:40 ` Mark Brown [this message]
2012-11-27 12:40 ` [PATCH 4/4] ASoC: wm5110: Implement haptics support Mark Brown
2012-11-30 10:09 ` [PATCH 1/4] mfd: arizona: Allow the CODEC DAPM context to be accessed elsewhere Samuel Ortiz
-- strict thread matches above, loose matches on Subject: below --
2012-11-27 10:33 Mark Brown
2012-11-27 10:33 ` [PATCH 3/4] ASoC: wm5102: Implement haptics support Mark Brown
2012-11-27 7:08 [PATCH 1/4] mfd: arizona: Allow the CODEC DAPM context to be accessed elsewhere Mark Brown
2012-11-27 7:08 ` [PATCH 3/4] ASoC: wm5102: Implement haptics support Mark Brown
2012-11-26 21:39 [PATCH 1/4] mfd: arizona: Allow the CODEC DAPM context to be accessed elsewhere Mark Brown
2012-11-26 21:39 ` [PATCH 3/4] ASoC: wm5102: Implement haptics support Mark Brown
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=1354020025-23881-3-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=lrg@ti.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 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).