blob: 1f78f530c5c39926a9433db2cc71126683f441b5 [file] [log] [blame]
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 * Tuner abstraction layer
10 *
Nicolas Pennequin357ffb32008-05-05 10:32:46 +000011 * Copyright (C) 2004 Jörg Hohensohn
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +000012 *
13 * All files in this archive are subject to the GNU General Public License.
14 * See the file COPYING in the source tree root for full license agreement.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
Michael Sevakis21a4a872007-06-06 19:23:48 +000020#ifndef __TUNER_H__
21#define __TUNER_H__
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +000022
Michael Sevakisa2ee6a62007-03-16 14:40:40 +000023#include "hwcompat.h"
24
Michael Sevakis7d759f62007-07-14 11:20:31 +000025/** Settings to the tuner layer **/
26enum
27{
28 RADIO_ALL = -1, /* debug */
29 RADIO_SLEEP,
30 RADIO_FREQUENCY,
31 RADIO_MUTE,
32 RADIO_FORCE_MONO,
33 RADIO_SCAN_FREQUENCY,
Michael Sevakis21a4a872007-06-06 19:23:48 +000034
Michael Sevakis7d759f62007-07-14 11:20:31 +000035 /* Put new general-purpose settings above this line */
36 __RADIO_SET_STANDARD_LAST
37};
38
39/** Readback from the tuner layer **/
40enum
41{
42 RADIO_PRESENT = 0,
43 RADIO_TUNED,
44 RADIO_STEREO,
45
46 /* Put new general-purpose readback values above this line */
47 __RADIO_GET_STANDARD_LAST
48};
49
50/** Tuner regions **/
51
52/* Basic region information */
53enum
54{
55 REGION_EUROPE = 0,
56 REGION_US_CANADA,
57 REGION_JAPAN,
58 REGION_KOREA,
59
60 /* Add new regions above this line */
61 TUNER_NUM_REGIONS
62};
63
64struct fm_region_data
65{
66 int freq_min;
67 int freq_max;
68 int freq_step;
69};
70
71extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +000072
Jens Arnoldc6522182007-02-18 08:46:12 +000073#if CONFIG_TUNER
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +000074
Michael Sevakisa2ee6a62007-03-16 14:40:40 +000075#ifdef SIMULATOR
Michael Sevakis7d759f62007-07-14 11:20:31 +000076int tuner_set(int setting, int value);
77int tuner_get(int setting);
Michael Sevakisa2ee6a62007-03-16 14:40:40 +000078#else
Michael Sevakis7d759f62007-07-14 11:20:31 +000079
80#ifdef CONFIG_TUNER_MULTI
81extern int (*tuner_set)(int setting, int value);
82extern int (*tuner_get)(int setting);
83#endif /* CONFIG_TUNER_MULTI */
84
85/** Sanyo LV24020LP **/
86#if (CONFIG_TUNER & LV24020LP)
87/* Sansa e200 Series */
88#include "lv24020lp.h"
89#endif
90
91/** Samsung S1A0903X01 **/
92#if (CONFIG_TUNER & S1A0903X01)
93/* Ondio FM, FM Recorder */
94#include "s1a0903x01.h"
95#endif
96
97/** Philips TEA5767 **/
98#if (CONFIG_TUNER & TEA5767)
99/* Ondio FM, FM Recorder, Recorder V2, iRiver h100/h300, iAudio x5 */
100#include "tea5767.h"
101#endif
102
Michael Sevakis21a4a872007-06-06 19:23:48 +0000103#endif /* SIMULATOR */
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +0000104
Michael Sevakis7d759f62007-07-14 11:20:31 +0000105/* Additional messages that get enumerated after tuner driver headers */
Michael Sevakisa2ee6a62007-03-16 14:40:40 +0000106
Michael Sevakis7d759f62007-07-14 11:20:31 +0000107/* for tuner_set */
108enum
Michael Sevakisa2ee6a62007-03-16 14:40:40 +0000109{
Michael Sevakis7d759f62007-07-14 11:20:31 +0000110 __RADIO_SET_ADDITIONAL_START = __RADIO_SET_STANDARD_LAST-1,
111#ifdef HAVE_RADIO_REGION
112 RADIO_REGION,
113#endif
114
115 RADIO_SET_CHIP_FIRST
Michael Sevakisa2ee6a62007-03-16 14:40:40 +0000116};
Michael Sevakisa2ee6a62007-03-16 14:40:40 +0000117
Michael Sevakis7d759f62007-07-14 11:20:31 +0000118/* for tuner_get */
119enum
Michael Sevakisa2ee6a62007-03-16 14:40:40 +0000120{
Michael Sevakisf58dc4b2007-07-16 15:25:06 +0000121 __RADIO_GET_ADDITIONAL_START = __RADIO_GET_STANDARD_LAST-1,
Michael Sevakis7d759f62007-07-14 11:20:31 +0000122
123 RADIO_GET_CHIP_FIRST
124};
125
126/** **/
127
128void tuner_init(void);
129bool tuner_power(bool power);
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +0000130
Jens Arnoldc6522182007-02-18 08:46:12 +0000131#endif /* #if CONFIG_TUNER */
Jörg Hohensohn8f8fbac2004-10-15 21:41:46 +0000132
Michael Sevakis21a4a872007-06-06 19:23:48 +0000133#endif /* __TUNER_H__ */