From patchwork Mon Nov 26 21:39:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 1806931 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3232BDF2EB for ; Mon, 26 Nov 2012 21:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756549Ab2KZVjy (ORCPT ); Mon, 26 Nov 2012 16:39:54 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:38369 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757258Ab2KZVjw (ORCPT ); Mon, 26 Nov 2012 16:39:52 -0500 Received: from finisterre.wolfsonmicro.main (cpc1-sgyl4-0-0-cust247.18-2.cable.virginmedia.com [82.41.24.248]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id 2FD1B750008; Mon, 26 Nov 2012 21:39:50 +0000 (GMT) Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.80) (envelope-from ) id 1Td6P7-0008Ti-FL; Mon, 26 Nov 2012 21:39:49 +0000 From: Mark Brown To: Samuel Ortiz , Liam Girdwood , Dmitry Torokhov Cc: linux-input@vger.kernel.org, patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, Mark Brown Subject: [PATCH 4/4] ASoC: wm5110: Implement haptics support Date: Mon, 26 Nov 2012 21:39:40 +0000 Message-Id: <1353965980-32543-4-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1353965980-32543-1-git-send-email-broonie@opensource.wolfsonmicro.com> References: <1353965980-32543-1-git-send-email-broonie@opensource.wolfsonmicro.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Provide a haptics widget for use by the haptics driver and expose the DAPM context for it. Signed-off-by: Mark Brown --- sound/soc/codecs/wm5110.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index 8b81fa5..601d90a 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -371,6 +371,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"), @@ -639,6 +640,7 @@ SND_SOC_DAPM_OUTPUT("SPKDAT2R"), { 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" }, \ @@ -963,9 +965,20 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec) int i; codec->control_data = priv->core.arizona->regmap; + priv->core.arizona->dapm = &codec->dapm; + return snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); } +static int wm5110_codec_remove(struct snd_soc_codec *codec) +{ + struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); + + priv->core.arizona->dapm = NULL; + + return 0; +} + #define WM5110_DIG_VU 0x0200 static unsigned int wm5110_digital_vu[] = { @@ -994,6 +1007,7 @@ static unsigned int wm5110_digital_vu[] = { static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { .probe = wm5110_codec_probe, + .remove = wm5110_codec_remove, .idle_bias_off = true,