Skip to content

Commit 9f3fb25

Browse files
committed
ASoC: wm_adsp: Add WDT expiry IRQ handling support
Change-Id: Ie0f369a5c7888b86b484acf29e49659be15084d0 Signed-off-by: Stuart Henderson <[email protected]>
1 parent f9bfe26 commit 9f3fb25

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@
242242
#define HALO_SCRATCH1 0x005c0
243243
#define HALO_CCM_CORE_CONTROL 0x41000
244244
#define HALO_CORE_SOFT_RESET 0x00010
245+
#define HALO_WDT_CONTROL 0x47000
245246

246247
/*
247248
* HALO Lock support
@@ -395,6 +396,13 @@
395396
#define HALO_CORE_SOFT_RESET_SHIFT 0
396397
#define HALO_CORE_SOFT_RESET_MASK 0x00000001
397398

399+
/*
400+
* HALO_WDT_CONTROL
401+
*/
402+
#define HALO_WDT_EN 0x00000001
403+
#define HALO_WDT_EN_MASK 0x00000001
404+
#define HALO_WDT_EN_SHIFT 0
405+
398406
/*
399407
* HALO_MPU_?M_VIO_STATUS
400408
*/
@@ -3598,6 +3606,12 @@ static void wm_adsp_stop_watchdog(struct wm_adsp *dsp)
35983606
}
35993607
}
36003608

3609+
static void wm_halo_stop_watchdog(struct wm_adsp *dsp)
3610+
{
3611+
regmap_update_bits(dsp->regmap, dsp->base + HALO_WDT_CONTROL,
3612+
HALO_WDT_EN_MASK, 0);
3613+
}
3614+
36013615
int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
36023616
struct snd_kcontrol *kcontrol, int event,
36033617
unsigned int freq)
@@ -5038,4 +5052,19 @@ irqreturn_t wm_halo_bus_error(struct wm_adsp *dsp)
50385052
}
50395053
EXPORT_SYMBOL_GPL(wm_halo_bus_error);
50405054

5055+
irqreturn_t wm_halo_wdt_expire(int irq, void *data)
5056+
{
5057+
struct wm_adsp *dsp = data;
5058+
5059+
mutex_lock(&dsp->pwr_lock);
5060+
5061+
adsp_warn(dsp, "WDT Expiry Fault\n");
5062+
wm_halo_stop_watchdog(dsp);
5063+
5064+
mutex_unlock(&dsp->pwr_lock);
5065+
5066+
return IRQ_HANDLED;
5067+
}
5068+
EXPORT_SYMBOL_GPL(wm_halo_wdt_expire);
5069+
50415070
MODULE_LICENSE("GPL v2");

sound/soc/codecs/wm_adsp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
163163
int wm_adsp2_lock(struct wm_adsp *adsp, unsigned int regions);
164164
irqreturn_t wm_adsp2_bus_error(struct wm_adsp *adsp);
165165
irqreturn_t wm_halo_bus_error(struct wm_adsp *dsp);
166+
irqreturn_t wm_halo_wdt_expire(int irq, void *data);
166167

167168
int wm_adsp2_event(struct snd_soc_dapm_widget *w,
168169
struct snd_kcontrol *kcontrol, int event);

0 commit comments

Comments
 (0)