|
| 1 | +/* |
| 2 | + * Decoder device driver (kernel module headers) |
| 3 | + * |
| 4 | + * Copyright (C) 2009 Hantro Products Oy. |
| 5 | + * |
| 6 | + * This program is free software; you can redistribute it and/or |
| 7 | + * modify it under the terms of the GNU General Public License |
| 8 | + * as published by the Free Software Foundation; either version 2 |
| 9 | + * of the License, or (at your option) any later version. |
| 10 | +
|
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU General Public License |
| 17 | + * along with this program; if not, write to the Free Software |
| 18 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | + */ |
| 20 | + |
| 21 | +#ifndef _HX170DEC_H_ |
| 22 | +#define _HX170DEC_H_ |
| 23 | + |
| 24 | +#include <linux/ioctl.h> |
| 25 | +#include <linux/types.h> |
| 26 | + |
| 27 | +struct core_desc |
| 28 | +{ |
| 29 | + __u32 id; /* id of the core */ |
| 30 | + __u32 *regs; /* pointer to user registers */ |
| 31 | + __u32 size; /* size of register space */ |
| 32 | +}; |
| 33 | + |
| 34 | +/* Use 'k' as magic number */ |
| 35 | +#define HX170DEC_IOC_MAGIC 'k' |
| 36 | +/* |
| 37 | + * S means "Set" through a ptr, |
| 38 | + * T means "Tell" directly with the argument value |
| 39 | + * G means "Get": reply by setting through a pointer |
| 40 | + * Q means "Query": response is on the return value |
| 41 | + * X means "eXchange": G and S atomically |
| 42 | + * H means "sHift": T and Q atomically |
| 43 | + */ |
| 44 | + |
| 45 | +#define HX170DEC_IOCGHWOFFSET _IOR(HX170DEC_IOC_MAGIC, 3, unsigned long *) |
| 46 | +#define HX170DEC_IOCGHWIOSIZE _IOR(HX170DEC_IOC_MAGIC, 4, unsigned int *) |
| 47 | + |
| 48 | +#define HX170DEC_IOC_MC_OFFSETS _IOR(HX170DEC_IOC_MAGIC, 7, unsigned long *) |
| 49 | +#define HX170DEC_IOC_MC_CORES _IOR(HX170DEC_IOC_MAGIC, 8, unsigned int *) |
| 50 | +#define HX170DEC_IOCS_DEC_PUSH_REG _IOW(HX170DEC_IOC_MAGIC, 9, struct core_desc *) |
| 51 | +#define HX170DEC_IOCS_PP_PUSH_REG _IOW(HX170DEC_IOC_MAGIC, 10, struct core_desc *) |
| 52 | +#define HX170DEC_IOCH_DEC_RESERVE _IO(HX170DEC_IOC_MAGIC, 11) |
| 53 | +#define HX170DEC_IOCT_DEC_RELEASE _IO(HX170DEC_IOC_MAGIC, 12) |
| 54 | +#define HX170DEC_IOCQ_PP_RESERVE _IO(HX170DEC_IOC_MAGIC, 13) |
| 55 | +#define HX170DEC_IOCT_PP_RELEASE _IO(HX170DEC_IOC_MAGIC, 14) |
| 56 | +#define HX170DEC_IOCX_DEC_WAIT _IOWR(HX170DEC_IOC_MAGIC, 15, struct core_desc *) |
| 57 | +#define HX170DEC_IOCX_PP_WAIT _IOWR(HX170DEC_IOC_MAGIC, 16, struct core_desc *) |
| 58 | +#define HX170DEC_IOCS_DEC_PULL_REG _IOWR(HX170DEC_IOC_MAGIC, 17, struct core_desc *) |
| 59 | +#define HX170DEC_IOCS_PP_PULL_REG _IOWR(HX170DEC_IOC_MAGIC, 18, struct core_desc *) |
| 60 | + |
| 61 | +#define HX170DEC_IOX_ASIC_ID _IOWR(HX170DEC_IOC_MAGIC, 20, __u32 *) |
| 62 | + |
| 63 | +/* |
| 64 | + * Following are not used yet: |
| 65 | + * |
| 66 | + * #define HX170DEC_PP_INSTANCE _IO(HX170DEC_IOC_MAGIC, 1) |
| 67 | + * #define HX170DEC_HW_PERFORMANCE _IO(HX170DEC_IOC_MAGIC, 2) |
| 68 | + * #define HX170DEC_IOC_CLI _IO(HX170DEC_IOC_MAGIC, 5) |
| 69 | + * #define HX170DEC_IOC_STI _IO(HX170DEC_IOC_MAGIC, 6) |
| 70 | + * #define HX170DEC_IOCG_CORE_WAIT _IOR(HX170DEC_IOC_MAGIC, 19, int *) |
| 71 | + * #define HX170DEC_DEBUG_STATUS _IO(HX170DEC_IOC_MAGIC, 29) |
| 72 | + */ |
| 73 | + |
| 74 | +#define HX170DEC_IOC_MAXNR 29 |
| 75 | + |
| 76 | +#endif /* !_HX170DEC_H_ */ |
0 commit comments