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