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