blob: 2bfc518841c97a298806e49b84597d3660bb7b58 [file] [log] [blame]
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301/*
2 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <linux/types.h>
15#include <linux/uaccess.h>
16#include <linux/spinlock.h>
17#include <linux/kernel.h>
18#include <linux/qdsp6v2/apr.h>
19#include <linux/qdsp6v2/apr_tal.h>
20#include <linux/qdsp6v2/dsp_debug.h>
21#include <linux/qdsp6v2/audio_notifier.h>
22
23#define DEST_ID APR_DEST_MODEM
24
25enum apr_subsys_state apr_get_subsys_state(void)
26{
27 return apr_get_modem_state();
28}
29
30void apr_set_subsys_state(void)
31{
32 apr_set_modem_state(APR_SUBSYS_DOWN);
33}
34
35uint16_t apr_get_data_src(struct apr_hdr *hdr)
36{
37 return DEST_ID;
38}
39
40int apr_get_dest_id(char *dest)
41{
42 return DEST_ID;
43}
44
45void subsys_notif_register(char *client_name, int domain,
46 struct notifier_block *nb)
47{
48 int ret;
49
50 if (domain != AUDIO_NOTIFIER_MODEM_DOMAIN) {
51 pr_debug("%s: Unused domain %d not registering with notifier\n",
52 __func__, domain);
53 return;
54 }
55
56 ret = audio_notifier_register(client_name, domain, nb);
57 if (ret < 0)
58 pr_err("%s: Audio notifier register failed for domain %d ret = %d\n",
59 __func__, domain, ret);
60}
61
62uint16_t apr_get_reset_domain(uint16_t proc)
63{
64 return APR_DEST_QDSP6;
65}