diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-05-31 07:44:17 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-05-31 09:35:49 -0400 |
commit | 546ad3d024fd47e5042d80ae1dc4c7d1b00912a7 (patch) | |
tree | 67df210c278996a980c5b4411d32e450b0021839 | |
parent | 7baa7e2490e1c292a84406c90089511c96ce3114 (diff) |
ASoC: arizona: Add data structure for voice trigger notifier
64-bit builds would generate a warning when we passed the core number as
a pointer through the notifier data:
sound/soc/codecs/cs47l24.c:1091:13: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
(void *)i);
Rather than just fix this up with more casting add a data structure that
holds information for the notifier chain. This will make it easier to
add additional information in the future as well.
Fixes: 7baa7e2490e1 ("ASoC: arizona: Add event notification on voice trigger events")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/arizona.h | 4 | ||||
-rw-r--r-- | sound/soc/codecs/cs47l24.c | 7 | ||||
-rw-r--r-- | sound/soc/codecs/wm5110.c | 7 |
3 files changed, 14 insertions, 4 deletions
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h index 18d347f3bfbe..46862af7665e 100644 --- a/sound/soc/codecs/arizona.h +++ b/sound/soc/codecs/arizona.h | |||
@@ -98,6 +98,10 @@ struct arizona_priv { | |||
98 | bool dvfs_cached; | 98 | bool dvfs_cached; |
99 | }; | 99 | }; |
100 | 100 | ||
101 | struct arizona_voice_trigger_info { | ||
102 | int core; | ||
103 | }; | ||
104 | |||
101 | #define ARIZONA_NUM_MIXER_INPUTS 104 | 105 | #define ARIZONA_NUM_MIXER_INPUTS 104 |
102 | 106 | ||
103 | extern const unsigned int arizona_mixer_tlv[]; | 107 | extern const unsigned int arizona_mixer_tlv[]; |
diff --git a/sound/soc/codecs/cs47l24.c b/sound/soc/codecs/cs47l24.c index 7e3d138d077b..bbc8cf18ded0 100644 --- a/sound/soc/codecs/cs47l24.c +++ b/sound/soc/codecs/cs47l24.c | |||
@@ -1067,6 +1067,7 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data) | |||
1067 | { | 1067 | { |
1068 | struct cs47l24_priv *priv = data; | 1068 | struct cs47l24_priv *priv = data; |
1069 | struct arizona *arizona = priv->core.arizona; | 1069 | struct arizona *arizona = priv->core.arizona; |
1070 | struct arizona_voice_trigger_info info; | ||
1070 | int serviced = 0; | 1071 | int serviced = 0; |
1071 | int i, ret; | 1072 | int i, ret; |
1072 | 1073 | ||
@@ -1074,10 +1075,12 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data) | |||
1074 | ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); | 1075 | ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); |
1075 | if (ret != -ENODEV) | 1076 | if (ret != -ENODEV) |
1076 | serviced++; | 1077 | serviced++; |
1077 | if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) | 1078 | if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) { |
1079 | info.core = i; | ||
1078 | arizona_call_notifiers(arizona, | 1080 | arizona_call_notifiers(arizona, |
1079 | ARIZONA_NOTIFY_VOICE_TRIGGER, | 1081 | ARIZONA_NOTIFY_VOICE_TRIGGER, |
1080 | (void *)i); | 1082 | &info); |
1083 | } | ||
1081 | } | 1084 | } |
1082 | 1085 | ||
1083 | if (!serviced) { | 1086 | if (!serviced) { |
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index dbc9b4df38a0..83c48eca56f5 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -2222,6 +2222,7 @@ static irqreturn_t wm5110_adsp2_irq(int irq, void *data) | |||
2222 | { | 2222 | { |
2223 | struct wm5110_priv *priv = data; | 2223 | struct wm5110_priv *priv = data; |
2224 | struct arizona *arizona = priv->core.arizona; | 2224 | struct arizona *arizona = priv->core.arizona; |
2225 | struct arizona_voice_trigger_info info; | ||
2225 | int serviced = 0; | 2226 | int serviced = 0; |
2226 | int i, ret; | 2227 | int i, ret; |
2227 | 2228 | ||
@@ -2229,10 +2230,12 @@ static irqreturn_t wm5110_adsp2_irq(int irq, void *data) | |||
2229 | ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); | 2230 | ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); |
2230 | if (ret != -ENODEV) | 2231 | if (ret != -ENODEV) |
2231 | serviced++; | 2232 | serviced++; |
2232 | if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) | 2233 | if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) { |
2234 | info.core = i; | ||
2233 | arizona_call_notifiers(arizona, | 2235 | arizona_call_notifiers(arizona, |
2234 | ARIZONA_NOTIFY_VOICE_TRIGGER, | 2236 | ARIZONA_NOTIFY_VOICE_TRIGGER, |
2235 | (void *)i); | 2237 | &info); |
2238 | } | ||
2236 | } | 2239 | } |
2237 | 2240 | ||
2238 | if (!serviced) { | 2241 | if (!serviced) { |