1 /* 2 * Copyright (c) 2015 South Silicon Valley Microelectronics Inc. 3 * Copyright (c) 2015 iComm Corporation 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * This program is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 * See the GNU General Public License for more details. 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 #ifndef _SSV_HUW_H_ 18 #define _SSV_HUW_H_ 19 #include <linux/ioctl.h> 20 struct ssv_huw_cmd { 21 __u32 in_data_len; 22 u8* in_data; 23 #ifndef __x86_64 24 __u32 padding1; 25 #endif 26 __u32 out_data_len; 27 u8* out_data; 28 #ifndef __x86_64 29 __u32 padding2; 30 #endif 31 __u32 response; 32 }__attribute__((packed)); 33 #define FILE_DEVICE_SSVSDIO MMC_BLOCK_MAJOR 34 #define FILE_DEVICE_SSVSDIO_SEQ 0x50 35 #define FILE_DEVICE_SSVSDIO_NAME "ssvhuwdev" 36 #if 0 37 #define IOCTL_SSVSDIO_GET_DRIVER_VERSION \ 38 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x01, struct ssv_huw_cmd) 39 #define IOCTL_SSVSDIO_GET_FUNCTION_NUMBER \ 40 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x02, struct ssv_huw_cmd) 41 #define IOCTL_SSVSDIO_GET_FUNCTION_FOCUS \ 42 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x03, struct ssv_huw_cmd) 43 #define IOCTL_SSVSDIO_SET_FUNCTION_FOCUS \ 44 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x04, struct ssv_huw_cmd) 45 #define IOCTL_SSVSDIO_GET_BUS_WIDTH \ 46 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x05, struct ssv_huw_cmd) 47 #define IOCTL_SSVSDIO_SET_BUS_WIDTH \ 48 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x06, struct ssv_huw_cmd) 49 #define IOCTL_SSVSDIO_GET_BUS_CLOCK \ 50 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x07, struct ssv_huw_cmd) 51 #define IOCTL_SSVSDIO_SET_BUS_CLOCK \ 52 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x08, struct ssv_huw_cmd) 53 #define IOCTL_SSVSDIO_GET_BLOCK_MODE \ 54 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x09, struct ssv_huw_cmd) 55 #define IOCTL_SSVSDIO_SET_BLOCK_MODE \ 56 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x0a, struct ssv_huw_cmd) 57 #define IOCTL_SSVSDIO_GET_BLOCKLEN \ 58 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x0b, struct ssv_huw_cmd) 59 #define IOCTL_SSVSDIO_SET_BLOCKLEN \ 60 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x0c, struct ssv_huw_cmd) 61 #define IOCTL_SSVSDIO_GET_FN0_BLOCKLEN \ 62 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x0d, struct ssv_huw_cmd) 63 #define IOCTL_SSVSDIO_SET_FN0_BLOCKLEN \ 64 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x0e, struct ssv_huw_cmd) 65 #define IOCTL_SSVSDIO_GET_BUS_INTERFACE_CONTROL \ 66 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x0f, struct ssv_huw_cmd) 67 #define IOCTL_SSVSDIO_SET_BUS_INTERFACE_CONTROL \ 68 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x10, struct ssv_huw_cmd) 69 #define IOCTL_SSVSDIO_GET_INT_ENABLE \ 70 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x11, struct ssv_huw_cmd) 71 #define IOCTL_SSVSDIO_SET_INT_ENABLE \ 72 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x12, struct ssv_huw_cmd) 73 #define IOCTL_SSVSDIO_GET_AUTO_ACK_INT \ 74 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x13, struct ssv_huw_cmd) 75 #define IOCTL_SSVSDIO_SET_AUTO_ACK_INT \ 76 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x14, struct ssv_huw_cmd) 77 #define IOCTL_SSVSDIO_ACK_INT \ 78 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x15, struct ssv_huw_cmd) 79 #define IOCTL_SSVSDIO_READ_BYTE \ 80 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x16, struct ssv_huw_cmd) 81 #define IOCTL_SSVSDIO_WRITE_BYTE \ 82 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x17, struct ssv_huw_cmd) 83 #define IOCTL_SSVSDIO_GET_MULTI_BYTE_IO_PORT \ 84 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x18, struct ssv_huw_cmd) 85 #define IOCTL_SSVSDIO_SET_MULTI_BYTE_IO_PORT \ 86 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x19, struct ssv_huw_cmd) 87 #define IOCTL_SSVSDIO_READ_MULTI_BYTE \ 88 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x1a, struct ssv_huw_cmd) 89 #define IOCTL_SSVSDIO_WRITE_MULTI_BYTE \ 90 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x1b, struct ssv_huw_cmd) 91 #define IOCTL_SSVSDIO_GET_MULTI_BYTE_REG_IO_PORT \ 92 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x1c, struct ssv_huw_cmd) 93 #define IOCTL_SSVSDIO_SET_MULTI_BYTE_REG_IO_PORT \ 94 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x1d, struct ssv_huw_cmd) 95 #endif 96 #define IOCTL_SSVSDIO_READ_REG \ 97 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x1e, struct ssv_huw_cmd) 98 #define IOCTL_SSVSDIO_WRITE_REG \ 99 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x1f, struct ssv_huw_cmd) 100 #define IOCTL_SSVSDIO_READ_DATA \ 101 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x20, struct ssv_huw_cmd) 102 #define IOCTL_SSVSDIO_WRITE_SRAM \ 103 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x21, struct ssv_huw_cmd) 104 #define IOCTL_SSVSDIO_START \ 105 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x22, struct ssv_huw_cmd) 106 #define IOCTL_SSVSDIO_STOP \ 107 _IOWR( FILE_DEVICE_SSVSDIO, FILE_DEVICE_SSVSDIO_SEQ+0x23, struct ssv_huw_cmd) 108 #endif 109