]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/sound/qdsp6v2/apr_tal.h
sound: qcom: add dsp support to apq8064
[mirror_ubuntu-zesty-kernel.git] / include / sound / qdsp6v2 / apr_tal.h
1 /* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13 #ifndef __APR_TAL_H_
14 #define __APR_TAL_H_
15
16 #include <linux/kernel.h>
17 #include <linux/kthread.h>
18 #include <linux/uaccess.h>
19
20 /* APR Client IDs */
21 #define APR_CLIENT_AUDIO 0x0
22 #define APR_CLIENT_VOICE 0x1
23 #define APR_CLIENT_MAX 0x2
24
25 #define APR_DL_SMD 0
26 #define APR_DL_MAX 1
27
28 #define APR_DEST_MODEM 0
29 #define APR_DEST_QDSP6 1
30 #define APR_DEST_MAX 2
31
32 #define APR_MAX_BUF 8192
33
34 #define APR_OPEN_TIMEOUT_MS 5000
35
36 typedef void (*apr_svc_cb_fn)(void *buf, int len, void *priv);
37 struct apr_svc_ch_dev *apr_tal_open(uint32_t svc, uint32_t dest,
38 uint32_t dl, apr_svc_cb_fn func, void *priv);
39 int apr_tal_write(struct apr_svc_ch_dev *apr_ch, void *data, int len);
40 int apr_tal_close(struct apr_svc_ch_dev *apr_ch);
41 struct apr_svc_ch_dev {
42 struct qcom_smd_channel *ch;
43 spinlock_t lock;
44 apr_svc_cb_fn func;
45 char data[APR_MAX_BUF];
46 wait_queue_head_t wait;
47 void *priv;
48 wait_queue_head_t dest;
49 uint32_t dest_state;
50 };
51
52 #endif