aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/radio/CG2900/stefmapi.h
blob: d9147bb257a9fee229c3102ebef83b389823f66a (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
/*
 * Copyright (C) ST-Ericsson SA 2010
 *
 * Linux FM Host API's for ST-Ericsson FM Chip.
 *
 * Author: Hemant Gupta/hemant.gupta@stericsson.com for ST-Ericsson.
 *
 * License terms: GNU General Public License (GPL), version 2
 */

#ifndef STE_FM_API_H
#define STE_FM_API_H

#include <linux/device.h>

/* Callback function to receive RDS Data. */
typedef void  (*ste_fm_rds_cb)(void);

/**
  * struct ste_fm_rds_buf_t - RDS Group Receiving Structure
  * @block1: RDS Block A
  * @block2: RDS Block B
  * @block3: RDS Block C
  * @block4: RDS Block D
  * @status1: Status of received RDS Block A
  * @status2: Status of received RDS Block B
  * @status3: Status of received RDS Block C
  * @status4: Status of received RDS Block D
  *
  * Structure for receiving the RDS Group from FM Chip.
  *
  */
struct ste_fm_rds_buf_t {
	u16 block1;
	u16 block2;
	u16 block3;
	u16 block4;
	u8 status1;
	u8 status2;
	u8 status3;
	u8 status4;
};

/**
  * struct ste_fm_rds_info_t - RDS Information Structure
  * @rds_head: RDS Queue Head for storing next valid data.
  * @rds_tail: RDS Queue Tail for retreiving next valid data.
  * @rds_group_sent: Number of RDS Groups sent to Application.
  * @rds_block_sent: Number of RDS Blocks sent to Application.
  *
  * Structure for storing the RDS data queue information.
  *
  */
struct ste_fm_rds_info_t {
	u8 rds_head;
	u8 rds_tail;
	u8 rds_group_sent;
	u8 rds_block_sent;
};

/**
 * enum ste_fm_flags_t - FM API Flags
 * @STE_FALSE: Equivalent to boolean false.
 * @STE_TRUE: Equivalent to boolean true.
 * FM API Flags.
 */
enum ste_fm_flags_t {
	STE_FALSE,
	STE_TRUE
};

/**
 * enum ste_fm_status_t - Status codes returned by FM API Layer.
 * @STE_STATUS_OK: No Error.
 * @STE_STATUS_SYSTEM_ERROR: Error occurred in last operation.
 * Various Status codes returned by FM API Layer.
 */
enum ste_fm_status_t {
	STE_STATUS_OK,
	STE_STATUS_SYSTEM_ERROR
};

/**
 * enum ste_fm_state_t - States of FM Driver.
 * @STE_FM_STATE_DEINITIALIZED: FM driver is not initialized.
 * @STE_FM_STATE_INITIALIZED: FM driver is initialized.
 * @STE_FM_STATE_SWITCHED_ON: FM driver is switched on and in active state.
 * @STE_FM_STATE_STAND_BY: FM Radio is switched on but not in active state.
 * Various states of FM Driver.
 */
enum ste_fm_state_t {
	STE_FM_STATE_DEINITIALIZED,
	STE_FM_STATE_INITIALIZED,
	STE_FM_STATE_SWITCHED_ON,
	STE_FM_STATE_STAND_BY
} ;

/**
 * enum fmd_gocmd_t - FM Driver Command state .
 * @STE_FM_IDLE_MODE: FM Radio is in Idle Mode.
 * @STE_FM_RX_MODE: FM Radio is configured in Rx mode.
 * @STE_FM_TX_MODE: FM Radio is configured in Tx mode.
 * Various Modes of the FM Radio.
 */
enum ste_fm_mode_t {
	STE_FM_IDLE_MODE,
	STE_FM_RX_MODE,
	STE_FM_TX_MODE
};

/**
 * enum ste_fm_band_t - Various Frequency band supported.
 * @STE_FM_BAND_US_EU: European / US Band.
 * @STE_FM_BAND_JAPAN: Japan Band.
 * @STE_FM_BAND_CHINA: China Band.
 * @STE_FM_BAND_CUSTOM: Custom Band.
 * Various Frequency band supported.
 */
enum ste_fm_band_t {
	STE_FM_BAND_US_EU,
	STE_FM_BAND_JAPAN,
	STE_FM_BAND_CHINA,
	STE_FM_BAND_CUSTOM
};

/**
 * enum ste_fm_band_t - Various Frequency grids supported.
 * @STE_FM_GRID_50: 50 kHz spacing.
 * @STE_FM_GRID_100: 100 kHz spacing.
 * @STE_FM_GRID_200: 200 kHz spacing.
 * Various Frequency grids supported.
 */
enum ste_fm_grid_t {
	STE_FM_GRID_50,
	STE_FM_GRID_100,
	STE_FM_GRID_200
};

/**
 * enum ste_fm_event_t - Various Events reported by FM API layer.
 * @STE_EVENT_NO_EVENT: No Event.
 * @STE_EVENT_SEARCH_CHANNEL_FOUND: Seek operation is completed.
 * @STE_EVENT_SCAN_CHANNELS_FOUND: Band Scan is completed.
 * @STE_EVENT_BLOCK_SCAN_CHANNELS_FOUND: Block Scan is completed.
 * @STE_EVENT_SCAN_CANCELLED: Scan/Seek is cancelled.
 * Various Events reported by FM API layer.
 */
enum ste_fm_event_t {
	STE_EVENT_NO_EVENT,
	STE_EVENT_SEARCH_CHANNEL_FOUND,
	STE_EVENT_SCAN_CHANNELS_FOUND,
	STE_EVENT_BLOCK_SCAN_CHANNELS_FOUND,
	STE_EVENT_SCAN_CANCELLED
};

/**
 * enum ste_fm_direction_t - Directions used while seek.
 * @STE_DIR_DOWN: Search in downwards direction.
 * @STE_DIR_UP: Search in upwards direction.
 * Directions used while seek.
 */
enum ste_fm_direction_t {
	STE_DIR_DOWN,
	STE_DIR_UP
};

/**
 * enum ste_fm_stereo_mode_t - Stereo Modes.
 * @STE_MODE_MONO: Mono Mode.
 * @STE_MODE_STEREO: Stereo Mode.
 * Stereo Modes.
 */
enum ste_fm_stereo_mode_t {
	STE_MODE_MONO,
	STE_MODE_STEREO
};

#define STE_FM_DEFAULT_RSSI_THRESHOLD			100

#define MAX_RDS_BUFFER					10
#define MAX_RDS_GROUPS					22
#define MIN_ANALOG_VOLUME				0
#define MAX_ANALOG_VOLUME				20
#define NUM_OF_RDS_BLOCKS				4
#define RDS_BLOCK_MASK					0x1C
#define RDS_ERROR_STATUS_MASK			0x03
#define RDS_UPTO_TWO_BITS_CORRECTED	0x01
#define RDS_UPTO_FIVE_BITS_CORRECTED	0x02
#define MAX_RT_SIZE						65
#define MAX_PSN_SIZE						9
#define DEFAULT_CHANNELS_TO_SCAN 		32
#define MAX_CHANNELS_TO_SCAN 			99
#define MAX_CHANNELS_FOR_BLOCK_SCAN 	198

extern u8 global_event;
extern struct ste_fm_rds_buf_t ste_fm_rds_buf[MAX_RDS_BUFFER][MAX_RDS_GROUPS];
extern struct ste_fm_rds_info_t ste_fm_rds_info;

/**
 * ste_fm_init()- Initializes FM Radio.
 * Initializes the Variables and structures required for FM Driver.
 * It also registers the callback to receive the events for command
 * completion, etc
 *
 * Returns:
 *   STE_STATUS_OK,  if Initialization successful
 *   STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_init(void);

/**
 * ste_fm_deinit()- De-initializes FM Radio.
 * De-initializes the Variables and structures required for FM Driver.
 *
 * Returns:
 *	 STE_STATUS_OK, if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_deinit(void);

/**
 * ste_fm_switch_on()- Start up procedure of the FM radio.
 * @device: Character device requesting the operation.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_switch_on(
		struct device *device
		);


/**
 * ste_fm_switch_off()- Switches off FM radio
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_switch_off(void);

/**
 * ste_fm_standby()- Makes the FM Radio Go in Standby mode.
 *
 * The FM Radio memorizes the the last state, i.e. Volume, last
 * tuned station, etc that helps in resuming quickly to previous state.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_standby(void);

/**
 * ste_fm_power_up_from_standby()- Power Up FM Radio from Standby mode.
 * It retruns the FM radio to the same state as it was before
 * going to Standby.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_power_up_from_standby(void);

/**
 * ste_fm_set_rx_default_settings()- Loads FM Rx Default Settings.
 * @freq: Frequency in Hz to be set on the FM Radio.
 * @band: Band To be Set.
 * (0: US/EU, 1: Japan, 2: China, 3: Custom)
 * @grid: Grid specifying Spacing.
 * (0: 50 KHz, 1: 100 KHz, 2: 200 Khz)
 * @enable_rds: Flag indicating enable or disable rds transmission.
 * @enable_stereo: Flag indicating enable or disable stereo mode.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_rx_default_settings(
		u32 freq,
		u8 band,
		u8 grid,
		bool enable_rds,
		bool enable_stereo
		);

/**
 * ste_fm_set_tx_default_settings()- Loads FM Tx Default Settings.
 * @freq: Frequency in Hz to be set on the FM Radio.
 * @band: Band To be Set.
 * (0: US/EU, 1: Japan, 2: China, 3: Custom)
 * @grid: Grid specifying Spacing.
 * (0: 50 KHz, 1: 100 KHz, 2: 200 Khz)
 * @enable_rds: Flag indicating enable or disable rds transmission.
 * @enable_stereo: Flag indicating enable or disable stereo mode.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_tx_default_settings(
		u32 freq,
		u8 band,
		u8 grid,
		bool enable_rds,
		bool enable_stereo
		);

/**
 * ste_fm_set_grid()- Sets the Grid on the FM Radio.
 * @grid: Grid specifying Spacing.
 * (0: 50 KHz,1: 100 KHz,2: 200 Khz)
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_grid(
		u8 grid
		);

/**
 * ste_fm_set_band()- Sets the Band on the FM Radio.
 * @band: Band specifying Region.
 * (0: US_EU,1: Japan,2: China,3: Custom)
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_band(
		u8 band
		);

/**
 * ste_fm_search_up_freq()- seek Up.
 * Searches the next available station in Upward Direction
 * starting from the Current freq.
 *
 * If the operation is started successfully, the chip will generate the
 * irpt_OperationSucced. interrupt when the operation is completed
 * and will tune to the next available frequency.
 * If no station is found, the chip is still tuned to the original station
 * before starting the search
 * Till the interrupt is received, no more API's should be called
 * except ste_fm_stop_scan
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation started successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_search_up_freq(void);

/**
 * ste_fm_search_down_freq()- seek Down.
 * Searches the next available station in Downward Direction
 * starting from the Current freq.
 *
 * If the operation is started successfully, the chip will generate
 * the irpt_OperationSucced. interrupt when the operation is completed.
 * and will tune to the next available frequency. If no station is found,
 * the chip is still tuned to the original station before starting the search.
 * Till the interrupt is received, no more API's should be called
 * except ste_fm_stop_scan.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation started successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_search_down_freq(void);

/**
 * ste_fm_start_band_scan()- Band Scan.
 *
 * Searches for available Stations in the entire Band starting from
 * current freq.
 * If the operation is started successfully, the chip will generate
 * the irpt_OperationSucced. interrupt when the operation is completed.
 * After completion the chip will still be tuned the original station before
 * starting the Scan. on reception of interrupt, the host should call the AP
 * ste_fm_get_scan_result() to retrieve the Stations and corresponding
 * RSSI of stations found in the Band.
 * Till the interrupt is received, no more API's should be called
 * except ste_fm_stop_scan, ste_fm_switch_off, ste_fm_standby and
 * ste_fm_get_frequency.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation started successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_start_band_scan(void);

/**
 * ste_fm_stop_scan()- Stops an active ongoing seek or Band Scan.
 *
 * If the operation is started successfully, the chip will generate the
 * irpt_OperationSucced interrupt when the operation is completed.
 * Till the interrupt is received, no more API's should be called.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation started successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_stop_scan(void);

/**
 * ste_fm_get_scan_result()- Retreives Band Scan Result
 * Retrieves the Scan Band Results of the stations found and
 * the corressponding RSSI values of the stations.
 * @num_of_scanfreq: (out) Number of Stations found
 * during Scanning.
 * @scan_freq: (out) Frequency of Stations in Hz
 * found during Scanning.
 * @scan_freq_rssi_level: (out) RSSI level of Stations
 * found during Scanning.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_scan_result(
		u16 *num_of_scanfreq,
		u32 *scan_freq,
		u32 *scan_freq_rssi_level
		);

/**
 * ste_fm_start_block_scan()- Block Scan.
 *
 * Searches for RSSI level of all the channels between the start and stop
 * channels. If the operation is started successfully, the chip will generate
 * the irpt_OperationSucced interrupt when the operation is completed.
 * After completion the chip will still be tuned the original station before
 * starting the Scan. On reception of interrupt, the host should call the AP
 * ste_fm_get_block_scan_result() to retrieve the RSSI of channels.
 * Till the interrupt is received, no more API's should be called from Host
 * except ste_fm_stop_scan, ste_fm_switch_off, ste_fm_standby and
 * ste_fm_get_frequency.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation started successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_start_block_scan(void);

/**
 * ste_fm_get_scan_result()- Retreives Band Scan Result
 * Retrieves the Scan Band Results of the stations found and
 * the corressponding RSSI values of the stations.
 * @num_of_scanchan: (out) Number of Stations found
 * during Scanning.
 * @scan_freq_rssi_level: (out) RSSI level of Stations
 * found during Scanning.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_block_scan_result(
		u16 *num_of_scanchan,
		u16 *scan_freq_rssi_level
		);

/**
 * ste_fm_tx_get_rds_deviation()- Gets RDS Deviation.
 * Retrieves the RDS Deviation level set for FM Tx.
 * @deviation: (out) Rds Deviation.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_get_rds_deviation(
		u16 *deviation
		);

/**
 * ste_fm_tx_set_rds_deviation()- Sets RDS Deviation.
 * Sets the RDS Deviation level on FM Tx.
 * @deviation: Rds Deviation to set on FM Tx.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_rds_deviation(
		u16 deviation
		);

/**
 * ste_fm_tx_set_pi_code()- Sets PI code for RDS Transmission.
 * Sets the Program Identification code to be transmitted.
 * @pi_code: PI code to be transmitted.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_pi_code(
		u16 pi_code
		);

/**
 * ste_fm_tx_set_pty_code()- Sets PTY code for RDS Transmission.
 * Sets the Program Type code to be transmitted.
 * @pty_code: PTY code to be transmitted.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_pty_code(
		u16 pty_code
		);

/**
 * ste_fm_tx_set_program_station_name()- Sets PSN for RDS Transmission.
 * Sets the Program Station Name to be transmitted.
 * @psn: Program Station Name to be transmitted.
 * @len: Length of Program Station Name to be transmitted.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_program_station_name(
		char *psn,
		u8 len
		);

/**
 * ste_fm_tx_set_radio_text()- Sets RT for RDS Transmission.
 * Sets the radio text to be transmitted.
 * @rt: Radio Text to be transmitted.
 * @len: Length of Radio Text to be transmitted.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_radio_text(
		char *rt,
		u8 len
		);

/**
 * ste_fm_tx_get_rds_deviation()- Gets Pilot Tone status
 * Gets the current status of pilot tone for FM Tx.
 * @enable: (out) Flag indicating Pilot Tone is enabled or disabled.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_get_pilot_tone_status(
		bool *enable
		);

/**
 * ste_fm_tx_set_pilot_tone_status()- Enables/Disables Pilot Tone.
 * Enables or disables the pilot tone for FM Tx.
 * @enable: Flag indicating enabling or disabling Pilot Tone.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_pilot_tone_status(
		bool enable
		);

/**
 * ste_fm_tx_get_pilot_deviation()- Gets Pilot Deviation.
 * Retrieves the Pilot Tone Deviation level set for FM Tx.
 * @deviation: (out) Pilot Tone Deviation.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_get_pilot_deviation(
		u16 *deviation
		);

/**
 * ste_fm_tx_set_pilot_deviation()- Sets Pilot Deviation.
 * Sets the Pilot Tone Deviation level on FM Tx.
 * @deviation: Pilot Tone Deviation to set.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_pilot_deviation(
		u16 deviation
		);

/**
 * ste_fm_tx_get_preemphasis()- Gets Pre-emhasis level.
 * Retrieves the Preemphasis level set for FM Tx.
 * @preemphasis: (out) Preemphasis level.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_get_preemphasis(
		u8 *preemphasis
		);

/**
 * ste_fm_tx_set_preemphasis()- Sets Pre-emhasis level.
 * Sets the Preemphasis level on FM Tx.
 * @preemphasis: Preemphasis level.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_preemphasis(
		u8 preemphasis
		);

/**
 * ste_fm_tx_get_power_level()- Gets Power level.
 * Retrieves the Power level set for FM Tx.
 * @power_level: (out) Power level.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_get_power_level(
		u16 *power_level
		);

/**
 * ste_fm_tx_set_power_level()- Sets Power level.
 * Sets the Power level for FM Tx.
 * @power_level: Power level.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_set_power_level(
		u16 power_level
		);

/**
 * ste_fm_tx_rds()- Enable or disable Tx RDS.
 * Enable or disable RDS transmission.
 * @enable_rds: Flag indicating enabling or disabling RDS.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_tx_rds(
		bool enable_rds
		);

/**
 * ste_fm_set_audio_balance()- Sets Audio Balance.
 * @balance: Audio Balnce to be Set in Percentage.
 * (-100: Right Mute.... 0: Both on.... 100: Left Mute)
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_audio_balance(
		s8 balance
		);

/**
 * ste_fm_set_volume()- Sets the Analog Out Gain of FM Chip.
 * @vol_level: Volume Level to be set on Tuner (0-20).
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_volume(
		u8 vol_level
		);

/**
 * ste_fm_get_volume()- Gets the currently set Analog Out Gain of FM Chip.
 * @vol_level: (out)Volume Level set on Tuner (0-20).
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_volume(
		u8 *vol_level
		);

/**
 * ste_fm_rds_off()- Disables the RDS decoding algorithm in FM chip
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_rds_off(void);

/**
 * ste_fm_rds_on()- Enables the RDS decoding algorithm in FM chip
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_rds_on(void);

/**
 * ste_fm_get_rds_status()- Retrieves the status whether RDS is enabled or not
 * @rds_status: (out) Status of RDS
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_rds_status(
		bool *rds_status
		);

/**
 * ste_fm_mute()- Mutes the Audio output from FM Chip
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_mute(void);

/**
 * ste_fm_unmute()- Unmutes the Audio output from FM Chip
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_unmute(void);

/**
 * ste_fm_get_frequency()- Gets the Curently tuned Frequency on FM Radio
 * @freq: (out) Frequency in Hz set on the FM Radio.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_frequency(
		u32 *freq
		);

/**
 * ste_fm_set_frequency()- Sets the frequency on FM Radio
 * @new_freq: Frequency in Hz to be set on the FM Radio.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_frequency(
		u32 new_freq
		);

/**
 * ste_fm_get_signal_strength()- Gets the RSSI level.
 * @signal_strength: (out) RSSI level of the currently
 * tuned frequency.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_signal_strength(
		u16 *signal_strength
		);

/**
 * ste_fm_get_af_updat()- Retrives results of AF Update
 * @af_update_rssi: (out) RSSI level of the Alternative frequency.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_af_update_get_result(
			u16 *af_update_rssi
			);


/**
 * ste_fm_af_update_start()- PErforms AF Update.
 * @af_freq: AF frequency in Hz whose RSSI is to be retrived.
 * tuned frequency.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */

u8 ste_fm_af_update_start(
			u32 af_freq
			);

/**
 * ste_fm_af_switch_get_result()- Retrives the AF switch result.
 * @af_switch_conclusion: (out) Conclusion of the AF Switch.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_af_switch_get_result(
			u16 *af_switch_conclusion
			);

/**
 * ste_fm_af_switch_start()- PErforms AF switch.
 * @af_switch_freq: Alternate Frequency in Hz to be switched.
 * @af_switch_pi: picode of the Alternative frequency.
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_af_switch_start(
		u32 af_switch_freq,
		u16 af_switch_pi
		);

/**
 * ste_fm_get_mode()- Gets the mode of the Radio tuner.
 * @cur_mode: (out) Current mode set on FM Radio
 * (0: Stereo, 1: Mono, 2: Blending, 3: Switching).
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_mode(
		u8 *cur_mode
		);

/**
 * ste_fm_set_mode()- Sets the mode on the Radio tuner.
 * @mode: mode to be set on FM Radio
 * (0: Stereo, 1: Mono, 2: Blending, 3: Switching.)
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_mode(
		u8 mode
		);

/**
 * ste_fm_select_antenna()- Selects the Antenna of the Radio tuner.
 * @antenna: (0: Embedded, 1: Wired.)
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_select_antenna(
		u8 antenna
		);

/**
 * ste_fm_get_antenna()- Retreives the currently selected antenna.
 * @antenna: out (0: Embedded, 1: Wired.)
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_antenna(
		u8 *antenna
		);

/**
 * ste_fm_get_rssi_threshold()- Gets the rssi threshold currently
 * set on FM radio.
 * @rssi_thresold: (out) Current rssi threshold set.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_get_rssi_threshold(
		u16 *rssi_thresold
		);

/**
 * ste_fm_set_rssi_threshold()- Sets the rssi threshold to be used during
 * Band Scan and seek Stations
 * @rssi_thresold: rssi threshold to be set.
 *
 * Returns:
 *	 STE_STATUS_OK,  if operation completed successfully.
 *	 STE_STATUS_SYSTEM_ERROR, otherwise.
 */
u8 ste_fm_set_rssi_threshold(
		u16 rssi_thresold
		);

/**
 * wake_up_poll_queue()- Wakes up the Task waiting on Poll Queue.
 * This function is called when Scan Band or seek has completed.
 */
void wake_up_poll_queue(void);

/**
 * void wake_up_read_queue()- Wakes up the Task waiting on Read Queue.
 * This function is called when RDS data is available for reading by
 * application.
 */
void wake_up_read_queue(void);
#endif /* STE_FM_API_H */