MLK-14997-2: include: uapi: add hifi header file
authorShengjiu Wang <shengjiu.wang@freescale.com>
Thu, 1 Jun 2017 07:16:25 +0000 (15:16 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:28 +0000 (15:22 -0500)
add hifi header file, which is used by user space.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
include/uapi/linux/Kbuild
include/uapi/linux/mxc_hifi4.h [new file with mode: 0644]

index 12274d7..7ca29e7 100644 (file)
@@ -287,6 +287,7 @@ header-y += mxc_sim_interface.h
 header-y += mxc_v4l2.h
 header-y += mtio.h
 header-y += mxc_asrc.h
+header-y += mxc_hifi4.h
 header-y += nbd.h
 header-y += ncp_fs.h
 header-y += ncp.h
diff --git a/include/uapi/linux/mxc_hifi4.h b/include/uapi/linux/mxc_hifi4.h
new file mode 100644 (file)
index 0000000..7194290
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017 NXP
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file mxc_hifi4.h
+ *
+ * @ingroup Audio
+ */
+
+#ifndef __MXC_HIFI4_UAPI_H__
+#define __MXC_HIFI4_UAPI_H__
+
+#define HIFI4_IOC_MAGIC                'H'
+#define HIFI4_LOAD_CODEC               _IOWR(HIFI4_IOC_MAGIC, 0, unsigned int)
+#define HIFI4_INIT_CODEC               _IOWR(HIFI4_IOC_MAGIC, 1, unsigned int)
+#define HIFI4_CODEC_OPEN               _IOWR(HIFI4_IOC_MAGIC, 2, unsigned int)
+#define HIFI4_CODEC_CLOSE              _IOWR(HIFI4_IOC_MAGIC, 3, unsigned int)
+#define HIFI4_DECODE_ONE_FRAME         _IOW(HIFI4_IOC_MAGIC, 4, unsigned int)
+#define HIFI4_UNLOAD_CODEC             _IOW(HIFI4_IOC_MAGIC, 5, unsigned int)
+#define HIFI4_GET_PCM_PROP             _IOW(HIFI4_IOC_MAGIC, 6, unsigned int)
+#define HIFI4_SET_CONFIG               _IOW(HIFI4_IOC_MAGIC, 7, unsigned int)
+
+#define CODEC_MP3_DEC          1
+#define CODEC_AAC_DEC          2
+#define CODEC_DAB_DEC          3
+#define CODEC_MP2_DEC          4
+#define CODEC_BSAC_DEC         5
+#define CODEC_DRM_DEC          6
+#define CODEC_SBC_DEC          7
+#define CODEC_SBC_ENC          8
+#define CODEC_DEMO_DEC         9
+
+struct decode_info {
+       void *in_buf_addr;
+       int   in_buf_size;
+       int   in_buf_off;
+       void *out_buf_addr;
+       int   out_buf_size;
+       int   out_buf_off;
+};
+
+struct prop_info {
+       int   samplerate;
+       int   channels;
+       int   bits;
+       unsigned int consumed_bytes;
+
+       /* dedicate for drm dec */
+       int   frame_size;
+
+       /* dedicate for bsac, aacplus and dabplus dec */
+       int   aac_samplerate;
+       int   sbr_type;
+       int   mpeg_surr_present;
+};
+
+struct binary_info {
+       int type;
+       char *file;
+};
+
+struct prop_config {
+       int   codec_id;  /* codec id */
+       int   cmd;       /* command value */
+       int   val;       /* parameter value */
+       int   ret;       /* executed status of function */
+};
+
+#endif/* __MXC_HIFI4_UAPI_H__ */