Initial commit
[kernel/linux-3.0.git] / drivers / samsung / fm_si4709 / Si4709_regs.h
1 #ifndef _Si4709_REGS_H
2 #define _Si4709_REGS_H
3
4 #define NUM_OF_REGISTERS                0x10
5
6 /*Si4709 registers*/
7 #define    DEVICE_ID                    0x00
8 #define    CHIP_ID                      0x01
9 #define    POWERCFG                     0x02
10 #define    CHANNEL                      0x03
11 #define    SYSCONFIG1                   0x04
12 #define    SYSCONFIG2                   0x05
13 #define    SYSCONFIG3                   0x06
14 #define    TEST1                        0x07
15 #define    TEST2                        0x08
16 #define    BOOTCONFIG                   0x09
17 #define    STATUSRSSI                   0x0A
18 #define    READCHAN                     0x0B
19 #define    RDSA                         0x0C
20 #define    RDSB                         0x0D
21 #define    RDSC                         0x0E
22 #define    RDSD                         0x0F
23
24 /***********POWERCFG************/
25 #define POWERCFG_DSMUTE                 0x8000
26 #define POWERCFG_DMUTE                  0x4000
27 #define POWERCFG_MONO                   0x2000
28 #define POWERCFG_RDSM                   0x0800
29 #define POWERCFG_SKMODE                 0x0400
30 #define POWERCFG_SEEKUP                 0x0200
31 #define POWERCFG_SEEK                   0x0100
32 #define POWERCFG_DISABLE                0x0040
33 #define POWERCFG_ENABLE                 0x0001
34 /************************************/
35
36 /***********CHANNEL************/
37 #define CHANNEL_TUNE                    0x8000
38 /************************************/
39
40 /***********SYSCONFIG1************/
41 #define SYSCONFIG1_RDSIEN               0x8000
42 #define SYSCONFIG1_STCIEN               0x4000
43 #define SYSCONFIG1_RDS                  0x1000
44 #define SYSCONFIG1_DE                   0x0800
45 #define SYSCONFIG1_AGCD                 0x0400
46 #define SYSCONFIG1_BLNDADJ1             0x0080
47 #define SYSCONFIG1_BLNDADJ0             0x0040
48 #define SYSCONFIG1_GPO1                 0x0008
49 #define SYSCONFIG1_GPO0                 0x0004
50 /************************************/
51
52 /***********SYSCONFIG2************/
53 #define SYSCONFIG2_BAND1                0x0080
54 #define SYSCONFIG2_BAND0                0x0040
55 #define SYSCONFIG2_SPACE1               0x0020
56 #define SYSCONFIG2_SPACE0               0x0010
57 #define SYSCONFIG2_VOLUME3              0x0008
58 #define SYSCONFIG2_VOLUME2              0x0004
59 #define SYSCONFIG2_VOLUME1              0x0002
60 #define SYSCONFIG2_VOLUME0              0x0001
61 /************************************/
62
63 /***********SYSCONFIG3************/
64 #define SYSCONFIG3_SMUTER1              0x8000
65 #define SYSCONFIG3_SMUTER0              0x4000
66 #define SYSCONFIG3_SMUTEA1              0x2000
67 #define SYSCONFIG3_SMUTEA0              0x1000
68 #define SYSCONFIG3_VOLEXT               0x0100
69 #define SYSCONFIG3_SKSNR3               0x0080
70 #define SYSCONFIG3_SKSNR2               0x0040
71 #define SYSCONFIG3_SKSNR1               0x0020
72 #define SYSCONFIG3_SKSNR0               0x0010
73 #define SYSCONFIG3_SKCNT3               0x0008
74 #define SYSCONFIG3_SKCNT2               0x0004
75 #define SYSCONFIG3_SKCNT1               0x0002
76 #define SYSCONFIG3_SKCNT0               0x0001
77 /************************************/
78
79 /***********TEST1************/
80 #define TEST1_AHIZEN                    0x4000
81 /************************************/
82
83 /***********STATUSRSSI************/
84 #define STATUSRSSI_RDSR                 0x8000
85 #define STATUSRSSI_STC                  0x4000
86 #define STATUSRSSI_SF_BL                0x2000
87 #define STATUSRSSI_AFCRL                0x1000
88 #define STATUSRSSI_RDSS                 0x0800
89 #define STATUSRSSI_BLERA1               0x0400
90 #define STATUSRSSI_BLERA0               0x0200
91 #define STATUSRSSI_ST                   0x0100
92 /************************************/
93
94 /***********READCHAN************/
95 #define READCHAN_BLERB1                 0x8000
96 #define READCHAN_BLERB0                 0x4000
97 #define READCHAN_BLERC1                 0x2000
98 #define READCHAN_BLERC0                 0x1000
99 #define READCHAN_BLERD1                 0x0800
100 #define READCHAN_BLERD0                 0x0400
101
102 #define READCHAN_CHAN_MASK              0x03FF
103 /************************************/
104
105 /*************************************************************/
106 static inline void switch_on_bits(u16 *data, u16 bits_on)
107 {
108         *data |= bits_on;
109 }
110
111 static inline void switch_off_bits(u16 *data, u16 bits_off)
112 {
113         u16 aux = 0xFFFF;
114         aux ^= bits_off;
115         *data &= aux;
116 }
117
118 #define BIT_ON                          1
119 #define BIT_OFF                         0
120
121 static inline int check_bit(u16 data, u16 bit)
122 {
123         return data & bit ? BIT_ON : BIT_OFF;
124 }
125
126 /**************************************************************/
127
128 /********************************************************************/
129 static inline void POWERCFG_BITSET_ENABLE_HIGH(u16 *data)
130 {
131         switch_on_bits(data, (POWERCFG_ENABLE));
132 }
133
134 static inline void POWERCFG_BITSET_DISABLE_HIGH(u16 *data)
135 {
136         switch_on_bits(data, (POWERCFG_DISABLE));
137 }
138
139 static inline void POWERCFG_BITSET_DISABLE_LOW(u16 *data)
140 {
141         switch_off_bits(data, (POWERCFG_DISABLE));
142 }
143
144 static inline void POWERCFG_BITSET_DMUTE_HIGH(u16 *data)
145 {
146         switch_on_bits(data, (POWERCFG_DMUTE));
147 }
148
149 static inline void POWERCFG_BITSET_DMUTE_LOW(u16 *data)
150 {
151         switch_off_bits(data, (POWERCFG_DMUTE));
152 }
153
154 static inline void POWERCFG_BITSET_DSMUTE_HIGH(u16 *data)
155 {
156         switch_on_bits(data, (POWERCFG_DSMUTE));
157 }
158
159 static inline void POWERCFG_BITSET_DSMUTE_LOW(u16 *data)
160 {
161         switch_off_bits(data, (POWERCFG_DSMUTE));
162 }
163
164 static inline void POWERCFG_BITSET_MONO_HIGH(u16 *data)
165 {
166         switch_on_bits(data, (POWERCFG_MONO));
167 }
168
169 static inline void POWERCFG_BITSET_MONO_LOW(u16 *data)
170 {
171         switch_off_bits(data, (POWERCFG_MONO));
172 }
173
174 static inline void POWERCFG_BITSET_RDSM_HIGH(u16 *data)
175 {
176         switch_on_bits(data, (POWERCFG_RDSM));
177 }
178
179 static inline void POWERCFG_BITSET_RDSM_LOW(u16 *data)
180 {
181         switch_off_bits(data, (POWERCFG_RDSM));
182 }
183
184 static inline void POWERCFG_BITSET_SKMODE_HIGH(u16 *data)
185 {
186         switch_on_bits(data, (POWERCFG_SKMODE));
187 }
188
189 static inline void POWERCFG_BITSET_SKMODE_LOW(u16 *data)
190 {
191         switch_off_bits(data, (POWERCFG_SKMODE));
192 }
193
194 static inline void POWERCFG_BITSET_SEEKUP_HIGH(u16 *data)
195 {
196         switch_on_bits(data, (POWERCFG_SEEKUP));
197 }
198
199 static inline void POWERCFG_BITSET_SEEKUP_LOW(u16 *data)
200 {
201         switch_off_bits(data, (POWERCFG_SEEKUP));
202 }
203
204 static inline void POWERCFG_BITSET_SEEK_HIGH(u16 *data)
205 {
206         switch_on_bits(data, (POWERCFG_SEEK));
207 }
208
209 static inline void POWERCFG_BITSET_SEEK_LOW(u16 *data)
210 {
211         switch_off_bits(data, (POWERCFG_SEEK));
212 }
213
214 static inline void POWERCFG_BITSET_RESERVED(u16 *data)
215 {
216         *data &= 0xEF41;
217 }
218
219 /********************************************************************/
220
221 static inline void CHANNEL_BITSET_TUNE_HIGH(u16 *data)
222 {
223         switch_on_bits(data, (CHANNEL_TUNE));
224 }
225
226 static inline void CHANNEL_BITSET_TUNE_LOW(u16 *data)
227 {
228         switch_off_bits(data, (CHANNEL_TUNE));
229 }
230
231 static inline void CHANNEL_BITSET_RESERVED(u16 *data)
232 {
233         *data &= 0x83FF;
234 }
235
236 /********************************************************************/
237
238 static inline void SYSCONFIG1_BITSET_RDSIEN_HIGH(u16 *data)
239 {
240         switch_on_bits(data, (SYSCONFIG1_RDSIEN));
241 }
242
243 static inline void SYSCONFIG1_BITSET_RDSIEN_LOW(u16 *data)
244 {
245         switch_off_bits(data, (SYSCONFIG1_RDSIEN));
246 }
247
248 static inline void SYSCONFIG1_BITSET_STCIEN_HIGH(u16 *data)
249 {
250         switch_on_bits(data, (SYSCONFIG1_STCIEN));
251 }
252
253 static inline void SYSCONFIG1_BITSET_STCIEN_LOW(u16 *data)
254 {
255         switch_off_bits(data, (SYSCONFIG1_STCIEN));
256 }
257
258 static inline void SYSCONFIG1_BITSET_RDS_HIGH(u16 *data)
259 {
260         switch_on_bits(data, (SYSCONFIG1_RDS));
261 }
262
263 static inline void SYSCONFIG1_BITSET_RDS_LOW(u16 *data)
264 {
265         switch_off_bits(data, (SYSCONFIG1_RDS));
266 }
267
268 static inline void SYSCONFIG1_BITSET_DE_50(u16 *data)
269 {
270         switch_on_bits(data, (SYSCONFIG1_DE));
271 }
272
273 static inline void SYSCONFIG1_BITSET_DE_75(u16 *data)
274 {
275         switch_off_bits(data, (SYSCONFIG1_DE));
276 }
277
278 static inline void SYSCONFIG1_BITSET_AGCD_HIGH(u16 *data)
279 {
280         switch_on_bits(data, (SYSCONFIG1_AGCD));
281 }
282
283 static inline void SYSCONFIG1_BITSET_AGCD_LOW(u16 *data)
284 {
285         switch_off_bits(data, (SYSCONFIG1_AGCD));
286 }
287
288 static inline void SYSCONFIG1_BITSET_RSSI_DEF_31_49(u16 *data)
289 {
290         switch_off_bits(data, (SYSCONFIG1_BLNDADJ1 | SYSCONFIG1_BLNDADJ0));
291 }
292
293 static inline void SYSCONFIG1_BITSET_RSSI_37_55(u16 *data)
294 {
295         switch_on_bits(data, (SYSCONFIG1_BLNDADJ0));
296         switch_off_bits(data, (SYSCONFIG1_BLNDADJ1));
297 }
298
299 static inline void SYSCONFIG1_BITSET_RSSI_19_37(u16 *data)
300 {
301         switch_on_bits(data, (SYSCONFIG1_BLNDADJ1));
302         switch_off_bits(data, (SYSCONFIG1_BLNDADJ0));
303 }
304
305 static inline void SYSCONFIG1_BITSET_RSSI_25_43(u16 *data)
306 {
307         switch_on_bits(data, (SYSCONFIG1_BLNDADJ1 | SYSCONFIG1_BLNDADJ0));
308 }
309
310 static inline void SYSCONFIG1_BITSET_GPIO_HIGH_IMP(u16 *data)
311 {
312         switch_off_bits(data, (SYSCONFIG1_GPO1 | SYSCONFIG1_GPO0));
313 }
314
315 static inline void SYSCONFIG1_BITSET_GPIO_STC_RDS_INT(u16 *data)
316 {
317         switch_on_bits(data, (SYSCONFIG1_GPO0));
318         switch_off_bits(data, (SYSCONFIG1_GPO1));
319 }
320
321 static inline void SYSCONFIG1_BITSET_GPIO_LOW(u16 *data)
322 {
323         switch_on_bits(data, (SYSCONFIG1_GPO1));
324         switch_off_bits(data, (SYSCONFIG1_GPO0));
325 }
326
327 static inline void SYSCONFIG1_BITSET_GPIO_HIGH(u16 *data)
328 {
329         switch_on_bits(data, (SYSCONFIG1_GPO1 | SYSCONFIG1_GPO0));
330 }
331
332 static inline void SYSCONFIG1_BITSET_RESERVED(u16 *data)
333 {
334         *data &= 0xDCCC;
335         *data |= 0x22;
336 }
337
338 /********************************************************************/
339
340 /*US/EUROPE (Default)*/
341 static inline void SYSCONFIG2_BITSET_BAND_87p5_108_MHz(u16 *data)
342 {
343         switch_off_bits(data, (SYSCONFIG2_BAND1 | SYSCONFIG2_BAND0));
344 }
345
346 /*Japan wide band*/
347 static inline void SYSCONFIG2_BITSET_BAND_76_108_MHz(u16 *data)
348 {
349         switch_on_bits(data, (SYSCONFIG2_BAND0));
350         switch_off_bits(data, (SYSCONFIG2_BAND1));
351 }
352
353 /*Japan*/
354 static inline void SYSCONFIG2_BITSET_BAND_76_90_MHz(u16 *data)
355 {
356         switch_on_bits(data, (SYSCONFIG2_BAND1));
357         switch_off_bits(data, (SYSCONFIG2_BAND0));
358 }
359
360 /*US, Australia (Default)*/
361 static inline void SYSCONFIG2_BITSET_SPACE_200_KHz(u16 *data)
362 {
363         switch_off_bits(data, (SYSCONFIG2_SPACE1 | SYSCONFIG2_SPACE0));
364 }
365
366 /*Europe, Japan*/
367 static inline void SYSCONFIG2_BITSET_SPACE_100_KHz(u16 *data)
368 {
369         switch_on_bits(data, (SYSCONFIG2_SPACE0));
370         switch_off_bits(data, (SYSCONFIG2_SPACE1));
371 }
372
373 static inline void SYSCONFIG2_BITSET_SPACE_50_KHz(u16 *data)
374 {
375         switch_on_bits(data, (SYSCONFIG2_SPACE1));
376         switch_off_bits(data, (SYSCONFIG2_SPACE0));
377 }
378
379 static inline void SYSCONFIG2_BITSET_VOLUME(u16 *data, u8 volume)
380 {
381         *data &= 0xFFF0;
382         *data |= (volume & 0x0F);
383 }
384
385 static inline void SYSCONFIG2_BITSET_SEEKTH(u16 *data, u8 seek_th)
386 {
387         *data &= 0x00FF;
388         *data |= ((seek_th << 8) & 0xFF00);
389 }
390
391 static inline u8 SYSCONFIG2_GET_VOLUME(u16 data)
392 {
393         return (u8) (data & 0x000F);
394 }
395
396 /********************************************************************/
397
398 static inline void SYSCONFIG3_BITSET_SMUTER_FASTEST(u16 *data)
399 {
400         switch_off_bits(data, (SYSCONFIG3_SMUTER1 | SYSCONFIG3_SMUTER0));
401 }
402
403 static inline void SYSCONFIG3_BITSET_SMUTER_FAST(u16 *data)
404 {
405         switch_off_bits(data, (SYSCONFIG3_SMUTER1));
406         switch_on_bits(data, (SYSCONFIG3_SMUTER0));
407 }
408
409 static inline void SYSCONFIG3_BITSET_SMUTER_SLOW(u16 *data)
410 {
411         switch_off_bits(data, (SYSCONFIG3_SMUTER0));
412         switch_on_bits(data, (SYSCONFIG3_SMUTER1));
413 }
414
415 static inline void SYSCONFIG3_BITSET_SMUTER_SLOWEST(u16 *data)
416 {
417         switch_on_bits(data, (SYSCONFIG3_SMUTER1 | SYSCONFIG3_SMUTER0));
418 }
419
420 static inline void SYSCONFIG3_BITSET_SMUTEA_16_dB(u16 *data)
421 {
422         switch_off_bits(data, (SYSCONFIG3_SMUTEA1 | SYSCONFIG3_SMUTEA0));
423 }
424
425 static inline void SYSCONFIG3_BITSET_SMUTEA_14dB(u16 *data)
426 {
427         switch_off_bits(data, (SYSCONFIG3_SMUTEA1));
428         switch_on_bits(data, (SYSCONFIG3_SMUTEA0));
429 }
430
431 static inline void SYSCONFIG3_BITSET_SMUTEA_12dB(u16 *data)
432 {
433         switch_off_bits(data, (SYSCONFIG3_SMUTEA0));
434         switch_on_bits(data, (SYSCONFIG3_SMUTEA1));
435 }
436
437 static inline void SYSCONFIG3_BITSET_SMUTEA_10dB(u16 *data)
438 {
439         switch_on_bits(data, (SYSCONFIG3_SMUTEA1 | SYSCONFIG3_SMUTEA0));
440 }
441
442 static inline void SYSCONFIG3_BITSET_VOLEXT_DISB(u16 *data)
443 {
444         switch_off_bits(data, (SYSCONFIG3_VOLEXT));
445 }
446
447 static inline void SYSCONFIG3_BITSET_VOLEXT_ENB(u16 *data)
448 {
449         switch_on_bits(data, (SYSCONFIG3_VOLEXT));
450 }
451
452 static inline void SYSCONFIG3_BITSET_SKSNR(u16 *data, u8 seeksnr)
453 {
454         *data &= 0xFF0F;
455         *data |= ((seeksnr << 4) & 0xF0);
456 }
457
458 static inline void SYSCONFIG3_BITSET_SKCNT(u16 *data, u8 seekcnt)
459 {
460         *data &= 0xFFF0;
461         *data |= ((seekcnt) & 0x0F);
462 }
463
464 static inline void SYSCONFIG3_BITSET_RESERVED(u16 *data)
465 {
466         *data &= 0xF1FF;
467 }
468
469 /********************************************************************/
470
471 static inline void TEST1_BITSET_AHIZEN_HIGH(u16 *data)
472 {
473         switch_on_bits(data, (TEST1_AHIZEN));
474 }
475
476 static inline void TEST1_BITSET_AHIZEN_LOW(u16 *data)
477 {
478         switch_off_bits(data, (TEST1_AHIZEN));
479 }
480
481 static inline void TEST1_BITSET_RESERVED(u16 *data)
482 {
483         *data &= 0x7FFF;
484 }
485
486 /********************************************************************/
487
488 #define NEW_RDS_GROUP_READY             1
489 #define NO_RDS_GROUP_READY              0
490
491 #define COMPLETE                        1
492 #define CLEAR                           0
493
494 #define SEEK_SUCCESSFUL                 1
495 #define SEEK_FAILURE_BAND_LMT_RCHD      0
496
497 #define AFC_RAILED                      1
498 #define AFC_NOT_RAILED                  0
499
500 #define RDS_DECODER_SYNCHRONIZED        1
501 #define RDS_DECODER_NOT_SYNCHRONIZED    0
502
503 #define STEREO                          1
504 #define MONO                            0
505
506 #define ERRORS_0                        0
507 #define ERRORS_1_2                      1
508 #define ERRORS_3_5                      2
509 #define ERRORS_NO_CORREC_POSSIBLE_6_p   3
510
511 static inline int STATUSRSSI_RDS_READY_STATUS(u16 data)
512 {
513         if (check_bit(data, STATUSRSSI_RDSR) == BIT_ON)
514                 return NEW_RDS_GROUP_READY;
515         else
516                 return NO_RDS_GROUP_READY;
517 }
518
519 static inline int STATUSRSSI_SEEK_TUNE_STATUS(u16 data)
520 {
521         if (check_bit(data, STATUSRSSI_STC) == BIT_ON)
522                 return COMPLETE;
523         else
524                 return CLEAR;
525 }
526
527 static inline int STATUSRSSI_SF_BL_STATUS(u16 data)
528 {
529         if (check_bit(data, STATUSRSSI_SF_BL) == BIT_ON)
530                 return SEEK_FAILURE_BAND_LMT_RCHD;
531         else
532                 return SEEK_SUCCESSFUL;
533 }
534
535 static inline int STATUSRSSI_AFC_RAIL_STATUS(u16 data)
536 {
537         if (check_bit(data, STATUSRSSI_AFCRL) == BIT_ON)
538                 return AFC_RAILED;
539         else
540                 return AFC_NOT_RAILED;
541 }
542
543 static inline int STATUSRSSI_RDS_SYNC_STATUS(u16 data)
544 {
545         if (check_bit(data, STATUSRSSI_RDSS) == BIT_ON)
546                 return RDS_DECODER_SYNCHRONIZED;
547         else
548                 return RDS_DECODER_NOT_SYNCHRONIZED;
549 }
550
551 static inline int STATUSRSSI_RDS_BLOCK_A_ERRORS(u16 data)
552 {
553         int ret = 0;
554         int bits_status = 0;
555
556         ret = check_bit(data, STATUSRSSI_BLERA1);
557
558         if (ret == BIT_ON)
559                 bits_status = 0x02;
560         else
561                 bits_status = 0x00;
562
563         ret = check_bit(data, STATUSRSSI_BLERA0);
564
565         if (ret == BIT_ON)
566                 bits_status |= 0x01;
567
568         return bits_status;
569 }
570
571 static inline int STATUSRSSI_STEREO_STATUS(u16 data)
572 {
573         if (check_bit(data, STATUSRSSI_RDSS) == BIT_ON)
574                 return STEREO;
575         else
576                 return MONO;
577 }
578
579 static inline u8 STATUSRSSI_RSSI_SIGNAL_STRENGTH(u16 data)
580 {
581         return (u8) (0x00FF & data);
582 }
583
584 static inline u8 DEVICE_ID_PART_NUMBER(u16 data)
585 {
586         data = data >> 12;
587         return (u8) (0x000F & data);
588 }
589
590 static inline u16 DEVICE_ID_MANUFACT_NUMBER(u16 data)
591 {
592         return (u16) (0x0FFF & data);
593 }
594
595 static inline u8 CHIP_ID_CHIP_VERSION(u16 data)
596 {
597         data = data >> 10;
598         return (u8) (0x003F & data);
599 }
600
601 static inline u8 CHIP_ID_DEVICE(u16 data)
602 {
603         data = data >> 6;
604         return (u8) (0x000F & data);
605 }
606
607 static inline u8 CHIP_ID_FIRMWARE_VERSION(u16 data)
608 {
609         return (u8) (0x003F & data);
610 }
611
612 static inline u8 SYS_CONFIG2_RSSI_TH(u16 data)
613 {
614         data = data >> 8;
615         return (u8) (0x00FF & data);
616 }
617
618 static inline u8 SYS_CONFIG2_FM_BAND(u16 data)
619 {
620         data = data >> 6;
621         return (u8) (0x0003 & data);
622 }
623
624 static inline u8 SYS_CONFIG2_FM_CHAN_SPAC(u16 data)
625 {
626         data = data >> 4;
627         return (u8) (0x0003 & data);
628 }
629
630 static inline u8 SYS_CONFIG2_FM_VOL(u16 data)
631 {
632         return (u8) (0x000F & data);
633 }
634
635 /*POWER_CONFIG_STATUS*/
636
637 #define SOFTMUTE_ENABLE                 0
638 #define SOFTMUTE_DISABLE                1
639
640 #define MUTE_ENABLE                     0
641 #define MUTE_DISABLE                    1
642
643 #define STEREO_SELECT                   0
644 #define MONO_SELECT                     1
645
646 #define RDS_MODE_STANDARD               0
647 #define RDS_MODE_VERBOSE                1
648
649 #define SEEK_MODE_CONT_SEEK             0
650 #define SEEK_MODE_STOP_SEEK             1
651
652 #define SEEK_DOWN                       0
653 #define SEEK_UP                         1
654
655 #define SEEK_DISABLE                    0
656 #define SEEK_ABLE                       1
657
658 static inline int POWER_CONFIG_SOFTMUTE_STATUS(u16 data)
659 {
660         if (check_bit(data, POWERCFG_DSMUTE) == BIT_ON)
661                 return SOFTMUTE_DISABLE;
662         else
663                 return SOFTMUTE_ENABLE;
664 }
665
666 static inline int POWER_CONFIG_MUTE_STATUS(u16 data)
667 {
668         if (check_bit(data, POWERCFG_DMUTE) == BIT_ON)
669                 return MUTE_DISABLE;
670         else
671                 return MUTE_ENABLE;
672 }
673
674 static inline int POWER_CONFIG_MONO_STATUS(u16 data)
675 {
676         if (check_bit(data, POWERCFG_MONO) == BIT_ON)
677                 return MONO_SELECT;
678         else
679                 return STEREO_SELECT;
680 }
681
682 static inline int POWER_CONFIG_RDS_MODE_STATUS(u16 data)
683 {
684         if (check_bit(data, POWERCFG_RDSM) == BIT_ON)
685                 return RDS_MODE_VERBOSE;
686         else
687                 return RDS_MODE_STANDARD;
688 }
689
690 static inline int POWER_CONFIG_SKMODE_STATUS(u16 data)
691 {
692         if (check_bit(data, POWERCFG_SKMODE) == BIT_ON)
693                 return SEEK_MODE_STOP_SEEK;
694         else
695                 return SEEK_MODE_CONT_SEEK;
696 }
697
698 static inline int POWER_CONFIG_SEEKUP_STATUS(u16 data)
699 {
700         if (check_bit(data, POWERCFG_SEEKUP) == BIT_ON)
701                 return SEEK_UP;
702         else
703                 return SEEK_DOWN;
704 }
705
706 static inline int POWER_CONFIG_SEEK_STATUS(u16 data)
707 {
708         if (check_bit(data, POWERCFG_SEEK) == BIT_ON)
709                 return SEEK_ABLE;
710         else
711                 return SEEK_DISABLE;
712 }
713
714 static inline int POWER_CONFIG_DISABLE_STATUS(u16 data)
715 {
716         if (check_bit(data, POWERCFG_DISABLE) == BIT_ON)
717                 return 1;
718         else
719                 return 0;
720 }
721
722 static inline int POWER_CONFIG_ENABLE_STATUS(u16 data)
723 {
724         if (check_bit(data, POWERCFG_ENABLE) == BIT_ON)
725                 return 1;
726         else
727                 return 0;
728 }
729
730 /********************************************************************/
731
732 static inline int READCHAN_BLOCK_B_ERRORS(u16 data)
733 {
734         int ret = 0;
735         int bits_status = 0;
736
737         ret = check_bit(data, READCHAN_BLERB1);
738
739         if (ret == BIT_ON)
740                 bits_status = 0x02;
741         else
742                 bits_status = 0x00;
743
744         ret = check_bit(data, READCHAN_BLERB0);
745
746         if (ret == BIT_ON)
747                 bits_status |= 0x01;
748
749         return bits_status;
750 }
751
752 static inline int READCHAN_BLOCK_C_ERRORS(u16 data)
753 {
754         int ret = 0;
755         int bits_status = 0;
756
757         ret = check_bit(data, READCHAN_BLERC1);
758
759         if (ret == BIT_ON)
760                 bits_status = 0x02;
761         else
762                 bits_status = 0x00;
763
764         ret = check_bit(data, READCHAN_BLERC0);
765
766         if (ret == BIT_ON)
767                 bits_status |= 0x01;
768
769         return bits_status;
770 }
771
772 static inline int READCHAN_BLOCK_D_ERRORS(u16 data)
773 {
774         int ret = 0;
775         int bits_status = 0;
776
777         ret = check_bit(data, READCHAN_BLERD1);
778
779         if (ret == BIT_ON)
780                 bits_status = 0x02;
781         else
782                 bits_status = 0x00;
783
784         ret = check_bit(data, READCHAN_BLERD0);
785
786         if (ret == BIT_ON)
787                 bits_status |= 0x01;
788
789         return bits_status;
790 }
791
792 static inline u16 READCHAN_GET_CHAN(u16 data)
793 {
794         return data & READCHAN_CHAN_MASK;
795 }
796
797 /********************************************************************/
798
799 #endif