aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/include/ste_audio_io_ioctl.h
blob: 3a1773f6f84a0179d1047d888778ca79d7a782cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/*
* Overview:
*   Header File defining IOCTLs for Audio IO interface
*
* Copyright (C) 2009 ST Ericsson
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as 
* published by the Free Software Foundation.
*/


#ifndef _AUDIOIO_IOCTL_H_
#define _AUDIOIO_IOCTL_H_


#define AUDIOIO_IOC_MAGIC            'N'
#define AUDIOIO_READ_REGISTER        _IOWR(AUDIOIO_IOC_MAGIC, 1,\
								audioio_data_t)
#define AUDIOIO_WRITE_REGISTER       _IOW(AUDIOIO_IOC_MAGIC, 2,\
								audioio_data_t)
#define AUDIOIO_PWR_CTRL_TRNSDR      _IOW(AUDIOIO_IOC_MAGIC, 3,\
							audioio_pwr_ctrl_t)
#define AUDIOIO_PWR_STS_TRNSDR       _IOR(AUDIOIO_IOC_MAGIC, 4,\
							audioio_pwr_ctrl_t)
#define AUDIOIO_LOOP_CTRL            _IOW(AUDIOIO_IOC_MAGIC, 5,\
							audioio_loop_ctrl_t)
#define AUDIOIO_LOOP_STS             _IOR(AUDIOIO_IOC_MAGIC, 6,\
							audioio_loop_ctrl_t)
#define AUDIOIO_GET_TRNSDR_GAIN_CAPABILITY      _IOR(AUDIOIO_IOC_MAGIC, 7,\
							audioio_get_gain_t)
#define AUDIOIO_GAIN_CAP_LOOP        _IOR(AUDIOIO_IOC_MAGIC, 8,\
							audioio_gain_loop_t)
#define AUDIOIO_SUPPORT_LOOP         _IOR(AUDIOIO_IOC_MAGIC, 9,\
							audioio_support_loop_t)
#define AUDIOIO_GAIN_DESC_TRNSDR     _IOR(AUDIOIO_IOC_MAGIC, 10,\
						audioio_gain_desc_trnsdr_t)
#define AUDIOIO_GAIN_CTRL_TRNSDR     _IOW(AUDIOIO_IOC_MAGIC, 11,\
						audioio_gain_ctrl_trnsdr_t)
#define AUDIOIO_GAIN_QUERY_TRNSDR    _IOR(AUDIOIO_IOC_MAGIC, 12,\
						audioio_gain_ctrl_trnsdr_t)
#define AUDIOIO_MUTE_CTRL_TRNSDR     _IOW(AUDIOIO_IOC_MAGIC, 13,\
							audioio_mute_trnsdr_t)
#define AUDIOIO_MUTE_STS_TRNSDR      _IOR(AUDIOIO_IOC_MAGIC, 14,\
							audioio_mute_trnsdr_t)
#define AUDIOIO_FADE_CTRL       	_IOW(AUDIOIO_IOC_MAGIC, 15,\
							audioio_fade_ctrl_t)
#define AUDIOIO_BURST_CTRL            _IOW(AUDIOIO_IOC_MAGIC, 16,\
							audioio_burst_ctrl_t)
#define AUDIOIO_READ_ALL_ACODEC_REGS_CTRL     _IOW(AUDIOIO_IOC_MAGIC, 17,\
					audioio_read_all_acodec_reg_ctrl_t)

/* audio codec channel ids */
#define EAR_CH			0
#define HS_CH			1
#define IHF_CH			2
#define VIBL_CH			3
#define VIBR_CH			4
#define MIC1A_CH		5
#define MIC1B_CH		6
#define MIC2_CH			7
#define LIN_CH			8
#define DMIC12_CH		9
#define DMIC34_CH		10
#define DMIC56_CH		11
#define MULTI_MIC_CH		12

#define MAX_NO_TRANSDUCERS	13

#define AUDIOIO_TRUE		1
#define AUDIOIO_FALSE		0

/** 16 bit unsigned quantity that is 16 bit word aligned */
typedef unsigned short uint16;

