1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __UAPI_RADIO_IRIS_H
20 #define __UAPI_RADIO_IRIS_H
21 #include <linux/types.h>
22 #include <media/radio-iris-commands.h>
23 #define MIN_TX_TONE_VAL 0x00
24 #define MAX_TX_TONE_VAL 0x07
25 #define MIN_HARD_MUTE_VAL 0x00
26 #define MAX_HARD_MUTE_VAL 0x03
27 #define MIN_SRCH_MODE 0x00
28 #define MAX_SRCH_MODE 0x09
29 #define MIN_SCAN_DWELL 0x00
30 #define MAX_SCAN_DWELL 0x0F
31 #define MIN_SIG_TH 0x00
32 #define MAX_SIG_TH 0x03
33 #define MIN_PTY 0X00
34 #define MAX_PTY 0x1F
35 #define MIN_PI 0x0000
36 #define MAX_PI 0xFFFF
37 #define MIN_SRCH_STATIONS_CNT 0x00
38 #define MAX_SRCH_STATIONS_CNT 0x14
39 #define MIN_CHAN_SPACING 0x00
40 #define MAX_CHAN_SPACING 0x02
41 #define MIN_EMPHASIS 0x00
42 #define MAX_EMPHASIS 0x01
43 #define MIN_RDS_STD 0x00
44 #define MAX_RDS_STD 0x02
45 #define MIN_ANTENNA_VAL 0x00
46 #define MAX_ANTENNA_VAL 0x01
47 #define MIN_TX_PS_REPEAT_CNT 0x01
48 #define MAX_TX_PS_REPEAT_CNT 0x0F
49 #define MIN_SOFT_MUTE 0x00
50 #define MAX_SOFT_MUTE 0x01
51 #define MIN_PEEK_ACCESS_LEN 0x01
52 #define MAX_PEEK_ACCESS_LEN 0xF9
53 #define MIN_RESET_CNTR 0x00
54 #define MAX_RESET_CNTR 0x01
55 #define MIN_HLSI 0x00
56 #define MAX_HLSI 0x02
57 #define MIN_NOTCH_FILTER 0x00
58 #define MAX_NOTCH_FILTER 0x02
59 #define MIN_INTF_DET_OUT_LW_TH 0x00
60 #define MAX_INTF_DET_OUT_LW_TH 0xFF
61 #define MIN_INTF_DET_OUT_HG_TH 0x00
62 #define MAX_INTF_DET_OUT_HG_TH 0xFF
63 #define MIN_SINR_TH - 128
64 #define MAX_SINR_TH 127
65 #define MIN_SINR_SAMPLES 0x01
66 #define MAX_SINR_SAMPLES 0xFF
67 #define MIN_BLEND_HI - 128
68 #define MAX_BLEND_HI 127
69 #define RADIO_HCI_COMMAND_HDR_SIZE sizeof(struct radio_hci_command_hdr)
70 #define RADIO_HCI_EVENT_HDR_SIZE sizeof(struct radio_hci_event_hdr)
71 #define RADIO_HCI_COMMAND_PKT 0x11
72 #define RADIO_HCI_EVENT_PKT 0x14
73 #define MAX_RIVA_PEEK_RSP_SIZE 251
74 #define DEFAULT_DATA_OFFSET 2
75 #define DEFAULT_DATA_SIZE 249
76 #define FM_TX_PWR_LVL_STEP_SIZE 36
77 #define FM_TX_PWR_LVL_0 0
78 #define FM_TX_PWR_LVL_MAX 7
79 #define FM_TX_PHY_CFG_MODE 0x3c
80 #define FM_TX_PHY_CFG_LEN 0x10
81 #define FM_TX_PWR_GAIN_OFFSET 14
82 #define FM_RDS_CNFG_MODE 0x0f
83 #define FM_RDS_CNFG_LEN 0x10
84 #define AF_RMSSI_TH_LSB_OFFSET 10
85 #define AF_RMSSI_TH_MSB_OFFSET 11
86 #define AF_RMSSI_SAMPLES_OFFSET 15
87 #define FM_RX_CONFG_MODE 0x15
88 #define FM_RX_CNFG_LEN 0x20
89 #define GD_CH_RMSSI_TH_OFFSET 12
90 #define MAX_GD_CH_RMSSI_TH 127
91 #define SRCH_ALGO_TYPE_OFFSET 25
92 #define SINRFIRSTSTAGE_OFFSET 26
93 #define RMSSIFIRSTSTAGE_OFFSET 27
94 #define CF0TH12_BYTE1_OFFSET 8
95 #define CF0TH12_BYTE2_OFFSET 9
96 #define CF0TH12_BYTE3_OFFSET 10
97 #define CF0TH12_BYTE4_OFFSET 11
98 #define MAX_SINR_FIRSTSTAGE 127
99 #define MAX_RMSSI_FIRSTSTAGE 127
100 #define RDS_PS0_XFR_MODE 0x01
101 #define RDS_PS0_LEN 6
102 #define RX_REPEATE_BYTE_OFFSET 5
103 #define FM_SPUR_TBL_SIZE 240
104 #define SPUR_DATA_LEN 16
105 #define ENTRIES_EACH_CMD 15
106 #define SPUR_DATA_INDEX 2
107 #define FM_AF_LIST_MAX_SIZE 200
108 #define AF_LIST_MAX (FM_AF_LIST_MAX_SIZE / 4)
109 #define MAX_BLEND_INDEX 49
110 #define TUNE_PARAM 16
111 #define FM_RDS_3A_GRP (0x40)
112 struct radio_hci_command_hdr {
113   __le16 opcode;
114   __u8 plen;
115 } __attribute__((packed));
116 struct radio_hci_event_hdr {
117   __u8 evt;
118   __u8 plen;
119 } __attribute__((packed));
120 #define HCI_OCF_FM_ENABLE_RECV_REQ 0x0001
121 #define HCI_OCF_FM_DISABLE_RECV_REQ 0x0002
122 #define HCI_OCF_FM_GET_RECV_CONF_REQ 0x0003
123 #define HCI_OCF_FM_SET_RECV_CONF_REQ 0x0004
124 #define HCI_OCF_FM_SET_MUTE_MODE_REQ 0x0005
125 #define HCI_OCF_FM_SET_STEREO_MODE_REQ 0x0006
126 #define HCI_OCF_FM_SET_ANTENNA 0x0007
127 #define HCI_OCF_FM_SET_SIGNAL_THRESHOLD 0x0008
128 #define HCI_OCF_FM_GET_SIGNAL_THRESHOLD 0x0009
129 #define HCI_OCF_FM_GET_STATION_PARAM_REQ 0x000A
130 #define HCI_OCF_FM_GET_PROGRAM_SERVICE_REQ 0x000B
131 #define HCI_OCF_FM_GET_RADIO_TEXT_REQ 0x000C
132 #define HCI_OCF_FM_GET_AF_LIST_REQ 0x000D
133 #define HCI_OCF_FM_SEARCH_STATIONS 0x000E
134 #define HCI_OCF_FM_SEARCH_RDS_STATIONS 0x000F
135 #define HCI_OCF_FM_SEARCH_STATIONS_LIST 0x0010
136 #define HCI_OCF_FM_CANCEL_SEARCH 0x0011
137 #define HCI_OCF_FM_RDS_GRP 0x0012
138 #define HCI_OCF_FM_RDS_GRP_PROCESS 0x0013
139 #define HCI_OCF_FM_EN_WAN_AVD_CTRL 0x0014
140 #define HCI_OCF_FM_EN_NOTCH_CTRL 0x0015
141 #define HCI_OCF_FM_SET_EVENT_MASK 0x0016
142 #define HCI_OCF_FM_SET_CH_DET_THRESHOLD 0x0017
143 #define HCI_OCF_FM_GET_CH_DET_THRESHOLD 0x0018
144 #define HCI_OCF_FM_SET_BLND_TBL 0x001B
145 #define HCI_OCF_FM_GET_BLND_TBL 0x001C
146 #define HCI_OCF_FM_ENABLE_TRANS_REQ 0x0001
147 #define HCI_OCF_FM_DISABLE_TRANS_REQ 0x0002
148 #define HCI_OCF_FM_GET_TRANS_CONF_REQ 0x0003
149 #define HCI_OCF_FM_SET_TRANS_CONF_REQ 0x0004
150 #define HCI_OCF_FM_RDS_RT_REQ 0x0008
151 #define HCI_OCF_FM_RDS_PS_REQ 0x0009
152 #define HCI_OCF_FM_TUNE_STATION_REQ 0x0001
153 #define HCI_OCF_FM_DEFAULT_DATA_READ 0x0002
154 #define HCI_OCF_FM_DEFAULT_DATA_WRITE 0x0003
155 #define HCI_OCF_FM_RESET 0x0004
156 #define HCI_OCF_FM_GET_FEATURE_LIST 0x0005
157 #define HCI_OCF_FM_DO_CALIBRATION 0x0006
158 #define HCI_OCF_FM_SET_CALIBRATION 0x0007
159 #define HCI_OCF_FM_SET_SPUR_TABLE 0x0008
160 #define HCI_OCF_FM_GET_SPUR_TABLE 0x0009
161 #define HCI_OCF_FM_READ_GRP_COUNTERS 0x0001
162 #define HCI_OCF_FM_PEEK_DATA 0x0002
163 #define HCI_OCF_FM_POKE_DATA 0x0003
164 #define HCI_OCF_FM_SSBI_PEEK_REG 0x0004
165 #define HCI_OCF_FM_SSBI_POKE_REG 0x0005
166 #define HCI_OCF_FM_STATION_DBG_PARAM 0x0007
167 #define HCI_FM_SET_INTERNAL_TONE_GENRATOR 0x0008
168 #define HCI_OGF_FM_RECV_CTRL_CMD_REQ 0x0013
169 #define HCI_OGF_FM_TRANS_CTRL_CMD_REQ 0x0014
170 #define HCI_OGF_FM_COMMON_CTRL_CMD_REQ 0x0015
171 #define HCI_OGF_FM_STATUS_PARAMETERS_CMD_REQ 0x0016
172 #define HCI_OGF_FM_TEST_CMD_REQ 0x0017
173 #define HCI_OGF_FM_DIAGNOSTIC_CMD_REQ 0x003F
174 #define hci_opcode_pack(ogf,ocf) ((__u16) ((ocf & 0x03ff) | (ogf << 10)))
175 #define hci_opcode_ogf(op) (op >> 10)
176 #define hci_opcode_ocf(op) (op & 0x03ff)
177 #define hci_recv_ctrl_cmd_op_pack(ocf) ((__u16) hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ, ocf))
178 #define hci_trans_ctrl_cmd_op_pack(ocf) ((__u16) hci_opcode_pack(HCI_OGF_FM_TRANS_CTRL_CMD_REQ, ocf))
179 #define hci_common_cmd_op_pack(ocf) ((__u16) hci_opcode_pack(HCI_OGF_FM_COMMON_CTRL_CMD_REQ, ocf))
180 #define hci_status_param_op_pack(ocf) ((__u16) hci_opcode_pack(HCI_OGF_FM_STATUS_PARAMETERS_CMD_REQ, ocf))
181 #define hci_diagnostic_cmd_op_pack(ocf) ((__u16) hci_opcode_pack(HCI_OGF_FM_DIAGNOSTIC_CMD_REQ, ocf))
182 #define HCI_FM_ENABLE_RECV_CMD 1
183 #define HCI_FM_DISABLE_RECV_CMD 2
184 #define HCI_FM_GET_RECV_CONF_CMD 3
185 #define HCI_FM_GET_STATION_PARAM_CMD 4
186 #define HCI_FM_GET_SIGNAL_TH_CMD 5
187 #define HCI_FM_GET_PROGRAM_SERVICE_CMD 6
188 #define HCI_FM_GET_RADIO_TEXT_CMD 7
189 #define HCI_FM_GET_AF_LIST_CMD 8
190 #define HCI_FM_CANCEL_SEARCH_CMD 9
191 #define HCI_FM_RESET_CMD 10
192 #define HCI_FM_GET_FEATURES_CMD 11
193 #define HCI_FM_STATION_DBG_PARAM_CMD 12
194 #define HCI_FM_ENABLE_TRANS_CMD 13
195 #define HCI_FM_DISABLE_TRANS_CMD 14
196 #define HCI_FM_GET_TX_CONFIG 15
197 #define HCI_FM_GET_DET_CH_TH_CMD 16
198 #define HCI_FM_GET_BLND_TBL_CMD 17
199 #define TX_PS_DATA_LENGTH 108
200 #define TX_RT_DATA_LENGTH 64
201 #define PS_STRING_LEN 9
202 struct hci_fm_recv_conf_req {
203   __u8 emphasis;
204   __u8 ch_spacing;
205   __u8 rds_std;
206   __u8 hlsi;
207   __u32 band_low_limit;
208   __u32 band_high_limit;
209 } __attribute__((packed));
210 struct hci_fm_trans_conf_req_struct {
211   __u8 emphasis;
212   __u8 rds_std;
213   __u32 band_low_limit;
214   __u32 band_high_limit;
215 } __attribute__((packed));
216 struct hci_fm_tx_ps {
217   __u8 ps_control;
218   __u16 pi;
219   __u8 pty;
220   __u8 ps_repeatcount;
221   __u8 ps_num;
222   __u8 ps_data[TX_PS_DATA_LENGTH];
223 } __attribute__((packed));
224 struct hci_fm_tx_rt {
225   __u8 rt_control;
226   __u16 pi;
227   __u8 pty;
228   __u8 rt_len;
229   __u8 rt_data[TX_RT_DATA_LENGTH];
230 } __attribute__((packed));
231 struct hci_fm_mute_mode_req {
232   __u8 hard_mute;
233   __u8 soft_mute;
234 } __attribute__((packed));
235 struct hci_fm_stereo_mode_req {
236   __u8 stereo_mode;
237   __u8 sig_blend;
238   __u8 intf_blend;
239   __u8 most_switch;
240 } __attribute__((packed));
241 struct hci_fm_search_station_req {
242   __u8 srch_mode;
243   __u8 scan_time;
244   __u8 srch_dir;
245 } __attribute__((packed));
246 struct hci_fm_search_rds_station_req {
247   struct hci_fm_search_station_req srch_station;
248   __u8 srch_pty;
249   __u16 srch_pi;
250 } __attribute__((packed));
251 struct hci_fm_search_station_list_req {
252   __u8 srch_list_mode;
253   __u8 srch_list_dir;
254   __u32 srch_list_max;
255   __u8 srch_pty;
256 } __attribute__((packed));
257 struct hci_fm_rds_grp_req {
258   __u32 rds_grp_enable_mask;
259   __u32 rds_buf_size;
260   __u8 en_rds_change_filter;
261 } __attribute__((packed));
262 struct hci_fm_en_avd_ctrl_req {
263   __u8 no_freqs;
264   __u8 freq_index;
265   __u8 lo_shft;
266   __u16 freq_min;
267   __u16 freq_max;
268 } __attribute__((packed));
269 struct hci_fm_def_data_rd_req {
270   __u8 mode;
271   __u8 length;
272   __u8 param_len;
273   __u8 param;
274 } __attribute__((packed));
275 struct hci_fm_def_data_wr_req {
276   __u8 mode;
277   __u8 length;
278   __u8 data[DEFAULT_DATA_SIZE];
279 } __attribute__((packed));
280 struct hci_fm_riva_data {
281   __u8 subopcode;
282   __u32 start_addr;
283   __u8 length;
284 } __attribute__((packed));
285 struct hci_fm_riva_poke {
286   struct hci_fm_riva_data cmd_params;
287   __u8 data[MAX_RIVA_PEEK_RSP_SIZE];
288 } __attribute__((packed));
289 struct hci_fm_ssbi_req {
290   __u16 start_addr;
291   __u8 data;
292 } __attribute__((packed));
293 struct hci_fm_ssbi_peek {
294   __u16 start_address;
295 } __attribute__((packed));
296 struct hci_fm_ch_det_threshold {
297   char sinr;
298   __u8 sinr_samples;
299   __u8 low_th;
300   __u8 high_th;
301 } __attribute__((packed));
302 struct hci_fm_blend_table {
303   __u8 ucBlendType;
304   __u8 ucBlendRampRateUp;
305   __u8 ucBlendDebounceNumSampleUp;
306   __u8 ucBlendDebounceIdxUp;
307   __u8 ucBlendSinrIdxSkipStep;
308   __u8 scBlendSinrHi;
309   __u8 scBlendRmssiHi;
310   __u8 ucBlendIndexHi;
311   __u8 ucBlendIndex[MAX_BLEND_INDEX];
312 } __attribute__((packed));
313 #define HCI_EV_TUNE_STATUS 0x01
314 #define HCI_EV_RDS_LOCK_STATUS 0x02
315 #define HCI_EV_STEREO_STATUS 0x03
316 #define HCI_EV_SERVICE_AVAILABLE 0x04
317 #define HCI_EV_SEARCH_PROGRESS 0x05
318 #define HCI_EV_SEARCH_RDS_PROGRESS 0x06
319 #define HCI_EV_SEARCH_LIST_PROGRESS 0x07
320 #define HCI_EV_RDS_RX_DATA 0x08
321 #define HCI_EV_PROGRAM_SERVICE 0x09
322 #define HCI_EV_RADIO_TEXT 0x0A
323 #define HCI_EV_FM_AF_LIST 0x0B
324 #define HCI_EV_TX_RDS_GRP_AVBLE 0x0C
325 #define HCI_EV_TX_RDS_GRP_COMPL 0x0D
326 #define HCI_EV_TX_RDS_CONT_GRP_COMPL 0x0E
327 #define HCI_EV_CMD_COMPLETE 0x0F
328 #define HCI_EV_CMD_STATUS 0x10
329 #define HCI_EV_TUNE_COMPLETE 0x11
330 #define HCI_EV_SEARCH_COMPLETE 0x12
331 #define HCI_EV_SEARCH_RDS_COMPLETE 0x13
332 #define HCI_EV_SEARCH_LIST_COMPLETE 0x14
333 #define HCI_REQ_DONE 0
334 #define HCI_REQ_PEND 1
335 #define HCI_REQ_CANCELED 2
336 #define HCI_REQ_STATUS 3
337 #define MAX_RAW_RDS_GRPS 21
338 #define RDSGRP_DATA_OFFSET 0x1
339 #define DUMMY_CLASS 0
340 #define RT_PLUS_LEN_1_TAG 3
341 #define RT_ERT_FLAG_BIT 5
342 #define TAG1_MSB_OFFSET 3
343 #define TAG1_MSB_MASK 7
344 #define TAG1_LSB_OFFSET 5
345 #define TAG1_POS_MSB_MASK 31
346 #define TAG1_POS_MSB_OFFSET 1
347 #define TAG1_POS_LSB_OFFSET 7
348 #define TAG1_LEN_OFFSET 1
349 #define TAG1_LEN_MASK 63
350 #define TAG2_MSB_OFFSET 5
351 #define TAG2_MSB_MASK 1
352 #define TAG2_LSB_OFFSET 3
353 #define TAG2_POS_MSB_MASK 7
354 #define TAG2_POS_MSB_OFFSET 3
355 #define TAG2_POS_LSB_OFFSET 5
356 #define TAG2_LEN_MASK 31
357 #define AGT_MASK 31
358 #define AGT(x) (x & AGT_MASK)
359 #define AID(lsb,msb) ((msb << 8) | (lsb))
360 #define GTC(blk2msb) (blk2msb >> 3)
361 #define GRP_3A 0x6
362 #define RT_PLUS_AID 0x4bd7
363 #define ERT_AID 0x6552
364 #define CARRIAGE_RETURN 0x000D
365 #define MAX_ERT_SEGMENT 31
366 #define ERT_FORMAT_DIR_BIT 1
367 #define EXTRACT_BIT(data,bit_pos) ((data & (1 << bit_pos)) >> bit_pos)
368 struct hci_ev_tune_status {
369   __u8 sub_event;
370   __le32 station_freq;
371   __u8 serv_avble;
372   char rssi;
373   __u8 stereo_prg;
374   __u8 rds_sync_status;
375   __u8 mute_mode;
376   char sinr;
377   __u8 intf_det_th;
378 } __attribute__((packed));
379 struct rds_blk_data {
380   __u8 rdsMsb;
381   __u8 rdsLsb;
382   __u8 blockStatus;
383 } __attribute__((packed));
384 struct rds_grp_data {
385   struct rds_blk_data rdsBlk[4];
386 } __attribute__((packed));
387 struct hci_ev_rds_rx_data {
388   __u8 num_rds_grps;
389   struct rds_grp_data rds_grp_data[MAX_RAW_RDS_GRPS];
390 } __attribute__((packed));
391 struct hci_ev_prg_service {
392   __le16 pi_prg_id;
393   __u8 pty_prg_type;
394   __u8 ta_prg_code_type;
395   __u8 ta_ann_code_flag;
396   __u8 ms_switch_code_flag;
397   __u8 dec_id_ctrl_code_flag;
398   __u8 ps_num;
399   __u8 prg_service_name[119];
400 } __attribute__((packed));
401 struct hci_ev_radio_text {
402   __le16 pi_prg_id;
403   __u8 pty_prg_type;
404   __u8 ta_prg_code_type;
405   __u8 txt_ab_flag;
406   __u8 radio_txt[64];
407 } __attribute__((packed));
408 struct hci_ev_af_list {
409   __le32 tune_freq;
410   __le16 pi_code;
411   __u8 af_size;
412   __u8 af_list[FM_AF_LIST_MAX_SIZE];
413 } __attribute__((packed));
414 struct hci_ev_cmd_complete {
415   __u8 num_hci_cmd_pkts;
416   __le16 cmd_opcode;
417 } __attribute__((packed));
418 struct hci_ev_cmd_status {
419   __u8 status;
420   __u8 num_hci_cmd_pkts;
421   __le16 status_opcode;
422 } __attribute__((packed));
423 struct hci_ev_srch_st {
424   __le32 station_freq;
425   __u8 rds_cap;
426   __u8 pty;
427   __le16 status_opcode;
428 } __attribute__((packed));
429 struct hci_ev_rel_freq {
430   __u8 rel_freq_msb;
431   __u8 rel_freq_lsb;
432 } __attribute__((packed));
433 struct hci_ev_srch_list_compl {
434   __u8 num_stations_found;
435   struct hci_ev_rel_freq rel_freq[20];
436 } __attribute__((packed));
437 struct hci_fm_conf_rsp {
438   __u8 status;
439   struct hci_fm_recv_conf_req recv_conf_rsp;
440 } __attribute__((packed));
441 struct hci_fm_get_trans_conf_rsp {
442   __u8 status;
443   struct hci_fm_trans_conf_req_struct trans_conf_rsp;
444 } __attribute__((packed));
445 struct hci_fm_sig_threshold_rsp {
446   __u8 status;
447   __u8 sig_threshold;
448 } __attribute__((packed));
449 struct hci_fm_station_rsp {
450   struct hci_ev_tune_status station_rsp;
451 } __attribute__((packed));
452 struct hci_fm_prgm_srv_rsp {
453   __u8 status;
454   struct hci_ev_prg_service prg_srv;
455 } __attribute__((packed));
456 struct hci_fm_radio_txt_rsp {
457   __u8 status;
458   struct hci_ev_radio_text rd_txt;
459 } __attribute__((packed));
460 struct hci_fm_af_list_rsp {
461   __u8 status;
462   struct hci_ev_af_list rd_txt;
463 } __attribute__((packed));
464 struct hci_fm_data_rd_rsp {
465   __u8 status;
466   __u8 ret_data_len;
467   __u8 data[DEFAULT_DATA_SIZE];
468 } __attribute__((packed));
469 struct hci_fm_feature_list_rsp {
470   __u8 status;
471   __u8 feature_mask;
472 } __attribute__((packed));
473 struct hci_fm_dbg_param_rsp {
474   __u8 status;
475   __u8 blend;
476   __u8 soft_mute;
477   __u8 inf_blend;
478   __u8 inf_soft_mute;
479   __u8 pilot_pil;
480   __u8 io_verc;
481   __u8 in_det_out;
482 } __attribute__((packed));
483 #define CLKSPURID_INDEX0 0
484 #define CLKSPURID_INDEX1 5
485 #define CLKSPURID_INDEX2 10
486 #define CLKSPURID_INDEX3 15
487 #define CLKSPURID_INDEX4 20
488 #define CLKSPURID_INDEX5 25
489 #define MAX_SPUR_FREQ_LIMIT 30
490 #define CKK_SPUR 0x3B
491 #define SPUR_DATA_SIZE 0x4
492 #define SPUR_ENTRIES_PER_ID 0x5
493 #define COMPUTE_SPUR(val) ((((val) - (76000)) / (50)))
494 #define GET_FREQ(val,bit) ((bit == 1) ? ((val) >> 8) : ((val) & 0xFF))
495 #define GET_SPUR_ENTRY_LEVEL(val) ((val) / (5))
496 struct hci_fm_spur_data {
497   __u32 freq[MAX_SPUR_FREQ_LIMIT];
498   __s8 rmssi[MAX_SPUR_FREQ_LIMIT];
499   __u8 enable[MAX_SPUR_FREQ_LIMIT];
500 } __attribute__((packed));
501 #define RADIO_HCI_DEV_REG 1
502 #define RADIO_HCI_DEV_WRITE 2
503 #define RDS_PTYPE 2
504 #define RDS_PID_LOWER 1
505 #define RDS_PID_HIGHER 0
506 #define RDS_OFFSET 5
507 #define RDS_PS_LENGTH_OFFSET 7
508 #define RDS_STRING 8
509 #define RDS_PS_DATA_OFFSET 8
510 #define RDS_CONFIG_OFFSET 3
511 #define RDS_AF_JUMP_OFFSET 4
512 #define PI_CODE_OFFSET 4
513 #define AF_SIZE_OFFSET 6
514 #define AF_LIST_OFFSET 7
515 #define RT_A_B_FLAG_OFFSET 4
516 enum radio_state_t {
517   FM_OFF,
518   FM_RECV,
519   FM_TRANS,
520   FM_RESET,
521   FM_CALIB,
522   FM_TURNING_OFF,
523   FM_RECV_TURNING_ON,
524   FM_TRANS_TURNING_ON,
525   FM_MAX_NO_STATES,
526 };
527 enum emphasis_type {
528   FM_RX_EMP75 = 0x0,
529   FM_RX_EMP50 = 0x1
530 };
531 enum channel_space_type {
532   FM_RX_SPACE_200KHZ = 0x0,
533   FM_RX_SPACE_100KHZ = 0x1,
534   FM_RX_SPACE_50KHZ = 0x2
535 };
536 enum high_low_injection {
537   AUTO_HI_LO_INJECTION = 0x0,
538   LOW_SIDE_INJECTION = 0x1,
539   HIGH_SIDE_INJECTION = 0x2
540 };
541 enum fm_rds_type {
542   FM_RX_RDBS_SYSTEM = 0x0,
543   FM_RX_RDS_SYSTEM = 0x1
544 };
545 enum iris_region_t {
546   IRIS_REGION_US,
547   IRIS_REGION_EU,
548   IRIS_REGION_JAPAN,
549   IRIS_REGION_JAPAN_WIDE,
550   IRIS_REGION_OTHER
551 };
552 #define STD_BUF_SIZE (256)
553 enum iris_buf_t {
554   IRIS_BUF_SRCH_LIST,
555   IRIS_BUF_EVENTS,
556   IRIS_BUF_RT_RDS,
557   IRIS_BUF_PS_RDS,
558   IRIS_BUF_RAW_RDS,
559   IRIS_BUF_AF_LIST,
560   IRIS_BUF_PEEK,
561   IRIS_BUF_SSBI_PEEK,
562   IRIS_BUF_RDS_CNTRS,
563   IRIS_BUF_RD_DEFAULT,
564   IRIS_BUF_CAL_DATA,
565   IRIS_BUF_RT_PLUS,
566   IRIS_BUF_ERT,
567   IRIS_BUF_SPUR,
568   IRIS_BUF_MAX,
569 };
570 enum iris_xfr_t {
571   IRIS_XFR_SYNC,
572   IRIS_XFR_ERROR,
573   IRIS_XFR_SRCH_LIST,
574   IRIS_XFR_RT_RDS,
575   IRIS_XFR_PS_RDS,
576   IRIS_XFR_AF_LIST,
577   IRIS_XFR_MAX
578 };
579 enum search_t {
580   SEEK,
581   SCAN,
582   SCAN_FOR_STRONG,
583   SCAN_FOR_WEAK,
584   RDS_SEEK_PTY,
585   RDS_SCAN_PTY,
586   RDS_SEEK_PI,
587   RDS_AF_JUMP,
588 };
589 enum spur_entry_levels {
590   ENTRY_0,
591   ENTRY_1,
592   ENTRY_2,
593   ENTRY_3,
594   ENTRY_4,
595   ENTRY_5,
596 };
597 #define REGION_US_EU_BAND_LOW 87500
598 #define REGION_US_EU_BAND_HIGH 108000
599 #define REGION_JAPAN_STANDARD_BAND_LOW 76000
600 #define REGION_JAPAN_STANDARD_BAND_HIGH 90000
601 #define REGION_JAPAN_WIDE_BAND_LOW 90000
602 #define REGION_JAPAN_WIDE_BAND_HIGH 108000
603 #define SRCH_MODE 0x07
604 #define SRCH_DIR 0x08
605 #define SCAN_DWELL 0x70
606 #define SRCH_ON 0x80
607 #define IOC_HRD_MUTE 0x03
608 #define IOC_SFT_MUTE 0x01
609 #define IOC_MON_STR 0x01
610 #define IOC_SIG_BLND 0x01
611 #define IOC_INTF_BLND 0x01
612 #define IOC_ANTENNA 0x01
613 #define RDS_ON 0x01
614 #define RDS_BUF_SZ 100
615 #define RDS_BLOCKS_NUM (4)
616 #define BYTES_PER_BLOCK (3)
617 #define MAX_PS_LENGTH (108)
618 #define MAX_RT_LENGTH (64)
619 #define RDS_GRP_CNTR_LEN (36)
620 #define RX_RT_DATA_LENGTH (63)
621 #define SRCH_DIR_UP (0)
622 #define SRCH_DIR_DOWN (1)
623 #define SEARCH_RDS_STNS_MODE_OFFSET 4
624 #define PARAMS_PER_STATION 0x08
625 #define STN_NUM_OFFSET 0x01
626 #define STN_FREQ_OFFSET 0x02
627 #define KHZ_TO_MHZ 1000
628 #define GET_MSB(x) ((x >> 8) & 0xFF)
629 #define GET_LSB(x) ((x) & 0xFF)
630 #define CTRL_ON (1)
631 #define CTRL_OFF (0)
632 #define RIVA_PEEK_OPCODE 0x0D
633 #define RIVA_POKE_OPCODE 0x0C
634 #define PEEK_DATA_OFSET 0x1
635 #define RIVA_PEEK_PARAM 0x6
636 #define RIVA_PEEK_LEN_OFSET 0x6
637 #define SSBI_PEEK_LEN 0x01
638 #define PROCS_CALIB_MODE 1
639 #define PROCS_CALIB_SIZE 23
640 #define DC_CALIB_MODE 2
641 #define DC_CALIB_SIZE 48
642 #define RSB_CALIB_MODE 3
643 #define RSB_CALIB_SIZE 4
644 #define CALIB_DATA_OFSET 2
645 #define CALIB_MODE_OFSET 1
646 #define MAX_CALIB_SIZE 75
647 #define INVALID_CHANNEL (0)
648 #define VALID_CHANNEL (1)
649 struct hci_fm_set_cal_req_proc {
650   __u8 mode;
651   __u8 data[PROCS_CALIB_SIZE];
652 } __attribute__((packed));
653 struct hci_fm_set_cal_req_dc {
654   __u8 mode;
655   __u8 data[DC_CALIB_SIZE];
656 } __attribute__((packed));
657 struct hci_cc_do_calibration_rsp {
658   __u8 status;
659   __u8 mode;
660   __u8 data[MAX_CALIB_SIZE];
661 } __attribute__((packed));
662 struct hci_fm_set_spur_table_req {
663   __u8 mode;
664   __u8 no_of_freqs_entries;
665   __u8 spur_data[FM_SPUR_TBL_SIZE];
666 } __attribute__((packed));
667 #define SIG_LEVEL_INTR (1 << 0)
668 #define RDS_SYNC_INTR (1 << 1)
669 #define AUDIO_CTRL_INTR (1 << 2)
670 #define AF_JUMP_ENABLE (1 << 4)
671 #endif
672