Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * Tuner abstraction layer |
| 10 | * |
Nicolas Pennequin | 357ffb3 | 2008-05-05 10:32:46 +0000 | [diff] [blame^] | 11 | * Copyright (C) 2004 Jörg Hohensohn |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 12 | * |
| 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 Sevakis | 21a4a87 | 2007-06-06 19:23:48 +0000 | [diff] [blame] | 20 | #ifndef __TUNER_H__ |
| 21 | #define __TUNER_H__ |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 22 | |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 23 | #include "hwcompat.h" |
| 24 | |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 25 | /** Settings to the tuner layer **/ |
| 26 | enum |
| 27 | { |
| 28 | RADIO_ALL = -1, /* debug */ |
| 29 | RADIO_SLEEP, |
| 30 | RADIO_FREQUENCY, |
| 31 | RADIO_MUTE, |
| 32 | RADIO_FORCE_MONO, |
| 33 | RADIO_SCAN_FREQUENCY, |
Michael Sevakis | 21a4a87 | 2007-06-06 19:23:48 +0000 | [diff] [blame] | 34 | |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 35 | /* Put new general-purpose settings above this line */ |
| 36 | __RADIO_SET_STANDARD_LAST |
| 37 | }; |
| 38 | |
| 39 | /** Readback from the tuner layer **/ |
| 40 | enum |
| 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 */ |
| 53 | enum |
| 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 | |
| 64 | struct fm_region_data |
| 65 | { |
| 66 | int freq_min; |
| 67 | int freq_max; |
| 68 | int freq_step; |
| 69 | }; |
| 70 | |
| 71 | extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS]; |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 72 | |
Jens Arnold | c652218 | 2007-02-18 08:46:12 +0000 | [diff] [blame] | 73 | #if CONFIG_TUNER |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 74 | |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 75 | #ifdef SIMULATOR |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 76 | int tuner_set(int setting, int value); |
| 77 | int tuner_get(int setting); |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 78 | #else |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 79 | |
| 80 | #ifdef CONFIG_TUNER_MULTI |
| 81 | extern int (*tuner_set)(int setting, int value); |
| 82 | extern 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 Sevakis | 21a4a87 | 2007-06-06 19:23:48 +0000 | [diff] [blame] | 103 | #endif /* SIMULATOR */ |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 104 | |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 105 | /* Additional messages that get enumerated after tuner driver headers */ |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 106 | |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 107 | /* for tuner_set */ |
| 108 | enum |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 109 | { |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 110 | __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 Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 116 | }; |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 117 | |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 118 | /* for tuner_get */ |
| 119 | enum |
Michael Sevakis | a2ee6a6 | 2007-03-16 14:40:40 +0000 | [diff] [blame] | 120 | { |
Michael Sevakis | f58dc4b | 2007-07-16 15:25:06 +0000 | [diff] [blame] | 121 | __RADIO_GET_ADDITIONAL_START = __RADIO_GET_STANDARD_LAST-1, |
Michael Sevakis | 7d759f6 | 2007-07-14 11:20:31 +0000 | [diff] [blame] | 122 | |
| 123 | RADIO_GET_CHIP_FIRST |
| 124 | }; |
| 125 | |
| 126 | /** **/ |
| 127 | |
| 128 | void tuner_init(void); |
| 129 | bool tuner_power(bool power); |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 130 | |
Jens Arnold | c652218 | 2007-02-18 08:46:12 +0000 | [diff] [blame] | 131 | #endif /* #if CONFIG_TUNER */ |
Jörg Hohensohn | 8f8fbac | 2004-10-15 21:41:46 +0000 | [diff] [blame] | 132 | |
Michael Sevakis | 21a4a87 | 2007-06-06 19:23:48 +0000 | [diff] [blame] | 133 | #endif /* __TUNER_H__ */ |