]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: arizona: Add data structure for voice trigger notifier
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tue, 31 May 2016 11:44:17 +0000 (12:44 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 31 May 2016 13:35:49 +0000 (14:35 +0100)
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>
sound/soc/codecs/arizona.h
sound/soc/codecs/cs47l24.c
sound/soc/codecs/wm5110.c

index 18d347f3bfbecbab1f864731a2ef1c1180e8037a..46862af7665ec866f89ce4ca114fe13fa80ed96b 100644 (file)
@@ -98,6 +98,10 @@ struct arizona_priv {
        bool dvfs_cached;
 };
 
+struct arizona_voice_trigger_info {
+       int core;
+};
+
 #define ARIZONA_NUM_MIXER_INPUTS 104
 
 extern const unsigned int arizona_mixer_tlv[];
index 7e3d138d077b665bb50724d0b78538368bc3b215..bbc8cf18ded094067e5090f850111a9d06e2e69e 100644 (file)
@@ -1067,6 +1067,7 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data)
 {
        struct cs47l24_priv *priv = data;
        struct arizona *arizona = priv->core.arizona;
+       struct arizona_voice_trigger_info info;
        int serviced = 0;
        int i, ret;
 
@@ -1074,10 +1075,12 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data)
                ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
                if (ret != -ENODEV)
                        serviced++;
-               if (ret == WM_ADSP_COMPR_VOICE_TRIGGER)
+               if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) {
+                       info.core = i;
                        arizona_call_notifiers(arizona,
                                               ARIZONA_NOTIFY_VOICE_TRIGGER,
-                                              (void *)i);
+                                              &info);
+               }
        }
 
        if (!serviced) {
index dbc9b4df38a088d0e047dd287d3e3335e6b62667..83c48eca56f5fb322df4fdd591a8b75fd54eaaa2 100644 (file)
@@ -2222,6 +2222,7 @@ static irqreturn_t wm5110_adsp2_irq(int irq, void *data)
 {
        struct wm5110_priv *priv = data;
        struct arizona *arizona = priv->core.arizona;
+       struct arizona_voice_trigger_info info;
        int serviced = 0;
        int i, ret;
 
@@ -2229,10 +2230,12 @@ static irqreturn_t wm5110_adsp2_irq(int irq, void *data)
                ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
                if (ret != -ENODEV)
                        serviced++;
-               if (ret == WM_ADSP_COMPR_VOICE_TRIGGER)
+               if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) {
+                       info.core = i;
                        arizona_call_notifiers(arizona,
                                               ARIZONA_NOTIFY_VOICE_TRIGGER,
-                                              (void *)i);
+                                              &info);
+               }
        }
 
        if (!serviced) {