提交 b287db11 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] se401: remove last V4L1 driver

This driver is for obsolete hardware that the old maintainer
didn't care (or not have the hardware anymore), and that no other developer
could find any hardware to buy.

The V4L1 API is no longer supported, and since nobody stepped in to convert
them to V4L2 the decision was made to remove them.
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 37d803ed
......@@ -97,21 +97,6 @@ Who: Pavel Machek <pavel@ucw.cz>
---------------------------
What: Video4Linux obsolete drivers using V4L1 API
When: kernel 2.6.39
Files: drivers/staging/se401/* drivers/staging/usbvideo/*
Check: drivers/staging/se401/se401.c drivers/staging/usbvideo/usbvideo.c
Why: There are some drivers still using V4L1 API, despite all efforts we've done
to migrate. Those drivers are for obsolete hardware that the old maintainer
didn't care (or not have the hardware anymore), and that no other developer
could find any hardware to buy. They probably have no practical usage today,
and people with such old hardware could probably keep using an older version
of the kernel. Those drivers will be moved to staging on 2.6.38 and, if nobody
cares enough to port and test them with V4L2 API, they'll be removed on 2.6.39.
Who: Mauro Carvalho Chehab <mchehab@infradead.org>
---------------------------
What: Video4Linux: Remove obsolete ioctl's
When: kernel 2.6.39
Files: include/media/videodev2.h
......
......@@ -55,8 +55,6 @@ source "drivers/staging/cxd2099/Kconfig"
source "drivers/staging/dabusb/Kconfig"
source "drivers/staging/se401/Kconfig"
source "drivers/staging/usbip/Kconfig"
source "drivers/staging/winbond/Kconfig"
......
......@@ -10,7 +10,6 @@ obj-$(CONFIG_VIDEO_CX25821) += cx25821/
obj-$(CONFIG_VIDEO_TM6000) += tm6000/
obj-$(CONFIG_DVB_CXD2099) += cxd2099/
obj-$(CONFIG_USB_DABUSB) += dabusb/
obj-$(CONFIG_USB_SE401) += se401/
obj-$(CONFIG_LIRC_STAGING) += lirc/
obj-$(CONFIG_USB_IP_COMMON) += usbip/
obj-$(CONFIG_W35UND) += winbond/
......
config USB_SE401
tristate "USB SE401 Camera support (DEPRECATED)"
depends on VIDEO_DEV && VIDEO_V4L2_COMMON && USB
---help---
Say Y here if you want to connect this type of camera to your
computer's USB port. See <file:Documentation/video4linux/se401.txt>
for more information and for a list of supported cameras.
This driver uses the deprecated V4L1 API and will be removed in
2.6.39, unless someone converts it to the V4L2 API.
To compile this driver as a module, choose M here: the
module will be called se401.
obj-$(CONFIG_USB_SE401) += se401.o
This is an obsolete driver for some old webcams that still use V4L1 API.
As V4L1 support is being removed from kernel, if nobody take care on it,
the driver will be removed for 2.6.39.
Please send patches to linux-media@vger.kernel.org
此差异已折叠。
#ifndef __LINUX_se401_H
#define __LINUX_se401_H
#include <linux/uaccess.h>
#include "videodev.h"
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <linux/mutex.h>
#define se401_DEBUG /* Turn on debug messages */
#ifdef se401_DEBUG
# define PDEBUG(level, fmt, args...) \
if (debug >= level) \
info("[" __PRETTY_FUNCTION__ ":%d] " fmt, __LINE__ , ## args)
#else
# define PDEBUG(level, fmt, args...) do {} while (0)
#endif
/* An almost drop-in replacement for sleep_on_interruptible */
#define wait_interruptible(test, queue, wait) \
{ \
add_wait_queue(queue, wait); \
set_current_state(TASK_INTERRUPTIBLE); \
if (test) \
schedule(); \
remove_wait_queue(queue, wait); \
set_current_state(TASK_RUNNING); \
if (signal_pending(current)) \
break; \
}
#define SE401_REQ_GET_CAMERA_DESCRIPTOR 0x06
#define SE401_REQ_START_CONTINUOUS_CAPTURE 0x41
#define SE401_REQ_STOP_CONTINUOUS_CAPTURE 0x42
#define SE401_REQ_CAPTURE_FRAME 0x43
#define SE401_REQ_GET_BRT 0x44
#define SE401_REQ_SET_BRT 0x45
#define SE401_REQ_GET_WIDTH 0x4c
#define SE401_REQ_SET_WIDTH 0x4d
#define SE401_REQ_GET_HEIGHT 0x4e
#define SE401_REQ_SET_HEIGHT 0x4f
#define SE401_REQ_GET_OUTPUT_MODE 0x50
#define SE401_REQ_SET_OUTPUT_MODE 0x51
#define SE401_REQ_GET_EXT_FEATURE 0x52
#define SE401_REQ_SET_EXT_FEATURE 0x53
#define SE401_REQ_CAMERA_POWER 0x56
#define SE401_REQ_LED_CONTROL 0x57
#define SE401_REQ_BIOS 0xff
#define SE401_BIOS_READ 0x07
#define SE401_FORMAT_BAYER 0x40
/* Hyundai hv7131b registers
7121 and 7141 should be the same (haven't really checked...) */
/* Mode registers: */
#define HV7131_REG_MODE_A 0x00
#define HV7131_REG_MODE_B 0x01
#define HV7131_REG_MODE_C 0x02
/* Frame registers: */
#define HV7131_REG_FRSU 0x10
#define HV7131_REG_FRSL 0x11
#define HV7131_REG_FCSU 0x12
#define HV7131_REG_FCSL 0x13
#define HV7131_REG_FWHU 0x14
#define HV7131_REG_FWHL 0x15
#define HV7131_REG_FWWU 0x16
#define HV7131_REG_FWWL 0x17
/* Timing registers: */
#define HV7131_REG_THBU 0x20
#define HV7131_REG_THBL 0x21
#define HV7131_REG_TVBU 0x22
#define HV7131_REG_TVBL 0x23
#define HV7131_REG_TITU 0x25
#define HV7131_REG_TITM 0x26
#define HV7131_REG_TITL 0x27
#define HV7131_REG_TMCD 0x28
/* Adjust Registers: */
#define HV7131_REG_ARLV 0x30
#define HV7131_REG_ARCG 0x31
#define HV7131_REG_AGCG 0x32
#define HV7131_REG_ABCG 0x33
#define HV7131_REG_APBV 0x34
#define HV7131_REG_ASLP 0x54
/* Offset Registers: */
#define HV7131_REG_OFSR 0x50
#define HV7131_REG_OFSG 0x51
#define HV7131_REG_OFSB 0x52
/* REset level statistics registers: */
#define HV7131_REG_LOREFNOH 0x57
#define HV7131_REG_LOREFNOL 0x58
#define HV7131_REG_HIREFNOH 0x59
#define HV7131_REG_HIREFNOL 0x5a
/* se401 registers */
#define SE401_OPERATINGMODE 0x2000
/* size of usb transfers */
#define SE401_PACKETSIZE 4096
/* number of queued bulk transfers to use, should be about 8 */
#define SE401_NUMSBUF 1
/* read the usb specs for this one :) */
#define SE401_VIDEO_ENDPOINT 1
#define SE401_BUTTON_ENDPOINT 2
/* number of frames supported by the v4l part */
#define SE401_NUMFRAMES 2
/* scratch buffers for passing data to the decoders */
#define SE401_NUMSCRATCH 32
/* maximum amount of data in a JangGu packet */
#define SE401_VLCDATALEN 1024
/* number of nul sized packets to receive before kicking the camera */
#define SE401_MAX_NULLPACKETS 4000
/* number of decoding errors before kicking the camera */
#define SE401_MAX_ERRORS 200
struct usb_device;
struct se401_sbuf {
unsigned char *data;
};
enum {
FRAME_UNUSED, /* Unused (no MCAPTURE) */
FRAME_READY, /* Ready to start grabbing */
FRAME_GRABBING, /* In the process of being grabbed into */
FRAME_DONE, /* Finished grabbing, but not been synced yet */
FRAME_ERROR, /* Something bad happened while processing */
};
enum {
FMT_BAYER,
FMT_JANGGU,
};
enum {
BUFFER_UNUSED,
BUFFER_READY,
BUFFER_BUSY,
BUFFER_DONE,
};
struct se401_scratch {
unsigned char *data;
volatile int state;
int offset;
int length;
};
struct se401_frame {
unsigned char *data; /* Frame buffer */
volatile int grabstate; /* State of grabbing */
unsigned char *curline;
int curlinepix;
int curpix;
};
struct usb_se401 {
struct video_device vdev;
/* Device structure */
struct usb_device *dev;
unsigned char iface;
char *camera_name;
int change;
int brightness;
int hue;
int rgain;
int ggain;
int bgain;
int expose_h;
int expose_m;
int expose_l;
int resetlevel;
int enhance;
int format;
int sizes;
int *width;
int *height;
int cwidth; /* current width */
int cheight; /* current height */
int palette;
int maxframesize;
int cframesize; /* current framesize */
struct mutex lock;
int user; /* user count for exclusive use */
int removed; /* device disconnected */
int streaming; /* Are we streaming video? */
char *fbuf; /* Videodev buffer area */
struct urb *urb[SE401_NUMSBUF];
struct urb *inturb;
int button;
int buttonpressed;
int curframe; /* Current receiving frame */
struct se401_frame frame[SE401_NUMFRAMES];
int readcount;
int framecount;
int error;
int dropped;
int scratch_next;
int scratch_use;
int scratch_overflow;
struct se401_scratch scratch[SE401_NUMSCRATCH];
/* Decoder specific data: */
unsigned char vlcdata[SE401_VLCDATALEN];
int vlcdatapos;
int bayeroffset;
struct se401_sbuf sbuf[SE401_NUMSBUF];
wait_queue_head_t wq; /* Processes waiting */
int nullpackets;
};
#endif
/*
* Video for Linux version 1 - OBSOLETE
*
* Header file for v4l1 drivers and applications, for
* Linux kernels 2.2.x or 2.4.x.
*
* Provides header for legacy drivers and applications
*
* See http://linuxtv.org for more info
*
*/
#ifndef __LINUX_VIDEODEV_H
#define __LINUX_VIDEODEV_H
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/videodev2.h>
#define VID_TYPE_CAPTURE 1 /* Can capture */
#define VID_TYPE_TUNER 2 /* Can tune */
#define VID_TYPE_TELETEXT 4 /* Does teletext */
#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
#define VID_TYPE_CLIPPING 32 /* Can clip */
#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
#define VID_TYPE_SCALES 128 /* Scalable */
#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
struct video_capability
{
char name[32];
int type;
int channels; /* Num channels */
int audios; /* Num audio devices */
int maxwidth; /* Supported width */
int maxheight; /* And height */
int minwidth; /* Supported width */
int minheight; /* And height */
};
struct video_channel
{
int channel;
char name[32];
int tuners;
__u32 flags;
#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
#define VIDEO_VC_AUDIO 2 /* Channel has audio */
__u16 type;
#define VIDEO_TYPE_TV 1
#define VIDEO_TYPE_CAMERA 2
__u16 norm; /* Norm set by channel */
};
struct video_tuner
{
int tuner;
char name[32];
unsigned long rangelow, rangehigh; /* Tuner range */
__u32 flags;
#define VIDEO_TUNER_PAL 1
#define VIDEO_TUNER_NTSC 2
#define VIDEO_TUNER_SECAM 4
#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
__u16 mode; /* PAL/NTSC/SECAM/OTHER */
#define VIDEO_MODE_PAL 0
#define VIDEO_MODE_NTSC 1
#define VIDEO_MODE_SECAM 2
#define VIDEO_MODE_AUTO 3
__u16 signal; /* Signal strength 16bit scale */
};
struct video_picture
{
__u16 brightness;
__u16 hue;
__u16 colour;
__u16 contrast;
__u16 whiteness; /* Black and white only */
__u16 depth; /* Capture depth */
__u16 palette; /* Palette in use */
#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
#define VIDEO_PALETTE_YUYV 8
#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
#define VIDEO_PALETTE_YUV420 10
#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
};
struct video_audio
{
int audio; /* Audio channel */
__u16 volume; /* If settable */
__u16 bass, treble;
__u32 flags;
#define VIDEO_AUDIO_MUTE 1
#define VIDEO_AUDIO_MUTABLE 2
#define VIDEO_AUDIO_VOLUME 4
#define VIDEO_AUDIO_BASS 8
#define VIDEO_AUDIO_TREBLE 16
#define VIDEO_AUDIO_BALANCE 32
char name[16];
#define VIDEO_SOUND_MONO 1
#define VIDEO_SOUND_STEREO 2
#define VIDEO_SOUND_LANG1 4
#define VIDEO_SOUND_LANG2 8
__u16 mode;
__u16 balance; /* Stereo balance */
__u16 step; /* Step actual volume uses */
};
struct video_clip
{
__s32 x,y;
__s32 width, height;
struct video_clip *next; /* For user use/driver use only */
};
struct video_window
{
__u32 x,y; /* Position of window */
__u32 width,height; /* Its size */
__u32 chromakey;
__u32 flags;
struct video_clip __user *clips; /* Set only */
int clipcount;
#define VIDEO_WINDOW_INTERLACE 1
#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
#define VIDEO_CLIP_BITMAP -1
/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
#define VIDEO_CLIPMAP_SIZE (128 * 625)
};
struct video_capture
{
__u32 x,y; /* Offsets into image */
__u32 width, height; /* Area to capture */
__u16 decimation; /* Decimation divider */
__u16 flags; /* Flags for capture */
#define VIDEO_CAPTURE_ODD 0 /* Temporal */
#define VIDEO_CAPTURE_EVEN 1
};
struct video_buffer
{
void *base;
int height,width;
int depth;
int bytesperline;
};
struct video_mmap
{
unsigned int frame; /* Frame (0 - n) for double buffer */
int height,width;
unsigned int format; /* should be VIDEO_PALETTE_* */
};
struct video_key
{
__u8 key[8];
__u32 flags;
};
struct video_mbuf
{
int size; /* Total memory to map */
int frames; /* Frames */
int offsets[VIDEO_MAX_FRAME];
};
#define VIDEO_NO_UNIT (-1)
struct video_unit
{
int video; /* Video minor */
int vbi; /* VBI minor */
int radio; /* Radio minor */
int audio; /* Audio minor */
int teletext; /* Teletext minor */
};
struct vbi_format {
__u32 sampling_rate; /* in Hz */
__u32 samples_per_line;
__u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
__s32 start[2]; /* starting line for each frame */
__u32 count[2]; /* count of lines for each frame */
__u32 flags;
#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
#define VBI_INTERLACED 2 /* lines are interlaced */
};
/* video_info is biased towards hardware mpeg encode/decode */
/* but it could apply generically to any hardware compressor/decompressor */
struct video_info
{
__u32 frame_count; /* frames output since decode/encode began */
__u32 h_size; /* current unscaled horizontal size */
__u32 v_size; /* current unscaled veritcal size */
__u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
__u32 picture_type; /* current picture type */
__u32 temporal_reference; /* current temporal reference */
__u8 user_data[256]; /* user data last found in compressed stream */
/* user_data[0] contains user data flags, user_data[1] has count */
};
/* generic structure for setting playback modes */
struct video_play_mode
{
int mode;
int p1;
int p2;
};
/* for loading microcode / fpga programming */
struct video_code
{
char loadwhat[16]; /* name or tag of file being passed */
int datasize;
__u8 *data;
};
#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
/* VIDIOCSWRITEMODE */
#define VID_WRITE_MPEG_AUD 0
#define VID_WRITE_MPEG_VID 1
#define VID_WRITE_OSD 2
#define VID_WRITE_TTX 3
#define VID_WRITE_CC 4
#define VID_WRITE_MJPEG 5
/* VIDIOCSPLAYMODE */
#define VID_PLAY_VID_OUT_MODE 0
/* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
#define VID_PLAY_GENLOCK 1
/* p1: 0 = OFF, 1 = ON */
/* p2: GENLOCK FINE DELAY value */
#define VID_PLAY_NORMAL 2
#define VID_PLAY_PAUSE 3
#define VID_PLAY_SINGLE_FRAME 4
#define VID_PLAY_FAST_FORWARD 5
#define VID_PLAY_SLOW_MOTION 6
#define VID_PLAY_IMMEDIATE_NORMAL 7
#define VID_PLAY_SWITCH_CHANNELS 8
#define VID_PLAY_FREEZE_FRAME 9
#define VID_PLAY_STILL_MODE 10
#define VID_PLAY_MASTER_MODE 11
/* p1: see below */
#define VID_PLAY_MASTER_NONE 1
#define VID_PLAY_MASTER_VIDEO 2
#define VID_PLAY_MASTER_AUDIO 3
#define VID_PLAY_ACTIVE_SCANLINES 12
/* p1 = first active; p2 = last active */
#define VID_PLAY_RESET 13
#define VID_PLAY_END_MARK 14
#endif /* __LINUX_VIDEODEV_H */
/*
* Local variables:
* c-basic-offset: 8
* End:
*/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册