blob: 7862449e84f30345455894c7b07155fb17e47d7e [file] [log] [blame]
l.yangafee7ee2024-10-10 15:01:10 +08001/*
2 * Copyright (C) 2013 ZTE, China
3 *
4 * It has the ioctl definitions for the volte driver that
5 * userspace needs to know about.
6 */
7
8#ifndef __LINUX_VOLTE_DRV_H
9#define __LINUX_VOLTE_DRV_H
10
11#include <linux/ioctl.h>
12#include <linux/types.h>
13
14
15
16typedef enum {
17 VOICE_GSM_MODE = 0,
18 VOICE_TD_MODE ,
19 VOICE_WCDMA_MODE,
20 VOICE_LTE_MODE,
21 VOICE_GSM_TD_MODE,//GSM TD share
22 VOICE_GSM_WCDMA_MODE, //GSM WCDMA share
23 MAX_VOICE_MODE
24} T_ZDrvVoice_MODE;
25typedef struct {
26 uint32_t clock_rate;
27 uint32_t channel_count;
28 uint32_t samples_per_frame;
29 uint32_t bits_per_sample;
30 uint32_t mode;
31} T_ZDrvVoice_Cfg;
32
33typedef T_ZDrvVoice_Cfg T_ZDrvVolte_Cfg;
34
35#ifdef __KERNEL__
36struct volte_dev {
37 T_ZDrvVoice_Cfg param;
38 void *readbuf;
39 void *writebuf;
40};
41#endif
42
43#define VOLTE_IOCTL_READ_START _IO('v', 1)
44#define VOLTE_IOCTL_READ_STOP _IO('v', 2)
45#define VOLTE_IOCTL_WRITE_START _IO('v', 3)
46#define VOLTE_IOCTL_WRITE_STOP _IO('v', 4)
47#define VOLTE_IOCTL_SET_CFG _IOW('v', 5, T_ZDrvVoice_Cfg)
48#define VOLTE_IOCTL_GET_SLIC_USE_FLAG _IOR ('v', 6, int)
49
50/**************voice define****************/
51typedef enum {
52 AMR_NB_CODEC = 0,
53 AMR_WB_CODEC,
54
55 MAX_CODEC_TYPE
56} T_Codec_Type;
57
58typedef enum {
59 DSP_PATH = 0,
60 SOFT_PATH,
61 MAX_CODEC_PATH
62} T_Codec_Path;
63
64typedef enum {
65 NOR_VOICE_INF_MODE = 0,//normal
66 VB_VOICE_INF_MODE,//voice buffer
67 MAX_VOICE_INF_MODE
68} T_VoiceInfMode;
69
70
71typedef enum {
72 VOICE_STOP = 0,
73 VOICE_START,
74 MAX_VOICE_STATE
75} T_Voice_State;
76
77typedef struct {
78 uint32_t clock_rate; //8000;16000
79 uint32_t mode; //// 0 gsm;1 td;2 wcdma;3 lte
80 uint32_t codec_type;//0 amr-nb;1 amr-wb
81 uint32_t codec_path;//0 hardware dsp;1 soft amr lib
82
83
84} T_Voice_Para;
85
86typedef struct {
87 uint32_t fs; //8000;16000
88 uint32_t enable; //// 0 disable;1 enable
89 uint32_t type;//0 single core;1 mult core
90
91
92} T_VoiceBuf_Para;
93
94
95#ifdef __KERNEL__
96struct voice_dev {
97 T_Voice_Para param;
98 uint32_t voice_state;
99};
100#endif
101
102#define VOICE_IOCTL_START _IOW('v', 10, T_ZDrvVoice_Cfg)
103#define VOICE_IOCTL_STOP _IOW('v', 11, T_ZDrvVoice_Cfg)
104#define VOICE_IOCTL_GET_SLIC_USE_FLAG _IOR ('v', 12, int)
105#define VOICE_IOCTL_VPLOOP _IOW('v', 13, int)
106
107#define VOICE_IOCTL_SET_VOL _IOW('v', 14, int)
108#define VOICE_IOCTL_GET_VOL _IOR('v', 15, int)
109
110#define VOICE_IOCTL_SET_MUTE _IOW('v', 16, bool)
111#define VOICE_IOCTL_GET_MUTE _IOR('v', 17, bool)
112
113#define VOICE_IOCTL_SET_PATH _IOW('v', 18, int)
114#define VOICE_IOCTL_GET_PATH _IOR('v', 19, int)
115
116#define VOICE_IOCTL_GET_FS _IOR('v', 20, int)
117#define VOICE_IOCTL_SET_VOICE_NVRW _IOW('v', 21, int)
118
119#define VOICE_IOCTL_SET_VP _IOW('v', 22, int)
120#define VOICE_IOCTL_GET_VP _IOR('v', 23, int)
121
122#define VOICE_IOCTL_SET_VBUF _IOW('v', 24, T_VoiceBuf_Para)
123#define VOICE_IOCTL_GET_VBUF _IOR('v', 25, T_VoiceBuf_Para)
124
125#define VOICE_IOCTL_SET_INF_MODE _IOW('v', 26, int)
126#define VOICE_IOCTL_GET_INF_MODE _IOR('v', 27, int)
127
128
129
130#ifdef __KERNEL__
131#define print_audio(fmt, ...) \
132 printk(fmt, ##__VA_ARGS__)
133#endif
134
135/**************audiomix define****************/
136typedef struct {
137 uint32_t sample_rate;
138 uint32_t audioType;
139 //uint32_t samples_per_frame;
140 //uint32_t bits_per_sample;
141} T_ZDrvAudioMix_Cfg;
142
143#ifdef __KERNEL__
144struct audio_mix_dev {
145 T_ZDrvAudioMix_Cfg param;
146 //void *readbuf;
147 void *writebuf;
148};
149#endif
150
151#define AUDIOMIX_IOCTL_SET_CFG _IOW('v', 7, T_ZDrvAudioMix_Cfg)
152
153#endif
154