Go to the documentation of this file.
22 #ifndef _FMDRV_COMMON_H
23 #define _FMDRV_COMMON_H
25 #define FM_ST_REG_TIMEOUT msecs_to_jiffies(6000)
26 #define FM_PKT_LOGICAL_CHAN_NUMBER 0x08
38 #define RSSI_LVL_GET 1
39 #define IF_COUNT_GET 2
41 #define RDS_SYNC_GET 4
42 #define RDS_DATA_GET 5
44 #define AF_FREQ_SET 11
45 #define MOST_MODE_SET 12
46 #define MOST_BLEND_SET 13
47 #define DEMPH_MODE_SET 14
48 #define SEARCH_LVL_SET 15
50 #define MUTE_STATUS_SET 17
51 #define RDS_PAUSE_LVL_SET 18
52 #define RDS_PAUSE_DUR_SET 19
53 #define RDS_MEM_SET 20
54 #define RDS_BLK_B_SET 21
55 #define RDS_MSK_B_SET 22
56 #define RDS_PI_MASK_SET 23
58 #define RDS_SYSTEM_SET 25
59 #define INT_MASK_SET 26
60 #define SEARCH_DIR_SET 27
62 #define AUDIO_ENABLE_SET 29
63 #define PCM_MODE_SET 30
64 #define I2S_MODE_CONFIG_SET 31
66 #define INTX_CONFIG_SET 33
67 #define PULL_EN_SET 34
69 #define SWITCH2FREF 36
70 #define FREQ_DRIFT_REPORT 37
73 #define FIRM_VER_GET 41
74 #define ASIC_VER_GET 42
75 #define ASIC_ID_GET 43
77 #define TUNER_MODE_SET 45
78 #define STOP_SEARCH 46
79 #define RDS_CNTRL_SET 47
81 #define WRITE_HARDWARE_REG 100
82 #define CODE_DOWNLOAD 101
85 #define FM_POWER_MODE 254
86 #define FM_INTERRUPT 255
91 #define CHANL_BW_SET 56
93 #define POWER_ENB_SET 90
94 #define POWER_ATT_SET 58
95 #define POWER_LEV_SET 59
96 #define AUDIO_DEV_SET 60
97 #define PILOT_DEV_SET 61
98 #define RDS_DEV_SET 62
99 #define TX_BAND_SET 65
101 #define AUDIO_IO_SET 63
102 #define PREMPH_SET 64
105 #define MPX_LMT_ENABLE 67
110 #define DISPLAY_MODE 74
111 #define RDS_REP_SET 77
112 #define RDS_CONFIG_DATA_SET 98
113 #define RDS_DATA_SET 99
114 #define RDS_DATA_ENB 94
119 #define PS_SCROLL_SPEED 82
120 #define TX_AUDIO_LEVEL_TEST 96
121 #define TX_AUDIO_LEVEL_TEST_THRESHOLD 73
122 #define TX_AUDIO_INPUT_LEVEL_RANGE_SET 54
123 #define RX_ANTENNA_SELECT 87
124 #define I2C_DEV_ADDR_SET 86
125 #define REF_ERR_CALIB_PARAM_SET 88
126 #define REF_ERR_CALIB_PERIODICITY_SET 89
127 #define SOC_INT_TRIGGER 52
128 #define SOC_AUDIO_PATH_SET 83
129 #define SOC_PCMI_OVERRIDE 84
130 #define SOC_I2S_OVERRIDE 85
131 #define RSSI_BLOCK_SCAN_FREQ_SET 95
132 #define RSSI_BLOCK_SCAN_START 97
133 #define RSSI_BLOCK_SCAN_DATA_GET 5
134 #define READ_FMANT_TUNE_VALUE 104
142 #define fm_cb(skb) ((struct fm_skb_cb *)(skb->cb))
153 #define FM_CMD_MSG_HDR_SIZE 5
166 #define FM_EVT_MSG_HDR_SIZE 7
169 #define FM_FW_FILE_HEADER_MAGIC 0x42535442
175 #define FM_FR_EVENT (1 << 0)
176 #define FM_BL_EVENT (1 << 1)
177 #define FM_RDS_EVENT (1 << 2)
178 #define FM_BBLK_EVENT (1 << 3)
179 #define FM_LSYNC_EVENT (1 << 4)
180 #define FM_LEV_EVENT (1 << 5)
181 #define FM_IFFR_EVENT (1 << 6)
182 #define FM_PI_EVENT (1 << 7)
183 #define FM_PD_EVENT (1 << 8)
184 #define FM_STIC_EVENT (1 << 9)
185 #define FM_MAL_EVENT (1 << 10)
186 #define FM_POW_ENB_EVENT (1 << 11)
192 #define FM_FMC_FW_FILE_START ("fmc_ch8")
193 #define FM_RX_FW_FILE_START ("fm_rx_ch8")
194 #define FM_TX_FW_FILE_START ("fm_tx_ch8")
196 #define FM_UNDEFINED_FREQ 0xFFFFFFFF
199 #define FM_BAND_EUROPE_US 0
200 #define FM_BAND_JAPAN 1
203 #define FM_SEARCH_DIRECTION_DOWN 0
204 #define FM_SEARCH_DIRECTION_UP 1
207 #define FM_TUNER_STOP_SEARCH_MODE 0
208 #define FM_TUNER_PRESET_MODE 1
209 #define FM_TUNER_AUTONOMOUS_SEARCH_MODE 2
210 #define FM_TUNER_AF_JUMP_MODE 3
213 #define FM_RX_VOLUME_MIN 0
214 #define FM_RX_VOLUME_MAX 70
217 #define FM_RX_VOLUME_GAIN_STEP 0x370
221 #define FM_MUTE_OFF 1
222 #define FM_MUTE_ATTENUATE 2
224 #define FM_RX_UNMUTE_MODE 0x00
225 #define FM_RX_RF_DEP_MODE 0x01
226 #define FM_RX_AC_MUTE_MODE 0x02
227 #define FM_RX_HARD_MUTE_LEFT_MODE 0x04
228 #define FM_RX_HARD_MUTE_RIGHT_MODE 0x08
229 #define FM_RX_SOFT_MUTE_FORCE_MODE 0x10
232 #define FM_RX_RF_DEPENDENT_MUTE_ON 1
233 #define FM_RX_RF_DEPENDENT_MUTE_OFF 0
236 #define FM_RX_RSSI_THRESHOLD_MIN -128
237 #define FM_RX_RSSI_THRESHOLD_MAX 127
240 #define FM_STEREO_MODE 0
241 #define FM_MONO_MODE 1
242 #define FM_STEREO_SOFT_BLEND 1
245 #define FM_RX_EMPHASIS_FILTER_50_USEC 0
246 #define FM_RX_EMPHASIS_FILTER_75_USEC 1
249 #define FM_RDS_DISABLE 0
250 #define FM_RDS_ENABLE 1
252 #define FM_NO_PI_CODE 0
255 #define FM_RX_PWR_SET_FM_ON_RDS_OFF 0x1
256 #define FM_RX_PWR_SET_FM_AND_RDS_BLK_ON 0x3
257 #define FM_RX_PWR_SET_FM_AND_RDS_BLK_OFF 0x0
260 #define FM_RX_RDS_FLUSH_FIFO 0x1
261 #define FM_RX_RDS_FIFO_THRESHOLD 64
262 #define FM_RDS_BLK_SIZE 3
265 #define FM_RDS_BLOCK_A 0
266 #define FM_RDS_BLOCK_B 1
267 #define FM_RDS_BLOCK_C 2
268 #define FM_RDS_BLOCK_Ctag 3
269 #define FM_RDS_BLOCK_D 4
270 #define FM_RDS_BLOCK_E 5
272 #define FM_RDS_BLK_IDX_A 0
273 #define FM_RDS_BLK_IDX_B 1
274 #define FM_RDS_BLK_IDX_C 2
275 #define FM_RDS_BLK_IDX_D 3
276 #define FM_RDS_BLK_IDX_UNKNOWN 0xF0
278 #define FM_RDS_STATUS_ERR_MASK 0x18
284 #define FM_RDS_GROUP_TYPE_MASK_0A ((unsigned long)1<<0)
285 #define FM_RDS_GROUP_TYPE_MASK_0B ((unsigned long)1<<1)
286 #define FM_RDS_GROUP_TYPE_MASK_1A ((unsigned long)1<<2)
287 #define FM_RDS_GROUP_TYPE_MASK_1B ((unsigned long)1<<3)
288 #define FM_RDS_GROUP_TYPE_MASK_2A ((unsigned long)1<<4)
289 #define FM_RDS_GROUP_TYPE_MASK_2B ((unsigned long)1<<5)
290 #define FM_RDS_GROUP_TYPE_MASK_3A ((unsigned long)1<<6)
291 #define FM_RDS_GROUP_TYPE_MASK_3B ((unsigned long)1<<7)
292 #define FM_RDS_GROUP_TYPE_MASK_4A ((unsigned long)1<<8)
293 #define FM_RDS_GROUP_TYPE_MASK_4B ((unsigned long)1<<9)
294 #define FM_RDS_GROUP_TYPE_MASK_5A ((unsigned long)1<<10)
295 #define FM_RDS_GROUP_TYPE_MASK_5B ((unsigned long)1<<11)
296 #define FM_RDS_GROUP_TYPE_MASK_6A ((unsigned long)1<<12)
297 #define FM_RDS_GROUP_TYPE_MASK_6B ((unsigned long)1<<13)
298 #define FM_RDS_GROUP_TYPE_MASK_7A ((unsigned long)1<<14)
299 #define FM_RDS_GROUP_TYPE_MASK_7B ((unsigned long)1<<15)
300 #define FM_RDS_GROUP_TYPE_MASK_8A ((unsigned long)1<<16)
301 #define FM_RDS_GROUP_TYPE_MASK_8B ((unsigned long)1<<17)
302 #define FM_RDS_GROUP_TYPE_MASK_9A ((unsigned long)1<<18)
303 #define FM_RDS_GROUP_TYPE_MASK_9B ((unsigned long)1<<19)
304 #define FM_RDS_GROUP_TYPE_MASK_10A ((unsigned long)1<<20)
305 #define FM_RDS_GROUP_TYPE_MASK_10B ((unsigned long)1<<21)
306 #define FM_RDS_GROUP_TYPE_MASK_11A ((unsigned long)1<<22)
307 #define FM_RDS_GROUP_TYPE_MASK_11B ((unsigned long)1<<23)
308 #define FM_RDS_GROUP_TYPE_MASK_12A ((unsigned long)1<<24)
309 #define FM_RDS_GROUP_TYPE_MASK_12B ((unsigned long)1<<25)
310 #define FM_RDS_GROUP_TYPE_MASK_13A ((unsigned long)1<<26)
311 #define FM_RDS_GROUP_TYPE_MASK_13B ((unsigned long)1<<27)
312 #define FM_RDS_GROUP_TYPE_MASK_14A ((unsigned long)1<<28)
313 #define FM_RDS_GROUP_TYPE_MASK_14B ((unsigned long)1<<29)
314 #define FM_RDS_GROUP_TYPE_MASK_15A ((unsigned long)1<<30)
315 #define FM_RDS_GROUP_TYPE_MASK_15B ((unsigned long)1<<31)
318 #define FM_RDS_MIN_AF 1
319 #define FM_RDS_MAX_AF 204
320 #define FM_RDS_MAX_AF_JAPAN 140
321 #define FM_RDS_1_AF_FOLLOWS 225
322 #define FM_RDS_25_AF_FOLLOWS 249
325 #define FM_RDS_SYSTEM_RDS 0
326 #define FM_RDS_SYSTEM_RBDS 1
329 #define FM_RX_RDS_AF_SWITCH_MODE_ON 1
330 #define FM_RX_RDS_AF_SWITCH_MODE_OFF 0
333 #define FM_IRQ_TIMEOUT_RETRY_MAX 5
336 #define FM_RX_AUDIO_ENABLE_I2S 0x01
337 #define FM_RX_AUDIO_ENABLE_ANALOG 0x02
338 #define FM_RX_AUDIO_ENABLE_I2S_AND_ANALOG 0x03
339 #define FM_RX_AUDIO_ENABLE_DISABLE 0x00
342 #define FM_RX_IFFREQ_TO_HI_SIDE 0x0
343 #define FM_RX_IFFREQ_TO_LO_SIDE 0x1
344 #define FM_RX_IFFREQ_HILO_AUTOMATIC 0x2
350 #define FM_DEFAULT_RX_VOLUME 10
351 #define FM_DEFAULT_RSSI_THRESHOLD 3
354 #define FM_PWR_LVL_LOW 91
355 #define FM_PWR_LVL_HIGH 122
358 #define FM_PWR_LVL_DEF 4
361 #define FM_TX_PREEMPH_OFF 1
362 #define FM_TX_PREEMPH_50US 0
363 #define FM_TX_PREEMPH_75US 2
366 #define FM_TX_ANT_IMP_50 0
367 #define FM_TX_ANT_IMP_200 1
368 #define FM_TX_ANT_IMP_500 2
376 void *,
unsigned int,
void *,
int *);
380 u8 __user *,
size_t);
396 #define FM_CHANNEL_SPACING_50KHZ 1
397 #define FM_CHANNEL_SPACING_100KHZ 2
398 #define FM_CHANNEL_SPACING_200KHZ 4
399 #define FM_FREQ_MUL 50