/** 16 bit signed quantity that is 16 bit word aligned */
typedef signed short int16;

/** 32 bit unsigned quantity that is 32 bit word aligned */
typedef unsigned long uint32;

/** signed quantity that is 32 bit word aligned */
typedef signed long int32;



typedef enum AUDIOIO_COMMON_SWITCH {
	AUDIOIO_COMMON_OFF = 0,
	AUDIOIO_COMMON_ON,
	AUDIOIO_COMMON_ALLCHANNEL_UNSUPPORTED = 0xFFFF
} AUDIOIO_COMMON_SWITCH;


typedef enum AUDIOIO_HAL_HW_LOOPS {
	AUDIOIO_NOLOOP = 0,
	AUDIOIO_SIDETONE_LOOP = 0xFFFF
} AUDIOIO_HAL_HW_LOOPS;


typedef enum AUDIOIO_FADE_PERIOD {
	e_FADE_00,
	e_FADE_01,
	e_FADE_10,
	e_FADE_11
}AUDIOIO_FADE_PERIOD;

typedef enum AUDIOIO_CH_INDEX {
	e_CHANNEL_1 = 0x01,
	e_CHANNEL_2 = 0x02,
	e_CHANNEL_3 = 0x04,
	e_CHANNEL_4 = 0x08,
	e_CHANNEL_ALL = 0x0f
}AUDIOIO_CH_INDEX;

typedef struct __audioio_data  {
	unsigned char	block;
	unsigned char	addr;
	unsigned char	data;
}audioio_data_t;

typedef struct __audioio_pwr_ctrl {
	AUDIOIO_COMMON_SWITCH ctrl_switch;
	int channel_type;
	AUDIOIO_CH_INDEX channel_index;
}audioio_pwr_ctrl_t;

typedef struct __audioio_loop_ctrl  {
	AUDIOIO_HAL_HW_LOOPS hw_loop;
	AUDIOIO_COMMON_SWITCH ctrl_switch;
	int channel_type;
	AUDIOIO_CH_INDEX channel_index;
}audioio_loop_ctrl_t;

typedef struct __audioio_get_gain {
	uint32 num_channels;
	uint16 max_num_gain;
}audioio_get_gain_t;

typedef struct __audioio_gain_loop {
	uint16 num_loop;
	uint16 max_gains;
}audioio_gain_loop_t;

typedef struct __audioio_support_loop {
	uint16 spprtd_loop_index;
}audioio_support_loop_t;

typedef struct __audioio_gain_desc_trnsdr {
	AUDIOIO_CH_INDEX channel_index;
	int channel_type;
	uint16 gain_index;
	int32 min_gain;
	int32 max_gain;
	uint32 gain_step;
}audioio_gain_desc_trnsdr_t;

typedef struct __audioio_gain_ctrl_trnsdr {
	AUDIOIO_CH_INDEX channel_index;
	int channel_type;
	uint16 gain_index;
	int32 gain_value;
	uint32 linear;
}audioio_gain_ctrl_trnsdr_t;

typedef struct __audioio_mute_trnsdr  {
	int channel_type;
	AUDIOIO_CH_INDEX channel_index;
	AUDIOIO_COMMON_SWITCH ctrl_switch;
}audioio_mute_trnsdr_t;

typedef struct __audioio_fade_ctrl  {
	AUDIOIO_COMMON_SWITCH ctrl_switch;
	AUDIOIO_FADE_PERIOD fade_period;
	int channel_type;
	AUDIOIO_CH_INDEX channel_index;
}audioio_fade_ctrl_t;

typedef struct __audioio_burst_ctrl {
	AUDIOIO_COMMON_SWITCH ctrl_switch;
	int channel_type;
	int32 burst_fifo_interrupt_sample_count;
	int32 burst_fifo_length;/*BFIFOTx*/
	int32 burst_fifo_switch_frame;
	int32 burst_fifo_sample_number;
}audioio_burst_ctrl_t;

typedef struct __audioio_read_all_acodec_reg_ctrl_t {
	unsigned char data[200];
}audioio_read_all_acodec_reg_ctrl_t;


#endif