Fix advanced EQ menu
[maemo-rb.git] / firmware / export / tuner.h
blob050bbd0f3369885ee976cda5b70124f35c671c84
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 "config.h"
26 #include "hwcompat.h"
28 /** Settings to the tuner layer **/
29 enum
31 RADIO_ALL = -1, /* debug */
32 RADIO_SLEEP,
33 RADIO_FREQUENCY,
34 RADIO_MUTE,
35 RADIO_FORCE_MONO,
36 RADIO_SCAN_FREQUENCY,
38 /* Put new general-purpose settings above this line */
39 __RADIO_SET_STANDARD_LAST
42 /** Readback from the tuner layer **/
43 enum
45 RADIO_PRESENT = 0,
46 RADIO_TUNED,
47 RADIO_STEREO,
48 /* RADIO_EVENT is an event that requests a screen update */
49 RADIO_EVENT,
50 RADIO_RSSI,
51 RADIO_RSSI_MIN,
52 RADIO_RSSI_MAX,
54 /* Put new general-purpose readback values above this line */
55 __RADIO_GET_STANDARD_LAST
58 #ifdef HAVE_RDS_CAP
59 /** Readback from the tuner RDS layer **/
60 enum
62 RADIO_RDS_NAME,
63 RADIO_RDS_TEXT,
65 /* Put new general-purpose readback values above this line */
66 __RADIO_GET_RDS_INFO_STANDARD_LAST
68 #endif
70 /** Tuner regions **/
72 /* Basic region information */
73 enum
75 REGION_EUROPE = 0,
76 REGION_US_CANADA,
77 REGION_JAPAN,
78 REGION_KOREA,
79 REGION_ITALY,
80 REGION_OTHER,
82 /* Add new regions above this line */
83 TUNER_NUM_REGIONS
86 struct fm_region_data
88 int freq_min;
89 int freq_max;
90 int freq_step;
91 int deemphasis; /* in microseconds, usually 50 or 75 */
94 extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
96 #if CONFIG_TUNER
98 #if !defined(SIMULATOR) && defined(CONFIG_TUNER_MULTI)
99 extern int tuner_detect_type(void);
100 extern int (*tuner_set)(int setting, int value);
101 extern int (*tuner_get)(int setting);
102 #endif /* CONFIG_TUNER_MULTI */
104 /** Sanyo LV24020LP **/
105 #if (CONFIG_TUNER & LV24020LP)
106 /* Sansa c200, e200 */
107 #include "lv24020lp.h"
108 #endif
110 /** Samsung S1A0903X01 **/
111 #if (CONFIG_TUNER & S1A0903X01)
112 /* Ondio FM, FM Recorder */
113 #include "s1a0903x01.h"
114 #endif
116 /** Philips TEA5760 **/
117 #if (CONFIG_TUNER & TEA5760)
118 #include "tea5760.h"
119 #endif
121 /** Philips TEA5767 **/
122 #if (CONFIG_TUNER & TEA5767)
123 /* Ondio FM, FM Recorder, Recorder V2, iRiver h100/h300, iAudio x5 */
124 #include "tea5767.h"
125 #endif
127 /* Silicon Labs 4700 */
128 #if (CONFIG_TUNER & SI4700)
129 #include "si4700.h"
130 #endif
132 /* RDA micro RDA5802 */
133 #if (CONFIG_TUNER & RDA5802)
134 #include "rda5802.h"
135 #endif
137 /* Apple remote tuner */
138 #if (CONFIG_TUNER & IPOD_REMOTE_TUNER)
139 #include "ipod_remote_tuner.h"
140 #endif
142 /* SigmaTel/Freescale STFM1000 */
143 #if (CONFIG_TUNER & STFM1000)
144 #include "stfm1000.h"
145 #endif
147 #if defined(SIMULATOR)
148 #undef tuner_set
149 int tuner_set(int setting, int value);
150 #undef tuner_get
151 int tuner_get(int setting);
152 #endif
156 /* Additional messages that get enumerated after tuner driver headers */
158 /* for tuner_set */
159 enum
161 __RADIO_SET_ADDITIONAL_START = __RADIO_SET_STANDARD_LAST-1,
162 #ifdef HAVE_RADIO_REGION
163 RADIO_REGION,
164 #endif
166 RADIO_SET_CHIP_FIRST
169 /* for tuner_get */
170 enum
172 __RADIO_GET_ADDITIONAL_START = __RADIO_GET_STANDARD_LAST-1,
174 RADIO_GET_CHIP_FIRST
177 /** **/
179 void tuner_init(void) INIT_ATTR;
181 #endif /* #if CONFIG_TUNER */
183 #endif /* __TUNER_H__ */