1/* $FreeBSD: releng/10.3/sys/dev/bktr/bktr_tuner.h 152375 2005-11-13 13:26:37Z netchild $ */ 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 TUNER_MT2032 14 63#define LG_TPI8PSB12P_PAL 15 64#define Bt848_MAX_TUNER 16 65 66/* experimental code for Automatic Frequency Control */ 67#define TUNER_AFC 68 69/* 70 * Fill in the tuner entries in the bktr_softc based on the selected tuner 71 * type (from the list of tuners above) 72 */ 73void select_tuner( bktr_ptr_t bktr, int tuner_type ); 74 75/* 76 * The Channel Set maps TV channels eg Ch 36, Ch 51, onto frequencies 77 * and is country specific. 78 */ 79int tuner_getchnlset( struct bktr_chnlset *chnlset ); 80 81/* 82 * tv_channel sets the tuner to channel 'n' using the current Channel Set 83 * tv_freq sets the tuner to a specific frequency for TV or for FM Radio 84 * get_tuner_status can be used to get the signal strength. 85 */ 86#define TV_FREQUENCY 0 87#define FM_RADIO_FREQUENCY 1 88int tv_channel( bktr_ptr_t bktr, int channel ); 89int tv_freq( bktr_ptr_t bktr, int frequency, int type ); 90int get_tuner_status( bktr_ptr_t bktr ); 91 92#if defined( TUNER_AFC ) 93int do_afc( bktr_ptr_t bktr, int addr, int frequency ); 94#endif /* TUNER_AFC */ 95 96int mt2032_init(bktr_ptr_t bktr); 97 98/* 99 * This is for start-up convenience only, NOT mandatory. 100 */ 101#if !defined( DEFAULT_CHNLSET ) 102#define DEFAULT_CHNLSET CHNLSET_WEUROPE 103#endif 104 105