151694Sroger/* $FreeBSD$ */
251694Sroger
351694Sroger/*
451694Sroger * This is part of the Driver for Video Capture Cards (Frame grabbers)
551694Sroger * and TV Tuner cards using the Brooktree Bt848, Bt848A, Bt849A, Bt878, Bt879
651694Sroger * chipset.
751694Sroger * Copyright Roger Hardiman and Amancio Hasty.
851694Sroger *
951694Sroger * bktr_card : This deals with identifying TV cards.
1051694Sroger *               trying to find the card make and model of card.
1151694Sroger *               trying to find the type of tuner fitted.
1251694Sroger *               reading the configuration EEPROM.
1351694Sroger *               locating i2c devices.
1451694Sroger *
1551694Sroger */
1651694Sroger
17139749Simp/*-
1851694Sroger * 1. Redistributions of source code must retain the
1951694Sroger * Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
2051694Sroger * All rights reserved.
2151694Sroger *
2251694Sroger * Redistribution and use in source and binary forms, with or without
2351694Sroger * modification, are permitted provided that the following conditions
2451694Sroger * are met:
2551694Sroger * 1. Redistributions of source code must retain the above copyright
2651694Sroger *    notice, this list of conditions and the following disclaimer.
2751694Sroger * 2. Redistributions in binary form must reproduce the above copyright
2851694Sroger *    notice, this list of conditions and the following disclaimer in the
2951694Sroger *    documentation and/or other materials provided with the distribution.
3051694Sroger * 3. All advertising materials mentioning features or use of this software
3151694Sroger *    must display the following acknowledgement:
3251694Sroger *      This product includes software developed by Amancio Hasty and
3351694Sroger *      Roger Hardiman
3451694Sroger * 4. The name of the author may not be used to endorse or promote products
3551694Sroger *    derived from this software without specific prior written permission.
3651694Sroger *
3751694Sroger * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
3851694Sroger * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
3951694Sroger * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
4051694Sroger * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
4151694Sroger * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
4251694Sroger * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
4351694Sroger * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4451694Sroger * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
4551694Sroger * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
4651694Sroger * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4751694Sroger * POSSIBILITY OF SUCH DAMAGE.
4851694Sroger */
4951694Sroger
5051694Sroger/*
5151694Sroger * If probeCard() fails to detect the correct card on boot you can
5251694Sroger * override it by setting adding the following option to your kernel config
5362112Sroger *  options BKTR_OVERRIDE_CARD  <card type>
5462112Sroger *  eg options BKTR_OVERRIDE CARD=1
5551694Sroger *
5651694Sroger * or using the sysclt  hw.bt848.card
5796398Sdd *  eg sysctl hw.bt848.card=1
5851694Sroger *
5951694Sroger * where <card type> is one of the following card defines.
6051694Sroger */
6151694Sroger
6251725Sroger#define CARD_UNKNOWN		0
6351725Sroger#define CARD_MIRO		1
6451725Sroger#define CARD_HAUPPAUGE		2
6551725Sroger#define CARD_STB		3
6651725Sroger#define CARD_INTEL		4   /* Also for VideoLogic Captivator PCI */
6751725Sroger#define CARD_IMS_TURBO		5
6851725Sroger#define CARD_AVER_MEDIA		6
6951725Sroger#define CARD_OSPREY		7
7051725Sroger#define CARD_NEC_PK		8
71110237Sorion#define CARD_IO_BCTV2		9
7251725Sroger#define CARD_FLYVIDEO		10
7351725Sroger#define CARD_ZOLTRIX		11
7451725Sroger#define CARD_KISS		12
7551725Sroger#define CARD_VIDEO_HIGHWAY_XTREME	13
7651725Sroger#define CARD_ASKEY_DYNALINK_MAGIC_TVIEW	14
7751725Sroger#define CARD_LEADTEK		15
7859014Sroger#define CARD_TERRATVPLUS	16
79133300Ssanpei#define	CARD_IO_BCTV3		17
80133300Ssanpei#define	CARD_AOPEN_VA1000	18
81138936Sjulian#define CARD_PINNACLE_PCTV_RAVE	19
82139563Sjulian#define CARD_PIXELVIEW_PLAYTV_PAK	20
83152375Snetchild#define CARD_TERRATVALUE	21
84152375Snetchild#define	CARD_PIXELVIEW_PLAYTV_PRO_REV_4C	22
85152375Snetchild#define Bt848_MAX_CARD		23
86152375Snetchild
87110237Sorion#define CARD_IO_GV		CARD_IO_BCTV2
8851694Sroger
8951694Srogerint	signCard( bktr_ptr_t bktr, int offset, int count, u_char* sig );
9051694Srogervoid	probeCard( bktr_ptr_t bktr, int verbose, int unit);
9151694Sroger
9251694Srogerint	writeEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data );
9351694Srogerint	readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data );
9451694Sroger
95