Renamed BT848[SG]CAPAREA to BT848_[SG]CAPAREA.

Added PR kern/7177 for SECAM Video Highway Xtreme with single crystal
PLL configuration submitted by Vsevolod Lobko <seva@alex-ua.com>.
In kernel configuration file add
options OVERRIDE_CARD=2
options OVERRIDE_TUNER=11
options BKTR_USE_PLL

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
This commit is contained in:
Søren Schmidt 1998-08-31 18:35:06 +00:00
parent 5d0c8abac1
commit 58dde31aeb
8 changed files with 142 additions and 32 deletions

View File

@ -262,6 +262,8 @@ OVERRIDE_TUNER opt_bktr.h
OVERRIDE_DBX opt_bktr.h
OVERRIDE_MSP opt_bktr.h
BROOKTREE_SYSTEM_DEFAULT opt_bktr.h
BKTR_USE_PLL opt_bktr.h
# meteor opt_meteor.h
METEOR_ALLOC_PAGES opt_meteor.h

View File

@ -1,4 +1,4 @@
/* BT848 1.40 Driver for Brooktree's Bt848 based cards.
/* BT848 1.41 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
Philips SAA 7116 and SAA 7196 are very different chipsets than
@ -274,13 +274,23 @@
for newer NTSC WinCastTV 404 with Bt878 chipset.
Tidied up PAL default in video_open()
1.40 10 August 1998 Roger Hardiman <roger@cs.strath.ac.uk>
1.49 10 August 1998 Roger Hardiman <roger@cs.strath.ac.uk>
Added Capture Area ioctl - BT848[SG]CAPAREA.
Normally the full 640x480 (768x576 PAL) image
is grabbed. This ioctl allows a smaller area
from anywhere within the video image to be
grabbed, eg a 400x300 image from (50,10).
See restrictions in BT848SCAPAREA.
1.50 31 August 1998 Roger Hardiman <roger@cs.strath.ac.uk>
Renamed BT848[SG]CAPAREA to BT848_[SG]CAPAREA.
Added PR kern/7177 for SECAM Video Highway Xtreme
with single crystal PLL configuration
submitted by Vsevolod Lobko <seva@alex-ua.com>.
In kernel configuration file add
options OVERRIDE_CARD=2
options OVERRIDE_TUNER=11
options BKTR_USE_PLL
*/
#define DDB(x) x
@ -532,7 +542,7 @@ static struct format_params format_params[] = {
/* # define BT848_IFORM_F_PALN (0x5) */
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x72, BT848_IFORM_X_XT1 },
/* # define BT848_IFORM_F_SECAM (0x6) */
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x00, BT848_IFORM_X_XT1 },
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x72, BT848_IFORM_X_XT1 },
/* # define BT848_IFORM_F_RSVD (0x7) - ???? */
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x72, BT848_IFORM_X_XT0 },
};
@ -636,6 +646,10 @@ static struct {
#define PHILIPS_FR1236_NTSC_WADDR 0xc2
#define PHILIPS_FR1236_NTSC_RADDR 0xc3
/* PLL on a the Philips FR1236MK2 tuner */
#define PHILIPS_FR1236_SECAM_WADDR 0xc0
#define PHILIPS_FR1236_SECAM_RADDR 0xc1
/* PLL on a the Philips FR1216MK2 tuner,
yes, the european version of the tuner is 1216 */
#define PHILIPS_FR1216_PAL_WADDR 0xc2
@ -741,7 +755,8 @@ static struct {
#define PHILIPS_PALI 8
#define PHILIPS_FR1236_NTSC 9
#define PHILIPS_FR1216_PAL 10
#define Bt848_MAX_TUNER 11
#define PHILIPS_FR1236_SECAM 11
#define Bt848_MAX_TUNER 12
/* XXX FIXME: this list is incomplete */
@ -886,6 +901,17 @@ static const struct TUNER tuners[] = {
TSA552x_RADIO },
{ 0x00, 0x00 }, /* band-switch crosspoints */
{ 0xa0, 0x90, 0x30, 0xa4 } }, /* the band-switch values */
/* PHILIPS_FR1236_SECAM */
{ "Philips FR1236 SECAM FM", /* the 'name' */
TTYPE_SECAM, /* input type */
PHILIPS_FR1236_SECAM_WADDR, /* PLL write address */
{ TSA552x_FCONTROL, /* control byte for PLL */
TSA552x_FCONTROL,
TSA552x_FCONTROL,
TSA552x_RADIO },
{ 0x00, 0x00 }, /* band-switch crosspoints */
{ 0xa0, 0x90, 0x30, 0xa4 } }, /* the band-switch values */
};
/******************************************************************************
@ -1648,6 +1674,13 @@ video_open( bktr_ptr_t bktr )
bt848->bdelay = format_params[bktr->format_params].bdelay;
frame_rate = format_params[bktr->format_params].frame_rate;
#ifdef BKTR_USE_PLL
bt848->tgctrl=0;
bt848->pll_f_lo=0xf9;
bt848->pll_f_hi=0xdc;
bt848->pll_f_xci=0x8e;
#endif
bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) | METEOR_DEV0;
bktr->max_clip_node = 0;
@ -2419,7 +2452,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
break;
/* end of METEORSETGEO */
/* FIXME. The Capture Area currently has the following restrictions
/* FIXME. The Capture Area currently has the following restrictions:
GENERAL
y_offset may need to be even in interlaced modes
RGB24 - Interlaced mode
@ -2436,7 +2469,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
y_size must be greater than or equal to 2*METEORSETGEO height (rows)
*/
case BT848SCAPAREA: /* set capture area of each video frame */
case BT848_SCAPAREA: /* set capture area of each video frame */
/* can't change parameters while capturing */
if (bktr->flags & METEOR_CAP_MASK)
return( EBUSY );
@ -2451,7 +2484,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
bktr->dma_prog_loaded = FALSE;
break;
case BT848GCAPAREA: /* get capture area of each video frame */
case BT848_GCAPAREA: /* get capture area of each video frame */
cap_area = (struct bktr_capture_area *) arg;
if (bktr->capture_area_enabled == FALSE) {
cap_area->x_offset = 0;
@ -3823,6 +3856,14 @@ build_dma_prog( bktr_ptr_t bktr, char i_flag )
/* end of video params */
#ifdef BKTR_USE_PLL
if (fp->iform_xtsel==BT848_IFORM_X_XT1) {
bt848->tgctrl=8; /* Select PLL mode */
} else {
bt848->tgctrl=0; /* Select Normal xtal 0/xtal 1 mode */
}
#endif
/* capture control */
switch (i_flag) {
case 1:

View File

@ -57,6 +57,7 @@ struct bt848_registers {
#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 */
@ -125,7 +126,14 @@ struct bt848_registers {
int :32; /* 74, 75,76,77 */
int :32; /* 78, 79,7a,7b */
BTLONG (sreset); /* 7c, 7d,7e,7f */
u_char filler[0x8c-0x80];
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 */
@ -149,10 +157,10 @@ struct bt848_registers {
#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_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 */
@ -179,7 +187,12 @@ struct bt848_registers {
BTBYTE (vbi_pack_del); /* e4, e5,e6,e7 */
int :32; /* e8, e9,ea,eb */
BTBYTE (o_vtc); /* ec, ed,ee,ef */
u_char filler2[0x100-0xf0];
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)

View File

@ -210,8 +210,8 @@ struct bktr_capture_area {
int x_size;
int y_size;
};
#define BT848SCAPAREA _IOW('x', 69, struct bktr_capture_area)
#define BT848GCAPAREA _IOR('x', 69, struct bktr_capture_area)
#define BT848_SCAPAREA _IOW('x', 69, struct bktr_capture_area)
#define BT848_GCAPAREA _IOR('x', 69, struct bktr_capture_area)
/* Read/Write the BT848's I2C bus directly
* b7-b0: data (read/write)

View File

@ -210,8 +210,8 @@ struct bktr_capture_area {
int x_size;
int y_size;
};
#define BT848SCAPAREA _IOW('x', 69, struct bktr_capture_area)
#define BT848GCAPAREA _IOR('x', 69, struct bktr_capture_area)
#define BT848_SCAPAREA _IOW('x', 69, struct bktr_capture_area)
#define BT848_GCAPAREA _IOR('x', 69, struct bktr_capture_area)
/* Read/Write the BT848's I2C bus directly
* b7-b0: data (read/write)

View File

@ -57,6 +57,7 @@ struct bt848_registers {
#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 */
@ -125,7 +126,14 @@ struct bt848_registers {
int :32; /* 74, 75,76,77 */
int :32; /* 78, 79,7a,7b */
BTLONG (sreset); /* 7c, 7d,7e,7f */
u_char filler[0x8c-0x80];
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 */
@ -149,10 +157,10 @@ struct bt848_registers {
#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_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 */
@ -179,7 +187,12 @@ struct bt848_registers {
BTBYTE (vbi_pack_del); /* e4, e5,e6,e7 */
int :32; /* e8, e9,ea,eb */
BTBYTE (o_vtc); /* ec, ed,ee,ef */
u_char filler2[0x100-0xf0];
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)

View File

@ -1,4 +1,4 @@
/* BT848 1.40 Driver for Brooktree's Bt848 based cards.
/* BT848 1.41 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
Philips SAA 7116 and SAA 7196 are very different chipsets than
@ -274,13 +274,23 @@
for newer NTSC WinCastTV 404 with Bt878 chipset.
Tidied up PAL default in video_open()
1.40 10 August 1998 Roger Hardiman <roger@cs.strath.ac.uk>
1.49 10 August 1998 Roger Hardiman <roger@cs.strath.ac.uk>
Added Capture Area ioctl - BT848[SG]CAPAREA.
Normally the full 640x480 (768x576 PAL) image
is grabbed. This ioctl allows a smaller area
from anywhere within the video image to be
grabbed, eg a 400x300 image from (50,10).
See restrictions in BT848SCAPAREA.
1.50 31 August 1998 Roger Hardiman <roger@cs.strath.ac.uk>
Renamed BT848[SG]CAPAREA to BT848_[SG]CAPAREA.
Added PR kern/7177 for SECAM Video Highway Xtreme
with single crystal PLL configuration
submitted by Vsevolod Lobko <seva@alex-ua.com>.
In kernel configuration file add
options OVERRIDE_CARD=2
options OVERRIDE_TUNER=11
options BKTR_USE_PLL
*/
#define DDB(x) x
@ -532,7 +542,7 @@ static struct format_params format_params[] = {
/* # define BT848_IFORM_F_PALN (0x5) */
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x72, BT848_IFORM_X_XT1 },
/* # define BT848_IFORM_F_SECAM (0x6) */
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x00, BT848_IFORM_X_XT1 },
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x72, BT848_IFORM_X_XT1 },
/* # define BT848_IFORM_F_RSVD (0x7) - ???? */
{ 625, 32, 576, 1135, 186, 922, 768, 944, 25, 0x7f, 0x72, BT848_IFORM_X_XT0 },
};
@ -636,6 +646,10 @@ static struct {
#define PHILIPS_FR1236_NTSC_WADDR 0xc2
#define PHILIPS_FR1236_NTSC_RADDR 0xc3
/* PLL on a the Philips FR1236MK2 tuner */
#define PHILIPS_FR1236_SECAM_WADDR 0xc0
#define PHILIPS_FR1236_SECAM_RADDR 0xc1
/* PLL on a the Philips FR1216MK2 tuner,
yes, the european version of the tuner is 1216 */
#define PHILIPS_FR1216_PAL_WADDR 0xc2
@ -741,7 +755,8 @@ static struct {
#define PHILIPS_PALI 8
#define PHILIPS_FR1236_NTSC 9
#define PHILIPS_FR1216_PAL 10
#define Bt848_MAX_TUNER 11
#define PHILIPS_FR1236_SECAM 11
#define Bt848_MAX_TUNER 12
/* XXX FIXME: this list is incomplete */
@ -886,6 +901,17 @@ static const struct TUNER tuners[] = {
TSA552x_RADIO },
{ 0x00, 0x00 }, /* band-switch crosspoints */
{ 0xa0, 0x90, 0x30, 0xa4 } }, /* the band-switch values */
/* PHILIPS_FR1236_SECAM */
{ "Philips FR1236 SECAM FM", /* the 'name' */
TTYPE_SECAM, /* input type */
PHILIPS_FR1236_SECAM_WADDR, /* PLL write address */
{ TSA552x_FCONTROL, /* control byte for PLL */
TSA552x_FCONTROL,
TSA552x_FCONTROL,
TSA552x_RADIO },
{ 0x00, 0x00 }, /* band-switch crosspoints */
{ 0xa0, 0x90, 0x30, 0xa4 } }, /* the band-switch values */
};
/******************************************************************************
@ -1648,6 +1674,13 @@ video_open( bktr_ptr_t bktr )
bt848->bdelay = format_params[bktr->format_params].bdelay;
frame_rate = format_params[bktr->format_params].frame_rate;
#ifdef BKTR_USE_PLL
bt848->tgctrl=0;
bt848->pll_f_lo=0xf9;
bt848->pll_f_hi=0xdc;
bt848->pll_f_xci=0x8e;
#endif
bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) | METEOR_DEV0;
bktr->max_clip_node = 0;
@ -2419,7 +2452,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
break;
/* end of METEORSETGEO */
/* FIXME. The Capture Area currently has the following restrictions
/* FIXME. The Capture Area currently has the following restrictions:
GENERAL
y_offset may need to be even in interlaced modes
RGB24 - Interlaced mode
@ -2436,7 +2469,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
y_size must be greater than or equal to 2*METEORSETGEO height (rows)
*/
case BT848SCAPAREA: /* set capture area of each video frame */
case BT848_SCAPAREA: /* set capture area of each video frame */
/* can't change parameters while capturing */
if (bktr->flags & METEOR_CAP_MASK)
return( EBUSY );
@ -2451,7 +2484,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
bktr->dma_prog_loaded = FALSE;
break;
case BT848GCAPAREA: /* get capture area of each video frame */
case BT848_GCAPAREA: /* get capture area of each video frame */
cap_area = (struct bktr_capture_area *) arg;
if (bktr->capture_area_enabled == FALSE) {
cap_area->x_offset = 0;
@ -3823,6 +3856,14 @@ build_dma_prog( bktr_ptr_t bktr, char i_flag )
/* end of video params */
#ifdef BKTR_USE_PLL
if (fp->iform_xtsel==BT848_IFORM_X_XT1) {
bt848->tgctrl=8; /* Select PLL mode */
} else {
bt848->tgctrl=0; /* Select Normal xtal 0/xtal 1 mode */
}
#endif
/* capture control */
switch (i_flag) {
case 1:

View File

@ -210,8 +210,8 @@ struct bktr_capture_area {
int x_size;
int y_size;
};
#define BT848SCAPAREA _IOW('x', 69, struct bktr_capture_area)
#define BT848GCAPAREA _IOR('x', 69, struct bktr_capture_area)
#define BT848_SCAPAREA _IOW('x', 69, struct bktr_capture_area)
#define BT848_GCAPAREA _IOR('x', 69, struct bktr_capture_area)
/* Read/Write the BT848's I2C bus directly
* b7-b0: data (read/write)