Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified by bktr2netbsd, to be committed later.
This commit is contained in:
parent
26f708a5a3
commit
8b27ce1a70
|
@ -0,0 +1,28 @@
|
|||
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
|
|
@ -0,0 +1,573 @@
|
|||
/* $NetBSD: bktr_audio.c,v 1.1.1.1 2000/05/07 00:16:17 wiz Exp $ */
|
||||
|
||||
/* FreeBSD: src/sys/dev/bktr/bktr_audio.c,v 1.2 1999/10/28 13:58:14 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
|
||||
* chipset.
|
||||
* Copyright Roger Hardiman and Amancio Hasty.
|
||||
*
|
||||
* bktr_audio : This deals with controlling the audio on TV cards,
|
||||
* controlling the Audio Multiplexer (audio source selector).
|
||||
* controlling any MSP34xx stereo audio decoders.
|
||||
* controlling any DPL35xx dolby surroud sound audio decoders.
|
||||
* initialising TDA98xx audio devices.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. Redistributions of source code must retain the
|
||||
* Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Amancio Hasty and
|
||||
* Roger Hardiman
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/vnode.h>
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/proc.h>
|
||||
static int bootverbose = 1;
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <machine/clock.h> /* for DELAY */
|
||||
#include <pci/pcivar.h>
|
||||
#endif
|
||||
|
||||
#if (__FreeBSD_version >=300000)
|
||||
#include <machine/bus_memio.h> /* for bus space */
|
||||
#include <machine/bus.h>
|
||||
#include <sys/bus.h>
|
||||
#endif
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#include <dev/ic/ioctl_meteor.h> /* NetBSD location of .h files */
|
||||
#include <dev/ic/ioctl_bt848.h>
|
||||
#else
|
||||
#include <machine/ioctl_meteor.h> /* Traditional location of .h files */
|
||||
#include <machine/ioctl_bt848.h> /* extensions to ioctl_meteor.h */
|
||||
#endif
|
||||
#include <dev/bktr/bktr_reg.h>
|
||||
#include <dev/bktr/bktr_core.h>
|
||||
#include <dev/bktr/bktr_tuner.h>
|
||||
#include <dev/bktr/bktr_card.h>
|
||||
#include <dev/bktr/bktr_audio.h>
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes for the GV_BCTV specific functions.
|
||||
*/
|
||||
void set_bctv_audio( bktr_ptr_t bktr );
|
||||
void bctv_gpio_write( bktr_ptr_t bktr, int port, int val );
|
||||
/*int bctv_gpio_read( bktr_ptr_t bktr, int port );*/ /* Not used */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* init_audio_devices
|
||||
* Reset any MSP34xx or TDA98xx audio devices.
|
||||
*/
|
||||
void init_audio_devices( bktr_ptr_t bktr ) {
|
||||
|
||||
/* enable stereo if appropriate on TDA audio chip */
|
||||
if ( bktr->card.dbx )
|
||||
init_BTSC( bktr );
|
||||
|
||||
/* reset the MSP34xx stereo audio chip */
|
||||
if ( bktr->card.msp3400c )
|
||||
msp_dpl_reset( bktr, bktr->msp_addr );
|
||||
|
||||
/* reset the DPL35xx dolby audio chip */
|
||||
if ( bktr->card.dpl3518a )
|
||||
msp_dpl_reset( bktr, bktr->dpl_addr );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
#define AUDIOMUX_DISCOVER_NOT
|
||||
int
|
||||
set_audio( bktr_ptr_t bktr, int cmd )
|
||||
{
|
||||
u_long temp;
|
||||
volatile u_char idx;
|
||||
|
||||
#if defined( AUDIOMUX_DISCOVER )
|
||||
if ( cmd >= 200 )
|
||||
cmd -= 200;
|
||||
else
|
||||
#endif /* AUDIOMUX_DISCOVER */
|
||||
|
||||
/* check for existance of audio MUXes */
|
||||
if ( !bktr->card.audiomuxs[ 4 ] )
|
||||
return( -1 );
|
||||
|
||||
switch (cmd) {
|
||||
case AUDIO_TUNER:
|
||||
#ifdef BKTR_REVERSEMUTE
|
||||
bktr->audio_mux_select = 3;
|
||||
#else
|
||||
bktr->audio_mux_select = 0;
|
||||
#endif
|
||||
|
||||
if (bktr->reverse_mute )
|
||||
bktr->audio_mux_select = 0;
|
||||
else
|
||||
bktr->audio_mux_select = 3;
|
||||
|
||||
break;
|
||||
case AUDIO_EXTERN:
|
||||
bktr->audio_mux_select = 1;
|
||||
break;
|
||||
case AUDIO_INTERN:
|
||||
bktr->audio_mux_select = 2;
|
||||
break;
|
||||
case AUDIO_MUTE:
|
||||
bktr->audio_mute_state = TRUE; /* set mute */
|
||||
break;
|
||||
case AUDIO_UNMUTE:
|
||||
bktr->audio_mute_state = FALSE; /* clear mute */
|
||||
break;
|
||||
default:
|
||||
printf("bktr: audio cmd error %02x\n", cmd);
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
|
||||
/* Most cards have a simple audio multiplexer to select the
|
||||
* audio source. The I/O_GV card has a more advanced multiplexer
|
||||
* and requires special handling.
|
||||
*/
|
||||
if ( bktr->bt848_card == CARD_IO_GV ) {
|
||||
set_bctv_audio( bktr );
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Proceed with the simpler audio multiplexer code for the majority
|
||||
* of Bt848 cards.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Leave the upper bits of the GPIO port alone in case they control
|
||||
* something like the dbx or teletext chips. This doesn't guarantee
|
||||
* success, but follows the rule of least astonishment.
|
||||
*/
|
||||
|
||||
if ( bktr->audio_mute_state == TRUE ) {
|
||||
#ifdef BKTR_REVERSEMUTE
|
||||
idx = 0;
|
||||
#else
|
||||
idx = 3;
|
||||
#endif
|
||||
|
||||
if (bktr->reverse_mute )
|
||||
idx = 3;
|
||||
else
|
||||
idx = 0;
|
||||
|
||||
}
|
||||
else
|
||||
idx = bktr->audio_mux_select;
|
||||
|
||||
temp = INL(bktr, BKTR_GPIO_DATA) & ~bktr->card.gpio_mux_bits;
|
||||
#if defined( AUDIOMUX_DISCOVER )
|
||||
OUTL(bktr, BKTR_GPIO_DATA, temp | (cmd & 0xff));
|
||||
printf("cmd: %d audio mux %x temp %x \n", cmd,bktr->card.audiomuxs[ idx ], temp );
|
||||
#else
|
||||
OUTL(bktr, BKTR_GPIO_DATA, temp | bktr->card.audiomuxs[ idx ]);
|
||||
#endif /* AUDIOMUX_DISCOVER */
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void
|
||||
temp_mute( bktr_ptr_t bktr, int flag )
|
||||
{
|
||||
static int muteState = FALSE;
|
||||
|
||||
if ( flag == TRUE ) {
|
||||
muteState = bktr->audio_mute_state;
|
||||
set_audio( bktr, AUDIO_MUTE ); /* prevent 'click' */
|
||||
}
|
||||
else {
|
||||
tsleep( BKTR_SLEEP, PZERO, "tuning", hz/8 );
|
||||
if ( muteState == FALSE )
|
||||
set_audio( bktr, AUDIO_UNMUTE );
|
||||
}
|
||||
}
|
||||
|
||||
/* address of BTSC/SAP decoder chip */
|
||||
#define TDA9850_WADDR 0xb6
|
||||
#define TDA9850_RADDR 0xb7
|
||||
|
||||
|
||||
/* registers in the TDA9850 BTSC/dbx chip */
|
||||
#define CON1ADDR 0x04
|
||||
#define CON2ADDR 0x05
|
||||
#define CON3ADDR 0x06
|
||||
#define CON4ADDR 0x07
|
||||
#define ALI1ADDR 0x08
|
||||
#define ALI2ADDR 0x09
|
||||
#define ALI3ADDR 0x0a
|
||||
|
||||
/*
|
||||
* initialise the dbx chip
|
||||
* taken from the Linux bttv driver TDA9850 initialisation code
|
||||
*/
|
||||
void
|
||||
init_BTSC( bktr_ptr_t bktr )
|
||||
{
|
||||
i2cWrite(bktr, TDA9850_WADDR, CON1ADDR, 0x08); /* noise threshold st */
|
||||
i2cWrite(bktr, TDA9850_WADDR, CON2ADDR, 0x08); /* noise threshold sap */
|
||||
i2cWrite(bktr, TDA9850_WADDR, CON3ADDR, 0x40); /* stereo mode */
|
||||
i2cWrite(bktr, TDA9850_WADDR, CON4ADDR, 0x07); /* 0 dB input gain? */
|
||||
i2cWrite(bktr, TDA9850_WADDR, ALI1ADDR, 0x10); /* wideband alignment? */
|
||||
i2cWrite(bktr, TDA9850_WADDR, ALI2ADDR, 0x10); /* spectral alignment? */
|
||||
i2cWrite(bktr, TDA9850_WADDR, ALI3ADDR, 0x03);
|
||||
}
|
||||
|
||||
/*
|
||||
* setup the dbx chip
|
||||
* XXX FIXME: alot of work to be done here, this merely unmutes it.
|
||||
*/
|
||||
int
|
||||
set_BTSC( bktr_ptr_t bktr, int control )
|
||||
{
|
||||
return( i2cWrite( bktr, TDA9850_WADDR, CON3ADDR, control ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* CARD_GV_BCTV specific functions.
|
||||
*/
|
||||
|
||||
#define BCTV_AUDIO_MAIN 0x10 /* main audio program */
|
||||
#define BCTV_AUDIO_SUB 0x20 /* sub audio program */
|
||||
#define BCTV_AUDIO_BOTH 0x30 /* main(L) + sub(R) program */
|
||||
|
||||
#define BCTV_GPIO_REG0 1
|
||||
#define BCTV_GPIO_REG1 3
|
||||
|
||||
#define BCTV_GR0_AUDIO_MODE 3
|
||||
#define BCTV_GR0_AUDIO_MAIN 0 /* main program */
|
||||
#define BCTV_GR0_AUDIO_SUB 3 /* sub program */
|
||||
#define BCTV_GR0_AUDIO_BOTH 1 /* main(L) + sub(R) */
|
||||
#define BCTV_GR0_AUDIO_MUTE 4 /* audio mute */
|
||||
#define BCTV_GR0_AUDIO_MONO 8 /* force mono */
|
||||
|
||||
void
|
||||
set_bctv_audio( bktr_ptr_t bktr )
|
||||
{
|
||||
int data;
|
||||
|
||||
switch (bktr->audio_mux_select) {
|
||||
case 1: /* external */
|
||||
case 2: /* internal */
|
||||
bctv_gpio_write(bktr, BCTV_GPIO_REG1, 0);
|
||||
break;
|
||||
default: /* tuner */
|
||||
bctv_gpio_write(bktr, BCTV_GPIO_REG1, 1);
|
||||
break;
|
||||
}
|
||||
/* switch (bktr->audio_sap_select) { */
|
||||
switch (BCTV_AUDIO_BOTH) {
|
||||
case BCTV_AUDIO_SUB:
|
||||
data = BCTV_GR0_AUDIO_SUB;
|
||||
break;
|
||||
case BCTV_AUDIO_BOTH:
|
||||
data = BCTV_GR0_AUDIO_BOTH;
|
||||
break;
|
||||
case BCTV_AUDIO_MAIN:
|
||||
default:
|
||||
data = BCTV_GR0_AUDIO_MAIN;
|
||||
break;
|
||||
}
|
||||
if (bktr->audio_mute_state == TRUE)
|
||||
data |= BCTV_GR0_AUDIO_MUTE;
|
||||
|
||||
bctv_gpio_write(bktr, BCTV_GPIO_REG0, data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* gpio_data bit assignment */
|
||||
#define BCTV_GPIO_ADDR_MASK 0x000300
|
||||
#define BCTV_GPIO_WE 0x000400
|
||||
#define BCTV_GPIO_OE 0x000800
|
||||
#define BCTV_GPIO_VAL_MASK 0x00f000
|
||||
|
||||
#define BCTV_GPIO_PORT_MASK 3
|
||||
#define BCTV_GPIO_ADDR_SHIFT 8
|
||||
#define BCTV_GPIO_VAL_SHIFT 12
|
||||
|
||||
/* gpio_out_en value for read/write */
|
||||
#define BCTV_GPIO_OUT_RMASK 0x000f00
|
||||
#define BCTV_GPIO_OUT_WMASK 0x00ff00
|
||||
|
||||
#define BCTV_BITS 100
|
||||
|
||||
void
|
||||
bctv_gpio_write( bktr_ptr_t bktr, int port, int val )
|
||||
{
|
||||
u_long data, outbits;
|
||||
|
||||
port &= BCTV_GPIO_PORT_MASK;
|
||||
switch (port) {
|
||||
case 1:
|
||||
case 3:
|
||||
data = ((val << BCTV_GPIO_VAL_SHIFT) & BCTV_GPIO_VAL_MASK) |
|
||||
((port << BCTV_GPIO_ADDR_SHIFT) & BCTV_GPIO_ADDR_MASK) |
|
||||
BCTV_GPIO_WE | BCTV_GPIO_OE;
|
||||
outbits = BCTV_GPIO_OUT_WMASK;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
OUTL(bktr, BKTR_GPIO_OUT_EN, 0);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, data);
|
||||
OUTL(bktr, BKTR_GPIO_OUT_EN, outbits);
|
||||
DELAY(BCTV_BITS);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, data & ~BCTV_GPIO_WE);
|
||||
DELAY(BCTV_BITS);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, data);
|
||||
DELAY(BCTV_BITS);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, ~0);
|
||||
OUTL(bktr, BKTR_GPIO_OUT_EN, 0);
|
||||
}
|
||||
|
||||
/* Not yet used
|
||||
int
|
||||
bctv_gpio_read( bktr_ptr_t bktr, int port )
|
||||
{
|
||||
u_long data, outbits, ret;
|
||||
|
||||
port &= BCTV_GPIO_PORT_MASK;
|
||||
switch (port) {
|
||||
case 1:
|
||||
case 3:
|
||||
data = ((port << BCTV_GPIO_ADDR_SHIFT) & BCTV_GPIO_ADDR_MASK) |
|
||||
BCTV_GPIO_WE | BCTV_GPIO_OE;
|
||||
outbits = BCTV_GPIO_OUT_RMASK;
|
||||
break;
|
||||
default:
|
||||
return( -1 );
|
||||
}
|
||||
OUTL(bktr, BKTR_GPIO_OUT_EN, 0);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, data);
|
||||
OUTL(bktr, BKTR_GPIO_OUT_EN, outbits);
|
||||
DELAY(BCTV_BITS);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, data & ~BCTV_GPIO_OE);
|
||||
DELAY(BCTV_BITS);
|
||||
ret = INL(bktr, BKTR_GPIO_DATA);
|
||||
DELAY(BCTV_BITS);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, data);
|
||||
DELAY(BCTV_BITS);
|
||||
OUTL(bktr, BKTR_GPIO_DATA, ~0);
|
||||
OUTL(bktr, BKTR_GPIO_OUT_EN, 0);
|
||||
return( (ret & BCTV_GPIO_VAL_MASK) >> BCTV_GPIO_VAL_SHIFT );
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* setup the MSP34xx Stereo Audio Chip
|
||||
* This uses the Auto Configuration Option on MSP3410D and MSP3415D chips
|
||||
* and DBX mode selection for MSP3430G chips.
|
||||
* For MSP3400C support, the full programming sequence is required and is
|
||||
* not yet supported.
|
||||
*/
|
||||
|
||||
/* Read the MSP version string */
|
||||
void msp_read_id( bktr_ptr_t bktr ){
|
||||
int rev1=0, rev2=0;
|
||||
rev1 = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x001e);
|
||||
rev2 = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x001f);
|
||||
|
||||
sprintf(bktr->msp_version_string, "34%02d%c-%c%d",
|
||||
(rev2>>8)&0xff, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Configure the MSP chip to Auto-detect the audio format.
|
||||
* For the MSP3430G, we use fast autodetect mode
|
||||
* For the MSP3410/3415 there are two schemes for this
|
||||
* a) Fast autodetection - the chip is put into autodetect mode, and the function
|
||||
* returns immediatly. This works in most cases and is the Default Mode.
|
||||
* b) Slow mode. The function sets the MSP3410/3415 chip, then waits for feedback from
|
||||
* the chip and re-programs it if needed.
|
||||
*/
|
||||
void msp_autodetect( bktr_ptr_t bktr ) {
|
||||
int auto_detect, loops;
|
||||
int stereo;
|
||||
|
||||
/* MSP3430G - countries with mono and DBX stereo */
|
||||
if (strncmp("3430G", bktr->msp_version_string, 5) == 0){
|
||||
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0030,0x2003);/* Enable Auto format detection */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0020,0x0020);/* Standard Select Reg. = BTSC-Stereo*/
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000E,0x2403);/* darned if I know */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0320);/* Source select = (St or A) */
|
||||
/* & Ch. Matrix = St */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0000,0x7300);/* Set volume to 0db gain */
|
||||
}
|
||||
|
||||
|
||||
/* MSP3410/MSP3415 - countries with mono, stereo using 2 FM channels and NICAM */
|
||||
/* FAST sound scheme */
|
||||
if ( (strncmp("3430G", bktr->msp_version_string, 5) != 0)
|
||||
&& (bktr->slow_msp_audio == 0) ){
|
||||
if(bootverbose)printf("inside fast MSP autodetect code\n");
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0000,0x7300);/* Set volume to 0db gain */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0020,0x0001);/* Enable Auto format detection */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0021,0x0001);/* Auto selection of NICAM/MONO mode */
|
||||
}
|
||||
|
||||
|
||||
/* MSP3410/MSP3415 - European Countries where the fast MSP3410/3415 programming fails */
|
||||
/* SLOW sound scheme */
|
||||
if ( (strncmp("3430G", bktr->msp_version_string, 5) != 0)
|
||||
&& (bktr->slow_msp_audio == 1) ){
|
||||
if (bootverbose)printf("inside slow MSP autodetect code\n");
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0000,0x7300);/* Set volume to 0db gain */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0020,0x0001);/* Enable Auto format detection */
|
||||
|
||||
/* wait for 0.5s max for terrestrial sound autodetection */
|
||||
loops = 10;
|
||||
do {
|
||||
DELAY(100000);
|
||||
auto_detect = msp_dpl_read(bktr, bktr->msp_addr, 0x10, 0x007e);
|
||||
loops++;
|
||||
} while (auto_detect > 0xff && loops < 50);
|
||||
if (bootverbose)printf ("Result of autodetect after %dms: %d\n", loops*10, auto_detect);
|
||||
|
||||
/* Now set the audio baseband processing */
|
||||
switch (auto_detect) {
|
||||
case 0: /* no TV sound standard detected */
|
||||
break;
|
||||
case 2: /* M Dual FM */
|
||||
break;
|
||||
case 3: /* B/G Dual FM; German stereo */
|
||||
/* Read the stereo detection value from DSP reg 0x0018 */
|
||||
DELAY(20000);
|
||||
stereo = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x0018);
|
||||
if (bootverbose)printf ("Stereo reg 0x18 a: %d\n", stereo);
|
||||
DELAY(20000);
|
||||
stereo = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x0018);
|
||||
if (bootverbose)printf ("Stereo reg 0x18 b: %d\n", stereo);
|
||||
DELAY(20000);
|
||||
stereo = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x0018);
|
||||
if (bootverbose)printf ("Stereo reg 0x18 c: %d\n", stereo);
|
||||
if (stereo > 0x0100 && stereo < 0x8000) { /* Seems to be stereo */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0020);/* Loudspeaker set stereo*/
|
||||
/*
|
||||
set spatial effect strength to 50% enlargement
|
||||
set spatial effect mode b, stereo basewidth enlargment only
|
||||
*/
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x3f28);
|
||||
} else if (stereo > 0x8000) { /* bilingual mode */
|
||||
if (bootverbose) printf ("Bilingual mode detected\n");
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0000);/* Loudspeaker */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x0000);/* all spatial effects off */
|
||||
} else { /* must be mono */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0030);/* Loudspeaker */
|
||||
/*
|
||||
set spatial effect strength to 50% enlargement
|
||||
set spatial effect mode a, stereo basewidth enlargment
|
||||
and pseudo stereo effect with automatic high-pass filter
|
||||
*/
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x3f08);
|
||||
}
|
||||
#if 0
|
||||
/* The reset value for Channel matrix mode is FM/AM and SOUNDA/LEFT */
|
||||
/* We would like STEREO instead val: 0x0020 */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0020);/* Loudspeaker */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0009,0x0020);/* Headphone */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000a,0x0020);/* SCART1 */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0041,0x0020);/* SCART2 */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000b,0x0020);/* I2S */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000c,0x0020);/* Quasi-Peak Detector Source */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x000e,0x0001);
|
||||
#endif
|
||||
break;
|
||||
case 8: /* B/G FM NICAM */
|
||||
msp_dpl_write(bktr, bktr->msp_addr, 0x10, 0x0021,0x0001);/* Auto selection of NICAM/MONO mode */
|
||||
break;
|
||||
case 9: /* L_AM NICAM or D/K*/
|
||||
case 10: /* i-FM NICAM */
|
||||
break;
|
||||
default:
|
||||
if (bootverbose) printf ("Unkown autodetection result value: %d\n", auto_detect);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* uncomment the following line to enable the MSP34xx 1Khz Tone Generator */
|
||||
/* turn your speaker volume down low before trying this */
|
||||
/* msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0014, 0x7f40); */
|
||||
}
|
||||
|
||||
/* Read the DPL version string */
|
||||
void dpl_read_id( bktr_ptr_t bktr ){
|
||||
int rev1=0, rev2=0;
|
||||
rev1 = msp_dpl_read(bktr, bktr->dpl_addr, 0x12, 0x001e);
|
||||
rev2 = msp_dpl_read(bktr, bktr->dpl_addr, 0x12, 0x001f);
|
||||
|
||||
sprintf(bktr->dpl_version_string, "34%02d%c-%c%d",
|
||||
((rev2>>8)&0xff)-1, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f);
|
||||
}
|
||||
|
||||
/* Configure the DPL chip to Auto-detect the audio format */
|
||||
void dpl_autodetect( bktr_ptr_t bktr ) {
|
||||
|
||||
/* The following are empiric values tried from the DPL35xx data sheet */
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x000c,0x0320); /* quasi peak detector source dolby
|
||||
lr 0x03xx; quasi peak detector matrix
|
||||
stereo 0xXX20 */
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x0040,0x0060); /* Surround decoder mode;
|
||||
ADAPTIVE/3D-PANORAMA, that means two
|
||||
speakers and no center speaker, all
|
||||
channels L/R/C/S mixed to L and R */
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x0041,0x0620); /* surround source matrix;I2S2/STEREO*/
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x0042,0x1F00); /* surround delay 31ms max */
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x0043,0x0000); /* automatic surround input balance */
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x0044,0x4000); /* surround spatial effect 50%
|
||||
recommended*/
|
||||
msp_dpl_write(bktr, bktr->dpl_addr, 0x12, 0x0045,0x5400); /* surround panorama effect 66%
|
||||
recommended with PANORAMA mode
|
||||
in 0x0040 set to panorama */
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/* $NetBSD: bktr_audio.h,v 1.1.1.1 2000/05/07 00:16:18 wiz Exp $ */
|
||||
|
||||
/* FreeBSD: src/sys/dev/bktr/bktr_audio.h,v 1.2 1999/10/28 13:58:14 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
|
||||
* chipset.
|
||||
* Copyright Roger Hardiman and Amancio Hasty.
|
||||
*
|
||||
* bktr_audio : This deals with controlling the audio on TV cards,
|
||||
* controlling the Audio Multiplexer (audio source selector).
|
||||
* controlling any MSP34xx stereo audio decoders.
|
||||
* controlling any DPL35xx dolby surroud sound audio decoders.
|
||||
* initialising TDA98xx audio devices.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. Redistributions of source code must retain the
|
||||
* Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Amancio Hasty and
|
||||
* Roger Hardiman
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Select Audio source, and allow muting
|
||||
*/
|
||||
int set_audio( bktr_ptr_t bktr, int mode );
|
||||
void temp_mute( bktr_ptr_t bktr, int flag );
|
||||
|
||||
|
||||
/*
|
||||
* Initialise any MSP or TDA devices
|
||||
*/
|
||||
void init_audio_devices( bktr_ptr_t bktr );
|
||||
|
||||
|
||||
/*
|
||||
* MSP34xx Audio Chip functions.
|
||||
*/
|
||||
void msp_autodetect( bktr_ptr_t bktr );
|
||||
void msp_read_id( bktr_ptr_t bktr );
|
||||
|
||||
|
||||
/*
|
||||
* DPL35xx Audio Chip functions.
|
||||
*/
|
||||
void dpl_autodetect( bktr_ptr_t bktr );
|
||||
void dpl_read_id( bktr_ptr_t bktr );
|
||||
|
||||
|
||||
/*
|
||||
* TDA98xx Audio Chip functions.
|
||||
*/
|
||||
void init_BTSC( bktr_ptr_t bktr );
|
||||
int set_BTSC( bktr_ptr_t bktr, int control );
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,89 @@
|
|||
/* $NetBSD: bktr_card.h,v 1.1.1.1 2000/05/07 00:16:18 wiz Exp $ */
|
||||
|
||||
/* FreeBSD: src/sys/dev/bktr/bktr_card.h,v 1.2 1999/09/27 08:04:55 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
|
||||
* chipset.
|
||||
* Copyright Roger Hardiman and Amancio Hasty.
|
||||
*
|
||||
* bktr_card : This deals with identifying TV cards.
|
||||
* trying to find the card make and model of card.
|
||||
* trying to find the type of tuner fitted.
|
||||
* reading the configuration EEPROM.
|
||||
* locating i2c devices.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. Redistributions of source code must retain the
|
||||
* Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Amancio Hasty and
|
||||
* Roger Hardiman
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If probeCard() fails to detect the correct card on boot you can
|
||||
* override it by setting adding the following option to your kernel config
|
||||
* options OVERRIDE_CARD <card type>
|
||||
* eg options OVERRIDE CARD=1
|
||||
*
|
||||
* or using the sysclt hw.bt848.card
|
||||
* eg sysctl -w hw.bt848.card=1
|
||||
*
|
||||
* where <card type> is one of the following card defines.
|
||||
*/
|
||||
|
||||
#define CARD_UNKNOWN 0
|
||||
#define CARD_MIRO 1
|
||||
#define CARD_HAUPPAUGE 2
|
||||
#define CARD_STB 3
|
||||
#define CARD_INTEL 4 /* Also for VideoLogic Captivator PCI */
|
||||
#define CARD_IMS_TURBO 5
|
||||
#define CARD_AVER_MEDIA 6
|
||||
#define CARD_OSPREY 7
|
||||
#define CARD_NEC_PK 8
|
||||
#define CARD_IO_GV 9
|
||||
#define CARD_FLYVIDEO 10
|
||||
#define CARD_ZOLTRIX 11
|
||||
#define CARD_KISS 12
|
||||
#define CARD_VIDEO_HIGHWAY_XTREME 13
|
||||
#define CARD_ASKEY_DYNALINK_MAGIC_TVIEW 14
|
||||
#define CARD_LEADTEK 15
|
||||
#define CARD_TERRATVPLUS 16
|
||||
#define Bt848_MAX_CARD 17
|
||||
|
||||
|
||||
int signCard( bktr_ptr_t bktr, int offset, int count, u_char* sig );
|
||||
void probeCard( bktr_ptr_t bktr, int verbose, int unit);
|
||||
|
||||
int writeEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data );
|
||||
int readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data );
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,95 @@
|
|||
/* $NetBSD: bktr_core.h,v 1.1.1.1 2000/05/07 00:16:18 wiz Exp $ */
|
||||
|
||||
/* FreeBSD: src/sys/dev/bktr/bktr_core.h,v 1.2 1999/10/28 13:58:16 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
|
||||
* chipset.
|
||||
* Copyright Roger Hardiman and Amancio Hasty.
|
||||
*
|
||||
* bktr_core : This deals with the Bt848/849/878/879 PCI Frame Grabber,
|
||||
* Handles all the open, close, ioctl and read userland calls.
|
||||
* Sets the Bt848 registers and generates RISC pograms.
|
||||
* Controls the i2c bus and GPIO interface.
|
||||
* Contains the interface to the kernel.
|
||||
* (eg probe/attach and open/close/ioctl)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. Redistributions of source code must retain the
|
||||
* Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Amancio Hasty and
|
||||
* Roger Hardiman
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
int i2cWrite( bktr_ptr_t bktr, int addr, int byte1, int byte2 );
|
||||
int i2cRead( bktr_ptr_t bktr, int addr );
|
||||
|
||||
void msp_dpl_reset( bktr_ptr_t bktr, int i2d_addr );
|
||||
unsigned int msp_dpl_read( bktr_ptr_t bktr, int i2c_addr, unsigned char dev, unsigned int addr );
|
||||
void msp_dpl_write( bktr_ptr_t bktr, int i2c_addr, unsigned char dev,
|
||||
unsigned int addr, unsigned int data );
|
||||
|
||||
|
||||
/*
|
||||
* Defines for userland processes blocked in this driver
|
||||
* For /dev/bktr[n] use memory address of bktr structure
|
||||
* For /dev/vbi[n] use memory address of bktr structure + 1
|
||||
* this is ok as the bktr structure is > 1 byte
|
||||
*/
|
||||
#define BKTR_SLEEP ((caddr_t)bktr )
|
||||
#define VBI_SLEEP ((caddr_t)bktr + 1)
|
||||
|
||||
|
||||
/* Prototypes for attatch and interrupt functions */
|
||||
void common_bktr_attach( bktr_ptr_t bktr, int unit,
|
||||
u_long pci_id, u_int rev );
|
||||
int common_bktr_intr( void *arg );
|
||||
|
||||
|
||||
/* Prototypes for open, close, read, mmap and ioctl calls */
|
||||
int video_open( bktr_ptr_t bktr );
|
||||
int video_close( bktr_ptr_t bktr );
|
||||
int video_read( bktr_ptr_t bktr, int unit, dev_t dev, struct uio *uio );
|
||||
int video_ioctl( bktr_ptr_t bktr, int unit,
|
||||
ioctl_cmd_t cmd, caddr_t arg, struct proc* pr );
|
||||
|
||||
|
||||
int tuner_open( bktr_ptr_t bktr );
|
||||
int tuner_close( bktr_ptr_t bktr );
|
||||
int tuner_ioctl( bktr_ptr_t bktr, int unit,
|
||||
ioctl_cmd_t cmd, caddr_t arg, struct proc* pr );
|
||||
|
||||
int vbi_open( bktr_ptr_t bktr );
|
||||
int vbi_close( bktr_ptr_t bktr );
|
||||
int vbi_read( bktr_ptr_t bktr, struct uio *uio, int ioflag );
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,74 @@
|
|||
/* $NetBSD: bktr_os.h,v 1.1.1.1 2000/05/07 00:16:18 wiz Exp $ */
|
||||
|
||||
/* FreeBSD: src/sys/dev/bktr/bktr_os.h,v 1.3 2000/04/16 07:50:09 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
|
||||
* chipset.
|
||||
* Copyright Roger Hardiman and Amancio Hasty.
|
||||
*
|
||||
* bktr_os : This has all the Operating System dependant code.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. Redistributions of source code must retain the
|
||||
* Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Amancio Hasty and
|
||||
* Roger Hardiman
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
/******************************/
|
||||
/* *** Memory Allocation *** */
|
||||
/******************************/
|
||||
#if (defined(__FreeBSD__) || defined(__bsdi__))
|
||||
vm_offset_t get_bktr_mem( int unit, unsigned size );
|
||||
#endif
|
||||
|
||||
#if (defined(__NetBSD__) || defined(__OpenBSD__))
|
||||
vm_offset_t get_bktr_mem(bktr_ptr_t, bus_dmamap_t *, unsigned size);
|
||||
void free_bktr_mem(bktr_ptr_t, bus_dmamap_t, vm_offset_t);
|
||||
#endif
|
||||
|
||||
/************************************/
|
||||
/* *** Interrupt Enable/Disable *** */
|
||||
/************************************/
|
||||
#if defined(__FreeBSD__)
|
||||
#define DECLARE_INTR_MASK(s) intrmask_t s
|
||||
#define DISABLE_INTR(s) s=spltty()
|
||||
#define ENABLE_INTR(s) splx(s)
|
||||
#else
|
||||
#define DECLARE_INTR_MASK(s) /* no need to declare 's' */
|
||||
#define DISABLE_INTR(s) disable_intr()
|
||||
#define ENABLE_INTR(s) enable_intr()
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,676 @@
|
|||
/* $NetBSD: bktr_reg.h,v 1.1.1.1 2000/05/07 00:16:18 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* FreeBSD: src/sys/dev/bktr/bktr_reg.h,v 1.36 1999/10/28 13:58:17 roger Exp
|
||||
*
|
||||
* Copyright (c) 1999 Roger Hardiman
|
||||
* Copyright (c) 1998 Amancio Hasty
|
||||
* Copyright (c) 1995 Mark Tinguely and Jim Lowe
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Mark Tinguely and Jim Lowe
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
# if (__FreeBSD_version >= 310000)
|
||||
# include <sys/bus.h>
|
||||
# include "smbus.h"
|
||||
# else
|
||||
# define NSMBUS 0 /* FreeBSD before 3.1 does not have SMBUS */
|
||||
# endif
|
||||
#else
|
||||
# define NSMBUS 0 /* Non FreeBSD systems do not have SMBUS */
|
||||
#endif
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#include <machine/bus.h> /* struct device */
|
||||
#include <sys/device.h>
|
||||
#include <sys/select.h> /* struct selinfo */
|
||||
#endif
|
||||
|
||||
#ifndef PCI_LATENCY_TIMER
|
||||
#define PCI_LATENCY_TIMER 0x0c /* pci timer register */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definitions for the Brooktree 848/878 video capture to pci interface.
|
||||
*/
|
||||
#define BROOKTREE_848_PCI_ID 0x0350109E
|
||||
#define BROOKTREE_849_PCI_ID 0x0351109E
|
||||
#define BROOKTREE_878_PCI_ID 0x036E109E
|
||||
#define BROOKTREE_879_PCI_ID 0x036F109E
|
||||
|
||||
#define BROOKTREE_848 1
|
||||
#define BROOKTREE_848A 2
|
||||
#define BROOKTREE_849A 3
|
||||
#define BROOKTREE_878 4
|
||||
#define BROOKTREE_879 5
|
||||
|
||||
typedef volatile u_int bregister_t;
|
||||
/*
|
||||
* if other persuasion endian, then compiler will probably require that
|
||||
* these next
|
||||
* macros be reversed
|
||||
*/
|
||||
#define BTBYTE(what) bregister_t what:8; int :24
|
||||
#define BTWORD(what) bregister_t what:16; int: 16
|
||||
#define BTLONG(what) bregister_t what:32
|
||||
|
||||
struct bt848_registers {
|
||||
BTBYTE (dstatus); /* 0, 1,2,3 */
|
||||
#define BT848_DSTATUS_PRES (1<<7)
|
||||
#define BT848_DSTATUS_HLOC (1<<6)
|
||||
#define BT848_DSTATUS_FIELD (1<<5)
|
||||
#define BT848_DSTATUS_NUML (1<<4)
|
||||
#define BT848_DSTATUS_CSEL (1<<3)
|
||||
#define BT848_DSTATUS_PLOCK (1<<2)
|
||||
#define BT848_DSTATUS_LOF (1<<1)
|
||||
#define BT848_DSTATUS_COF (1<<0)
|
||||
BTBYTE (iform); /* 4, 5,6,7 */
|
||||
#define BT848_IFORM_MUXSEL (0x3<<5)
|
||||
# define BT848_IFORM_M_MUX1 (0x03<<5)
|
||||
# define BT848_IFORM_M_MUX0 (0x02<<5)
|
||||
# define BT848_IFORM_M_MUX2 (0x01<<5)
|
||||
# define BT848_IFORM_M_MUX3 (0x0)
|
||||
# define BT848_IFORM_M_RSVD (0x00<<5)
|
||||
#define BT848_IFORM_XTSEL (0x3<<3)
|
||||
# define BT848_IFORM_X_AUTO (0x03<<3)
|
||||
# define BT848_IFORM_X_XT1 (0x02<<3)
|
||||
# define BT848_IFORM_X_XT0 (0x01<<3)
|
||||
# define BT848_IFORM_X_RSVD (0x00<<3)
|
||||
BTBYTE (tdec); /* 8, 9,a,b */
|
||||
BTBYTE (e_crop); /* c, d,e,f */
|
||||
BTBYTE (e_vdelay_lo); /* 10, 11,12,13 */
|
||||
BTBYTE (e_vactive_lo); /* 14, 15,16,17 */
|
||||
BTBYTE (e_delay_lo); /* 18, 19,1a,1b */
|
||||
BTBYTE (e_hactive_lo); /* 1c, 1d,1e,1f */
|
||||
BTBYTE (e_hscale_hi); /* 20, 21,22,23 */
|
||||
BTBYTE (e_hscale_lo); /* 24, 25,26,27 */
|
||||
BTBYTE (bright); /* 28, 29,2a,2b */
|
||||
BTBYTE (e_control); /* 2c, 2d,2e,2f */
|
||||
#define BT848_E_CONTROL_LNOTCH (1<<7)
|
||||
#define BT848_E_CONTROL_COMP (1<<6)
|
||||
#define BT848_E_CONTROL_LDEC (1<<5)
|
||||
#define BT848_E_CONTROL_CBSENSE (1<<4)
|
||||
#define BT848_E_CONTROL_RSVD (1<<3)
|
||||
#define BT848_E_CONTROL_CON_MSB (1<<2)
|
||||
#define BT848_E_CONTROL_SAT_U_MSB (1<<1)
|
||||
#define BT848_E_CONTROL_SAT_V_MSB (1<<0)
|
||||
BTBYTE (contrast_lo); /* 30, 31,32,33 */
|
||||
BTBYTE (sat_u_lo); /* 34, 35,36,37 */
|
||||
BTBYTE (sat_v_lo); /* 38, 39,3a,3b */
|
||||
BTBYTE (hue); /* 3c, 3d,3e,3f */
|
||||
BTBYTE (e_scloop); /* 40, 41,42,43 */
|
||||
#define BT848_E_SCLOOP_RSVD1 (1<<7)
|
||||
#define BT848_E_SCLOOP_CAGC (1<<6)
|
||||
#define BT848_E_SCLOOP_CKILL (1<<5)
|
||||
#define BT848_E_SCLOOP_HFILT (0x3<<3)
|
||||
# define BT848_E_SCLOOP_HFILT_ICON (0x3<<3)
|
||||
# define BT848_E_SCLOOP_HFILT_QCIF (0x2<<3)
|
||||
# define BT848_E_SCLOOP_HFILT_CIF (0x1<<3)
|
||||
# define BT848_E_SCLOOP_HFILT_AUTO (0x0<<3)
|
||||
#define BT848_E_SCLOOP_RSVD0 (0x7<<0)
|
||||
int :32; /* 44, 45,46,47 */
|
||||
BTBYTE (oform); /* 48, 49,4a,4b */
|
||||
BTBYTE (e_vscale_hi); /* 4c, 4d,4e,4f */
|
||||
BTBYTE (e_vscale_lo); /* 50, 51,52,53 */
|
||||
BTBYTE (test); /* 54, 55,56,57 */
|
||||
int :32; /* 58, 59,5a,5b */
|
||||
int :32; /* 5c, 5d,5e,5f */
|
||||
BTLONG (adelay); /* 60, 61,62,63 */
|
||||
BTBYTE (bdelay); /* 64, 65,66,67 */
|
||||
BTBYTE (adc); /* 68, 69,6a,6b */
|
||||
#define BT848_ADC_RESERVED (0x80) /* required pattern */
|
||||
#define BT848_ADC_SYNC_T (1<<5)
|
||||
#define BT848_ADC_AGC_EN (1<<4)
|
||||
#define BT848_ADC_CLK_SLEEP (1<<3)
|
||||
#define BT848_ADC_Y_SLEEP (1<<2)
|
||||
#define BT848_ADC_C_SLEEP (1<<1)
|
||||
#define BT848_ADC_CRUSH (1<<0)
|
||||
BTBYTE (e_vtc); /* 6c, 6d,6e,6f */
|
||||
int :32; /* 70, 71,72,73 */
|
||||
int :32; /* 74, 75,76,77 */
|
||||
int :32; /* 78, 79,7a,7b */
|
||||
BTLONG (sreset); /* 7c, 7d,7e,7f */
|
||||
u_char filler1[0x84-0x80];
|
||||
BTBYTE (tgctrl); /* 84, 85,86,87 */
|
||||
#define BT848_TGCTRL_TGCKI (3<<3)
|
||||
#define BT848_TGCTRL_TGCKI_XTAL (0<<3)
|
||||
#define BT848_TGCTRL_TGCKI_PLL (1<<3)
|
||||
#define BT848_TGCTRL_TGCKI_GPCLK (2<<3)
|
||||
#define BT848_TGCTRL_TGCKI_GPCLK_I (3<<3)
|
||||
u_char filler[0x8c-0x88];
|
||||
BTBYTE (o_crop); /* 8c, 8d,8e,8f */
|
||||
BTBYTE (o_vdelay_lo); /* 90, 91,92,93 */
|
||||
BTBYTE (o_vactive_lo); /* 94, 95,96,97 */
|
||||
BTBYTE (o_delay_lo); /* 98, 99,9a,9b */
|
||||
BTBYTE (o_hactive_lo); /* 9c, 9d,9e,9f */
|
||||
BTBYTE (o_hscale_hi); /* a0, a1,a2,a3 */
|
||||
BTBYTE (o_hscale_lo); /* a4, a5,a6,a7 */
|
||||
int :32; /* a8, a9,aa,ab */
|
||||
BTBYTE (o_control); /* ac, ad,ae,af */
|
||||
#define BT848_O_CONTROL_LNOTCH (1<<7)
|
||||
#define BT848_O_CONTROL_COMP (1<<6)
|
||||
#define BT848_O_CONTROL_LDEC (1<<5)
|
||||
#define BT848_O_CONTROL_CBSENSE (1<<4)
|
||||
#define BT848_O_CONTROL_RSVD (1<<3)
|
||||
#define BT848_O_CONTROL_CON_MSB (1<<2)
|
||||
#define BT848_O_CONTROL_SAT_U_MSB (1<<1)
|
||||
#define BT848_O_CONTROL_SAT_V_MSB (1<<0)
|
||||
u_char fillter4[16];
|
||||
BTBYTE (o_scloop); /* c0, c1,c2,c3 */
|
||||
#define BT848_O_SCLOOP_RSVD1 (1<<7)
|
||||
#define BT848_O_SCLOOP_CAGC (1<<6)
|
||||
#define BT848_O_SCLOOP_CKILL (1<<5)
|
||||
#define BT848_O_SCLOOP_HFILT (0x3<<3)
|
||||
#define BT848_O_SCLOOP_HFILT_ICON (0x3<<3)
|
||||
#define BT848_O_SCLOOP_HFILT_QCIF (0x2<<3)
|
||||
#define BT848_O_SCLOOP_HFILT_CIF (0x1<<3)
|
||||
#define BT848_O_SCLOOP_HFILT_AUTO (0x0<<3)
|
||||
#define BT848_O_SCLOOP_RSVD0 (0x7<<0)
|
||||
int :32; /* c4, c5,c6,c7 */
|
||||
int :32; /* c8, c9,ca,cb */
|
||||
BTBYTE (o_vscale_hi); /* cc, cd,ce,cf */
|
||||
BTBYTE (o_vscale_lo); /* d0, d1,d2,d3 */
|
||||
BTBYTE (color_fmt); /* d4, d5,d6,d7 */
|
||||
bregister_t color_ctl_swap :4; /* d8 */
|
||||
#define BT848_COLOR_CTL_WSWAP_ODD (1<<3)
|
||||
#define BT848_COLOR_CTL_WSWAP_EVEN (1<<2)
|
||||
#define BT848_COLOR_CTL_BSWAP_ODD (1<<1)
|
||||
#define BT848_COLOR_CTL_BSWAP_EVEN (1<<0)
|
||||
bregister_t color_ctl_gamma :1;
|
||||
bregister_t color_ctl_rgb_ded :1;
|
||||
bregister_t color_ctl_color_bars :1;
|
||||
bregister_t color_ctl_ext_frmrate :1;
|
||||
#define BT848_COLOR_CTL_GAMMA (1<<4)
|
||||
#define BT848_COLOR_CTL_RGB_DED (1<<5)
|
||||
#define BT848_COLOR_CTL_COLOR_BARS (1<<6)
|
||||
#define BT848_COLOR_CTL_EXT_FRMRATE (1<<7)
|
||||
int :24; /* d9,da,db */
|
||||
BTBYTE (cap_ctl); /* dc, dd,de,df */
|
||||
#define BT848_CAP_CTL_DITH_FRAME (1<<4)
|
||||
#define BT848_CAP_CTL_VBI_ODD (1<<3)
|
||||
#define BT848_CAP_CTL_VBI_EVEN (1<<2)
|
||||
#define BT848_CAP_CTL_ODD (1<<1)
|
||||
#define BT848_CAP_CTL_EVEN (1<<0)
|
||||
BTBYTE (vbi_pack_size); /* e0, e1,e2,e3 */
|
||||
BTBYTE (vbi_pack_del); /* e4, e5,e6,e7 */
|
||||
int :32; /* e8, e9,ea,eb */
|
||||
BTBYTE (o_vtc); /* ec, ed,ee,ef */
|
||||
BTBYTE (pll_f_lo); /* f0, f1,f2,f3 */
|
||||
BTBYTE (pll_f_hi); /* f4, f5,f6,f7 */
|
||||
BTBYTE (pll_f_xci); /* f8, f9,fa,fb */
|
||||
#define BT848_PLL_F_C (1<<6)
|
||||
#define BT848_PLL_F_X (1<<7)
|
||||
u_char filler2[0x100-0xfc];
|
||||
BTLONG (int_stat); /* 100, 101,102,103 */
|
||||
BTLONG (int_mask); /* 104, 105,106,107 */
|
||||
#define BT848_INT_RISCS (0xf<<28)
|
||||
#define BT848_INT_RISC_EN (1<<27)
|
||||
#define BT848_INT_RACK (1<<25)
|
||||
#define BT848_INT_FIELD (1<<24)
|
||||
#define BT848_INT_MYSTERYBIT (1<<23)
|
||||
#define BT848_INT_SCERR (1<<19)
|
||||
#define BT848_INT_OCERR (1<<18)
|
||||
#define BT848_INT_PABORT (1<<17)
|
||||
#define BT848_INT_RIPERR (1<<16)
|
||||
#define BT848_INT_PPERR (1<<15)
|
||||
#define BT848_INT_FDSR (1<<14)
|
||||
#define BT848_INT_FTRGT (1<<13)
|
||||
#define BT848_INT_FBUS (1<<12)
|
||||
#define BT848_INT_RISCI (1<<11)
|
||||
#define BT848_INT_GPINT (1<<9)
|
||||
#define BT848_INT_I2CDONE (1<<8)
|
||||
#define BT848_INT_RSV1 (1<<7)
|
||||
#define BT848_INT_RSV0 (1<<6)
|
||||
#define BT848_INT_VPRES (1<<5)
|
||||
#define BT848_INT_HLOCK (1<<4)
|
||||
#define BT848_INT_OFLOW (1<<3)
|
||||
#define BT848_INT_HSYNC (1<<2)
|
||||
#define BT848_INT_VSYNC (1<<1)
|
||||
#define BT848_INT_FMTCHG (1<<0)
|
||||
int :32; /* 108, 109,10a,10b */
|
||||
BTWORD (gpio_dma_ctl); /* 10c, 10d,10e,10f */
|
||||
#define BT848_DMA_CTL_PL23TP4 (0<<6) /* planar1 trigger 4 */
|
||||
#define BT848_DMA_CTL_PL23TP8 (1<<6) /* planar1 trigger 8 */
|
||||
#define BT848_DMA_CTL_PL23TP16 (2<<6) /* planar1 trigger 16 */
|
||||
#define BT848_DMA_CTL_PL23TP32 (3<<6) /* planar1 trigger 32 */
|
||||
#define BT848_DMA_CTL_PL1TP4 (0<<4) /* planar1 trigger 4 */
|
||||
#define BT848_DMA_CTL_PL1TP8 (1<<4) /* planar1 trigger 8 */
|
||||
#define BT848_DMA_CTL_PL1TP16 (2<<4) /* planar1 trigger 16 */
|
||||
#define BT848_DMA_CTL_PL1TP32 (3<<4) /* planar1 trigger 32 */
|
||||
#define BT848_DMA_CTL_PKTP4 (0<<2) /* packed trigger 4 */
|
||||
#define BT848_DMA_CTL_PKTP8 (1<<2) /* packed trigger 8 */
|
||||
#define BT848_DMA_CTL_PKTP16 (2<<2) /* packed trigger 16 */
|
||||
#define BT848_DMA_CTL_PKTP32 (3<<2) /* packed trigger 32 */
|
||||
#define BT848_DMA_CTL_RISC_EN (1<<1)
|
||||
#define BT848_DMA_CTL_FIFO_EN (1<<0)
|
||||
BTLONG (i2c_data_ctl); /* 110, 111,112,113 */
|
||||
#define BT848_DATA_CTL_I2CDIV (0xf<<4)
|
||||
#define BT848_DATA_CTL_I2CSYNC (1<<3)
|
||||
#define BT848_DATA_CTL_I2CW3B (1<<2)
|
||||
#define BT848_DATA_CTL_I2CSCL (1<<1)
|
||||
#define BT848_DATA_CTL_I2CSDA (1<<0)
|
||||
BTLONG (risc_strt_add); /* 114, 115,116,117 */
|
||||
BTLONG (gpio_out_en); /* 118, 119,11a,11b */ /* really 24 bits */
|
||||
BTLONG (gpio_reg_inp); /* 11c, 11d,11e,11f */ /* really 24 bits */
|
||||
BTLONG (risc_count); /* 120, 121,122,123 */
|
||||
u_char filler3[0x200-0x124];
|
||||
BTLONG (gpio_data); /* 200, 201,202,203 */ /* really 24 bits */
|
||||
};
|
||||
|
||||
|
||||
#define BKTR_DSTATUS 0x000
|
||||
#define BKTR_IFORM 0x004
|
||||
#define BKTR_TDEC 0x008
|
||||
#define BKTR_E_CROP 0x00C
|
||||
#define BKTR_O_CROP 0x08C
|
||||
#define BKTR_E_VDELAY_LO 0x010
|
||||
#define BKTR_O_VDELAY_LO 0x090
|
||||
#define BKTR_E_VACTIVE_LO 0x014
|
||||
#define BKTR_O_VACTIVE_LO 0x094
|
||||
#define BKTR_E_DELAY_LO 0x018
|
||||
#define BKTR_O_DELAY_LO 0x098
|
||||
#define BKTR_E_HACTIVE_LO 0x01C
|
||||
#define BKTR_O_HACTIVE_LO 0x09C
|
||||
#define BKTR_E_HSCALE_HI 0x020
|
||||
#define BKTR_O_HSCALE_HI 0x0A0
|
||||
#define BKTR_E_HSCALE_LO 0x024
|
||||
#define BKTR_O_HSCALE_LO 0x0A4
|
||||
#define BKTR_BRIGHT 0x028
|
||||
#define BKTR_E_CONTROL 0x02C
|
||||
#define BKTR_O_CONTROL 0x0AC
|
||||
#define BKTR_CONTRAST_LO 0x030
|
||||
#define BKTR_SAT_U_LO 0x034
|
||||
#define BKTR_SAT_V_LO 0x038
|
||||
#define BKTR_HUE 0x03C
|
||||
#define BKTR_E_SCLOOP 0x040
|
||||
#define BKTR_O_SCLOOP 0x0C0
|
||||
#define BKTR_OFORM 0x048
|
||||
#define BKTR_E_VSCALE_HI 0x04C
|
||||
#define BKTR_O_VSCALE_HI 0x0CC
|
||||
#define BKTR_E_VSCALE_LO 0x050
|
||||
#define BKTR_O_VSCALE_LO 0x0D0
|
||||
#define BKTR_TEST 0x054
|
||||
#define BKTR_ADELAY 0x060
|
||||
#define BKTR_BDELAY 0x064
|
||||
#define BKTR_ADC 0x068
|
||||
#define BKTR_E_VTC 0x06C
|
||||
#define BKTR_O_VTC 0x0EC
|
||||
#define BKTR_SRESET 0x07C
|
||||
#define BKTR_COLOR_FMT 0x0D4
|
||||
#define BKTR_COLOR_CTL 0x0D8
|
||||
#define BKTR_CAP_CTL 0x0DC
|
||||
#define BKTR_VBI_PACK_SIZE 0x0E0
|
||||
#define BKTR_VBI_PACK_DEL 0x0E4
|
||||
#define BKTR_INT_STAT 0x100
|
||||
#define BKTR_INT_MASK 0x104
|
||||
#define BKTR_RISC_COUNT 0x120
|
||||
#define BKTR_RISC_STRT_ADD 0x114
|
||||
#define BKTR_GPIO_DMA_CTL 0x10C
|
||||
#define BKTR_GPIO_OUT_EN 0x118
|
||||
#define BKTR_GPIO_REG_INP 0x11C
|
||||
#define BKTR_GPIO_DATA 0x200
|
||||
#define BKTR_I2C_DATA_CTL 0x110
|
||||
#define BKTR_TGCTRL 0x084
|
||||
#define BKTR_PLL_F_LO 0x0F0
|
||||
#define BKTR_PLL_F_HI 0x0F4
|
||||
#define BKTR_PLL_F_XCI 0x0F8
|
||||
|
||||
/*
|
||||
* device support for onboard tv tuners
|
||||
*/
|
||||
|
||||
/* description of the LOGICAL tuner */
|
||||
struct TVTUNER {
|
||||
int frequency;
|
||||
u_char chnlset;
|
||||
u_char channel;
|
||||
u_char band;
|
||||
u_char afc;
|
||||
u_char radio_mode; /* current mode of the radio mode */
|
||||
};
|
||||
|
||||
/* description of the PHYSICAL tuner */
|
||||
struct TUNER {
|
||||
char* name;
|
||||
u_char type;
|
||||
u_char pllControl[4];
|
||||
u_char bandLimits[ 2 ];
|
||||
u_char bandAddrs[ 4 ]; /* 3 first for the 3 TV
|
||||
** bands. Last for radio
|
||||
** band (0x00=NoRadio).
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
/* description of the card */
|
||||
#define EEPROMBLOCKSIZE 32
|
||||
struct CARDTYPE {
|
||||
unsigned int card_id; /* card id (from #define's) */
|
||||
char* name;
|
||||
const struct TUNER* tuner; /* Tuner details */
|
||||
u_char tuner_pllAddr; /* Tuner i2c address */
|
||||
u_char dbx; /* Has DBX chip? */
|
||||
u_char msp3400c; /* Has msp3400c chip? */
|
||||
u_char dpl3518a; /* Has dpl3518a chip? */
|
||||
u_char eepromAddr;
|
||||
u_char eepromSize; /* bytes / EEPROMBLOCKSIZE */
|
||||
u_int audiomuxs[ 5 ]; /* tuner, ext (line-in) */
|
||||
/* int/unused (radio) */
|
||||
/* mute, present */
|
||||
u_int gpio_mux_bits; /* GPIO mask for audio mux */
|
||||
};
|
||||
|
||||
struct format_params {
|
||||
/* Total lines, lines before image, image lines */
|
||||
int vtotal, vdelay, vactive;
|
||||
/* Total unscaled horizontal pixels, pixels before image, image pixels */
|
||||
int htotal, hdelay, hactive;
|
||||
/* Scaled horizontal image pixels, Total Scaled horizontal pixels */
|
||||
int scaled_hactive, scaled_htotal;
|
||||
/* frame rate . for ntsc is 30 frames per second */
|
||||
int frame_rate;
|
||||
/* A-delay and B-delay */
|
||||
u_char adelay, bdelay;
|
||||
/* Iform XTSEL value */
|
||||
int iform_xtsel;
|
||||
/* VBI number of lines per field, and number of samples per line */
|
||||
int vbi_num_lines, vbi_num_samples;
|
||||
};
|
||||
|
||||
#if ((defined(__FreeBSD__)) && (NSMBUS > 0))
|
||||
struct bktr_i2c_softc {
|
||||
device_t iicbus;
|
||||
device_t smbus;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* Bt848/878 register access
|
||||
* The registers can either be access via a memory mapped structure
|
||||
* or accessed via bus_space.
|
||||
* bus_0pace access allows cross platform support, where as the
|
||||
* memory mapped structure method only works on 32 bit processors
|
||||
* with the right type of endianness.
|
||||
*/
|
||||
#if defined(__NetBSD__) || ( defined(__FreeBSD__) && (__FreeBSD_version >=300000) )
|
||||
#define INB(bktr,offset) bus_space_read_1((bktr)->memt,(bktr)->memh,(offset))
|
||||
#define INW(bktr,offset) bus_space_read_2((bktr)->memt,(bktr)->memh,(offset))
|
||||
#define INL(bktr,offset) bus_space_read_4((bktr)->memt,(bktr)->memh,(offset))
|
||||
#define OUTB(bktr,offset,value) bus_space_write_1((bktr)->memt,(bktr)->memh,(offset),(value))
|
||||
#define OUTW(bktr,offset,value) bus_space_write_2((bktr)->memt,(bktr)->memh,(offset),(value))
|
||||
#define OUTL(bktr,offset,value) bus_space_write_4((bktr)->memt,(bktr)->memh,(offset),(value))
|
||||
#else
|
||||
#define INB(bktr,offset) *(volatile unsigned char*) ((int)((bktr)->memh)+(offset))
|
||||
#define INW(bktr,offset) *(volatile unsigned short*)((int)((bktr)->memh)+(offset))
|
||||
#define INL(bktr,offset) *(volatile unsigned int*) ((int)((bktr)->memh)+(offset))
|
||||
#define OUTB(bktr,offset,value) *(volatile unsigned char*) ((int)((bktr)->memh)+(offset)) = (value)
|
||||
#define OUTW(bktr,offset,value) *(volatile unsigned short*)((int)((bktr)->memh)+(offset)) = (value)
|
||||
#define OUTL(bktr,offset,value) *(volatile unsigned int*) ((int)((bktr)->memh)+(offset)) = (value)
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct bktr_clip bktr_clip_t;
|
||||
|
||||
/*
|
||||
* NetBSD >= 1.3H uses vaddr_t instead of vm_offset_t
|
||||
*/
|
||||
#if defined(__NetBSD__) && __NetBSD_Version__ >= 103080000
|
||||
typedef vaddr_t vm_offset_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* BrookTree 848 info structure, one per bt848 card installed.
|
||||
*/
|
||||
struct bktr_softc {
|
||||
|
||||
#if defined (__bsdi__)
|
||||
struct device bktr_dev; /* base device */
|
||||
struct isadev bktr_id; /* ISA device */
|
||||
struct intrhand bktr_ih; /* interrupt vectoring */
|
||||
#define pcici_t pci_devaddr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
struct device bktr_dev; /* base device */
|
||||
bus_dma_tag_t dmat; /* DMA tag */
|
||||
bus_space_tag_t memt;
|
||||
bus_space_handle_t memh;
|
||||
bus_size_t obmemsz; /* size of en card (bytes) */
|
||||
void *ih;
|
||||
bus_dmamap_t dm_prog;
|
||||
bus_dmamap_t dm_oprog;
|
||||
bus_dmamap_t dm_mem;
|
||||
bus_dmamap_t dm_vbidata;
|
||||
bus_dmamap_t dm_vbibuffer;
|
||||
#if __NetBSD_Version__ >= 103080000
|
||||
paddr_t phys_base; /* Bt848 register physical address */
|
||||
#else
|
||||
vm_offset_t phys_base; /* Bt848 register physical address */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__)
|
||||
struct device bktr_dev; /* base device */
|
||||
bus_dma_tag_t dmat; /* DMA tag */
|
||||
bus_space_tag_t memt;
|
||||
bus_space_handle_t memh;
|
||||
bus_size_t obmemsz; /* size of en card (bytes) */
|
||||
void *ih;
|
||||
bus_dmamap_t dm_prog;
|
||||
bus_dmamap_t dm_oprog;
|
||||
bus_dmamap_t dm_mem;
|
||||
bus_dmamap_t dm_vbidata;
|
||||
bus_dmamap_t dm_vbibuffer;
|
||||
size_t dm_mapsize;
|
||||
pci_chipset_tag_t pc; /* Opaque PCI chipset tag */
|
||||
pcitag_t tag; /* PCI tag, for doing PCI commands */
|
||||
vm_offset_t phys_base; /* Bt848 register physical address */
|
||||
#endif
|
||||
|
||||
#if defined (__FreeBSD__)
|
||||
#if (__FreeBSD_version < 400000)
|
||||
vm_offset_t phys_base; /* 2.x Bt848 register physical address */
|
||||
pcici_t tag; /* 2.x PCI tag, for doing PCI commands */
|
||||
#endif
|
||||
#if (__FreeBSD_version >= 400000)
|
||||
struct resource *res_mem; /* 4.x resource descriptor for registers */
|
||||
struct resource *res_irq; /* 4.x resource descriptor for interrupt */
|
||||
void *res_ih; /* 4.x newbus interrupt handler cookie */
|
||||
#endif
|
||||
#if (__FreeBSD_version >= 310000)
|
||||
bus_space_tag_t memt; /* Bus space register access functions */
|
||||
bus_space_handle_t memh; /* Bus space register access functions */
|
||||
bus_size_t obmemsz;/* Size of card (bytes) */
|
||||
#endif
|
||||
#if (NSMBUS > 0)
|
||||
struct bktr_i2c_softc i2c_sc; /* bt848_i2c device */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* the following definitions are common over all platforms */
|
||||
vm_offset_t bigbuf; /* buffer that holds the captured image */
|
||||
int alloc_pages; /* number of pages in bigbuf */
|
||||
|
||||
vm_offset_t vbidata; /* RISC program puts VBI data from the current frame here */
|
||||
vm_offset_t vbibuffer; /* Circular buffer holding VBI data for the user */
|
||||
int vbiinsert; /* Position for next write into circular buffer */
|
||||
int vbistart; /* Position of last read from circular buffer */
|
||||
int vbisize; /* Number of bytes in the circular buffer */
|
||||
u_long vbi_sequence_number; /* sequence number for VBI */
|
||||
int vbi_read_blocked; /* user process blocked on read() from /dev/vbi */
|
||||
struct selinfo vbi_select; /* Data used by select() on /dev/vbi */
|
||||
|
||||
|
||||
struct proc *proc; /* process to receive raised signal */
|
||||
int signal; /* signal to send to process */
|
||||
int clr_on_start; /* clear cap buf on capture start? */
|
||||
#define METEOR_SIG_MODE_MASK 0xffff0000
|
||||
#define METEOR_SIG_FIELD_MODE 0x00010000
|
||||
#define METEOR_SIG_FRAME_MODE 0x00000000
|
||||
vm_offset_t dma_prog;
|
||||
vm_offset_t odd_dma_prog;
|
||||
char dma_prog_loaded;
|
||||
struct meteor_mem *mem; /* used to control sync. multi-frame output */
|
||||
u_long synch_wait; /* wait for free buffer before continuing */
|
||||
short current; /* frame number in buffer (1-frames) */
|
||||
short rows; /* number of rows in a frame */
|
||||
short cols; /* number of columns in a frame */
|
||||
int capture_area_x_offset; /* Usually the full 640x480(NTSC) image is */
|
||||
int capture_area_y_offset; /* captured. The capture area allows for */
|
||||
int capture_area_x_size; /* example 320x200 pixels from the centre */
|
||||
int capture_area_y_size; /* of the video image to be captured. */
|
||||
char capture_area_enabled; /* When TRUE use user's capture area. */
|
||||
int pixfmt; /* active pixel format (idx into fmt tbl) */
|
||||
int pixfmt_compat; /* Y/N - in meteor pix fmt compat mode */
|
||||
u_long format; /* frame format rgb, yuv, etc.. */
|
||||
short frames; /* number of frames allocated */
|
||||
int frame_size; /* number of bytes in a frame */
|
||||
u_long fifo_errors; /* number of fifo capture errors since open */
|
||||
u_long dma_errors; /* number of DMA capture errors since open */
|
||||
u_long frames_captured;/* number of frames captured since open */
|
||||
u_long even_fields_captured; /* number of even fields captured */
|
||||
u_long odd_fields_captured; /* number of odd fields captured */
|
||||
u_long range_enable; /* enable range checking ?? */
|
||||
u_short capcontrol; /* reg 0xdc capture control */
|
||||
u_short bktr_cap_ctl;
|
||||
volatile u_int flags;
|
||||
#define METEOR_INITALIZED 0x00000001
|
||||
#define METEOR_OPEN 0x00000002
|
||||
#define METEOR_MMAP 0x00000004
|
||||
#define METEOR_INTR 0x00000008
|
||||
#define METEOR_READ 0x00000010 /* XXX never gets referenced */
|
||||
#define METEOR_SINGLE 0x00000020 /* get single frame */
|
||||
#define METEOR_CONTIN 0x00000040 /* continuously get frames */
|
||||
#define METEOR_SYNCAP 0x00000080 /* synchronously get frames */
|
||||
#define METEOR_CAP_MASK 0x000000f0
|
||||
#define METEOR_NTSC 0x00000100
|
||||
#define METEOR_PAL 0x00000200
|
||||
#define METEOR_SECAM 0x00000400
|
||||
#define BROOKTREE_NTSC 0x00000100 /* used in video open() and */
|
||||
#define BROOKTREE_PAL 0x00000200 /* in the kernel config */
|
||||
#define BROOKTREE_SECAM 0x00000400 /* file */
|
||||
#define METEOR_AUTOMODE 0x00000800
|
||||
#define METEOR_FORM_MASK 0x00000f00
|
||||
#define METEOR_DEV0 0x00001000
|
||||
#define METEOR_DEV1 0x00002000
|
||||
#define METEOR_DEV2 0x00004000
|
||||
#define METEOR_DEV3 0x00008000
|
||||
#define METEOR_DEV_SVIDEO 0x00006000
|
||||
#define METEOR_DEV_RGB 0x0000a000
|
||||
#define METEOR_DEV_MASK 0x0000f000
|
||||
#define METEOR_RGB16 0x00010000
|
||||
#define METEOR_RGB24 0x00020000
|
||||
#define METEOR_YUV_PACKED 0x00040000
|
||||
#define METEOR_YUV_PLANAR 0x00080000
|
||||
#define METEOR_WANT_EVEN 0x00100000 /* want even frame */
|
||||
#define METEOR_WANT_ODD 0x00200000 /* want odd frame */
|
||||
#define METEOR_WANT_MASK 0x00300000
|
||||
#define METEOR_ONLY_EVEN_FIELDS 0x01000000
|
||||
#define METEOR_ONLY_ODD_FIELDS 0x02000000
|
||||
#define METEOR_ONLY_FIELDS_MASK 0x03000000
|
||||
#define METEOR_YUV_422 0x04000000
|
||||
#define METEOR_OUTPUT_FMT_MASK 0x040f0000
|
||||
#define METEOR_WANT_TS 0x08000000 /* time-stamp a frame */
|
||||
#define METEOR_RGB 0x20000000 /* meteor rgb unit */
|
||||
#define METEOR_FIELD_MODE 0x80000000
|
||||
u_char tflags; /* Tuner flags (/dev/tuner) */
|
||||
#define TUNER_INITALIZED 0x00000001
|
||||
#define TUNER_OPEN 0x00000002
|
||||
u_char vbiflags; /* VBI flags (/dev/vbi) */
|
||||
#define VBI_INITALIZED 0x00000001
|
||||
#define VBI_OPEN 0x00000002
|
||||
#define VBI_CAPTURE 0x00000004
|
||||
u_short fps; /* frames per second */
|
||||
struct meteor_video video;
|
||||
struct TVTUNER tuner;
|
||||
struct CARDTYPE card;
|
||||
u_char audio_mux_select; /* current mode of the audio */
|
||||
u_char audio_mute_state; /* mute state of the audio */
|
||||
u_char format_params;
|
||||
u_long current_sol;
|
||||
u_long current_col;
|
||||
int clip_start;
|
||||
int line_length;
|
||||
int last_y;
|
||||
int y;
|
||||
int y2;
|
||||
int yclip;
|
||||
int yclip2;
|
||||
int max_clip_node;
|
||||
bktr_clip_t clip_list[100];
|
||||
int reverse_mute; /* Swap the GPIO values for Mute and TV Audio */
|
||||
int bt848_tuner;
|
||||
int bt848_card;
|
||||
u_long id;
|
||||
#define BT848_USE_XTALS 0
|
||||
#define BT848_USE_PLL 1
|
||||
int xtal_pll_mode; /* Use XTAL or PLL mode for PAL/SECAM */
|
||||
int remote_control; /* remote control detected */
|
||||
int remote_control_addr; /* remote control i2c address */
|
||||
char msp_version_string[9]; /* MSP version string 34xxx-xx */
|
||||
int msp_addr; /* MSP i2c address */
|
||||
char dpl_version_string[9]; /* DPL version string 35xxx-xx */
|
||||
int dpl_addr; /* DPL i2c address */
|
||||
int slow_msp_audio; /* 0 = use fast MSP3410/3415 programming sequence */
|
||||
/* 1 = use slow MSP3410/3415 programming sequence */
|
||||
|
||||
};
|
||||
|
||||
typedef struct bktr_softc bktr_reg_t;
|
||||
typedef struct bktr_softc* bktr_ptr_t;
|
||||
|
||||
#define Bt848_MAX_SIGN 16
|
||||
|
||||
struct bt848_card_sig {
|
||||
int card;
|
||||
int tuner;
|
||||
u_char signature[Bt848_MAX_SIGN];
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************/
|
||||
/* ioctl_cmd_t int on old versions, u_long on new versions */
|
||||
/***********************************************************/
|
||||
|
||||
#if (__FreeBSD__ == 2)
|
||||
typedef int ioctl_cmd_t;
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#if (__FreeBSD_version >= 300000)
|
||||
typedef u_long ioctl_cmd_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
typedef u_long ioctl_cmd_t;
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,105 @@
|
|||
/* $NetBSD: bktr_tuner.h,v 1.1.1.1 2000/05/07 00:16:18 wiz Exp $ */
|
||||
|
||||
/* FreeBSD: src/sys/dev/bktr/bktr_tuner.h,v 1.1 1999/09/26 22:06:20 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
|
||||
* chipset.
|
||||
* Copyright Roger Hardiman and Amancio Hasty.
|
||||
*
|
||||
* bktr_tuner : This deals with controlling the tuner fitted to TV cards.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. Redistributions of source code must retain the
|
||||
* Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Amancio Hasty and
|
||||
* Roger Hardiman
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Definitions for Tuners */
|
||||
|
||||
#define NO_TUNER 0
|
||||
#define TEMIC_NTSC 1
|
||||
#define TEMIC_PAL 2
|
||||
#define TEMIC_SECAM 3
|
||||
#define PHILIPS_NTSC 4
|
||||
#define PHILIPS_PAL 5
|
||||
#define PHILIPS_SECAM 6
|
||||
#define TEMIC_PALI 7
|
||||
#define PHILIPS_PALI 8
|
||||
#define PHILIPS_FR1236_NTSC 9 /* These have FM radio support */
|
||||
#define PHILIPS_FR1216_PAL 10 /* These have FM radio support */
|
||||
#define PHILIPS_FR1236_SECAM 11 /* These have FM radio support */
|
||||
#define ALPS_TSCH5 12
|
||||
#define ALPS_TSBH1 13
|
||||
#define Bt848_MAX_TUNER 14
|
||||
|
||||
/* experimental code for Automatic Frequency Control */
|
||||
#define TUNER_AFC
|
||||
|
||||
/*
|
||||
* Fill in the tuner entries in the bktr_softc based on the selected tuner
|
||||
* type (from the list of tuners above)
|
||||
*/
|
||||
void select_tuner( bktr_ptr_t bktr, int tuner_type );
|
||||
|
||||
|
||||
/*
|
||||
* The Channel Set maps TV channels eg Ch 36, Ch 51, onto frequencies
|
||||
* and is country specific.
|
||||
*/
|
||||
int tuner_getchnlset( struct bktr_chnlset *chnlset );
|
||||
|
||||
/*
|
||||
* tv_channel sets the tuner to channel 'n' using the current Channel Set
|
||||
* tv_freq sets the tuner to a specific frequency for TV or for FM Radio
|
||||
* get_tuner_status can be used to get the signal strength.
|
||||
*/
|
||||
#define TV_FREQUENCY 0
|
||||
#define FM_RADIO_FREQUENCY 1
|
||||
int tv_channel( bktr_ptr_t bktr, int channel );
|
||||
int tv_freq( bktr_ptr_t bktr, int frequency, int type );
|
||||
int get_tuner_status( bktr_ptr_t bktr );
|
||||
|
||||
#if defined( TUNER_AFC )
|
||||
int do_afc( bktr_ptr_t bktr, int addr, int frequency );
|
||||
#endif /* TUNER_AFC */
|
||||
|
||||
|
||||
/*
|
||||
* This is for start-up convenience only, NOT mandatory.
|
||||
*/
|
||||
#if !defined( DEFAULT_CHNLSET )
|
||||
#define DEFAULT_CHNLSET CHNLSET_WEUROPE
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue