diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-26 16:18:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-28 08:44:00 -0500 |
commit | 2f76e6855ff7257230b81dfb223acc1ab0e41b0b (patch) | |
tree | 91740240eceb2ac66dad8e0df422c8f0e5c3cc97 /sound/soc/codecs | |
parent | 3f41e3d2e80ebd093128a02b2009e14faf488052 (diff) |
ASoC: wm5110: Implement haptics support
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>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wm5110.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index 3485b83dc068..2a075ad00d5b 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -352,6 +352,7 @@ SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0), | |||
352 | 352 | ||
353 | SND_SOC_DAPM_SIGGEN("TONE"), | 353 | SND_SOC_DAPM_SIGGEN("TONE"), |
354 | SND_SOC_DAPM_SIGGEN("NOISE"), | 354 | SND_SOC_DAPM_SIGGEN("NOISE"), |
355 | SND_SOC_DAPM_SIGGEN("HAPTICS"), | ||
355 | 356 | ||
356 | SND_SOC_DAPM_INPUT("IN1L"), | 357 | SND_SOC_DAPM_INPUT("IN1L"), |
357 | SND_SOC_DAPM_INPUT("IN1R"), | 358 | SND_SOC_DAPM_INPUT("IN1R"), |
@@ -610,6 +611,7 @@ SND_SOC_DAPM_OUTPUT("SPKDAT2R"), | |||
610 | { name, "Noise Generator", "Noise Generator" }, \ | 611 | { name, "Noise Generator", "Noise Generator" }, \ |
611 | { name, "Tone Generator 1", "Tone Generator 1" }, \ | 612 | { name, "Tone Generator 1", "Tone Generator 1" }, \ |
612 | { name, "Tone Generator 2", "Tone Generator 2" }, \ | 613 | { name, "Tone Generator 2", "Tone Generator 2" }, \ |
614 | { name, "Haptics", "HAPTICS" }, \ | ||
613 | { name, "AEC", "AEC Loopback" }, \ | 615 | { name, "AEC", "AEC Loopback" }, \ |
614 | { name, "IN1L", "IN1L PGA" }, \ | 616 | { name, "IN1L", "IN1L PGA" }, \ |
615 | { name, "IN1R", "IN1R PGA" }, \ | 617 | { name, "IN1R", "IN1R PGA" }, \ |
@@ -902,9 +904,29 @@ static struct snd_soc_dai_driver wm5110_dai[] = { | |||
902 | static int wm5110_codec_probe(struct snd_soc_codec *codec) | 904 | static int wm5110_codec_probe(struct snd_soc_codec *codec) |
903 | { | 905 | { |
904 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); | 906 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); |
907 | int ret; | ||
905 | 908 | ||
906 | codec->control_data = priv->core.arizona->regmap; | 909 | codec->control_data = priv->core.arizona->regmap; |
907 | return snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); | 910 | priv->core.arizona->dapm = &codec->dapm; |
911 | |||
912 | ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); | ||
913 | if (ret != 0) | ||
914 | return ret; | ||
915 | |||
916 | snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS"); | ||
917 | |||
918 | priv->core.arizona->dapm = &codec->dapm; | ||
919 | |||
920 | return 0; | ||
921 | } | ||
922 | |||
923 | static int wm5110_codec_remove(struct snd_soc_codec *codec) | ||
924 | { | ||
925 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); | ||
926 | |||
927 | priv->core.arizona->dapm = NULL; | ||
928 | |||
929 | return 0; | ||
908 | } | 930 | } |
909 | 931 | ||
910 | #define WM5110_DIG_VU 0x0200 | 932 | #define WM5110_DIG_VU 0x0200 |
@@ -935,6 +957,7 @@ static unsigned int wm5110_digital_vu[] = { | |||
935 | 957 | ||
936 | static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { | 958 | static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { |
937 | .probe = wm5110_codec_probe, | 959 | .probe = wm5110_codec_probe, |
960 | .remove = wm5110_codec_remove, | ||
938 | 961 | ||
939 | .idle_bias_off = true, | 962 | .idle_bias_off = true, |
940 | 963 | ||