1 /* include/linux/msm_adsp.h 2 * 3 * Copyright (C) 2007 Google, Inc. 4 * Author: Iliyan Malchev <ibm@android.com> 5 * 6 * This software is licensed under the terms of the GNU General Public 7 * License version 2, as published by the Free Software Foundation, and 8 * may be copied, distributed, and modified under those terms. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 */ 16 #ifndef __LINUX_MSM_ADSP_H 17 #define __LINUX_MSM_ADSP_H 18 19 #include <linux/types.h> 20 #include <linux/ioctl.h> 21 22 #define ADSP_IOCTL_MAGIC 'q' 23 24 /* ADSP_IOCTL_WRITE_COMMAND */ 25 struct adsp_command_t { 26 uint16_t queue; 27 uint32_t len; /* bytes */ 28 uint8_t *data; 29 }; 30 31 /* ADSP_IOCTL_GET_EVENT */ 32 struct adsp_event_t { 33 uint16_t type; /* 1 == event (RPC), 0 == message (adsp) */ 34 uint32_t timeout_ms; /* -1 for infinite, 0 for immediate return */ 35 uint16_t msg_id; 36 uint16_t flags; /* 1 == 16--bit event, 0 == 32-bit event */ 37 uint32_t len; /* size in, number of bytes out */ 38 uint8_t *data; 39 }; 40 41 #define ADSP_IOCTL_ENABLE \ 42 _IOR(ADSP_IOCTL_MAGIC, 1, unsigned) 43 44 #define ADSP_IOCTL_DISABLE \ 45 _IOR(ADSP_IOCTL_MAGIC, 2, unsigned) 46 47 #define ADSP_IOCTL_DISABLE_ACK \ 48 _IOR(ADSP_IOCTL_MAGIC, 3, unsigned) 49 50 #define ADSP_IOCTL_WRITE_COMMAND \ 51 _IOR(ADSP_IOCTL_MAGIC, 4, struct adsp_command_t *) 52 53 #define ADSP_IOCTL_GET_EVENT \ 54 _IOWR(ADSP_IOCTL_MAGIC, 5, struct adsp_event_data_t *) 55 56 #define ADSP_IOCTL_SET_CLKRATE \ 57 _IOR(ADSP_IOCTL_MAGIC, 6, unsigned) 58 59 #define ADSP_IOCTL_DISABLE_EVENT_RSP \ 60 _IOR(ADSP_IOCTL_MAGIC, 10, unsigned) 61 62 #define ADSP_IOCTL_REGISTER_PMEM \ 63 _IOW(ADSP_IOCTL_MAGIC, 13, unsigned) 64 65 #define ADSP_IOCTL_UNREGISTER_PMEM \ 66 _IOW(ADSP_IOCTL_MAGIC, 14, unsigned) 67 68 /* Cause any further GET_EVENT ioctls to fail (-ENODEV) 69 * until the device is closed and reopened. Useful for 70 * terminating event dispatch threads 71 */ 72 #define ADSP_IOCTL_ABORT_EVENT_READ \ 73 _IOW(ADSP_IOCTL_MAGIC, 15, unsigned) 74 75 #define ADSP_IOCTL_LINK_TASK \ 76 _IOW(ADSP_IOCTL_MAGIC, 16, unsigned) 77 78 #endif 79