aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-11-10 10:24:14 -0500
committerMark Brown <broonie@kernel.org>2016-11-10 11:20:24 -0500
commitd3d5c90556301dc1f3afe5a4e1133ddd1f43858b (patch)
tree43b533add8ebbc2c5d94e13ad9f8b465abe02219
parent1095e281559d61ed05c1b33aa4c6b305fcc211df (diff)
ASoC: arizona: Move notifier functions to header and make inline
These functions are very thin wrappers around core functions, so they make sense as inline functions. Also making them inline avoids build issues in the case where the machine driver is built in but the CODEC is built as a module. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/arizona.c24
-rw-r--r--sound/soc/codecs/arizona.h32
2 files changed, 24 insertions, 32 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 99ce6a0e73de..ca5ca9eac272 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -2691,30 +2691,6 @@ int arizona_lhpf_coeff_put(struct snd_kcontrol *kcontrol,
2691} 2691}
2692EXPORT_SYMBOL_GPL(arizona_lhpf_coeff_put); 2692EXPORT_SYMBOL_GPL(arizona_lhpf_coeff_put);
2693 2693
2694int arizona_register_notifier(struct snd_soc_codec *codec,
2695 struct notifier_block *nb,
2696 int (*notify)(struct notifier_block *nb,
2697 unsigned long action, void *data))
2698{
2699 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
2700 struct arizona *arizona = priv->arizona;
2701
2702 nb->notifier_call = notify;
2703
2704 return blocking_notifier_chain_register(&arizona->notifier, nb);
2705}
2706EXPORT_SYMBOL_GPL(arizona_register_notifier);
2707
2708int arizona_unregister_notifier(struct snd_soc_codec *codec,
2709 struct notifier_block *nb)
2710{
2711 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
2712 struct arizona *arizona = priv->arizona;
2713
2714 return blocking_notifier_chain_unregister(&arizona->notifier, nb);
2715}
2716EXPORT_SYMBOL_GPL(arizona_unregister_notifier);
2717
2718MODULE_DESCRIPTION("ASoC Wolfson Arizona class device support"); 2694MODULE_DESCRIPTION("ASoC Wolfson Arizona class device support");
2719MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); 2695MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
2720MODULE_LICENSE("GPL"); 2696MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index 34d65d1eafba..813f1cdb565d 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -14,6 +14,8 @@
14#define _ASOC_ARIZONA_H 14#define _ASOC_ARIZONA_H
15 15
16#include <linux/completion.h> 16#include <linux/completion.h>
17#include <linux/notifier.h>
18#include <linux/mfd/arizona/core.h>
17 19
18#include <sound/soc.h> 20#include <sound/soc.h>
19 21
@@ -66,7 +68,6 @@
66/* Notifier events */ 68/* Notifier events */
67#define ARIZONA_NOTIFY_VOICE_TRIGGER 0x1 69#define ARIZONA_NOTIFY_VOICE_TRIGGER 0x1
68 70
69struct arizona;
70struct wm_adsp; 71struct wm_adsp;
71 72
72struct arizona_dai_priv { 73struct arizona_dai_priv {
@@ -329,12 +330,27 @@ extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift);
329 330
330extern const char *arizona_sample_rate_val_to_name(unsigned int rate_val); 331extern const char *arizona_sample_rate_val_to_name(unsigned int rate_val);
331 332
332extern int arizona_register_notifier(struct snd_soc_codec *codec, 333static inline int arizona_register_notifier(struct snd_soc_codec *codec,
333 struct notifier_block *nb, 334 struct notifier_block *nb,
334 int (*notify)(struct notifier_block *nb, 335 int (*notify)
335 unsigned long action, 336 (struct notifier_block *nb,
336 void *data)); 337 unsigned long action, void *data))
337extern int arizona_unregister_notifier(struct snd_soc_codec *codec, 338{
338 struct notifier_block *nb); 339 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
340 struct arizona *arizona = priv->arizona;
341
342 nb->notifier_call = notify;
343
344 return blocking_notifier_chain_register(&arizona->notifier, nb);
345}
346
347static inline int arizona_unregister_notifier(struct snd_soc_codec *codec,
348 struct notifier_block *nb)
349{
350 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
351 struct arizona *arizona = priv->arizona;
352
353 return blocking_notifier_chain_unregister(&arizona->notifier, nb);
354}
339 355
340#endif 356#endif