resolve conflicts.

This commit is contained in:
wiz 2000-07-01 01:38:58 +00:00
parent 5457abf9cb
commit d307475c33
9 changed files with 206 additions and 140 deletions

View File

@ -1,28 +0,0 @@
README FOR BT848/BT878 DRIVER
Updated 20th March 2000
Roger Hardiman
roger@cs.strath.ac.uk
roger@freebsd.org
http://www.telepresence.strath.ac.uk/bt848
http://www.freebsd.org/~roger
Introduction
------------
The BKTR driver is a driver for Bt848 and Bt878 based Video Capture
cards and TV Tuner Cards.
The driver was written by Amancio Hasty for FreeBSD but is now
maintained by Roger Hardiman.
The driver has been ported from FreeBSD to NetBSD, OpenBSD and BSD/OS.
There is also a Linux version on an old version.
Please read the README file for your specific Operating System for
more information.
Thanks
Roger
--
Roger Hardiman

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_audio.c,v 1.5 2000/05/21 15:43:56 wiz Exp $ */
/* $NetBSD: bktr_audio.c,v 1.6 2000/07/01 01:39:00 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_audio.c,v 1.2 1999/10/28 13:58:14 roger Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_audio.c,v 1.5 2000/06/26 09:41:31 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)
* and TV Tuner cards using the Brooktree Bt848, Bt848A, Bt849A, Bt878, Bt879

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_card.c,v 1.5 2000/05/21 15:43:57 wiz Exp $ */
/* $NetBSD: bktr_card.c,v 1.6 2000/07/01 01:39:01 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_card.c,v 1.9 2000/02/12 08:49:21 peter Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_card.c,v 1.12 2000/06/28 15:09:12 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)
@ -826,43 +826,56 @@ checkTuner:
/* Hauppauge kindly supplied the following Tuner Table */
/* FIXME: I think the tuners the driver selects for types */
/* 0x08 and 0x15 may be incorrect but no one has complained. */
/* Old Temic tuners had their own API, but newer Temic tuners */
/* have the same API as Philips tuners */
/*
ID Tuner Model Format We select Format
0 NONE
1 EXTERNAL
2 OTHER
3 Philips FI1216 BG
4 Philips FI1216MF BGLL' PHILIPS_SECAM
5 Philips FI1236 MN PHILIPS_NTSC
6 Philips FI1246 I PHILIPS_PALI
7 Philips FI1256 DK
8 Philips FI1216 MK2 BG PHILIPS_PALI
9 Philips FI1216MF MK2 BGLL' PHILIPS_SECAM
a Philips FI1236 MK2 MN PHILIPS_NTSC
b Philips FI1246 MK2 I PHILIPS_PALI
c Philips FI1256 MK2 DK
d Temic 4032FY5 NTSC TEMIC_NTSC
e Temic 4002FH5 BG TEMIC_PAL
f Temic 4062FY5 I TEMIC_PALI
10 Philips FR1216 MK2 BG
11 Philips FR1216MF MK2 BGLL' PHILIPS_FR1236_SECAM
12 Philips FR1236 MK2 MN PHILIPS_FR1236_NTSC
13 Philips FR1246 MK2 I
14 Philips FR1256 MK2 DK
15 Philips FM1216 BG PHILIPS_FR1216_PAL
16 Philips FM1216MF BGLL' PHILIPS_FR1236_SECAM
17 Philips FM1236 MN PHILIPS_FR1236_NTSC
18 Philips FM1246 I
19 Philips FM1256 DK
1a Temic 4036FY5 MN - FI1236 MK2 clone PHILIPS_NTSC
1b Samsung TCPN9082D MN
1c Samsung TCPM9092P Pal BG/I/DK
1d Temic 4006FH5 BG PHILIPS_PALI clone
1e Samsung TCPN9085D MN/Radio
1f Samsung TCPB9085P Pal BG/I/DK / Radio
20 Samsung TCPL9091P Pal BG & Secam L/L'
21 Temic 4039FY5 NTSC Radio
ID Tuner Model Format We select Format
0x00 NONE
0x01 EXTERNAL
0x02 OTHER
0x03 Philips FI1216 BG
0x04 Philips FI1216MF BGLL' PHILIPS_SECAM
0x05 Philips FI1236 MN PHILIPS_NTSC
0x06 Philips FI1246 I PHILIPS_PALI
0x07 Philips FI1256 DK
0x08 Philips FI1216 MK2 BG PHILIPS_PALI
0x09 Philips FI1216MF MK2 BGLL' PHILIPS_SECAM
0x0a Philips FI1236 MK2 MN PHILIPS_NTSC
0x0b Philips FI1246 MK2 I PHILIPS_PALI
0x0c Philips FI1256 MK2 DK
0x0d Temic 4032FY5 NTSC TEMIC_NTSC
0x0e Temic 4002FH5 BG TEMIC_PAL
0x0f Temic 4062FY5 I TEMIC_PALI
0x10 Philips FR1216 MK2 BG
0x11 Philips FR1216MF MK2 BGLL' PHILIPS_FR1236_SECAM
0x12 Philips FR1236 MK2 MN PHILIPS_FR1236_NTSC
0x13 Philips FR1246 MK2 I
0x14 Philips FR1256 MK2 DK
0x15 Philips FM1216 BG PHILIPS_FR1216_PAL
0x16 Philips FM1216MF BGLL' PHILIPS_FR1236_SECAM
0x17 Philips FM1236 MN PHILIPS_FR1236_NTSC
0x18 Philips FM1246 I
0x19 Philips FM1256 DK
0x1a Temic 4036FY5 MN (FI1236 MK2 clone) PHILIPS_NTSC
0x1b Samsung TCPN9082D MN
0x1c Samsung TCPM9092P Pal BG/I/DK
0x1d Temic 4006FH5 BG PHILIPS_PALI
0x1e Samsung TCPN9085D MN/Radio
0x1f Samsung TCPB9085P Pal BG/I/DK / Radio
0x20 Samsung TCPL9091P Pal BG & Secam L/L'
0x21 Temic 4039FY5 NTSC Radio
0x22 Philips FQ1216ME Pal BGIDK & Secam L/L'
0x23 Temic 4066FY5 Pal I (FI1246 MK2 clone) PHILIPS_PALI
0x24 Philips TD1536 MN/ATSCDigital
0x25 Philips TD1536D MN/ATSCDigital DUAL INPUT
0x26 Philips FMR1236 M/N FM(no demod)
0x27 Philips FI1256MP B/G, D/K
0x28 Samsung TCPQ9091P BG/I/DK, L/L'
0x29 Temic 4006FN5 BG/I/DK
0x2a Temic 4009FR5 BG FM
0x2b Temic 4046FM5 B/G, I, D/K, L/L'
0x2c Temic 4009FN5 B/G, I, D/K, FM (no demod)
0x2d Philips TD1536D_FH_44 MN/ATSCDigital DUAL INPUT
*/
@ -914,6 +927,7 @@ checkTuner:
case 0x8:
case 0xb:
case 0x1d:
case 0x23:
select_tuner( bktr, PHILIPS_PALI );
goto checkDBX;

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_card.h,v 1.2 2000/05/07 00:24:33 wiz Exp $ */
/* $NetBSD: bktr_card.h,v 1.3 2000/07/01 01:39:01 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_card.h,v 1.2 1999/09/27 08:04:55 roger Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_card.h,v 1.4 2000/06/26 09:41:31 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_core.c,v 1.7 2000/06/30 08:12:10 veego Exp $ */
/* $NetBSD: bktr_core.c,v 1.8 2000/07/01 01:39:01 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.106 2000/04/16 07:50:08 roger Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.109 2000/06/28 15:09:12 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)
@ -110,9 +110,14 @@
|| (defined(__NetBSD__)) \
)
/*******************/
/* *** FreeBSD *** */
/*******************/
#ifdef __FreeBSD__
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/vnode.h>
@ -161,13 +166,10 @@
#include "iicbus_if.h"
#endif
char *
const char *
bktr_name(bktr_ptr_t bktr)
{
char buf[10];
snprintf(buf, sizeof(buf), "bktr%d", bktr->sc_dev.dv_unit);
return buf;
return bktr->bktr_xname;
}
@ -189,6 +191,21 @@ typedef unsigned int uintptr_t;
/**************************/
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/vnode.h>
#ifdef __NetBSD__
#include <uvm/uvm_extern.h>
#else
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#endif
#include <sys/inttypes.h> /* uintptr_t */
#include <dev/ic/bt8xx.h>
#include <dev/pci/bktr/bktr_reg.h>
@ -200,7 +217,7 @@ typedef unsigned int uintptr_t;
static int bt848_format = -1;
char *
const char *
bktr_name(bktr_ptr_t bktr)
{
return (bktr->bktr_dev.dv_xname);

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_core.h,v 1.2 2000/05/21 15:43:57 wiz Exp $ */
/* $NetBSD: bktr_core.h,v 1.3 2000/07/01 01:39:01 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_core.h,v 1.2 1999/10/28 13:58:16 roger Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_core.h,v 1.4 2000/06/26 09:41:32 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)
@ -71,7 +71,7 @@ void msp_dpl_write( bktr_ptr_t bktr, int i2c_addr, unsigned char dev,
/* device name for printf */
char *bktr_name(bktr_ptr_t bktr);
const char *bktr_name(bktr_ptr_t bktr);
/* Prototypes for attatch and interrupt functions */
void common_bktr_attach( bktr_ptr_t bktr, int unit,

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_os.c,v 1.9 2000/06/30 08:12:11 veego Exp $ */
/* $NetBSD: bktr_os.c,v 1.10 2000/07/01 01:39:02 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.7 2000/04/16 07:50:09 roger Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.10 2000/06/28 15:09:12 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)
@ -60,6 +60,12 @@
#define FIFO_RISC_DISABLED 0
#define ALL_INTS_DISABLED 0
/*******************/
/* *** FreeBSD *** */
/*******************/
#ifdef __FreeBSD__
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@ -108,8 +114,79 @@
#include <machine/clock.h> /* for DELAY */
#include <pci/pcivar.h>
#include <pci/pcireg.h>
#if (NSMBUS > 0)
#include <dev/bktr/bktr_i2c.h>
#endif
#include <sys/sysctl.h>
int bt848_card = -1;
int bt848_tuner = -1;
int bt848_reverse_mute = -1;
int bt848_format = -1;
int bt848_slow_msp_audio = -1;
SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt");
SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, format, CTLFLAG_RW, &bt848_format, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, slow_msp_audio, CTLFLAG_RW, &bt848_slow_msp_audio, -1, "");
#if (__FreeBSD__ == 2)
#define PCIR_REVID PCI_CLASS_REG
#endif
#endif /* end freebsd section */
/****************/
/* *** BSDI *** */
/****************/
#ifdef __bsdi__
#endif /* __bsdi__ */
/**************************/
/* *** OpenBSD/NetBSD *** */
/**************************/
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/select.h>
#include <sys/vnode.h>
#include <vm/vm.h>
#ifndef __NetBSD__
#include <vm/vm_kern.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#endif
#include <sys/device.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
#define BKTR_DEBUG
#ifdef BKTR_DEBUG
int bktr_debug = 0;
#define DPR(x) (bktr_debug ? printf x : 0)
#else
#define DPR(x)
#endif
#endif /* __NetBSD__ || __OpenBSD__ */
#ifdef __NetBSD__
#include <dev/ic/bt8xx.h> /* NetBSD location for .h files */
#include <dev/pci/bktr/bktr_reg.h>
@ -129,56 +206,6 @@
#include <dev/bktr/bktr_os.h>
#endif
#if defined(__FreeBSD__)
#if (NSMBUS > 0)
#include <dev/bktr/bktr_i2c.h>
#endif
#include <sys/sysctl.h>
int bt848_card = -1;
int bt848_tuner = -1;
int bt848_reverse_mute = -1;
int bt848_format = -1;
int bt848_slow_msp_audio = -1;
SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt");
SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, format, CTLFLAG_RW, &bt848_format, -1, "");
SYSCTL_INT(_hw_bt848, OID_AUTO, slow_msp_audio, CTLFLAG_RW, &bt848_slow_msp_audio, -1, "");
#endif
#if (__FreeBSD__ == 2)
#define PCIR_REVID PCI_CLASS_REG
#endif
/****************/
/* *** BSDI *** */
/****************/
#ifdef __bsdi__
#endif /* __bsdi__ */
/**************************/
/* *** OpenBSD/NetBSD *** */
/**************************/
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
#define BKTR_DEBUG
#ifdef BKTR_DEBUG
int bktr_debug = 0;
#define DPR(x) (bktr_debug ? printf x : 0)
#else
#define DPR(x)
#endif
#endif /* __NetBSD__ || __OpenBSD__ */
/****************************/
@ -289,6 +316,9 @@ bktr_attach( device_t dev )
unit = device_get_unit(dev);
/* build the device name for bktr_name() */
snprintf(bktr->bktr_xname, sizeof(bktr->bktr_xname), "bktr%d",unit);
/*
* Enable bus mastering and Memory Mapped device
*/
@ -299,7 +329,7 @@ bktr_attach( device_t dev )
/*
* Map control/status registers.
*/
rid = PCI_MAP_REG_START;
rid = PCIR_MAPS;
bktr->res_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);
@ -434,7 +464,7 @@ bktr_detach( device_t dev )
*/
bus_teardown_intr(dev, bktr->res_irq, bktr->res_ih);
bus_release_resource(dev, SYS_RES_IRQ, 0, bktr->res_irq);
bus_release_resource(dev, SYS_RES_MEMORY, PCI_MAP_REG_START, bktr->res_mem);
bus_release_resource(dev, SYS_RES_MEMORY, PCIR_MAPS, bktr->res_mem);
return 0;
}
@ -851,6 +881,9 @@ bktr_attach( pcici_t tag, int unit )
return;
}
/* build the device name for bktr_name() */
snprintf(bktr->bktr_xname, sizeof(bktr->bktr_xname), "bktr%d",unit);
/* Enable Memory Mapping */
fun = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
pci_conf_write(tag, PCI_COMMAND_STATUS_REG, fun | 2);

