blob: 45282c1ddbbb0e8826f7d94785286b032b5d16ff [file] [log] [blame]
Sana Venkat Rajufccf2022013-12-15 11:51:17 +05301/* Copyright (c) 2011,2014, The Linux Foundation. All rights reserved.
Harini Jayaramanef7805f2011-09-28 12:45:31 -06002 *
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 __MSM_BUSPM_DEV_H__
14#define __MSM_BUSPM_DEV_H__
15
16#include <linux/ioctl.h>
17
18struct msm_buspm_map_dev {
19 void *vaddr;
20 unsigned long paddr;
21 size_t buflen;
22};
23
24/* Read/write data into kernel buffer */
25struct buspm_xfer_req {
Sana Venkat Rajufccf2022013-12-15 11:51:17 +053026 unsigned int size; /* Size of this request, in bytes */
Harini Jayaramanef7805f2011-09-28 12:45:31 -060027 void *data; /* Data buffer to transfer data to/from */
28};
29
30struct buspm_alloc_params {
31 int size;
32};
33
Gagan Mac0d5d49e2012-08-28 19:41:37 -060034enum msm_buspm_ioc_cmds {
35 MSM_BUSPM_SPDM_CLK_DIS = 0,
36 MSM_BUSPM_SPDM_CLK_EN,
37};
38
Harini Jayaramanef7805f2011-09-28 12:45:31 -060039#define MSM_BUSPM_IOC_MAGIC 'p'
40
41#define MSM_BUSPM_IOC_FREE \
42 _IOW(MSM_BUSPM_IOC_MAGIC, 0, void *)
43
44#define MSM_BUSPM_IOC_ALLOC \
45 _IOW(MSM_BUSPM_IOC_MAGIC, 1, size_t)
46
47#define MSM_BUSPM_IOC_RDBUF \
48 _IOW(MSM_BUSPM_IOC_MAGIC, 2, struct buspm_xfer_req)
49
50#define MSM_BUSPM_IOC_WRBUF \
51 _IOW(MSM_BUSPM_IOC_MAGIC, 3, struct buspm_xfer_req)
52
53#define MSM_BUSPM_IOC_RD_PHYS_ADDR \
54 _IOR(MSM_BUSPM_IOC_MAGIC, 4, unsigned long)
Gagan Mac0d5d49e2012-08-28 19:41:37 -060055
56#define MSM_BUSPM_IOC_CMD \
57 _IOR(MSM_BUSPM_IOC_MAGIC, 5, uint32_t)
Harini Jayaramanef7805f2011-09-28 12:45:31 -060058#endif