blob: 5ca583966e416de27af1fc0659de622db6a5def5 [file] [log] [blame]
AnilKumar Chimata20c6b2f2017-04-07 12:18:46 -07001/* Copyright (c) 2012-2017 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 __QSEECOM_KERNEL_H_
14#define __QSEECOM_KERNEL_H_
15
16#include <linux/types.h>
17#include <soc/qcom/scm.h>
18
19#define QSEECOM_ALIGN_SIZE 0x40
20#define QSEECOM_ALIGN_MASK (QSEECOM_ALIGN_SIZE - 1)
21#define QSEECOM_ALIGN(x) \
22 ((x + QSEECOM_ALIGN_MASK) & (~QSEECOM_ALIGN_MASK))
23
24/*
25 * struct qseecom_handle -
26 * Handle to the qseecom device for kernel clients
27 * @sbuf - shared buffer pointer
28 * @sbbuf_len - shared buffer size
29 */
30struct qseecom_handle {
31 void *dev; /* in/out */
32 unsigned char *sbuf; /* in/out */
33 uint32_t sbuf_len; /* in/out */
34};
35
36int qseecom_start_app(struct qseecom_handle **handle,
37 char *app_name, uint32_t size);
38int qseecom_shutdown_app(struct qseecom_handle **handle);
39int qseecom_send_command(struct qseecom_handle *handle, void *send_buf,
40 uint32_t sbuf_len, void *resp_buf, uint32_t rbuf_len);
41int qseecom_set_bandwidth(struct qseecom_handle *handle, bool high);
42int qseecom_process_listener_from_smcinvoke(struct scm_desc *desc);
43
44#endif /* __QSEECOM_KERNEL_H_ */