1997-03-10 06:38:26 +00:00
|
|
|
/*
|
|
|
|
* extensions to ioctl_meteor.h for the bt848 cards
|
1998-09-30 20:43:25 +00:00
|
|
|
*
|
1999-02-11 10:18:04 +00:00
|
|
|
* $Id: ioctl_bt848.h,v 1.20 1999/01/28 16:32:52 roger Exp $
|
1997-03-10 06:38:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
1997-03-21 17:29:54 +00:00
|
|
|
* frequency sets
|
1997-03-10 06:38:26 +00:00
|
|
|
*/
|
1997-03-21 17:29:54 +00:00
|
|
|
#define CHNLSET_NABCST 1
|
|
|
|
#define CHNLSET_CABLEIRC 2
|
|
|
|
#define CHNLSET_CABLEHRC 3
|
|
|
|
#define CHNLSET_WEUROPE 4
|
1997-10-07 06:30:01 +00:00
|
|
|
#define CHNLSET_JPNBCST 5
|
|
|
|
#define CHNLSET_JPNCABLE 6
|
1998-09-10 07:52:30 +00:00
|
|
|
#define CHNLSET_XUSSR 7
|
1997-10-07 06:30:01 +00:00
|
|
|
#define CHNLSET_MIN CHNLSET_NABCST
|
1998-09-10 07:52:30 +00:00
|
|
|
#define CHNLSET_MAX CHNLSET_XUSSR
|
1997-03-10 06:38:26 +00:00
|
|
|
|
|
|
|
|
1997-03-16 07:40:01 +00:00
|
|
|
/*
|
|
|
|
* constants for various tuner registers
|
|
|
|
*/
|
|
|
|
#define BT848_HUEMIN (-90)
|
|
|
|
#define BT848_HUEMAX 90
|
|
|
|
#define BT848_HUECENTER 0
|
|
|
|
#define BT848_HUERANGE 179.3
|
|
|
|
#define BT848_HUEREGMIN (-128)
|
|
|
|
#define BT848_HUEREGMAX 127
|
|
|
|
#define BT848_HUESTEPS 256
|
|
|
|
|
|
|
|
#define BT848_BRIGHTMIN (-50)
|
|
|
|
#define BT848_BRIGHTMAX 50
|
|
|
|
#define BT848_BRIGHTCENTER 0
|
|
|
|
#define BT848_BRIGHTRANGE 99.6
|
|
|
|
#define BT848_BRIGHTREGMIN (-128)
|
|
|
|
#define BT848_BRIGHTREGMAX 127
|
|
|
|
#define BT848_BRIGHTSTEPS 256
|
|
|
|
|
|
|
|
#define BT848_CONTRASTMIN 0
|
|
|
|
#define BT848_CONTRASTMAX 237
|
|
|
|
#define BT848_CONTRASTCENTER 100
|
|
|
|
#define BT848_CONTRASTRANGE 236.57
|
|
|
|
#define BT848_CONTRASTREGMIN 0
|
|
|
|
#define BT848_CONTRASTREGMAX 511
|
|
|
|
#define BT848_CONTRASTSTEPS 512
|
|
|
|
|
|
|
|
#define BT848_CHROMAMIN 0
|
|
|
|
#define BT848_CHROMAMAX 284
|
|
|
|
#define BT848_CHROMACENTER 100
|
|
|
|
#define BT848_CHROMARANGE 283.89
|
|
|
|
#define BT848_CHROMAREGMIN 0
|
|
|
|
#define BT848_CHROMAREGMAX 511
|
|
|
|
#define BT848_CHROMASTEPS 512
|
|
|
|
|
|
|
|
#define BT848_SATUMIN 0
|
|
|
|
#define BT848_SATUMAX 202
|
|
|
|
#define BT848_SATUCENTER 100
|
|
|
|
#define BT848_SATURANGE 201.18
|
|
|
|
#define BT848_SATUREGMIN 0
|
|
|
|
#define BT848_SATUREGMAX 511
|
|
|
|
#define BT848_SATUSTEPS 512
|
|
|
|
|
|
|
|
#define BT848_SATVMIN 0
|
|
|
|
#define BT848_SATVMAX 284
|
|
|
|
#define BT848_SATVCENTER 100
|
|
|
|
#define BT848_SATVRANGE 283.89
|
|
|
|
#define BT848_SATVREGMIN 0
|
|
|
|
#define BT848_SATVREGMAX 511
|
|
|
|
#define BT848_SATVSTEPS 512
|
|
|
|
|
|
|
|
|
1997-03-21 17:29:54 +00:00
|
|
|
/*
|
|
|
|
* audio stuff
|
|
|
|
*/
|
|
|
|
#define AUDIO_TUNER 0x00 /* command for the audio routine */
|
|
|
|
#define AUDIO_EXTERN 0x01 /* don't confuse them with bit */
|
|
|
|
#define AUDIO_INTERN 0x02 /* settings */
|
|
|
|
#define AUDIO_MUTE 0x80
|
|
|
|
#define AUDIO_UNMUTE 0x81
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* EEProm stuff
|
|
|
|
*/
|
1997-03-19 19:08:31 +00:00
|
|
|
struct eeProm {
|
1997-03-25 04:11:13 +00:00
|
|
|
short offset;
|
|
|
|
short count;
|
|
|
|
u_char bytes[ 256 ];
|
1997-03-19 19:08:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1997-03-10 06:38:26 +00:00
|
|
|
/*
|
|
|
|
* XXX: this is a hack, should be in ioctl_meteor.h
|
|
|
|
* here to avoid touching that file for now...
|
|
|
|
*/
|
|
|
|
#define TVTUNER_SETCHNL _IOW('x', 32, unsigned int) /* set channel */
|
|
|
|
#define TVTUNER_GETCHNL _IOR('x', 32, unsigned int) /* get channel */
|
|
|
|
#define TVTUNER_SETTYPE _IOW('x', 33, unsigned int) /* set tuner type */
|
|
|
|
#define TVTUNER_GETTYPE _IOR('x', 33, unsigned int) /* get tuner type */
|
|
|
|
#define TVTUNER_GETSTATUS _IOR('x', 34, unsigned int) /* get tuner status */
|
1997-03-16 07:40:01 +00:00
|
|
|
#define TVTUNER_SETFREQ _IOW('x', 35, unsigned int) /* set frequency */
|
|
|
|
#define TVTUNER_GETFREQ _IOR('x', 36, unsigned int) /* get frequency */
|
1999-02-11 10:18:04 +00:00
|
|
|
|
1997-03-16 07:40:01 +00:00
|
|
|
|
1997-03-21 17:29:54 +00:00
|
|
|
#define BT848_SHUE _IOW('x', 37, int) /* set hue */
|
|
|
|
#define BT848_GHUE _IOR('x', 37, int) /* get hue */
|
1997-03-16 07:40:01 +00:00
|
|
|
#define BT848_SBRIG _IOW('x', 38, int) /* set brightness */
|
1997-03-21 17:29:54 +00:00
|
|
|
#define BT848_GBRIG _IOR('x', 38, int) /* get brightness */
|
1997-03-16 07:40:01 +00:00
|
|
|
#define BT848_SCSAT _IOW('x', 39, int) /* set chroma sat */
|
1997-03-21 17:29:54 +00:00
|
|
|
#define BT848_GCSAT _IOR('x', 39, int) /* get UV saturation */
|
|
|
|
#define BT848_SCONT _IOW('x', 40, int) /* set contrast */
|
1997-03-16 07:40:01 +00:00
|
|
|
#define BT848_GCONT _IOR('x', 40, int) /* get contrast */
|
|
|
|
#define BT848_SVSAT _IOW('x', 41, int) /* set chroma V sat */
|
1997-03-21 17:29:54 +00:00
|
|
|
#define BT848_GVSAT _IOR('x', 41, int) /* get V saturation */
|
1997-03-16 07:40:01 +00:00
|
|
|
#define BT848_SUSAT _IOW('x', 42, int) /* set chroma U sat */
|
1997-03-21 17:29:54 +00:00
|
|
|
#define BT848_GUSAT _IOR('x', 42, int) /* get U saturation */
|
1997-03-10 06:38:26 +00:00
|
|
|
|
1997-03-19 19:08:31 +00:00
|
|
|
#define BT848_SCBARS _IOR('x', 43, int) /* set colorbar */
|
|
|
|
#define BT848_CCBARS _IOR('x', 44, int) /* clear colorbar */
|
|
|
|
|
1997-03-10 06:38:26 +00:00
|
|
|
|
1997-03-21 17:29:54 +00:00
|
|
|
#define BT848_SAUDIO _IOW('x', 46, int) /* set audio channel */
|
|
|
|
#define BT848_GAUDIO _IOR('x', 47, int) /* get audio channel */
|
|
|
|
#define BT848_SBTSC _IOW('x', 48, int) /* set audio channel */
|
|
|
|
|
1997-03-25 04:11:13 +00:00
|
|
|
#define BT848_GSTATUS _IOR('x', 49, unsigned int) /* reap status */
|
|
|
|
|
1997-04-02 01:48:39 +00:00
|
|
|
#define BT848_WEEPROM _IOWR('x', 50, struct eeProm) /* write to EEProm */
|
|
|
|
#define BT848_REEPROM _IOWR('x', 51, struct eeProm) /* read from EEProm */
|
|
|
|
|
|
|
|
#define BT848_SIGNATURE _IOWR('x', 52, struct eeProm) /* read card sig */
|
|
|
|
|
|
|
|
#define TVTUNER_SETAFC _IOW('x', 53, int) /* turn AFC on/off */
|
|
|
|
#define TVTUNER_GETAFC _IOR('x', 54, int) /* query AFC on/off */
|
1997-09-09 06:32:32 +00:00
|
|
|
#define BT848_SLNOTCH _IOW('x', 55, int) /* set luma notch */
|
|
|
|
#define BT848_GLNOTCH _IOR('x', 56, int) /* get luma notch */
|
1997-03-25 04:11:13 +00:00
|
|
|
|
1999-02-11 10:18:04 +00:00
|
|
|
#define BT848_MAX_CHNLSET_NAME_LEN 16
|
|
|
|
struct bktr_chnlset {
|
|
|
|
short index;
|
|
|
|
short max_channel;
|
|
|
|
char name[BT848_MAX_CHNLSET_NAME_LEN];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TVTUNER_GETCHNLSET _IOWR('x', 57, struct bktr_chnlset) /* get channelset */
|
|
|
|
|
|
|
|
struct bktr_remote {
|
|
|
|
unsigned char data[3];
|
|
|
|
};
|
|
|
|
#define REMOTE_GETKEY _IOR('x', 58, struct bktr_remote) /*get remote keypress*/ /*returns raw data*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Direct access to GPIO pins
|
|
|
|
*/
|
|
|
|
#define BT848_GPIO_SET_EN _IOW('x', 59, int) /* set gpio_out_en */
|
|
|
|
#define BT848_GPIO_GET_EN _IOR('x', 60, int) /* get gpio_out_en */
|
|
|
|
#define BT848_GPIO_SET_DATA _IOW('x', 61, int) /* set gpio_data */
|
|
|
|
#define BT848_GPIO_GET_DATA _IOR('x', 62, int) /* get gpio_data */
|
|
|
|
|
1997-03-10 06:38:26 +00:00
|
|
|
/*
|
|
|
|
* XXX: more bad magic,
|
|
|
|
* we need to fix the METEORGINPUT to return something public
|
|
|
|
* duplicate them here for now...
|
|
|
|
*/
|
|
|
|
#define METEOR_DEV0 0x00001000
|
|
|
|
#define METEOR_DEV1 0x00002000
|
|
|
|
#define METEOR_DEV2 0x00004000
|
1999-01-28 16:32:52 +00:00
|
|
|
#define METEOR_DEV3 0x00008000
|
|
|
|
#define METEOR_DEV_SVIDEO 0x00006000
|
1997-05-01 00:15:30 +00:00
|
|
|
/*
|
|
|
|
* right now I don't know were to put these, but as they are suppose to be
|
|
|
|
* a part of a common video capture interface, these should be relocated to
|
|
|
|
* another place. Probably most of the METEOR_xxx defines need to be
|
|
|
|
* renamed and moved to a common header
|
|
|
|
*/
|
|
|
|
|
1997-09-09 06:32:32 +00:00
|
|
|
typedef enum { METEOR_PIXTYPE_RGB, METEOR_PIXTYPE_YUV,
|
1997-11-16 04:52:29 +00:00
|
|
|
METEOR_PIXTYPE_YUV_PACKED,
|
|
|
|
METEOR_PIXTYPE_YUV_12 } METEOR_PIXTYPE;
|
|
|
|
|
1997-05-01 00:15:30 +00:00
|
|
|
|
|
|
|
struct meteor_pixfmt {
|
|
|
|
u_int index; /* Index in supported pixfmt list */
|
|
|
|
METEOR_PIXTYPE type; /* What's the board gonna feed us */
|
|
|
|
u_int Bpp; /* Bytes per pixel */
|
|
|
|
u_long masks[3]; /* R,G,B or Y,U,V masks, respectively */
|
|
|
|
unsigned swap_bytes :1; /* Bytes swapped within shorts */
|
|
|
|
unsigned swap_shorts:1; /* Shorts swapped within longs */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct bktr_clip {
|
|
|
|
int x_min;
|
|
|
|
int x_max;
|
|
|
|
int y_min;
|
|
|
|
int y_max;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BT848_MAX_CLIP_NODE 100
|
|
|
|
struct _bktr_clip {
|
|
|
|
struct bktr_clip x[BT848_MAX_CLIP_NODE];
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* I'm using METEOR_xxx just because that will be common to other interface
|
|
|
|
* and less of a surprise
|
|
|
|
*/
|
|
|
|
#define METEORSACTPIXFMT _IOW('x', 64, int )
|
|
|
|
#define METEORGACTPIXFMT _IOR('x', 64, int )
|
|
|
|
#define METEORGSUPPIXFMT _IOWR('x', 65, struct meteor_pixfmt)
|
|
|
|
|
|
|
|
/* set clip list */
|
|
|
|
#define BT848SCLIP _IOW('x', 66, struct _bktr_clip )
|
|
|
|
#define BT848GCLIP _IOR('x', 66, struct _bktr_clip )
|
1997-10-07 06:30:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* set input format */
|
|
|
|
#define BT848SFMT _IOW('x', 67, unsigned long )
|
|
|
|
#define BT848GFMT _IOR('x', 67, unsigned long )
|
|
|
|
|
1998-05-16 07:07:10 +00:00
|
|
|
/* set clear-buffer-on-start */
|
|
|
|
#define BT848SCBUF _IOW('x', 68, int)
|
|
|
|
#define BT848GCBUF _IOR('x', 68, int)
|
|
|
|
|
1998-08-31 18:31:36 +00:00
|
|
|
/* set capture area */
|
|
|
|
/* The capture area is the area of the video image which is grabbed */
|
|
|
|
/* Usually the capture area is 640x480 (768x576 PAL) pixels */
|
|
|
|
/* This area is then scaled to the dimensions the user requires */
|
|
|
|
/* using the METEORGEO ioctl */
|
|
|
|
/* However, the capture area could be 400x300 pixels from the top right */
|
|
|
|
/* corner of the video image */
|
|
|
|
struct bktr_capture_area {
|
|
|
|
int x_offset;
|
|
|
|
int y_offset;
|
|
|
|
int x_size;
|
|
|
|
int y_size;
|
|
|
|
};
|
1998-08-31 18:35:06 +00:00
|
|
|
#define BT848_SCAPAREA _IOW('x', 69, struct bktr_capture_area)
|
|
|
|
#define BT848_GCAPAREA _IOR('x', 69, struct bktr_capture_area)
|
1998-05-16 07:07:10 +00:00
|
|
|
|
1997-11-06 07:00:45 +00:00
|
|
|
/* Read/Write the BT848's I2C bus directly
|
|
|
|
* b7-b0: data (read/write)
|
|
|
|
* b15-b8: internal peripheral register (write)
|
|
|
|
* b23-b16: i2c addr (write)
|
|
|
|
* b31-b24: 1 = write, 0 = read
|
|
|
|
*/
|
|
|
|
#define BT848_I2CWR _IOWR('x', 57, u_long) /* i2c read-write */
|
1998-02-02 13:09:12 +00:00
|
|
|
/* Support for radio tuner */
|
|
|
|
#define RADIO_SETMODE _IOW('x', 58, unsigned int) /* set radio modes */
|
1998-02-26 08:19:14 +00:00
|
|
|
#define RADIO_GETMODE _IOR('x', 58, unsigned char) /* get radio modes */
|
|
|
|
#define RADIO_AFC 0x01 /* These modes will probably not */
|
|
|
|
#define RADIO_MONO 0x02 /* work on the FRxxxx. It does */
|
|
|
|
#define RADIO_MUTE 0x08 /* work on the FMxxxx. */
|
1998-02-02 13:09:12 +00:00
|
|
|
#define RADIO_SETFREQ _IOW('x', 59, unsigned int) /* set frequency */
|
|
|
|
#define RADIO_GETFREQ _IOR('x', 59, unsigned int) /* set frequency */
|
1998-02-26 08:19:14 +00:00
|
|
|
/* Argument is frequency*100MHz */
|
1997-11-06 07:00:45 +00:00
|
|
|
|
1997-10-07 06:30:01 +00:00
|
|
|
/* XXX - Copied from /sys/pci/brktree_reg.h */
|
|
|
|
#define BT848_IFORM_FORMAT (0x7<<0)
|
|
|
|
# define BT848_IFORM_F_RSVD (0x7)
|
|
|
|
# define BT848_IFORM_F_SECAM (0x6)
|
|
|
|
# define BT848_IFORM_F_PALN (0x5)
|
|
|
|
# define BT848_IFORM_F_PALM (0x4)
|
|
|
|
# define BT848_IFORM_F_PALBDGHI (0x3)
|
|
|
|
# define BT848_IFORM_F_NTSCJ (0x2)
|
|
|
|
# define BT848_IFORM_F_NTSCM (0x1)
|
|
|
|
# define BT848_IFORM_F_AUTO (0x0)
|
|
|
|
|