blob: e79c59433d789a009779c190b1953fdc4836c0be [file] [log] [blame]
Meng Wang688a8672019-01-29 13:43:33 +08001/* SPDX-License-Identifier: GPL-2.0-only */
Meng Wang61af6842018-09-10 17:47:55 +08002/*
3 * Copyright (c) 2016, The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304 */
5
6#ifndef __AUDIO_SSR_H_
7#define __AUDIO_SSR_H_
8
9enum {
10 AUDIO_SSR_DOMAIN_ADSP,
11 AUDIO_SSR_DOMAIN_MODEM,
12 AUDIO_SSR_DOMAIN_MAX
13};
14
15#ifdef CONFIG_MSM_QDSP6_SSR
16
17/*
18 * Use audio_ssr_register to register with the SSR subsystem
19 *
20 * domain_id - Service to use, example: AUDIO_SSR_DOMAIN_ADSP
21 * *nb - Pointer to a notifier block. Provide a callback function
22 * to be notified of an event for that service. The ioctls
23 * used by the callback are defined in subsystem_notif.h.
24 *
25 * Returns: Success: Client handle
26 * Failure: Pointer error code
27 */
28void *audio_ssr_register(int domain_id, struct notifier_block *nb);
29
30/*
31 * Use audio_ssr_deregister to register with the SSR subsystem
32 *
33 * handle - Handle received from audio_ssr_register
34 * *nb - Pointer to a notifier block. Callback function
35 * Used from audio_ssr_register.
36 *
37 * Returns: Success: 0
38 * Failure: Error code
39 */
40int audio_ssr_deregister(void *handle, struct notifier_block *nb);
41
42
43/*
44 * Use audio_ssr_send_nmi to force a RAM dump on ADSP
45 * down event.
46 *
47 * *ssr_cb_data - *data received from notifier callback
48 */
49void audio_ssr_send_nmi(void *ssr_cb_data);
50
51#else
52
53static inline void *audio_ssr_register(int domain_id,
54 struct notifier_block *nb)
55{
56 return NULL;
57}
58
59static inline int audio_ssr_deregister(void *handle, struct notifier_block *nb)
60{
61 return 0;
62}
63
64static inline void audio_ssr_send_nmi(void *ssr_cb_data)
65{
66}
67
68#endif /* CONFIG_MSM_QDSP6_SSR */
69
70#endif