FM tuner region code cleanup - FS #11492 by me.
[maemo-rb.git] / firmware / export / tuner.h
blob9263c08d90a0f703c0d368e04c1dc1f3ce8f9658
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 * Tuner abstraction layer
11 * Copyright (C) 2004 Jörg Hohensohn
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
22 #ifndef __TUNER_H__
23 #define __TUNER_H__
25 #include "hwcompat.h"
27 /** Settings to the tuner layer **/
28 enum
30 RADIO_ALL = -1, /* debug */
31 RADIO_SLEEP,
32 RADIO_FREQUENCY,
33 RADIO_MUTE,
34 RADIO_FORCE_MONO,
35 RADIO_SCAN_FREQUENCY,
37 /* Put new general-purpose settings above this line */
38 __RADIO_SET_STANDARD_LAST
41 /** Readback from the tuner layer **/
42 enum
44 RADIO_PRESENT = 0,
45 RADIO_TUNED,
46 RADIO_STEREO,
47 /* RADIO_EVENT is an event that requests a screen update */
48 RADIO_EVENT,
50 /* Put new general-purpose readback values above this line */
51 __RADIO_GET_STANDARD_LAST
54 #ifdef HAVE_RDS_CAP
55 /** Readback from the tuner RDS layer **/
56 enum
58 RADIO_RDS_NAME,
59 RADIO_RDS_TEXT,
61 /* Put new general-purpose readback values above this line */
62 __RADIO_GET_RDS_INFO_STANDARD_LAST
64 #endif
66 /** Tuner regions **/
68 /* Basic region information */
69 enum
71 REGION_EUROPE = 0,
72 REGION_US_CANADA,
73 REGION_JAPAN,
74 REGION_KOREA,
75 REGION_ITALY,
76 REGION_OTHER,
78 /* Add new regions above this line */
79 TUNER_NUM_REGIONS
82 struct fm_region_data
84 int freq_min;
85 int freq_max;
86 int freq_step;
87 int deemphasis; /* in microseconds, usually 50 or 75 */
90 extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
92 #if CONFIG_TUNER
94 #if (CONFIG_PLATFORM & PLATFORM_HOSTED)
95 int tuner_set(int setting, int value);
96 int tuner_get(int setting);
97 #ifdef HAVE_RDS_CAP
98 char* tuner_get_rds_info(int setting);
99 #endif
100 #else
102 #ifdef CONFIG_TUNER_MULTI
103 extern int tuner_detect_type(void);
104 extern int (*tuner_set)(int setting, int value);
105 extern int (*tuner_get)(int setting);
106 #endif /* CONFIG_TUNER_MULTI */
108 /** Sanyo LV24020LP **/
109 #if (CONFIG_TUNER & LV24020LP)
110 /* Sansa c200, e200 */
111 #include "lv24020lp.h"
112 #endif
114 /** Samsung S1A0903X01 **/
115 #if (CONFIG_TUNER & S1A0903X01)
116 /* Ondio FM, FM Recorder */
117 #include "s1a0903x01.h"
118 #endif
120 /** Philips TEA5760 **/
121 #if (CONFIG_TUNER & TEA5760)
122 #include "tea5760.h"
123 #endif
125 /** Philips TEA5767 **/
126 #if (CONFIG_TUNER & TEA5767)
127 /* Ondio FM, FM Recorder, Recorder V2, iRiver h100/h300, iAudio x5 */
128 #include "tea5767.h"
129 #endif
131 /* Silicon Labs 4700 */
132 #if (CONFIG_TUNER & SI4700)
133 #include "si4700.h"
134 #endif
136 /* RDA micro RDA5802 */
137 #if (CONFIG_TUNER & RDA5802)
138 #include "rda5802.h"
139 #endif
141 /* Apple remote tuner */
142 #if (CONFIG_TUNER & IPOD_REMOTE_TUNER)
143 #include "ipod_remote_tuner.h"
144 #endif
146 #endif /* PLATFORM_HOSTED */
148 /* Additional messages that get enumerated after tuner driver headers */
150 /* for tuner_set */
151 enum
153 __RADIO_SET_ADDITIONAL_START = __RADIO_SET_STANDARD_LAST-1,
154 #ifdef HAVE_RADIO_REGION
155 RADIO_REGION,
156 #endif
158 RADIO_SET_CHIP_FIRST
161 /* for tuner_get */
162 enum
164 __RADIO_GET_ADDITIONAL_START = __RADIO_GET_STANDARD_LAST-1,
166 RADIO_GET_CHIP_FIRST
169 /** **/
171 void tuner_init(void) INIT_ATTR;
173 #endif /* #if CONFIG_TUNER */
175 #endif /* __TUNER_H__ */