GSoC/Buflib: Enable compaction in buflib.
[kugel-rb.git] / firmware / export / tuner.h
blob6fedc0f785f091b7bb38b299f150fa618cac1625
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,
49 RADIO_RSSI,
50 RADIO_RSSI_MIN,
51 RADIO_RSSI_MAX,
53 /* Put new general-purpose readback values above this line */
54 __RADIO_GET_STANDARD_LAST
57 #ifdef HAVE_RDS_CAP
58 /** Readback from the tuner RDS layer **/
59 enum
61 RADIO_RDS_NAME,
62 RADIO_RDS_TEXT,
64 /* Put new general-purpose readback values above this line */
65 __RADIO_GET_RDS_INFO_STANDARD_LAST
67 #endif
69 /** Tuner regions **/
71 /* Basic region information */
72 enum
74 REGION_EUROPE = 0,
75 REGION_US_CANADA,
76 REGION_JAPAN,
77 REGION_KOREA,
78 REGION_ITALY,
79 REGION_OTHER,
81 /* Add new regions above this line */
82 TUNER_NUM_REGIONS
85 struct fm_region_data
87 int freq_min;
88 int freq_max;
89 int freq_step;
90 int deemphasis; /* in microseconds, usually 50 or 75 */
93 extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
95 #if CONFIG_TUNER
97 #if !defined(SIMULATOR) && defined(CONFIG_TUNER_MULTI)
98 extern int tuner_detect_type(void);
99 extern int (*tuner_set)(int setting, int value);
100 extern int (*tuner_get)(int setting);
101 #endif /* CONFIG_TUNER_MULTI */
103 /** Sanyo LV24020LP **/
104 #if (CONFIG_TUNER & LV24020LP)
105 /* Sansa c200, e200 */
106 #include "lv24020lp.h"
107 #endif
109 /** Samsung S1A0903X01 **/
110 #if (CONFIG_TUNER & S1A0903X01)
111 /* Ondio FM, FM Recorder */
112 #include "s1a0903x01.h"
113 #endif
115 /** Philips TEA5760 **/
116 #if (CONFIG_TUNER & TEA5760)
117 #include "tea5760.h"
118 #endif
120 /** Philips TEA5767 **/
121 #if (CONFIG_TUNER & TEA5767)
122 /* Ondio FM, FM Recorder, Recorder V2, iRiver h100/h300, iAudio x5 */
123 #include "tea5767.h"
124 #endif
126 /* Silicon Labs 4700 */
127 #if (CONFIG_TUNER & SI4700)
128 #include "si4700.h"
129 #endif
131 /* RDA micro RDA5802 */
132 #if (CONFIG_TUNER & RDA5802)
133 #include "rda5802.h"
134 #endif
136 /* Apple remote tuner */
137 #if (CONFIG_TUNER & IPOD_REMOTE_TUNER)
138 #include "ipod_remote_tuner.h"
139 #endif
141 #if defined(SIMULATOR)
142 #undef tuner_set
143 int tuner_set(int setting, int value);
144 #undef tuner_get
145 int tuner_get(int setting);
146 #endif
150 /* Additional messages that get enumerated after tuner driver headers */
152 /* for tuner_set */
153 enum
155 __RADIO_SET_ADDITIONAL_START = __RADIO_SET_STANDARD_LAST-1,
156 #ifdef HAVE_RADIO_REGION
157 RADIO_REGION,
158 #endif
160 RADIO_SET_CHIP_FIRST
163 /* for tuner_get */
164 enum
166 __RADIO_GET_ADDITIONAL_START = __RADIO_GET_STANDARD_LAST-1,
168 RADIO_GET_CHIP_FIRST
171 /** **/
173 void tuner_init(void) INIT_ATTR;
175 #endif /* #if CONFIG_TUNER */
177 #endif /* __TUNER_H__ */