View File

@ -1,7 +1,7 @@
/* $NetBSD: bktr_reg.h,v 1.4 2000/05/07 14:59:23 veego Exp $ */
/* $NetBSD: bktr_reg.h,v 1.5 2000/07/01 01:39:02 wiz Exp $ */
/*
* FreeBSD: src/sys/dev/bktr/bktr_reg.h,v 1.36 1999/10/28 13:58:17 roger Exp
* FreeBSD: src/sys/dev/bktr/bktr_reg.h,v 1.38 2000/06/26 09:41:32 roger Exp
*
* Copyright (c) 1999 Roger Hardiman
* Copyright (c) 1998 Amancio Hasty
@ -58,6 +58,35 @@
# endif
#endif
/*
* The kernel options for the driver now all begin with BKTR.
* Support the older kernel options on FreeBSD and OpenBSD.
*
*/
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(BROOKTREE_SYSTEM_DEFAULT)
#define BKTR_SYSTEM_DEFAULT BROOKTREE_SYSTEM_DEFAULT
#endif
#if defined(OVERRIDE_CARD)
#define BKTR_OVERRIDE_CARD OVERRIDE_CARD
#endif
#if defined(OVERRIDE_TUNER)
#define BKTR_OVERRIDE_TUNER OVERRIDE_TUNER
#endif
#if defined(OVERRIDE_DBX)
#define BKTR_OVERRIDE_DBX OVERRIDE_DBX
#endif
#if defined(OVERRIDE_MSP)
#define BKTR_OVERRIDE_MSP OVERRIDE_MSP
#endif
#endif
#ifndef PCI_LATENCY_TIMER
#define PCI_LATENCY_TIMER 0x0c /* pci timer register */
#endif
@ -512,6 +541,7 @@ struct bktr_softc {
#if (NSMBUS > 0)
struct bktr_i2c_softc i2c_sc; /* bt848_i2c device */
#endif
char bktr_xname[7]; /* device name and unit number */
#endif
/* the following definitions are common over all platforms */

View File

@ -1,6 +1,6 @@
/* $NetBSD: bktr_tuner.c,v 1.4 2000/06/25 17:47:39 wiz Exp $ */
/* $NetBSD: bktr_tuner.c,v 1.5 2000/07/01 01:39:02 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_tuner.c,v 1.5 2000/01/24 14:00:21 roger Exp */
/* FreeBSD: src/sys/dev/bktr/bktr_tuner.c,v 1.7 2000/06/26 09:41:32 roger Exp */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)