* [PATCH 1/2] ASoC: arizona: Move notifier functions to header and make inline
@ 2016-11-10 15:24 Charles Keepax
2016-11-10 15:24 ` [PATCH 2/2] ASoC: arizona: Call arizona_init_notifiers for all CODECs Charles Keepax
2016-11-10 17:29 ` Applied "ASoC: arizona: Move notifier functions to header and make inline" " Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Charles Keepax @ 2016-11-10 15:24 UTC (permalink / raw)
To: broonie; +Cc: alsa-devel, patches, lgirdwood
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>
---
sound/soc/codecs/arizona.c | 24 ------------------------
sound/soc/codecs/arizona.h | 32 ++++++++++++++++++++++++--------
2 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 99ce6a0e..ca5ca9e 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,
}
EXPORT_SYMBOL_GPL(arizona_lhpf_coeff_put);
-int arizona_register_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb,
- int (*notify)(struct notifier_block *nb,
- unsigned long action, void *data))
-{
- struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
- struct arizona *arizona = priv->arizona;
-
- nb->notifier_call = notify;
-
- return blocking_notifier_chain_register(&arizona->notifier, nb);
-}
-EXPORT_SYMBOL_GPL(arizona_register_notifier);
-
-int arizona_unregister_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb)
-{
- struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
- struct arizona *arizona = priv->arizona;
-
- return blocking_notifier_chain_unregister(&arizona->notifier, nb);
-}
-EXPORT_SYMBOL_GPL(arizona_unregister_notifier);
-
MODULE_DESCRIPTION("ASoC Wolfson Arizona class device support");
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index 34d65d1..813f1cd 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -14,6 +14,8 @@
#define _ASOC_ARIZONA_H
#include <linux/completion.h>
+#include <linux/notifier.h>
+#include <linux/mfd/arizona/core.h>
#include <sound/soc.h>
@@ -66,7 +68,6 @@
/* Notifier events */
#define ARIZONA_NOTIFY_VOICE_TRIGGER 0x1
-struct arizona;
struct wm_adsp;
struct arizona_dai_priv {
@@ -329,12 +330,27 @@ extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift);
extern const char *arizona_sample_rate_val_to_name(unsigned int rate_val);
-extern int arizona_register_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb,
- int (*notify)(struct notifier_block *nb,
- unsigned long action,
- void *data));
-extern int arizona_unregister_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb);
+static inline int arizona_register_notifier(struct snd_soc_codec *codec,
+ struct notifier_block *nb,
+ int (*notify)
+ (struct notifier_block *nb,
+ unsigned long action, void *data))
+{
+ struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+ struct arizona *arizona = priv->arizona;
+
+ nb->notifier_call = notify;
+
+ return blocking_notifier_chain_register(&arizona->notifier, nb);
+}
+
+static inline int arizona_unregister_notifier(struct snd_soc_codec *codec,
+ struct notifier_block *nb)
+{
+ struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+ struct arizona *arizona = priv->arizona;
+
+ return blocking_notifier_chain_unregister(&arizona->notifier, nb);
+}
#endif
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ASoC: arizona: Call arizona_init_notifiers for all CODECs
2016-11-10 15:24 [PATCH 1/2] ASoC: arizona: Move notifier functions to header and make inline Charles Keepax
@ 2016-11-10 15:24 ` Charles Keepax
2016-11-10 17:28 ` Applied "ASoC: arizona: Call arizona_init_notifiers for all CODECs" to the asoc tree Mark Brown
2016-11-10 17:29 ` Applied "ASoC: arizona: Move notifier functions to header and make inline" " Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Charles Keepax @ 2016-11-10 15:24 UTC (permalink / raw)
To: broonie; +Cc: alsa-devel, patches, lgirdwood
The call to arizona_init_notifiers was only added for CODECs that are
generating voice trigger events, however, this is somewhat annoying
for machine drivers that might be used with multiple CODECs as they
need to conditionally register for the notifier, depending on the
CODEC being attached.
As the cost of initialising the notifier is so minimal, and we may
well add other events in the future that apply to more CODECs, simply
do this for all Arizona CODECs.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm5102.c | 1 +
sound/soc/codecs/wm8997.c | 1 +
sound/soc/codecs/wm8998.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 0136234..72ff291 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -1945,6 +1945,7 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
arizona_init_spk(codec);
arizona_init_gpio(codec);
+ arizona_init_notifiers(codec);
snd_soc_dapm_disable_pin(dapm, "HAPTICS");
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 600595c..ea8b1bf 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1063,6 +1063,7 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
arizona_init_spk(codec);
+ arizona_init_notifiers(codec);
snd_soc_dapm_disable_pin(dapm, "HAPTICS");
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 4cccaae..1e1d9c1 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1325,6 +1325,7 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec)
arizona_init_spk(codec);
arizona_init_gpio(codec);
+ arizona_init_notifiers(codec);
snd_soc_dapm_disable_pin(dapm, "HAPTICS");
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Applied "ASoC: arizona: Call arizona_init_notifiers for all CODECs" to the asoc tree
2016-11-10 15:24 ` [PATCH 2/2] ASoC: arizona: Call arizona_init_notifiers for all CODECs Charles Keepax
@ 2016-11-10 17:28 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-11-10 17:28 UTC (permalink / raw)
To: Charles Keepax; +Cc: alsa-devel, broonie, patches, lgirdwood
The patch
ASoC: arizona: Call arizona_init_notifiers for all CODECs
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 88c1886075e069f699c20fbc04ef6f10b8eb8c43 Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date: Thu, 10 Nov 2016 15:24:15 +0000
Subject: [PATCH] ASoC: arizona: Call arizona_init_notifiers for all CODECs
The call to arizona_init_notifiers was only added for CODECs that are
generating voice trigger events, however, this is somewhat annoying
for machine drivers that might be used with multiple CODECs as they
need to conditionally register for the notifier, depending on the
CODEC being attached.
As the cost of initialising the notifier is so minimal, and we may
well add other events in the future that apply to more CODECs, simply
do this for all Arizona CODECs.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/wm5102.c | 1 +
sound/soc/codecs/wm8997.c | 1 +
sound/soc/codecs/wm8998.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 0136234e6e66..72ff291a85be 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -1945,6 +1945,7 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
arizona_init_spk(codec);
arizona_init_gpio(codec);
+ arizona_init_notifiers(codec);
snd_soc_dapm_disable_pin(dapm, "HAPTICS");
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 600595c54fe7..ea8b1bfdf5a0 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1063,6 +1063,7 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
arizona_init_spk(codec);
+ arizona_init_notifiers(codec);
snd_soc_dapm_disable_pin(dapm, "HAPTICS");
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 4cccaae6dcfa..1e1d9c1f0371 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1325,6 +1325,7 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec)
arizona_init_spk(codec);
arizona_init_gpio(codec);
+ arizona_init_notifiers(codec);
snd_soc_dapm_disable_pin(dapm, "HAPTICS");
--
2.10.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Applied "ASoC: arizona: Move notifier functions to header and make inline" to the asoc tree
2016-11-10 15:24 [PATCH 1/2] ASoC: arizona: Move notifier functions to header and make inline Charles Keepax
2016-11-10 15:24 ` [PATCH 2/2] ASoC: arizona: Call arizona_init_notifiers for all CODECs Charles Keepax
@ 2016-11-10 17:29 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-11-10 17:29 UTC (permalink / raw)
To: Charles Keepax; +Cc: alsa-devel, broonie, patches, lgirdwood
The patch
ASoC: arizona: Move notifier functions to header and make inline
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From d3d5c90556301dc1f3afe5a4e1133ddd1f43858b Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date: Thu, 10 Nov 2016 15:24:14 +0000
Subject: [PATCH] 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>
---
sound/soc/codecs/arizona.c | 24 ------------------------
sound/soc/codecs/arizona.h | 32 ++++++++++++++++++++++++--------
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,
}
EXPORT_SYMBOL_GPL(arizona_lhpf_coeff_put);
-int arizona_register_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb,
- int (*notify)(struct notifier_block *nb,
- unsigned long action, void *data))
-{
- struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
- struct arizona *arizona = priv->arizona;
-
- nb->notifier_call = notify;
-
- return blocking_notifier_chain_register(&arizona->notifier, nb);
-}
-EXPORT_SYMBOL_GPL(arizona_register_notifier);
-
-int arizona_unregister_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb)
-{
- struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
- struct arizona *arizona = priv->arizona;
-
- return blocking_notifier_chain_unregister(&arizona->notifier, nb);
-}
-EXPORT_SYMBOL_GPL(arizona_unregister_notifier);
-
MODULE_DESCRIPTION("ASoC Wolfson Arizona class device support");
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_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 @@
#define _ASOC_ARIZONA_H
#include <linux/completion.h>
+#include <linux/notifier.h>
+#include <linux/mfd/arizona/core.h>
#include <sound/soc.h>
@@ -66,7 +68,6 @@
/* Notifier events */
#define ARIZONA_NOTIFY_VOICE_TRIGGER 0x1
-struct arizona;
struct wm_adsp;
struct arizona_dai_priv {
@@ -329,12 +330,27 @@ extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift);
extern const char *arizona_sample_rate_val_to_name(unsigned int rate_val);
-extern int arizona_register_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb,
- int (*notify)(struct notifier_block *nb,
- unsigned long action,
- void *data));
-extern int arizona_unregister_notifier(struct snd_soc_codec *codec,
- struct notifier_block *nb);
+static inline int arizona_register_notifier(struct snd_soc_codec *codec,
+ struct notifier_block *nb,
+ int (*notify)
+ (struct notifier_block *nb,
+ unsigned long action, void *data))
+{
+ struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+ struct arizona *arizona = priv->arizona;
+
+ nb->notifier_call = notify;
+
+ return blocking_notifier_chain_register(&arizona->notifier, nb);
+}
+
+static inline int arizona_unregister_notifier(struct snd_soc_codec *codec,
+ struct notifier_block *nb)
+{
+ struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+ struct arizona *arizona = priv->arizona;
+
+ return blocking_notifier_chain_unregister(&arizona->notifier, nb);
+}
#endif
--
2.10.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-10 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10 15:24 [PATCH 1/2] ASoC: arizona: Move notifier functions to header and make inline Charles Keepax
2016-11-10 15:24 ` [PATCH 2/2] ASoC: arizona: Call arizona_init_notifiers for all CODECs Charles Keepax
2016-11-10 17:28 ` Applied "ASoC: arizona: Call arizona_init_notifiers for all CODECs" to the asoc tree Mark Brown
2016-11-10 17:29 ` Applied "ASoC: arizona: Move notifier functions to header and make inline" " Mark Brown
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).