2004-10-15 21:41:46 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
* Tuner abstraction layer
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2004 J<EFBFBD>rg Hohensohn
|
|
|
|
|
*
|
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
|
*
|
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
|
* KIND, either express or implied.
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
#ifndef __TUNER_SAMSUNG_H__
|
|
|
|
|
#define __TUNER_SAMSUNG_H__
|
|
|
|
|
|
2007-03-16 14:40:40 +00:00
|
|
|
|
#include "hwcompat.h"
|
|
|
|
|
|
2004-10-15 21:41:46 +00:00
|
|
|
|
/* settings to the tuner layer */
|
2007-03-16 14:40:40 +00:00
|
|
|
|
#define RADIO_ALL -1 /* debug */
|
2004-10-19 08:20:38 +00:00
|
|
|
|
#define RADIO_SLEEP 0
|
2004-10-15 21:41:46 +00:00
|
|
|
|
#define RADIO_FREQUENCY 1
|
|
|
|
|
#define RADIO_MUTE 2
|
|
|
|
|
#define RADIO_IF_MEASUREMENT 3
|
|
|
|
|
#define RADIO_SENSITIVITY 4
|
|
|
|
|
#define RADIO_FORCE_MONO 5
|
2007-03-16 14:40:40 +00:00
|
|
|
|
#define RADIO_SCAN_FREQUENCY 6
|
2006-10-05 12:40:13 +00:00
|
|
|
|
#if (CONFIG_TUNER & TEA5767)
|
2007-03-16 14:40:40 +00:00
|
|
|
|
#define RADIO_SET_DEEMPHASIS 7
|
|
|
|
|
#define RADIO_SET_BAND 8
|
2006-10-05 12:40:13 +00:00
|
|
|
|
#endif
|
2004-10-15 21:41:46 +00:00
|
|
|
|
/* readback from the tuner layer */
|
|
|
|
|
#define RADIO_PRESENT 0
|
2004-10-19 08:20:38 +00:00
|
|
|
|
#define RADIO_TUNED 1
|
2004-10-15 21:41:46 +00:00
|
|
|
|
#define RADIO_STEREO 2
|
|
|
|
|
|
2007-02-18 08:46:12 +00:00
|
|
|
|
#if CONFIG_TUNER
|
2004-10-15 21:41:46 +00:00
|
|
|
|
|
2007-03-16 14:40:40 +00:00
|
|
|
|
#ifdef SIMULATOR
|
|
|
|
|
int radio_set(int setting, int value);
|
|
|
|
|
int radio_get(int setting);
|
|
|
|
|
#else
|
|
|
|
|
#if CONFIG_TUNER == S1A0903X01 /* FM recorder */
|
|
|
|
|
#define radio_set samsung_set
|
|
|
|
|
#define radio_get samsung_get
|
|
|
|
|
#elif CONFIG_TUNER == TEA5767 /* iRiver, iAudio */
|
|
|
|
|
#define radio_set philips_set
|
|
|
|
|
#define radio_get philips_get
|
|
|
|
|
#elif CONFIG_TUNER == (S1A0903X01 | TEA5767) /* OndioFM */
|
|
|
|
|
#define radio_set _radio_set
|
|
|
|
|
#define radio_get _radio_get
|
|
|
|
|
int (*_radio_set)(int setting, int value);
|
|
|
|
|
int (*_radio_get)(int setting);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-10-15 21:41:46 +00:00
|
|
|
|
#if (CONFIG_TUNER & S1A0903X01)
|
2007-03-16 14:40:40 +00:00
|
|
|
|
int samsung_set(int setting, int value);
|
2004-10-15 21:41:46 +00:00
|
|
|
|
int samsung_get(int setting);
|
2007-03-16 14:40:40 +00:00
|
|
|
|
#endif /* CONFIG_TUNER & S1A0903X01 */
|
2004-10-15 21:41:46 +00:00
|
|
|
|
|
|
|
|
|
#if (CONFIG_TUNER & TEA5767)
|
2007-03-16 14:40:40 +00:00
|
|
|
|
struct philips_dbg_info
|
|
|
|
|
{
|
|
|
|
|
unsigned char read_regs[5];
|
|
|
|
|
unsigned char write_regs[5];
|
|
|
|
|
};
|
|
|
|
|
int philips_set(int setting, int value);
|
2004-10-15 21:41:46 +00:00
|
|
|
|
int philips_get(int setting);
|
2007-03-16 14:40:40 +00:00
|
|
|
|
void philips_dbg_info(struct philips_dbg_info *info);
|
|
|
|
|
#endif /* CONFIG_TUNER & TEA5767 */
|
|
|
|
|
|
|
|
|
|
/* Just inline here since only radio screen needs this atm and
|
|
|
|
|
there's no tuner.c. */
|
|
|
|
|
static inline void tuner_init(void)
|
|
|
|
|
{
|
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
#if CONFIG_TUNER == (S1A0903X01 | TEA5767)
|
2007-04-11 23:51:00 +00:00
|
|
|
|
if (HW_MASK & TUNER_MODEL)
|
2007-03-16 14:40:40 +00:00
|
|
|
|
{
|
|
|
|
|
_radio_set = philips_set;
|
|
|
|
|
_radio_get = philips_get;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_radio_set = samsung_set;
|
|
|
|
|
_radio_get = samsung_get;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2004-10-15 21:41:46 +00:00
|
|
|
|
#endif
|
2007-03-16 14:40:40 +00:00
|
|
|
|
}
|
2004-10-15 21:41:46 +00:00
|
|
|
|
|
2007-02-18 08:46:12 +00:00
|
|
|
|
#endif /* #if CONFIG_TUNER */
|
2004-10-15 21:41:46 +00:00
|
|
|
|
|
|
|
|
|
#endif
|