Skip to content

Commit

Permalink
ASoC: arizona: Add data structure for voice trigger notifier
Browse files Browse the repository at this point in the history
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 <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Charles Keepax authored and Mark Brown committed May 31, 2016
1 parent 7baa7e2 commit 546ad3d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions sound/soc/codecs/arizona.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
7 changes: 5 additions & 2 deletions sound/soc/codecs/cs47l24.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,17 +1067,20 @@ 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;

for (i = 1; i <= 2; ++i) {
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) {
Expand Down
7 changes: 5 additions & 2 deletions sound/soc/codecs/wm5110.c
Original file line number Diff line number Diff line change
Expand Up @@ -2222,17 +2222,20 @@ 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;

for (i = 0; i < WM5110_NUM_ADSP; ++i) {
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) {
Expand Down

0 comments on commit 546ad3d

Please sign in to comment.