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

[media] usbvision: convert // to /* */

Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 5490a7cb
......@@ -39,7 +39,7 @@
static int i2c_debug;
module_param (i2c_debug, int, 0644); // debug_i2c_usb mode of the device driver
module_param (i2c_debug, int, 0644); /* debug_i2c_usb mode of the device driver */
MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
#define PDEBUG(level, fmt, args...) { \
......
......@@ -103,7 +103,7 @@ USBVISION_DRIVER_VERSION_PATCHLEVEL)
#define DBG_PROBE 1<<2
#define DBG_MMAP 1<<3
//String operations
/* String operations */
#define rmspace(str) while(*str==' ') str++;
#define goto2next(str) while(*str!=' ') str++; while(*str==' ') str++;
......@@ -118,7 +118,7 @@ static struct usbvision_v4l2_format_st usbvision_v4l2_format[] = {
{ 1, 4, 32, V4L2_PIX_FMT_RGB32 , "RGB32" },
{ 1, 2, 16, V4L2_PIX_FMT_RGB555 , "RGB555" },
{ 1, 2, 16, V4L2_PIX_FMT_YUYV , "YUV422" },
{ 1, 2, 12, V4L2_PIX_FMT_YVU420 , "YUV420P" }, // 1.5 !
{ 1, 2, 12, V4L2_PIX_FMT_YVU420 , "YUV420P" }, /* 1.5 ! */
{ 1, 2, 16, V4L2_PIX_FMT_YUV422P , "YUV422P" }
};
......@@ -153,7 +153,7 @@ MODULE_PARM_DESC(video_nr, "Set video device number (/dev/videoX). Default: -1
MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX). Default: -1 (autodetect)");
// Misc stuff
/* Misc stuff */
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE(DRIVER_LICENSE);
......@@ -534,7 +534,7 @@ static int vidioc_enum_input (struct file *file, void *priv,
if (usbvision->have_tuner) {
chan = vi->index;
} else {
chan = vi->index + 1; /*skip Television string*/
chan = vi->index + 1; /* skip Television string*/
}
/* Determine the requested input characteristics
specific for each usbvision card model */
......@@ -618,7 +618,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
{
struct usb_usbvision *usbvision = video_drvdata(file);
if (!usbvision->have_tuner || vt->index) // Only tuner 0
if (!usbvision->have_tuner || vt->index) /* Only tuner 0 */
return -EINVAL;
if(usbvision->radio) {
strcpy(vt->name, "Radio");
......@@ -637,7 +637,7 @@ static int vidioc_s_tuner (struct file *file, void *priv,
{
struct usb_usbvision *usbvision = video_drvdata(file);
// Only no or one tuner for now
/* Only no or one tuner for now */
if (!usbvision->have_tuner || vt->index)
return -EINVAL;
/* let clients handle this */
......@@ -651,7 +651,7 @@ static int vidioc_g_frequency (struct file *file, void *priv,
{
struct usb_usbvision *usbvision = video_drvdata(file);
freq->tuner = 0; // Only one tuner
freq->tuner = 0; /* Only one tuner */
if(usbvision->radio) {
freq->type = V4L2_TUNER_RADIO;
} else {
......@@ -667,7 +667,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
{
struct usb_usbvision *usbvision = video_drvdata(file);
// Only no or one tuner for now
/* Only no or one tuner for now */
if (!usbvision->have_tuner || freq->tuner)
return -EINVAL;
......@@ -1069,7 +1069,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
(unsigned long)count, frame->bytes_read);
/* For now, forget the frame if it has not been read in one shot. */
/* if (frame->bytes_read >= frame->scanlength) {// All data has been read */
/* if (frame->bytes_read >= frame->scanlength) {*/ /* All data has been read */
frame->bytes_read = 0;
/* Mark it as available to be used again. */
......@@ -1163,7 +1163,7 @@ static int usbvision_radio_open(struct file *file)
goto out;
}
// If so far no errors then we shall start the radio
/* If so far no errors then we shall start the radio */
usbvision->radio = 1;
call_all(usbvision, tuner, s_radio);
usbvision_set_audio(usbvision, USBVISION_AUDIO_RADIO);
......@@ -1212,11 +1212,9 @@ static int usbvision_radio_close(struct file *file)
return err_code;
}
//
// Video registration stuff
//
/* Video registration stuff */
// Video template
/* Video template */
static const struct v4l2_file_operations usbvision_fops = {
.owner = THIS_MODULE,
.open = usbvision_v4l2_open,
......@@ -1268,7 +1266,7 @@ static struct video_device usbvision_video_template = {
};
// Radio template
/* Radio template */
static const struct v4l2_file_operations usbvision_radio_fops = {
.owner = THIS_MODULE,
.open = usbvision_radio_open,
......@@ -1328,10 +1326,10 @@ static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
return vdev;
}
// unregister video4linux devices
/* unregister video4linux devices */
static void usbvision_unregister_video(struct usb_usbvision *usbvision)
{
// Radio Device:
/* Radio Device: */
if (usbvision->rdev) {
PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
video_device_node_name(usbvision->rdev));
......@@ -1343,7 +1341,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
usbvision->rdev = NULL;
}
// Video Device:
/* Video Device: */
if (usbvision->vdev) {
PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
video_device_node_name(usbvision->vdev));
......@@ -1356,10 +1354,10 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
}
}
// register video4linux devices
/* register video4linux devices */
static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
{
// Video Device:
/* Video Device: */
usbvision->vdev = usbvision_vdev_init(usbvision,
&usbvision_video_template,
"USBVision Video");
......@@ -1374,9 +1372,9 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
printk(KERN_INFO "USBVision[%d]: registered USBVision Video device %s [v4l2]\n",
usbvision->nr, video_device_node_name(usbvision->vdev));
// Radio Device:
/* Radio Device: */
if (usbvision_device_data[usbvision->dev_model].radio) {
// usbvision has radio
/* usbvision has radio */
usbvision->rdev = usbvision_vdev_init(usbvision,
&usbvision_radio_template,
"USBVision Radio");
......@@ -1391,7 +1389,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device %s [v4l2]\n",
usbvision->nr, video_device_node_name(usbvision->rdev));
}
// all done
/* all done */
return 0;
err_exit:
......@@ -1426,7 +1424,7 @@ static struct usb_usbvision *usbvision_alloc(struct usb_device *dev,
mutex_init(&usbvision->v4l2_lock);
// prepare control urb for control messages during interrupts
/* prepare control urb for control messages during interrupts */
usbvision->ctrl_urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
if (usbvision->ctrl_urb == NULL)
goto err_unreg;
......@@ -1482,7 +1480,7 @@ static void usbvision_configure_video(struct usb_usbvision *usbvision)
return;
model = usbvision->dev_model;
usbvision->palette = usbvision_v4l2_format[2]; // V4L2_PIX_FMT_RGB24;
usbvision->palette = usbvision_v4l2_format[2]; /* V4L2_PIX_FMT_RGB24; */
if (usbvision_device_data[usbvision->dev_model].vin_reg2_override) {
usbvision->vin_reg2_preset =
......@@ -1639,7 +1637,7 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
mutex_lock(&usbvision->v4l2_lock);
// At this time we ask to cancel outstanding URBs
/* At this time we ask to cancel outstanding URBs */
usbvision_stop_isoc(usbvision);
v4l2_device_disconnect(&usbvision->v4l2_dev);
......@@ -1648,10 +1646,10 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
usbvision_i2c_unregister(usbvision);
usbvision_power_off(usbvision);
}
usbvision->remove_pending = 1; // Now all ISO data will be ignored
usbvision->remove_pending = 1; /* Now all ISO data will be ignored */
usb_put_dev(usbvision->dev);
usbvision->dev = NULL; // USB device is no more
usbvision->dev = NULL; /* USB device is no more */
mutex_unlock(&usbvision->v4l2_lock);
......@@ -1692,9 +1690,9 @@ static int __init usbvision_init(void)
/* disable planar mode support unless compression enabled */
if (isoc_mode != ISOC_MODE_COMPRESS ) {
// FIXME : not the right way to set supported flag
usbvision_v4l2_format[6].supported = 0; // V4L2_PIX_FMT_YVU420
usbvision_v4l2_format[7].supported = 0; // V4L2_PIX_FMT_YUV422P
/* FIXME : not the right way to set supported flag */
usbvision_v4l2_format[6].supported = 0; /* V4L2_PIX_FMT_YVU420 */
usbvision_v4l2_format[7].supported = 0; /* V4L2_PIX_FMT_YUV422P */
}
err_code = usb_register(&usbvision_driver);
......
......@@ -132,15 +132,15 @@
#define MAX_BYTES_PER_PIXEL 4
#define MIN_FRAME_WIDTH 64
#define MAX_USB_WIDTH 320 //384
#define MAX_FRAME_WIDTH 320 //384 /*streching sometimes causes crashes*/
#define MAX_USB_WIDTH 320 /* 384 */
#define MAX_FRAME_WIDTH 320 /* 384 */ /* streching sometimes causes crashes*/
#define MIN_FRAME_HEIGHT 48
#define MAX_USB_HEIGHT 240 //288
#define MAX_FRAME_HEIGHT 240 //288 /*Streching sometimes causes crashes*/
#define MAX_USB_HEIGHT 240 /* 288 */
#define MAX_FRAME_HEIGHT 240 /* 288 */ /* Streching sometimes causes crashes*/
#define MAX_FRAME_SIZE (MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * MAX_BYTES_PER_PIXEL)
#define USBVISION_CLIPMASK_SIZE (MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT / 8) //bytesize of clipmask
#define USBVISION_CLIPMASK_SIZE (MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT / 8) /* bytesize of clipmask */
#define USBVISION_URB_FRAMES 32
......@@ -148,7 +148,7 @@
#define USBVISION_NUMFRAMES 3 /* Maximum number of frames an application can get */
#define USBVISION_NUMSBUF 2 /* Dimensioning the USB S buffering */
#define USBVISION_POWEROFF_TIME 3 * (HZ) // 3 seconds
#define USBVISION_POWEROFF_TIME 3 * (HZ) /* 3 seconds */
#define FRAMERATE_MIN 0
......@@ -287,7 +287,7 @@ struct usbvision_frame_header {
unsigned char magic_1; /* 0 magic */
unsigned char magic_2; /* 1 magic */
unsigned char header_length; /* 2 */
unsigned char frame_num; /* 3 */
unsigned char frame_num; /* 3 */
unsigned char frame_phase; /* 4 */
unsigned char frame_latency; /* 5 */
unsigned char data_format; /* 6 */
......@@ -322,7 +322,7 @@ struct usbvision_frame {
struct usbvision_v4l2_format_st v4l2_format; /* format the user needs*/
int v4l2_linesize; /* bytes for one videoline*/
struct timeval timestamp;
int sequence; // How many video frames we send to user
int sequence; /* How many video frames we send to user */
};
#define CODEC_SAA7113 7113
......@@ -369,19 +369,19 @@ struct usb_usbvision {
unsigned char ctrl_urb_buffer[8];
int ctrl_urb_busy;
struct usb_ctrlrequest ctrl_urb_setup;
wait_queue_head_t ctrl_urb_wq; // Processes waiting
wait_queue_head_t ctrl_urb_wq; /* Processes waiting */
/* configuration part */
int have_tuner;
int tuner_type;
int bridge_type; // NT1003, NT1004, NT1005
int bridge_type; /* NT1003, NT1004, NT1005 */
int radio;
int video_inputs; // # of inputs
int video_inputs; /* # of inputs */
unsigned long freq;
int audio_mute;
int audio_channel;
int isoc_mode; // format of video data for the usb isoc-transfer
unsigned int nr; // Number of the device
int isoc_mode; /* format of video data for the usb isoc-transfer */
unsigned int nr; /* Number of the device */
/* Device structure */
struct usb_device *dev;
......@@ -389,7 +389,7 @@ struct usb_usbvision {
int num_alt; /* Number of alternative settings */
unsigned int *alt_max_pkt_size; /* array of max_packet_size */
unsigned char iface; /* Video interface number */
unsigned char iface_alt; /* Alt settings */
unsigned char iface_alt; /* Alt settings */
unsigned char vin_reg2_preset;
struct mutex v4l2_lock;
struct timer_list power_off_timer;
......@@ -411,10 +411,10 @@ struct usb_usbvision {
struct list_head inqueue, outqueue; /* queued frame list and ready to dequeue frame list */
wait_queue_head_t wait_frame; /* Processes waiting */
wait_queue_head_t wait_stream; /* Processes waiting */
struct usbvision_frame *cur_frame; // pointer to current frame, set by usbvision_find_header
struct usbvision_frame frame[USBVISION_NUMFRAMES]; // frame buffer
int num_frames; // number of frames allocated
struct usbvision_sbuf sbuf[USBVISION_NUMSBUF]; // S buffering
struct usbvision_frame *cur_frame; /* pointer to current frame, set by usbvision_find_header */
struct usbvision_frame frame[USBVISION_NUMFRAMES]; /* frame buffer */
int num_frames; /* number of frames allocated */
struct usbvision_sbuf sbuf[USBVISION_NUMSBUF]; /* S buffering */
volatile int remove_pending; /* If set then about to exit */
/* Scratch space from the Isochronous Pipe.*/
......@@ -432,32 +432,32 @@ struct usb_usbvision {
v4l2_std_id tvnorm_id; /* selected tv norm */
unsigned char video_endp; /* 0x82 for USBVISION devices based */
// Decompression stuff:
/* Decompression stuff: */
unsigned char *intra_frame_buffer; /* Buffer for reference frame */
int block_pos; //for test only
int request_intra; // 0 = normal; 1 = intra frame is requested;
int last_isoc_frame_num; // check for lost isoc frames
int isoc_packet_size; // need to calculate used_bandwidth
int used_bandwidth; // used bandwidth 0-100%, need to set compr_level
int compr_level; // How strong (100) or weak (0) is compression
int last_compr_level; // How strong (100) or weak (0) was compression
int block_pos; /* for test only */
int request_intra; /* 0 = normal; 1 = intra frame is requested; */
int last_isoc_frame_num; /* check for lost isoc frames */
int isoc_packet_size; /* need to calculate used_bandwidth */
int used_bandwidth; /* used bandwidth 0-100%, need to set compr_level */
int compr_level; /* How strong (100) or weak (0) is compression */
int last_compr_level; /* How strong (100) or weak (0) was compression */
int usb_bandwidth; /* Mbit/s */
/* Statistics that can be overlayed on the screen */
unsigned long isoc_urb_count; // How many URBs we received so far
unsigned long isoc_urb_count; /* How many URBs we received so far */
unsigned long urb_length; /* Length of last URB */
unsigned long isoc_data_count; /* How many bytes we received */
unsigned long header_count; /* How many frame headers we found */
unsigned long scratch_ovf_count; /* How many times we overflowed scratch */
unsigned long isoc_skip_count; /* How many empty ISO packets received */
unsigned long isoc_err_count; /* How many bad ISO packets received */
unsigned long isoc_packet_count; // How many packets we totally got
unsigned long time_in_irq; // How long do we need for interrupt
unsigned long isoc_packet_count; /* How many packets we totally got */
unsigned long time_in_irq; /* How long do we need for interrupt */
int isoc_measure_bandwidth_count;
int frame_num; // How many video frames we send to user
int max_strip_len; // How big is the biggest strip
int frame_num; /* How many video frames we send to user */
int max_strip_len; /* How big is the biggest strip */
int comprblock_pos;
int strip_len_errors; // How many times was block_pos greater than strip_len
int strip_len_errors; /* How many times was block_pos greater than strip_len */
int strip_magic_errors;
int strip_line_number_errors;
int compr_block_types[4];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册