Home | History | Annotate | Line # | Download | only in bktr
      1  1.2  wiz /* $SourceForge: bktr_tuner.h,v 1.3 2003/03/11 23:11:28 thomasklausner Exp $ */
      2  1.1  wiz 
      3  1.2  wiz /*	$NetBSD: bktr_tuner.h,v 1.2 2003/03/12 00:14:41 wiz Exp $	*/
      4  1.2  wiz /* $FreeBSD: src/sys/dev/bktr/bktr_tuner.h,v 1.1 1999/09/26 22:06:20 roger Exp$ */
      5  1.1  wiz 
      6  1.1  wiz /*
      7  1.1  wiz  * This is part of the Driver for Video Capture Cards (Frame grabbers)
      8  1.1  wiz  * and TV Tuner cards using the Brooktree Bt848, Bt848A, Bt849A, Bt878, Bt879
      9  1.1  wiz  * chipset.
     10  1.1  wiz  * Copyright Roger Hardiman and Amancio Hasty.
     11  1.2  wiz  *
     12  1.1  wiz  * bktr_tuner : This deals with controlling the tuner fitted to TV cards.
     13  1.1  wiz  *
     14  1.1  wiz  */
     15  1.1  wiz 
     16  1.1  wiz /*
     17  1.1  wiz  * 1. Redistributions of source code must retain the
     18  1.1  wiz  * Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
     19  1.1  wiz  * All rights reserved.
     20  1.1  wiz  *
     21  1.1  wiz  * Redistribution and use in source and binary forms, with or without
     22  1.1  wiz  * modification, are permitted provided that the following conditions
     23  1.1  wiz  * are met:
     24  1.1  wiz  * 1. Redistributions of source code must retain the above copyright
     25  1.1  wiz  *    notice, this list of conditions and the following disclaimer.
     26  1.1  wiz  * 2. Redistributions in binary form must reproduce the above copyright
     27  1.1  wiz  *    notice, this list of conditions and the following disclaimer in the
     28  1.1  wiz  *    documentation and/or other materials provided with the distribution.
     29  1.1  wiz  * 3. All advertising materials mentioning features or use of this software
     30  1.1  wiz  *    must display the following acknowledgement:
     31  1.1  wiz  *      This product includes software developed by Amancio Hasty and
     32  1.1  wiz  *      Roger Hardiman
     33  1.1  wiz  * 4. The name of the author may not be used to endorse or promote products
     34  1.1  wiz  *    derived from this software without specific prior written permission.
     35  1.1  wiz  *
     36  1.1  wiz  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     37  1.1  wiz  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     38  1.1  wiz  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     39  1.1  wiz  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     40  1.1  wiz  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     41  1.1  wiz  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     42  1.1  wiz  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     43  1.1  wiz  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     44  1.1  wiz  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     45  1.1  wiz  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     46  1.1  wiz  * POSSIBILITY OF SUCH DAMAGE.
     47  1.1  wiz  */
     48  1.1  wiz 
     49  1.1  wiz /* Definitions for Tuners */
     50  1.1  wiz 
     51  1.1  wiz #define NO_TUNER                0
     52  1.1  wiz #define TEMIC_NTSC              1
     53  1.1  wiz #define TEMIC_PAL               2
     54  1.1  wiz #define TEMIC_SECAM             3
     55  1.1  wiz #define PHILIPS_NTSC            4
     56  1.1  wiz #define PHILIPS_PAL             5
     57  1.1  wiz #define PHILIPS_SECAM           6
     58  1.1  wiz #define TEMIC_PALI              7
     59  1.1  wiz #define PHILIPS_PALI            8
     60  1.1  wiz #define PHILIPS_FR1236_NTSC     9    /* These have FM radio support */
     61  1.1  wiz #define PHILIPS_FR1216_PAL      10   /* These have FM radio support */
     62  1.1  wiz #define PHILIPS_FR1236_SECAM    11   /* These have FM radio support */
     63  1.1  wiz #define ALPS_TSCH5              12
     64  1.1  wiz #define ALPS_TSBH1              13
     65  1.1  wiz #define Bt848_MAX_TUNER         14
     66  1.1  wiz 
     67  1.2  wiz /* experimental code for Automatic Frequency Control */
     68  1.1  wiz #define TUNER_AFC
     69  1.1  wiz 
     70  1.1  wiz /*
     71  1.1  wiz  * Fill in the tuner entries in the bktr_softc based on the selected tuner
     72  1.1  wiz  * type (from the list of tuners above)
     73  1.1  wiz  */
     74  1.2  wiz void	select_tuner(bktr_ptr_t bktr, int tuner_type);
     75  1.1  wiz 
     76  1.1  wiz 
     77  1.1  wiz /*
     78  1.1  wiz  * The Channel Set maps TV channels eg Ch 36, Ch 51, onto frequencies
     79  1.1  wiz  * and is country specific.
     80  1.1  wiz  */
     81  1.2  wiz int	tuner_getchnlset(struct bktr_chnlset *chnlset);
     82  1.1  wiz 
     83  1.1  wiz /*
     84  1.1  wiz  * tv_channel sets the tuner to channel 'n' using the current Channel Set
     85  1.1  wiz  * tv_freq sets the tuner to a specific frequency for TV or for FM Radio
     86  1.1  wiz  * get_tuner_status can be used to get the signal strength.
     87  1.1  wiz  */
     88  1.1  wiz #define TV_FREQUENCY       0
     89  1.1  wiz #define FM_RADIO_FREQUENCY 1
     90  1.2  wiz int	tv_channel(bktr_ptr_t bktr, int channel);
     91  1.2  wiz int	tv_freq(bktr_ptr_t bktr, int frequency, int type);
     92  1.2  wiz int	get_tuner_status(bktr_ptr_t bktr);
     93  1.1  wiz 
     94  1.2  wiz #if defined(TUNER_AFC)
     95  1.2  wiz int	do_afc(bktr_ptr_t bktr, int addr, int frequency);
     96  1.1  wiz #endif /* TUNER_AFC */
     97  1.1  wiz 
     98  1.1  wiz 
     99  1.2  wiz /*
    100  1.1  wiz  * This is for start-up convenience only, NOT mandatory.
    101  1.1  wiz  */
    102  1.2  wiz #if !defined(DEFAULT_CHNLSET)
    103  1.1  wiz #define DEFAULT_CHNLSET CHNLSET_WEUROPE
    104  1.1  wiz #endif
    105  1.1  wiz 
    106  1.1  wiz 
    107