Skip to content

Commit 546ad3d

Browse files
charleskeepaxbroonie
authored andcommitted
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: 7baa7e2 ("ASoC: arizona: Add event notification on voice trigger events") Signed-off-by: Charles Keepax <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 7baa7e2 commit 546ad3d

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

sound/soc/codecs/arizona.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ struct arizona_priv {
9898
bool dvfs_cached;
9999
};
100100

101+
struct arizona_voice_trigger_info {
102+
int core;
103+
};
104+
101105
#define ARIZONA_NUM_MIXER_INPUTS 104
102106

103107
extern const unsigned int arizona_mixer_tlv[];

sound/soc/codecs/cs47l24.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,17 +1067,20 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data)
10671067
{
10681068
struct cs47l24_priv *priv = data;
10691069
struct arizona *arizona = priv->core.arizona;
1070+
struct arizona_voice_trigger_info info;
10701071
int serviced = 0;
10711072
int i, ret;
10721073

10731074
for (i = 1; i <= 2; ++i) {
10741075
ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
10751076
if (ret != -ENODEV)
10761077
serviced++;
1077-
if (ret == WM_ADSP_COMPR_VOICE_TRIGGER)
1078+
if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) {
1079+
info.core = i;
10781080
arizona_call_notifiers(arizona,
10791081
ARIZONA_NOTIFY_VOICE_TRIGGER,
1080-
(void *)i);
1082+
&info);
1083+
}
10811084
}
10821085

10831086
if (!serviced) {

sound/soc/codecs/wm5110.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,17 +2222,20 @@ static irqreturn_t wm5110_adsp2_irq(int irq, void *data)
22222222
{
22232223
struct wm5110_priv *priv = data;
22242224
struct arizona *arizona = priv->core.arizona;
2225+
struct arizona_voice_trigger_info info;
22252226
int serviced = 0;
22262227
int i, ret;
22272228

22282229
for (i = 0; i < WM5110_NUM_ADSP; ++i) {
22292230
ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
22302231
if (ret != -ENODEV)
22312232
serviced++;
2232-
if (ret == WM_ADSP_COMPR_VOICE_TRIGGER)
2233+
if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) {
2234+
info.core = i;
22332235
arizona_call_notifiers(arizona,
22342236
ARIZONA_NOTIFY_VOICE_TRIGGER,
2235-
(void *)i);
2237+
&info);
2238+
}
22362239
}
22372240

22382241
if (!serviced) {

0 commit comments

Comments
 (0)