int video_junk;
struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY];
-struct data_buffer \
+struct data_buffer
field_buffer[FIELD_BUFFER_MANY][(FIELD_BUFFER_SIZE/PAGE_SIZE)];
-struct data_buffer \
+struct data_buffer
frame_buffer[FRAME_BUFFER_MANY][(FRAME_BUFFER_SIZE/PAGE_SIZE)];
struct list_head urb_video_head;
void easycap_complete(struct urb *);
int easycap_open(struct inode *, struct file *);
int easycap_release(struct inode *, struct file *);
-long easycap_ioctl_noinode(struct file *, unsigned int, \
+long easycap_ioctl_noinode(struct file *, unsigned int,
unsigned long);
-int easycap_ioctl(struct inode *, struct file *, unsigned int, \
+int easycap_ioctl(struct inode *, struct file *, unsigned int,
unsigned long);
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
unsigned int easycap_poll(struct file *, poll_table *);
int easycap_mmap(struct file *, struct vm_area_struct *);
-int easycap_usb_probe(struct usb_interface *, \
+int easycap_usb_probe(struct usb_interface *,
const struct usb_device_id *);
void easycap_usb_disconnect(struct usb_interface *);
void easycap_delete(struct kref *);
int submit_video_urbs(struct easycap *);
int kill_video_urbs(struct easycap *);
int field2frame(struct easycap *);
-int redaub(struct easycap *, void *, void *, \
+int redaub(struct easycap *, void *, void *,
int, int, __u8, __u8, bool);
void easycap_testcard(struct easycap *, int);
int fillin_formats(void);
int reset(struct easycap *);
int newinput(struct easycap *, int);
int adjust_standard(struct easycap *, v4l2_std_id);
-int adjust_format(struct easycap *, __u32, __u32, __u32, \
+int adjust_format(struct easycap *, __u32, __u32, __u32,
int, bool);
int adjust_brightness(struct easycap *, int);
int adjust_contrast(struct easycap *, int);
void easycap_alsa_complete(struct urb *);
int easycap_alsa_open(struct snd_pcm_substream *);
int easycap_alsa_close(struct snd_pcm_substream *);
-int easycap_alsa_hw_params(struct snd_pcm_substream *, \
+int easycap_alsa_hw_params(struct snd_pcm_substream *,
struct snd_pcm_hw_params *);
int easycap_alsa_vmalloc(struct snd_pcm_substream *, size_t);
int easycap_alsa_hw_free(struct snd_pcm_substream *);
int easycap_alsa_prepare(struct snd_pcm_substream *);
int easycap_alsa_ack(struct snd_pcm_substream *);
int easycap_alsa_trigger(struct snd_pcm_substream *, int);
-snd_pcm_uframes_t \
- easycap_alsa_pointer(struct snd_pcm_substream *);
+snd_pcm_uframes_t easycap_alsa_pointer(struct snd_pcm_substream *);
struct page *easycap_alsa_page(struct snd_pcm_substream *, unsigned long);
#else
ssize_t easyoss_read(struct file *, char __user *, size_t, loff_t *);
int easyoss_open(struct inode *, struct file *);
int easyoss_release(struct inode *, struct file *);
-long easyoss_ioctl_noinode(struct file *, unsigned int, \
+long easyoss_ioctl_noinode(struct file *, unsigned int,
unsigned long);
-int easyoss_ioctl(struct inode *, struct file *, unsigned int, \
+int easyoss_ioctl(struct inode *, struct file *, unsigned int,
unsigned long);
unsigned int easyoss_poll(struct file *, poll_table *);
void easyoss_delete(struct kref *);
int merit_saa(struct usb_device *);
int check_vt(struct usb_device *);
int select_input(struct usb_device *, int, int);
-int set_resolution(struct usb_device *, \
+int set_resolution(struct usb_device *,
__u16, __u16, __u16, __u16);
int read_saa(struct usb_device *, __u16);
}
}
if (0xFFFF == peasycap_standard->mask) {
- SAM("ERROR: 0x%08X=std_id: standard not found\n", \
+ SAM("ERROR: 0x%08X=std_id: standard not found\n",
(unsigned int)std_id);
return -EINVAL;
}
-SAM("selected standard: %s\n", \
+SAM("selected standard: %s\n",
&(peasycap_standard->v4l2_standard.name[0]));
-if (peasycap->standard_offset == \
+if (peasycap->standard_offset ==
(int)(peasycap_standard - &easycap_standard[0])) {
SAM("requested standard already in effect\n");
return 0;
peasycap->standard_offset = (int)(peasycap_standard - &easycap_standard[0]);
for (k = 0; k < INPUT_MANY; k++) {
if (!peasycap->inputset[k].standard_offset_ok) {
- peasycap->inputset[k].standard_offset = \
+ peasycap->inputset[k].standard_offset =
peasycap->standard_offset;
}
}
if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) {
- peasycap->inputset[peasycap->input].standard_offset = \
+ peasycap->inputset[peasycap->input].standard_offset =
peasycap->standard_offset;
peasycap->inputset[peasycap->input].standard_offset_ok = 1;
} else
JOM(8, "%i=peasycap->input\n", peasycap->input);
-peasycap->fps = peasycap_standard->v4l2_standard.frameperiod.denominator / \
+peasycap->fps = peasycap_standard->v4l2_standard.frameperiod.denominator /
peasycap_standard->v4l2_standard.frameperiod.numerator;
switch (peasycap->fps) {
case 6:
itwas = (unsigned int)ir;
rc = write_saa(peasycap->pusb_device, reg, set);
if (0 != rc)
- SAM("ERROR: failed to set SAA register " \
+ SAM("ERROR: failed to set SAA register "
"0x%02X to 0x%02X for JP standard\n", reg, set);
else {
isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"to 0x%02X\n", reg, isnow);
else
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"from 0x%02X to 0x%02X\n", reg, itwas, isnow);
}
itwas = (unsigned int)ir;
rc = write_saa(peasycap->pusb_device, reg, set);
if (0 != rc)
- SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X " \
+ SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X "
"for JP standard\n", reg, set);
else {
isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"to 0x%02X\n", reg, isnow);
else
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"from 0x%02X to 0x%02X\n", reg, itwas, isnow);
}
/*--------------------------------------------------------------------------*/
itwas = (unsigned int)ir;
rc = write_saa(peasycap->pusb_device, reg, set);
if (0 != write_saa(peasycap->pusb_device, reg, set)) {
- SAM("ERROR: failed to set SAA register " \
+ SAM("ERROR: failed to set SAA register "
"0x%02X to 0x%02X for table 42\n", reg, set);
} else {
isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"to 0x%02X\n", reg, isnow);
else
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"from 0x%02X to 0x%02X\n", reg, itwas, isnow);
}
}
reg = 0x08;
ir = read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- SAM("ERROR: failed to read SAA register 0x%02X " \
+ SAM("ERROR: failed to read SAA register 0x%02X "
"so cannot reset\n", reg);
else {
itwas = (unsigned int)ir;
set = itwas & ~0x40 ;
rc = write_saa(peasycap->pusb_device, reg, set);
if (0 != rc)
- SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", \
+ SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n",
reg, set);
else {
isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- JOM(8, "SAA register 0x%02X changed to 0x%02X\n", \
+ JOM(8, "SAA register 0x%02X changed to 0x%02X\n",
reg, isnow);
else
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"from 0x%02X to 0x%02X\n", reg, itwas, isnow);
}
}
reg = 0x40;
ir = read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- SAM("ERROR: failed to read SAA register 0x%02X " \
+ SAM("ERROR: failed to read SAA register 0x%02X "
"so cannot reset\n", reg);
else {
itwas = (unsigned int)ir;
set = itwas & ~0x80 ;
rc = write_saa(peasycap->pusb_device, reg, set);
if (0 != rc)
- SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", \
+ SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n",
reg, set);
else {
isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
if (0 > ir)
- JOM(8, "SAA register 0x%02X changed to 0x%02X\n", \
+ JOM(8, "SAA register 0x%02X changed to 0x%02X\n",
reg, isnow);
else
- JOM(8, "SAA register 0x%02X changed " \
+ JOM(8, "SAA register 0x%02X changed "
"from 0x%02X to 0x%02X\n", reg, itwas, isnow);
}
}
else
set = 0x07 ;
if (0 != write_saa(peasycap->pusb_device, reg, set))
- SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", \
+ SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n",
reg, set);
else {
isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
* ERRORS RETURN A NEGATIVE NUMBER.
*/
/*--------------------------------------------------------------------------*/
-int adjust_format(struct easycap *peasycap, \
+int adjust_format(struct easycap *peasycap,
__u32 width, __u32 height, __u32 pixelformat, int field, bool try)
{
struct easycap_format *peasycap_format, *peasycap_best_format;
memcpy((void *)pc, (void *)(&uc), 4);
bf[4] = 0;
mask = 0xFF & easycap_standard[peasycap->standard_offset].mask;
-SAM("sought: %ix%i,%s(0x%08X),%i=field,0x%02X=std mask\n", \
+SAM("sought: %ix%i,%s(0x%08X),%i=field,0x%02X=std mask\n",
width, height, pc, pixelformat, field, mask);
switch (field) {
case V4L2_FIELD_ANY: {
peasycap_best_format = (struct easycap_format *)NULL;
peasycap_format = &easycap_format[0];
while (0 != peasycap_format->v4l2_format.fmt.pix.width) {
- JOM(16, ".> %i %i 0x%08X %ix%i\n", \
+ JOM(16, ".> %i %i 0x%08X %ix%i\n",
peasycap_format->mask & 0x01,
peasycap_format->v4l2_format.fmt.pix.field,
peasycap_format->v4l2_format.fmt.pix.pixelformat,
peasycap_format->v4l2_format.fmt.pix.width,
peasycap_format->v4l2_format.fmt.pix.height);
- if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) && \
- (peasycap_format->v4l2_format.fmt.pix.field == field) && \
- (peasycap_format->v4l2_format.fmt.pix.pixelformat == \
- pixelformat) && \
- (peasycap_format->v4l2_format.fmt.pix.width == width) && \
+ if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) &&
+ (peasycap_format->v4l2_format.fmt.pix.field == field) &&
+ (peasycap_format->v4l2_format.fmt.pix.pixelformat ==
+ pixelformat) &&
+ (peasycap_format->v4l2_format.fmt.pix.width == width) &&
(peasycap_format->v4l2_format.fmt.pix.height == height)) {
peasycap_best_format = peasycap_format;
break;
peasycap_format++;
}
if (0 == peasycap_format->v4l2_format.fmt.pix.width) {
- SAM("cannot do: %ix%i with standard mask 0x%02X\n", \
+ SAM("cannot do: %ix%i with standard mask 0x%02X\n",
width, height, mask);
peasycap_format = &easycap_format[0]; best = -1;
while (0 != peasycap_format->v4l2_format.fmt.pix.width) {
- if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) && \
- (peasycap_format->v4l2_format.fmt.pix\
- .field == field) && \
- (peasycap_format->v4l2_format.fmt.pix\
+ if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) &&
+ (peasycap_format->v4l2_format.fmt.pix
+ .field == field) &&
+ (peasycap_format->v4l2_format.fmt.pix
.pixelformat == pixelformat)) {
- miss = abs(peasycap_format->\
+ miss = abs(peasycap_format->
v4l2_format.fmt.pix.width - width);
if ((best > miss) || (best < 0)) {
best = miss;
peasycap_format++;
}
if (-1 == best) {
- SAM("cannot do %ix... with standard mask 0x%02X\n", \
+ SAM("cannot do %ix... with standard mask 0x%02X\n",
width, mask);
- SAM("cannot do ...x%i with standard mask 0x%02X\n", \
+ SAM("cannot do ...x%i with standard mask 0x%02X\n",
height, mask);
SAM(" %ix%i unmatched\n", width, height);
return peasycap->format_offset;
SAM("MISTAKE: true==try where is should be false\n");
return -EINVAL;
}
-SAM("actioning: %ix%i %s\n", \
- peasycap_format->v4l2_format.fmt.pix.width, \
+SAM("actioning: %ix%i %s\n",
+ peasycap_format->v4l2_format.fmt.pix.width,
peasycap_format->v4l2_format.fmt.pix.height,
&peasycap_format->name[0]);
peasycap->height = peasycap_format->v4l2_format.fmt.pix.height;
for (k = 0; k < INPUT_MANY; k++) {
if (!peasycap->inputset[k].format_offset_ok) {
- peasycap->inputset[k].format_offset = \
+ peasycap->inputset[k].format_offset =
peasycap->format_offset;
}
}
if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) {
- peasycap->inputset[peasycap->input].format_offset = \
+ peasycap->inputset[peasycap->input].format_offset =
peasycap->format_offset;
peasycap->inputset[peasycap->input].format_offset_ok = 1;
} else
multiplier = 2;
else
multiplier = 1;
-peasycap->videofieldamount = multiplier * peasycap->width * \
+peasycap->videofieldamount = multiplier * peasycap->width *
multiplier * peasycap->height;
-peasycap->frame_buffer_used = peasycap->bytesperpixel * \
+peasycap->frame_buffer_used = peasycap->bytesperpixel *
peasycap->width * peasycap->height;
if (peasycap->video_isoc_streaming) {
resubmit = true;
*/
/*---------------------------------------------------------------------------*/
if (0 == (0x01 & peasycap_format->mask)) {
- if (((720 == peasycap_format->v4l2_format.fmt.pix.width) && \
- (576 == \
- peasycap_format->v4l2_format.fmt.pix.height)) || \
- ((360 == \
- peasycap_format->v4l2_format.fmt.pix.width) && \
- (288 == \
+ if (((720 == peasycap_format->v4l2_format.fmt.pix.width) &&
+ (576 ==
+ peasycap_format->v4l2_format.fmt.pix.height)) ||
+ ((360 ==
+ peasycap_format->v4l2_format.fmt.pix.width) &&
+ (288 ==
peasycap_format->v4l2_format.fmt.pix.height))) {
if (0 != set_resolution(p, 0x0000, 0x0001, 0x05A0, 0x0121)) {
SAM("ERROR: set_resolution() failed\n");
return -EINVAL;
}
- } else if ((704 == peasycap_format->v4l2_format.fmt.pix.width) && \
+ } else if ((704 == peasycap_format->v4l2_format.fmt.pix.width) &&
(576 == peasycap_format->v4l2_format.fmt.pix.height)) {
if (0 != set_resolution(p, 0x0004, 0x0001, 0x0584, 0x0121)) {
SAM("ERROR: set_resolution() failed\n");
return -EINVAL;
}
- } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) && \
- (480 == \
- peasycap_format->v4l2_format.fmt.pix.height)) || \
- ((320 == \
- peasycap_format->v4l2_format.fmt.pix.width) && \
- (240 == \
+ } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) &&
+ (480 ==
+ peasycap_format->v4l2_format.fmt.pix.height)) ||
+ ((320 ==
+ peasycap_format->v4l2_format.fmt.pix.width) &&
+ (240 ==
peasycap_format->v4l2_format.fmt.pix.height))) {
if (0 != set_resolution(p, 0x0014, 0x0020, 0x0514, 0x0110)) {
SAM("ERROR: set_resolution() failed\n");
*/
/*---------------------------------------------------------------------------*/
} else {
- if (((720 == peasycap_format->v4l2_format.fmt.pix.width) && \
- (480 == \
- peasycap_format->v4l2_format.fmt.pix.height)) || \
- ((360 == \
- peasycap_format->v4l2_format.fmt.pix.width) && \
- (240 == \
+ if (((720 == peasycap_format->v4l2_format.fmt.pix.width) &&
+ (480 ==
+ peasycap_format->v4l2_format.fmt.pix.height)) ||
+ ((360 ==
+ peasycap_format->v4l2_format.fmt.pix.width) &&
+ (240 ==
peasycap_format->v4l2_format.fmt.pix.height))) {
if (0 != set_resolution(p, 0x0000, 0x0003, 0x05A0, 0x00F3)) {
SAM("ERROR: set_resolution() failed\n");
return -EINVAL;
}
- } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) && \
- (480 == \
- peasycap_format->v4l2_format.fmt.pix.height)) || \
- ((320 == \
- peasycap_format->v4l2_format.fmt.pix.width) && \
- (240 == \
+ } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) &&
+ (480 ==
+ peasycap_format->v4l2_format.fmt.pix.height)) ||
+ ((320 ==
+ peasycap_format->v4l2_format.fmt.pix.width) &&
+ (240 ==
peasycap_format->v4l2_format.fmt.pix.height))) {
if (0 != set_resolution(p, 0x0014, 0x0003, 0x0514, 0x00F3)) {
SAM("ERROR: set_resolution() failed\n");
i1 = 0;
while (0xFFFFFFFF != easycap_control[i1].id) {
if (V4L2_CID_BRIGHTNESS == easycap_control[i1].id) {
- if ((easycap_control[i1].minimum > value) || \
+ if ((easycap_control[i1].minimum > value) ||
(easycap_control[i1].maximum < value))
value = easycap_control[i1].default_value;
- if ((easycap_control[i1].minimum <= peasycap->brightness) && \
- (easycap_control[i1].maximum >= \
+ if ((easycap_control[i1].minimum <= peasycap->brightness) &&
+ (easycap_control[i1].maximum >=
peasycap->brightness)) {
if (peasycap->brightness == value) {
- SAM("unchanged brightness at 0x%02X\n", \
+ SAM("unchanged brightness at 0x%02X\n",
value);
return 0;
}
peasycap->brightness = value;
for (k = 0; k < INPUT_MANY; k++) {
if (!peasycap->inputset[k].brightness_ok)
- peasycap->inputset[k].brightness = \
+ peasycap->inputset[k].brightness =
peasycap->brightness;
}
if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) {
- peasycap->inputset[peasycap->input].brightness = \
+ peasycap->inputset[peasycap->input].brightness =
peasycap->brightness;
peasycap->inputset[peasycap->input].brightness_ok = 1;
} else
SAM("adjusting brightness to 0x%02X\n", mood);
return 0;
} else {
- SAM("WARNING: failed to adjust brightness " \
+ SAM("WARNING: failed to adjust brightness "
"to 0x%02X\n", mood);
return -ENOENT;
}
i1 = 0;
while (0xFFFFFFFF != easycap_control[i1].id) {
if (V4L2_CID_CONTRAST == easycap_control[i1].id) {
- if ((easycap_control[i1].minimum > value) || \
+ if ((easycap_control[i1].minimum > value) ||
(easycap_control[i1].maximum < value))
value = easycap_control[i1].default_value;
- if ((easycap_control[i1].minimum <= peasycap->contrast) && \
- (easycap_control[i1].maximum >= \
+ if ((easycap_control[i1].minimum <= peasycap->contrast) &&
+ (easycap_control[i1].maximum >=
peasycap->contrast)) {
if (peasycap->contrast == value) {
SAM("unchanged contrast at 0x%02X\n", value);
peasycap->contrast = value;
for (k = 0; k < INPUT_MANY; k++) {
if (!peasycap->inputset[k].contrast_ok) {
- peasycap->inputset[k].contrast = \
+ peasycap->inputset[k].contrast =
peasycap->contrast;
}
}
if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) {
- peasycap->inputset[peasycap->input].contrast = \
+ peasycap->inputset[peasycap->input].contrast =
peasycap->contrast;
peasycap->inputset[peasycap->input].contrast_ok = 1;
} else
SAM("adjusting contrast to 0x%02X\n", mood);
return 0;
} else {
- SAM("WARNING: failed to adjust contrast to " \
+ SAM("WARNING: failed to adjust contrast to "
"0x%02X\n", mood);
return -ENOENT;
}
i1 = 0;
while (0xFFFFFFFF != easycap_control[i1].id) {
if (V4L2_CID_SATURATION == easycap_control[i1].id) {
- if ((easycap_control[i1].minimum > value) || \
+ if ((easycap_control[i1].minimum > value) ||
(easycap_control[i1].maximum < value))
value = easycap_control[i1].default_value;
- if ((easycap_control[i1].minimum <= peasycap->saturation) && \
- (easycap_control[i1].maximum >= \
+ if ((easycap_control[i1].minimum <= peasycap->saturation) &&
+ (easycap_control[i1].maximum >=
peasycap->saturation)) {
if (peasycap->saturation == value) {
- SAM("unchanged saturation at 0x%02X\n", \
+ SAM("unchanged saturation at 0x%02X\n",
value);
return 0;
}
peasycap->saturation = value;
for (k = 0; k < INPUT_MANY; k++) {
if (!peasycap->inputset[k].saturation_ok) {
- peasycap->inputset[k].saturation = \
+ peasycap->inputset[k].saturation =
peasycap->saturation;
}
}
if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) {
- peasycap->inputset[peasycap->input].saturation = \
+ peasycap->inputset[peasycap->input].saturation =
peasycap->saturation;
peasycap->inputset[peasycap->input].saturation_ok = 1;
} else
SAM("adjusting saturation to 0x%02X\n", mood);
return 0;
} else {
- SAM("WARNING: failed to adjust saturation to " \
+ SAM("WARNING: failed to adjust saturation to "
"0x%02X\n", mood);
return -ENOENT;
}
i1 = 0;
while (0xFFFFFFFF != easycap_control[i1].id) {
if (V4L2_CID_HUE == easycap_control[i1].id) {
- if ((easycap_control[i1].minimum > value) || \
+ if ((easycap_control[i1].minimum > value) ||
(easycap_control[i1].maximum < value))
value = easycap_control[i1].default_value;
- if ((easycap_control[i1].minimum <= peasycap->hue) && \
- (easycap_control[i1].maximum >= \
+ if ((easycap_control[i1].minimum <= peasycap->hue) &&
+ (easycap_control[i1].maximum >=
peasycap->hue)) {
if (peasycap->hue == value) {
SAM("unchanged hue at 0x%02X\n", value);
peasycap->inputset[k].hue = peasycap->hue;
}
if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) {
- peasycap->inputset[peasycap->input].hue = \
+ peasycap->inputset[peasycap->input].hue =
peasycap->hue;
peasycap->inputset[peasycap->input].hue_ok = 1;
} else
i1 = 0;
while (0xFFFFFFFF != easycap_control[i1].id) {
if (V4L2_CID_AUDIO_VOLUME == easycap_control[i1].id) {
- if ((easycap_control[i1].minimum > value) || \
+ if ((easycap_control[i1].minimum > value) ||
(easycap_control[i1].maximum < value))
value = easycap_control[i1].default_value;
- if ((easycap_control[i1].minimum <= peasycap->volume) && \
- (easycap_control[i1].maximum >= \
+ if ((easycap_control[i1].minimum <= peasycap->volume) &&
+ (easycap_control[i1].maximum >=
peasycap->volume)) {
if (peasycap->volume == value) {
SAM("unchanged volume at 0x%02X\n", value);
}
}
peasycap->volume = value;
- mood = (16 > peasycap->volume) ? 16 : \
- ((31 < peasycap->volume) ? 31 : \
+ mood = (16 > peasycap->volume) ? 16 :
+ ((31 < peasycap->volume) ? 31 :
(__s8) peasycap->volume);
if (!audio_gainset(peasycap->pusb_device, mood)) {
SAM("adjusting volume to 0x%02X\n", mood);
return 0;
} else {
- SAM("WARNING: failed to adjust volume to " \
+ SAM("WARNING: failed to adjust volume to "
"0x%2X\n", mood);
return -ENOENT;
}
/*---------------------------------------------------------------------------*/
/*
* AN ALTERNATIVE METHOD OF MUTING MIGHT SEEM TO BE:
- * usb_set_interface(peasycap->pusb_device, \
- * peasycap->audio_interface, \
+ * usb_set_interface(peasycap->pusb_device,
+ * peasycap->audio_interface,
* peasycap->audio_altsetting_off);
* HOWEVER, AFTER THIS COMMAND IS ISSUED ALL SUBSEQUENT URBS RECEIVE STATUS
* -ESHUTDOWN. THE HANDLER ROUTINE easyxxx_complete() DECLINES TO RESUBMIT
case 1: {
peasycap->audio_idle = 1;
peasycap->timeval0.tv_sec = 0;
- SAM("adjusting mute: %i=peasycap->audio_idle\n", \
+ SAM("adjusting mute: %i=peasycap->audio_idle\n",
peasycap->audio_idle);
return 0;
}
default: {
peasycap->audio_idle = 0;
- SAM("adjusting mute: %i=peasycap->audio_idle\n", \
+ SAM("adjusting mute: %i=peasycap->audio_idle\n",
peasycap->audio_idle);
return 0;
}
kd = isdongle(peasycap);
if (0 <= kd && DONGLE_MANY > kd) {
if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) {
- SAY("ERROR: cannot lock " \
+ SAY("ERROR: cannot lock "
"easycapdc60_dongle[%i].mutex_video\n", kd);
return -ERESTARTSYS;
}
if (3 > i) {
rc = (int) strict_strtol(p1, 10, &lng);
if (0 != rc) {
- SAM("ERROR: %i=strict_strtol(%s,.,,)\n", \
+ SAM("ERROR: %i=strict_strtol(%s,.,,)\n",
rc, p1);
- mutex_unlock(&easycapdc60_dongle[kd].\
+ mutex_unlock(&easycapdc60_dongle[kd].
mutex_video);
return -EINVAL;
}
}
memset(&v4l2_capability, 0, sizeof(struct v4l2_capability));
- strlcpy(&v4l2_capability.driver[0], "easycap", \
+ strlcpy(&v4l2_capability.driver[0], "easycap",
sizeof(v4l2_capability.driver));
- v4l2_capability.capabilities = \
- V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | \
+ v4l2_capability.capabilities =
+ V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE;
v4l2_capability.version = KERNEL_VERSION(k[0], k[1], k[2]);
JOM(8, "v4l2_capability.version=(%i,%i,%i)\n", k[0], k[1], k[2]);
- strlcpy(&v4l2_capability.card[0], "EasyCAP DC60", \
+ strlcpy(&v4l2_capability.card[0], "EasyCAP DC60",
sizeof(v4l2_capability.card));
- if (usb_make_path(peasycap->pusb_device, &v4l2_capability.bus_info[0],\
+ if (usb_make_path(peasycap->pusb_device, &v4l2_capability.bus_info[0],
sizeof(v4l2_capability.bus_info)) < 0) {
- strlcpy(&v4l2_capability.bus_info[0], "EasyCAP bus_info", \
+ strlcpy(&v4l2_capability.bus_info[0], "EasyCAP bus_info",
sizeof(v4l2_capability.bus_info));
- JOM(8, "%s=v4l2_capability.bus_info\n", \
+ JOM(8, "%s=v4l2_capability.bus_info\n",
&v4l2_capability.bus_info[0]);
}
- if (0 != copy_to_user((void __user *)arg, &v4l2_capability, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_capability,
sizeof(struct v4l2_capability))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_ENUMINPUT\n");
- if (0 != copy_from_user(&v4l2_input, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_input, (void __user *)arg,
sizeof(struct v4l2_input))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
v4l2_input.type = V4L2_INPUT_TYPE_CAMERA;
v4l2_input.audioset = 0x01;
v4l2_input.tuner = 0;
- v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \
+ v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM |
V4L2_STD_NTSC ;
v4l2_input.status = 0;
JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]);
v4l2_input.type = V4L2_INPUT_TYPE_CAMERA;
v4l2_input.audioset = 0x01;
v4l2_input.tuner = 0;
- v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \
+ v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM |
V4L2_STD_NTSC ;
v4l2_input.status = 0;
JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]);
v4l2_input.type = V4L2_INPUT_TYPE_CAMERA;
v4l2_input.audioset = 0x01;
v4l2_input.tuner = 0;
- v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \
+ v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM |
V4L2_STD_NTSC ;
v4l2_input.status = 0;
JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]);
v4l2_input.type = V4L2_INPUT_TYPE_CAMERA;
v4l2_input.audioset = 0x01;
v4l2_input.tuner = 0;
- v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \
+ v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM |
V4L2_STD_NTSC ;
v4l2_input.status = 0;
JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]);
v4l2_input.type = V4L2_INPUT_TYPE_CAMERA;
v4l2_input.audioset = 0x01;
v4l2_input.tuner = 0;
- v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \
+ v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM |
V4L2_STD_NTSC ;
v4l2_input.status = 0;
JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]);
v4l2_input.type = V4L2_INPUT_TYPE_CAMERA;
v4l2_input.audioset = 0x01;
v4l2_input.tuner = 0;
- v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \
+ v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM |
V4L2_STD_NTSC ;
v4l2_input.status = 0;
JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]);
}
}
- if (0 != copy_to_user((void __user *)arg, &v4l2_input, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_input,
sizeof(struct v4l2_input))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_ENUMAUDOUT\n");
- if (0 != copy_from_user(&v4l2_audioout, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_audioout, (void __user *)arg,
sizeof(struct v4l2_audioout))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
v4l2_audioout.index = 0;
strcpy(&v4l2_audioout.name[0], "Soundtrack");
- if (0 != copy_to_user((void __user *)arg, &v4l2_audioout, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_audioout,
sizeof(struct v4l2_audioout))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_QUERYCTRL\n");
- if (0 != copy_from_user(&v4l2_queryctrl, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_queryctrl, (void __user *)arg,
sizeof(struct v4l2_queryctrl))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
i1 = 0;
while (0xFFFFFFFF != easycap_control[i1].id) {
if (easycap_control[i1].id == v4l2_queryctrl.id) {
- JOM(8, "VIDIOC_QUERYCTRL %s=easycap_control[%i]" \
+ JOM(8, "VIDIOC_QUERYCTRL %s=easycap_control[%i]"
".name\n", &easycap_control[i1].name[0], i1);
- memcpy(&v4l2_queryctrl, &easycap_control[i1], \
+ memcpy(&v4l2_queryctrl, &easycap_control[i1],
sizeof(struct v4l2_queryctrl));
break;
}
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
- if (0 != copy_to_user((void __user *)arg, &v4l2_queryctrl, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_queryctrl,
sizeof(struct v4l2_queryctrl))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
- if (0 != copy_from_user(pv4l2_control, (void __user *)arg, \
+ if (0 != copy_from_user(pv4l2_control, (void __user *)arg,
sizeof(struct v4l2_control))) {
kfree(pv4l2_control);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
break;
}
default: {
- SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", \
+ SAM("ERROR: unknown V4L2 control: 0x%08X=id\n",
pv4l2_control->id);
kfree(pv4l2_control);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
- if (0 != copy_to_user((void __user *)arg, pv4l2_control, \
+ if (0 != copy_to_user((void __user *)arg, pv4l2_control,
sizeof(struct v4l2_control))) {
kfree(pv4l2_control);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
JOM(8, "VIDIOC_S_CTRL\n");
- if (0 != copy_from_user(&v4l2_control, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_control, (void __user *)arg,
sizeof(struct v4l2_control))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
break;
}
default: {
- SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", \
+ SAM("ERROR: unknown V4L2 control: 0x%08X=id\n",
v4l2_control.id);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
JOM(8, "VIDIOC_ENUM_FMT\n");
- if (0 != copy_from_user(&v4l2_fmtdesc, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_fmtdesc, (void __user *)arg,
sizeof(struct v4l2_fmtdesc))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
return -EINVAL;
}
}
- if (0 != copy_to_user((void __user *)arg, &v4l2_fmtdesc, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_fmtdesc,
sizeof(struct v4l2_fmtdesc))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_ENUM_FRAMESIZES\n");
- if (0 != copy_from_user(&v4l2_frmsizeenum, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_frmsizeenum, (void __user *)arg,
sizeof(struct v4l2_frmsizeenum))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
case 0: {
v4l2_frmsizeenum.discrete.width = 640;
v4l2_frmsizeenum.discrete.height = 480;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 1: {
v4l2_frmsizeenum.discrete.width = 320;
v4l2_frmsizeenum.discrete.height = 240;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 2: {
v4l2_frmsizeenum.discrete.width = 720;
v4l2_frmsizeenum.discrete.height = 480;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 3: {
v4l2_frmsizeenum.discrete.width = 360;
v4l2_frmsizeenum.discrete.height = 240;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 0: {
v4l2_frmsizeenum.discrete.width = 640;
v4l2_frmsizeenum.discrete.height = 480;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 1: {
v4l2_frmsizeenum.discrete.width = 320;
v4l2_frmsizeenum.discrete.height = 240;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 2: {
v4l2_frmsizeenum.discrete.width = 704;
v4l2_frmsizeenum.discrete.height = 576;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 3: {
v4l2_frmsizeenum.discrete.width = 720;
v4l2_frmsizeenum.discrete.height = 576;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
case 4: {
v4l2_frmsizeenum.discrete.width = 360;
v4l2_frmsizeenum.discrete.height = 288;
- JOM(8, "%i=index: %ix%i\n", index, \
- (int)(v4l2_frmsizeenum.\
- discrete.width), \
- (int)(v4l2_frmsizeenum.\
+ JOM(8, "%i=index: %ix%i\n", index,
+ (int)(v4l2_frmsizeenum.
+ discrete.width),
+ (int)(v4l2_frmsizeenum.
discrete.height));
break;
}
}
}
}
- if (0 != copy_to_user((void __user *)arg, &v4l2_frmsizeenum, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_frmsizeenum,
sizeof(struct v4l2_frmsizeenum))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
denominator = 25;
}
- if (0 != copy_from_user(&v4l2_frmivalenum, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_frmivalenum, (void __user *)arg,
sizeof(struct v4l2_frmivalenum))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
case 0: {
v4l2_frmivalenum.discrete.numerator = 1;
v4l2_frmivalenum.discrete.denominator = denominator;
- JOM(8, "%i=index: %i/%i\n", index, \
- (int)(v4l2_frmivalenum.discrete.numerator), \
+ JOM(8, "%i=index: %i/%i\n", index,
+ (int)(v4l2_frmivalenum.discrete.numerator),
(int)(v4l2_frmivalenum.discrete.denominator));
break;
}
case 1: {
v4l2_frmivalenum.discrete.numerator = 1;
v4l2_frmivalenum.discrete.denominator = denominator/5;
- JOM(8, "%i=index: %i/%i\n", index, \
- (int)(v4l2_frmivalenum.discrete.numerator), \
+ JOM(8, "%i=index: %i/%i\n", index,
+ (int)(v4l2_frmivalenum.discrete.numerator),
(int)(v4l2_frmivalenum.discrete.denominator));
break;
}
return -EINVAL;
}
}
- if (0 != copy_to_user((void __user *)arg, &v4l2_frmivalenum, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_frmivalenum,
sizeof(struct v4l2_frmivalenum))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
- if (0 != copy_from_user(pv4l2_format, (void __user *)arg, \
+ if (0 != copy_from_user(pv4l2_format, (void __user *)arg,
sizeof(struct v4l2_format))) {
kfree(pv4l2_format);
kfree(pv4l2_pix_format);
memset(pv4l2_pix_format, 0, sizeof(struct v4l2_pix_format));
pv4l2_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- memcpy(&pv4l2_format->fmt.pix, \
- &easycap_format[peasycap->format_offset]\
+ memcpy(&pv4l2_format->fmt.pix,
+ &easycap_format[peasycap->format_offset]
.v4l2_format.fmt.pix, sizeof(struct v4l2_pix_format));
- JOM(8, "user is told: %s\n", \
+ JOM(8, "user is told: %s\n",
&easycap_format[peasycap->format_offset].name[0]);
- if (0 != copy_to_user((void __user *)arg, pv4l2_format, \
+ if (0 != copy_to_user((void __user *)arg, pv4l2_format,
sizeof(struct v4l2_format))) {
kfree(pv4l2_format);
kfree(pv4l2_pix_format);
try = false;
}
- if (0 != copy_from_user(&v4l2_format, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_format, (void __user *)arg,
sizeof(struct v4l2_format))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
- best_format = adjust_format(peasycap, \
- v4l2_format.fmt.pix.width, \
- v4l2_format.fmt.pix.height, \
- v4l2_format.fmt.pix.pixelformat, \
- v4l2_format.fmt.pix.field, \
+ best_format = adjust_format(peasycap,
+ v4l2_format.fmt.pix.width,
+ v4l2_format.fmt.pix.height,
+ v4l2_format.fmt.pix.pixelformat,
+ v4l2_format.fmt.pix.field,
try);
if (0 > best_format) {
if (-EBUSY == best_format) {
memset(&v4l2_pix_format, 0, sizeof(struct v4l2_pix_format));
v4l2_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- memcpy(&(v4l2_format.fmt.pix), &(easycap_format[best_format]\
+ memcpy(&(v4l2_format.fmt.pix), &(easycap_format[best_format]
.v4l2_format.fmt.pix), sizeof(v4l2_pix_format));
JOM(8, "user is told: %s\n", &easycap_format[best_format].name[0]);
- if (0 != copy_to_user((void __user *)arg, &v4l2_format, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_format,
sizeof(struct v4l2_format))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_CROPCAP\n");
- if (0 != copy_from_user(&v4l2_cropcap, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_cropcap, (void __user *)arg,
sizeof(struct v4l2_cropcap))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "user is told: %ix%i\n", peasycap->width, peasycap->height);
- if (0 != copy_to_user((void __user *)arg, &v4l2_cropcap, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_cropcap,
sizeof(struct v4l2_cropcap))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
case VIDIOC_QUERYSTD: {
- JOM(8, "VIDIOC_QUERYSTD: " \
+ JOM(8, "VIDIOC_QUERYSTD: "
"EasyCAP is incapable of detecting standard\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
JOM(8, "VIDIOC_ENUMSTD\n");
- if (0 != copy_from_user(&v4l2_standard, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_standard, (void __user *)arg,
sizeof(struct v4l2_standard))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
index = v4l2_standard.index;
last3 = last2; last2 = last1; last1 = last0; last0 = index;
- if ((index == last3) && (index == last2) && \
+ if ((index == last3) && (index == last2) &&
(index == last1) && (index == last0)) {
index++;
last3 = last2; last2 = last1; last1 = last0; last0 = index;
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
- JOM(8, "%i=index: %s\n", index, \
+ JOM(8, "%i=index: %s\n", index,
&(peasycap_standard->v4l2_standard.name[0]));
- memcpy(&v4l2_standard, &(peasycap_standard->v4l2_standard), \
+ memcpy(&v4l2_standard, &(peasycap_standard->v4l2_standard),
sizeof(struct v4l2_standard));
v4l2_standard.index = index;
- if (0 != copy_to_user((void __user *)arg, &v4l2_standard, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_standard,
sizeof(struct v4l2_standard))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_G_STD\n");
if (0 > peasycap->standard_offset) {
- JOM(8, "%i=peasycap->standard_offset\n", \
+ JOM(8, "%i=peasycap->standard_offset\n",
peasycap->standard_offset);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EBUSY;
}
- if (0 != copy_from_user(&std_id, (void __user *)arg, \
+ if (0 != copy_from_user(&std_id, (void __user *)arg,
sizeof(v4l2_std_id))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
peasycap_standard = &easycap_standard[peasycap->standard_offset];
std_id = peasycap_standard->v4l2_standard.id;
- JOM(8, "user is told: %s\n", \
+ JOM(8, "user is told: %s\n",
&peasycap_standard->v4l2_standard.name[0]);
- if (0 != copy_to_user((void __user *)arg, &std_id, \
+ if (0 != copy_to_user((void __user *)arg, &std_id,
sizeof(v4l2_std_id))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_S_STD\n");
- if (0 != copy_from_user(&std_id, (void __user *)arg, \
+ if (0 != copy_from_user(&std_id, (void __user *)arg,
sizeof(v4l2_std_id))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
- JOM(8, "User requests standard: 0x%08X%08X\n", \
- (int)((std_id & (((v4l2_std_id)0xFFFFFFFF) << 32)) >> 32), \
+ JOM(8, "User requests standard: 0x%08X%08X\n",
+ (int)((std_id & (((v4l2_std_id)0xFFFFFFFF) << 32)) >> 32),
(int)(std_id & ((v4l2_std_id)0xFFFFFFFF)));
rc = adjust_standard(peasycap, std_id);
JOM(8, "VIDIOC_REQBUFS\n");
- if (0 != copy_from_user(&v4l2_requestbuffers, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_requestbuffers, (void __user *)arg,
sizeof(struct v4l2_requestbuffers))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
if (nbuffers > FRAME_BUFFER_MANY)
nbuffers = FRAME_BUFFER_MANY;
if (v4l2_requestbuffers.count == nbuffers) {
- JOM(8, " ... agree to %i buffers\n", \
+ JOM(8, " ... agree to %i buffers\n",
nbuffers);
} else {
- JOM(8, " ... insist on %i buffers\n", \
+ JOM(8, " ... insist on %i buffers\n",
nbuffers);
v4l2_requestbuffers.count = nbuffers;
}
peasycap->frame_buffer_many = nbuffers;
- if (0 != copy_to_user((void __user *)arg, &v4l2_requestbuffers, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_requestbuffers,
sizeof(struct v4l2_requestbuffers))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_QUERYBUF\n");
if (peasycap->video_eof) {
- JOM(8, "returning -EIO because %i=video_eof\n", \
+ JOM(8, "returning -EIO because %i=video_eof\n",
peasycap->video_eof);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EIO;
}
- if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg,
sizeof(struct v4l2_buffer))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
v4l2_buffer.index = index;
v4l2_buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
v4l2_buffer.bytesused = peasycap->frame_buffer_used;
- v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED | \
- peasycap->done[index] | \
+ v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED |
+ peasycap->done[index] |
peasycap->queued[index];
v4l2_buffer.field = V4L2_FIELD_NONE;
v4l2_buffer.memory = V4L2_MEMORY_MMAP;
JOM(16, " %10i=bytesused\n", v4l2_buffer.bytesused);
JOM(16, " 0x%08X=flags\n", v4l2_buffer.flags);
JOM(16, " %10i=field\n", v4l2_buffer.field);
- JOM(16, " %10li=timestamp.tv_usec\n", \
+ JOM(16, " %10li=timestamp.tv_usec\n",
(long)v4l2_buffer.timestamp.tv_usec);
JOM(16, " %10i=sequence\n", v4l2_buffer.sequence);
JOM(16, " 0x%08X=memory\n", v4l2_buffer.memory);
JOM(16, " %10i=m.offset\n", v4l2_buffer.m.offset);
JOM(16, " %10i=length\n", v4l2_buffer.length);
- if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_buffer,
sizeof(struct v4l2_buffer))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
JOM(8, "VIDIOC_QBUF\n");
- if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg,
sizeof(struct v4l2_buffer))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
- if (v4l2_buffer.index < 0 || \
+ if (v4l2_buffer.index < 0 ||
(v4l2_buffer.index >= peasycap->frame_buffer_many)) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
peasycap->done[v4l2_buffer.index] = 0;
peasycap->queued[v4l2_buffer.index] = V4L2_BUF_FLAG_QUEUED;
- if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_buffer,
sizeof(struct v4l2_buffer))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
- JOM(8, "..... user queueing frame buffer %i\n", \
+ JOM(8, "..... user queueing frame buffer %i\n",
(int)v4l2_buffer.index);
peasycap->frame_lock = 0;
JOM(8, "VIDIOC_DQBUF\n");
if ((peasycap->video_idle) || (peasycap->video_eof)) {
- JOM(8, "returning -EIO because " \
- "%i=video_idle %i=video_eof\n", \
+ JOM(8, "returning -EIO because "
+ "%i=video_idle %i=video_eof\n",
peasycap->video_idle, peasycap->video_eof);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EIO;
}
- if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \
+ if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg,
sizeof(struct v4l2_buffer))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
else if (V4L2_FIELD_ANY == v4l2_buffer.field)
JOM(8, "user wants V4L2_FIELD_ANY\n");
else
- JOM(8, "user wants V4L2_FIELD_...UNKNOWN: %i\n", \
+ JOM(8, "user wants V4L2_FIELD_...UNKNOWN: %i\n",
v4l2_buffer.field);
}
do {
rcdq = easycap_dqbuf(peasycap, 0);
if (-EIO == rcdq) {
- JOM(8, "returning -EIO because " \
+ JOM(8, "returning -EIO because "
"dqbuf() returned -EIO\n");
- mutex_unlock(&easycapdc60_dongle[kd].\
+ mutex_unlock(&easycapdc60_dongle[kd].
mutex_video);
return -EIO;
}
}
}
if (V4L2_BUF_FLAG_DONE != peasycap->done[peasycap->frame_read]) {
- JOM(8, "V4L2_BUF_FLAG_DONE != 0x%08X\n", \
+ JOM(8, "V4L2_BUF_FLAG_DONE != 0x%08X\n",
peasycap->done[peasycap->frame_read]);
}
peasycap->polled = 0;
for (i = 0; i < 180; i++)
j += peasycap->merit[i];
if (90 < j) {
- SAM("easycap driver shutting down " \
+ SAM("easycap driver shutting down "
"on condition blue\n");
peasycap->video_eof = 1; peasycap->audio_eof = 1;
}
timeval2.tv_sec = timeval1.tv_sec + sdr.quotient;
}
if (!(peasycap->isequence % 500)) {
- fudge = ((long long int)(1000000)) * \
- ((long long int)(timeval.tv_sec - \
- timeval2.tv_sec)) + \
- (long long int)(timeval.tv_usec - \
+ fudge = ((long long int)(1000000)) *
+ ((long long int)(timeval.tv_sec -
+ timeval2.tv_sec)) +
+ (long long int)(timeval.tv_usec -
timeval2.tv_usec);
sdr = signed_div(fudge, 1000);
sll = sdr.quotient;
JOM(16, " %10i=bytesused\n", v4l2_buffer.bytesused);
JOM(16, " 0x%08X=flags\n", v4l2_buffer.flags);
JOM(16, " %10i=field\n", v4l2_buffer.field);
- JOM(16, " %10li=timestamp.tv_sec\n", \
+ JOM(16, " %10li=timestamp.tv_sec\n",
(long)v4l2_buffer.timestamp.tv_sec);
- JOM(16, " %10li=timestamp.tv_usec\n", \
+ JOM(16, " %10li=timestamp.tv_usec\n",
(long)v4l2_buffer.timestamp.tv_usec);
JOM(16, " %10i=sequence\n", v4l2_buffer.sequence);
JOM(16, " 0x%08X=memory\n", v4l2_buffer.memory);
JOM(16, " %10i=m.offset\n", v4l2_buffer.m.offset);
JOM(16, " %10i=length\n", v4l2_buffer.length);
- if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \
+ if (0 != copy_to_user((void __user *)arg, &v4l2_buffer,
sizeof(struct v4l2_buffer))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
input = peasycap->frame_buffer[peasycap->frame_read][0].input;
if (0x08 & input) {
- JOM(8, "user is offered frame buffer %i, input %i\n", \
+ JOM(8, "user is offered frame buffer %i, input %i\n",
peasycap->frame_read, (0x07 & input));
} else {
- JOM(8, "user is offered frame buffer %i\n", \
+ JOM(8, "user is offered frame buffer %i\n",
peasycap->frame_read);
}
peasycap->frame_lock = 1;
JOM(8, "%i=peasycap->frame_fill\n", peasycap->frame_fill);
if (peasycap->frame_read == peasycap->frame_fill) {
if (peasycap->frame_lock) {
- JOM(8, "WORRY: filling frame buffer " \
+ JOM(8, "WORRY: filling frame buffer "
"while offered to user\n");
}
}
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
- if (0 != copy_from_user(pv4l2_streamparm, (void __user *)arg, \
+ if (0 != copy_from_user(pv4l2_streamparm, (void __user *)arg,
sizeof(struct v4l2_streamparm))) {
kfree(pv4l2_streamparm);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
pv4l2_streamparm->parm.capture.timeperframe.numerator = 1;
if (peasycap->fps) {
- pv4l2_streamparm->parm.capture.timeperframe.\
+ pv4l2_streamparm->parm.capture.timeperframe.
denominator = peasycap->fps;
} else {
if (true == peasycap->ntsc) {
- pv4l2_streamparm->parm.capture.timeperframe.\
+ pv4l2_streamparm->parm.capture.timeperframe.
denominator = 30;
} else {
- pv4l2_streamparm->parm.capture.timeperframe.\
+ pv4l2_streamparm->parm.capture.timeperframe.
denominator = 25;
}
}
- pv4l2_streamparm->parm.capture.readbuffers = \
+ pv4l2_streamparm->parm.capture.readbuffers =
peasycap->frame_buffer_many;
pv4l2_streamparm->parm.capture.extendedmode = 0;
- if (0 != copy_to_user((void __user *)arg, pv4l2_streamparm, \
+ if (0 != copy_to_user((void __user *)arg, pv4l2_streamparm,
sizeof(struct v4l2_streamparm))) {
kfree(pv4l2_streamparm);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
/*****************************************************************************/
#if !defined(EASYCAP_NEEDS_ALSA)
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if ((defined(EASYCAP_IS_VIDEODEV_CLIENT)) || \
+#if ((defined(EASYCAP_IS_VIDEODEV_CLIENT)) ||
(defined(EASYCAP_NEEDS_UNLOCKED_IOCTL)))
long
easyoss_ioctl_noinode(struct file *file, unsigned int cmd, unsigned long arg) {
JOM(8, "........... %i=outgoing\n", outgoing);
JOM(8, " cf. %i=AFMT_S16_LE\n", AFMT_S16_LE);
JOM(8, " cf. %i=AFMT_U8\n", AFMT_U8);
- if (0 != copy_to_user((void __user *)arg, &outgoing, \
+ if (0 != copy_to_user((void __user *)arg, &outgoing,
sizeof(int))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT;
return -EFAULT;
}
JOM(8, "........... %i=incoming\n", incoming);
- JOM(8, "........... cf 0x%x=PCM_ENABLE_INPUT " \
- "0x%x=PCM_ENABLE_OUTPUT\n", \
+ JOM(8, "........... cf 0x%x=PCM_ENABLE_INPUT "
+ "0x%x=PCM_ENABLE_OUTPUT\n",
PCM_ENABLE_INPUT, PCM_ENABLE_OUTPUT);
;
;
audio_buf_info.fragsize = 0;
audio_buf_info.fragstotal = 0;
- if (0 != copy_to_user((void __user *)arg, &audio_buf_info, \
+ if (0 != copy_to_user((void __user *)arg, &audio_buf_info,
sizeof(int))) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT;
GET(p, 0x0115, &get5);
GET(p, 0x0116, &get6);
GET(p, 0x0117, &get7);
-JOT(8, "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X\n", \
+JOT(8, "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X\n",
get0, get1, get2, get3, get4, get5, get6, get7);
-JOT(8, "....cf PAL_720x526: " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X\n", \
+JOT(8, "....cf PAL_720x526: "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X\n",
0x000, 0x000, 0x001, 0x000, 0x5A0, 0x005, 0x121, 0x001);
-JOT(8, "....cf PAL_704x526: " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X\n", \
+JOT(8, "....cf PAL_704x526: "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X\n",
0x004, 0x000, 0x001, 0x000, 0x584, 0x005, 0x121, 0x001);
-JOT(8, "....cf VGA_640x480: " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X, " \
- "0x%03X, 0x%03X\n", \
+JOT(8, "....cf VGA_640x480: "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X, "
+ "0x%03X, 0x%03X\n",
0x008, 0x000, 0x020, 0x000, 0x508, 0x005, 0x110, 0x001);
return 0;
}
i0 = 0;
if (true == ntsc) {
while (0xFF != saa7113configNTSC[i0].reg) {
- ir = write_saa(p, saa7113configNTSC[i0].reg, \
+ ir = write_saa(p, saa7113configNTSC[i0].reg,
saa7113configNTSC[i0].set);
i0++;
}
} else {
while (0xFF != saa7113configPAL[i0].reg) {
- ir = write_saa(p, saa7113configPAL[i0].reg, \
+ ir = write_saa(p, saa7113configPAL[i0].reg,
saa7113configPAL[i0].set);
i0++;
}
GET(p, 0x0502, &igot); got502 = (0xFF & igot);
GET(p, 0x0503, &igot); got503 = (0xFF & igot);
-JOT(16, "write_vt(., 0x%04X, 0x%04X): was 0x%04X\n", \
+JOT(16, "write_vt(., 0x%04X, 0x%04X): was 0x%04X\n",
reg0, set0, ((got503 << 8) | got502));
set502 = (0x00FF & set0);
ir = read_saa(p, saa7113configNTSC[i0].reg);
if (ir != saa7113configNTSC[i0].set) {
- SAY("SAA register 0x%02X has 0x%02X, " \
- "expected 0x%02X\n", \
- saa7113configNTSC[i0].reg, \
+ SAY("SAA register 0x%02X has 0x%02X, "
+ "expected 0x%02X\n",
+ saa7113configNTSC[i0].reg,
ir, saa7113configNTSC[i0].set);
rc--;
}
ir = read_saa(p, saa7113configPAL[i0].reg);
if (ir != saa7113configPAL[i0].set) {
- SAY("SAA register 0x%02X has 0x%02X, " \
- "expected 0x%02X\n", \
- saa7113configPAL[i0].reg, \
+ SAY("SAA register 0x%02X has 0x%02X, "
+ "expected 0x%02X\n",
+ saa7113configPAL[i0].reg,
ir, saa7113configPAL[i0].set);
rc--;
}
}
ir = read_stk(p, stk1160configNTSC[i0].reg);
if (0x100 == stk1160configNTSC[i0].reg) {
- if ((ir != (0xFF & stk1160configNTSC[i0].set)) && \
- (ir != (0x80 | (0xFF & \
- stk1160configNTSC[i0].set))) && \
- (0xFFFF != \
+ if ((ir != (0xFF & stk1160configNTSC[i0].set)) &&
+ (ir != (0x80 | (0xFF &
+ stk1160configNTSC[i0].set))) &&
+ (0xFFFF !=
stk1160configNTSC[i0].set)) {
- SAY("STK register 0x%03X has 0x%02X, " \
- "expected 0x%02X\n", \
- stk1160configNTSC[i0].reg, \
+ SAY("STK register 0x%03X has 0x%02X, "
+ "expected 0x%02X\n",
+ stk1160configNTSC[i0].reg,
ir, stk1160configNTSC[i0].set);
}
i0++; continue;
}
- if ((ir != (0xFF & stk1160configNTSC[i0].set)) && \
+ if ((ir != (0xFF & stk1160configNTSC[i0].set)) &&
(0xFFFF != stk1160configNTSC[i0].set)) {
- SAY("STK register 0x%03X has 0x%02X, " \
- "expected 0x%02X\n", \
- stk1160configNTSC[i0].reg, \
+ SAY("STK register 0x%03X has 0x%02X, "
+ "expected 0x%02X\n",
+ stk1160configNTSC[i0].reg,
ir, stk1160configNTSC[i0].set);
}
i0++;
}
ir = read_stk(p, stk1160configPAL[i0].reg);
if (0x100 == stk1160configPAL[i0].reg) {
- if ((ir != (0xFF & stk1160configPAL[i0].set)) && \
- (ir != (0x80 | (0xFF & \
- stk1160configPAL[i0].set))) && \
- (0xFFFF != \
+ if ((ir != (0xFF & stk1160configPAL[i0].set)) &&
+ (ir != (0x80 | (0xFF &
+ stk1160configPAL[i0].set))) &&
+ (0xFFFF !=
stk1160configPAL[i0].set)) {
- SAY("STK register 0x%03X has 0x%02X, " \
- "expected 0x%02X\n", \
- stk1160configPAL[i0].reg, \
+ SAY("STK register 0x%03X has 0x%02X, "
+ "expected 0x%02X\n",
+ stk1160configPAL[i0].reg,
ir, stk1160configPAL[i0].set);
}
i0++; continue;
}
- if ((ir != (0xFF & stk1160configPAL[i0].set)) && \
+ if ((ir != (0xFF & stk1160configPAL[i0].set)) &&
(0xFFFF != stk1160configPAL[i0].set)) {
- SAY("STK register 0x%03X has 0x%02X, " \
- "expected 0x%02X\n", \
- stk1160configPAL[i0].reg, \
+ SAY("STK register 0x%03X has 0x%02X, "
+ "expected 0x%02X\n",
+ stk1160configPAL[i0].reg,
ir, stk1160configPAL[i0].set);
}
i0++;
case 0:
case 1: {
if (0 != write_saa(p, 0x02, 0x80)) {
- SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \
+ SAY("ERROR: failed to set SAA register 0x02 for input %i\n",
input);
}
SET(p, 0x0000, 0x0098);
}
case 2: {
if (0 != write_saa(p, 0x02, 0x80)) {
- SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \
+ SAY("ERROR: failed to set SAA register 0x02 for input %i\n",
input);
}
SET(p, 0x0000, 0x0090);
}
case 3: {
if (0 != write_saa(p, 0x02, 0x80)) {
- SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \
+ SAY("ERROR: failed to set SAA register 0x02 for input %i\n",
input);
}
SET(p, 0x0000, 0x0088);
}
case 4: {
if (0 != write_saa(p, 0x02, 0x80)) {
- SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \
+ SAY("ERROR: failed to set SAA register 0x02 for input %i\n",
input);
}
SET(p, 0x0000, 0x0080);
switch (mode) {
case 7: {
if (0 != write_saa(p, 0x02, 0x87)) {
- SAY("ERROR: failed to set SAA register 0x02 " \
+ SAY("ERROR: failed to set SAA register 0x02 "
"for input %i\n", input);
}
if (0 != write_saa(p, 0x05, 0xFF)) {
- SAY("ERROR: failed to set SAA register 0x05 " \
+ SAY("ERROR: failed to set SAA register 0x05 "
"for input %i\n", input);
}
break;
}
case 9: {
if (0 != write_saa(p, 0x02, 0x89)) {
- SAY("ERROR: failed to set SAA register 0x02 " \
+ SAY("ERROR: failed to set SAA register 0x02 "
"for input %i\n", input);
}
if (0 != write_saa(p, 0x05, 0x00)) {
- SAY("ERROR: failed to set SAA register 0x05 " \
+ SAY("ERROR: failed to set SAA register 0x05 "
"for input %i\n", input);
}
break;
}
}
if (0 != write_saa(p, 0x04, 0x00)) {
- SAY("ERROR: failed to set SAA register 0x04 for input %i\n", \
+ SAY("ERROR: failed to set SAA register 0x04 for input %i\n",
input);
}
if (0 != write_saa(p, 0x09, 0x80)) {
- SAY("ERROR: failed to set SAA register 0x09 for input %i\n", \
+ SAY("ERROR: failed to set SAA register 0x09 for input %i\n",
input);
}
SET(p, 0x0002, 0x0093);
}
/****************************************************************************/
int
-set_resolution(struct usb_device *p, \
+set_resolution(struct usb_device *p,
__u16 set0, __u16 set1, __u16 set2, __u16 set3)
{
__u16 u0x0111, u0x0113, u0x0115, u0x0117;
if (!pusb_device)
return -ENODEV;
rc1 = 0; igot = 0;
-rc0 = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \
- (__u8)0x01, \
- (__u8)(USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE), \
- (__u16)value, \
- (__u16)index, \
- (void *)NULL, \
- (__u16)0, \
+rc0 = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0),
+ (__u8)0x01,
+ (__u8)(USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE),
+ (__u16)value,
+ (__u16)index,
+ (void *)NULL,
+ (__u16)0,
(int)500);
#if defined(NOREADBACK)
#
#else
-rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0), \
- (__u8)0x00, \
- (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE), \
- (__u16)0x00, \
- (__u16)index, \
- (void *)&igot, \
- (__u16)sizeof(__u16), \
+rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0),
+ (__u8)0x00,
+ (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE),
+ (__u16)0x00,
+ (__u16)index,
+ (void *)&igot,
+ (__u16)sizeof(__u16),
(int)50000);
igot = 0xFF & igot;
switch (index) {
case 0x350:
case 0x351: {
if (0 != (0xFF & igot)) {
- JOT(8, "unexpected 0x%02X for STK register 0x%03X\n", \
+ JOT(8, "unexpected 0x%02X for STK register 0x%03X\n",
igot, index);
}
break;
}
default: {
if ((0xFF & value) != (0xFF & igot)) {
- JOT(8, "unexpected 0x%02X != 0x%02X " \
- "for STK register 0x%03X\n", \
+ JOT(8, "unexpected 0x%02X != 0x%02X "
+ "for STK register 0x%03X\n",
igot, value, index);
}
break;
if (!pusb_device)
return -ENODEV;
-ir = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0), \
- (__u8)0x00, \
- (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE), \
- (__u16)0x00, \
- (__u16)index, \
- (void *)pvoid, \
- sizeof(__u8), \
+ir = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0),
+ (__u8)0x00,
+ (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE),
+ (__u16)0x00,
+ (__u16)index,
+ (void *)pvoid,
+ sizeof(__u8),
(int)50000);
return 0xFF & ir;
}
{
if (!pusb_device)
return -ENODEV;
-return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \
- (__u8)USB_REQ_SET_FEATURE, \
- (__u8)(USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE), \
- USB_DEVICE_REMOTE_WAKEUP, \
- (__u16)0, \
- (void *) NULL, \
- (__u16)0, \
+return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0),
+ (__u8)USB_REQ_SET_FEATURE,
+ (__u8)(USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE),
+ USB_DEVICE_REMOTE_WAKEUP,
+ (__u16)0,
+ (void *) NULL,
+ (__u16)0,
(int)50000);
}
/*****************************************************************************/
*/
/*---------------------------------------------------------------------------*/
const __u8 request = 0x01;
-const __u8 requesttype = \
+const __u8 requesttype =
(__u8)(USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
const __u16 value_unmute = 0x0200;
const __u16 index = 0x0301;
if (NULL == pusb_device)
return -ENODEV;
-JOM(8, "%02X %02X %02X %02X %02X %02X %02X %02X\n", \
- requesttype, request, \
- (0x00FF & value_unmute), \
- (0xFF00 & value_unmute) >> 8, \
- (0x00FF & index), \
- (0xFF00 & index) >> 8, \
- (0x00FF & length), \
+JOM(8, "%02X %02X %02X %02X %02X %02X %02X %02X\n",
+ requesttype, request,
+ (0x00FF & value_unmute),
+ (0xFF00 & value_unmute) >> 8,
+ (0x00FF & index),
+ (0xFF00 & index) >> 8,
+ (0x00FF & length),
(0xFF00 & length) >> 8);
buffer[0] = 0x01;
-rc = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \
- (__u8)request, \
- (__u8)requesttype, \
- (__u16)value_unmute, \
- (__u16)index, \
- (void *)&buffer[0], \
- (__u16)length, \
+rc = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0),
+ (__u8)request,
+ (__u8)requesttype,
+ (__u16)value_unmute,
+ (__u16)index,
+ (void *)&buffer[0],
+ (__u16)length,
(int)50000);
JOT(8, "0x%02X=buffer\n", *((__u8 *) &buffer[0]));
mute = 0x8000 & ((unsigned int)igot);
mute = 0;
-JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x10,...0x18\n", \
+JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x10,...0x18\n",
mute | u8 | (u8 << 8));
write_vt(pusb_device, 0x0010, (mute | u8 | (u8 << 8)));
write_vt(pusb_device, 0x0012, (mute | u8 | (u8 << 8)));
else
u8 = 0;
-JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x1C\n", \
+JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x1C\n",
mute | u8 | (u8 << 8));
write_vt(pusb_device, 0x001C, (mute | u8 | (u8 << 8)));
write_vt(pusb_device, 0x001A, 0x0404);
SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT;
} else {
- JOM(16, "0x%08lX=peasycap->pusb_device\n", \
+ JOM(16, "0x%08lX=peasycap->pusb_device\n",
(long int)peasycap->pusb_device);
}
file->private_data = peasycap;
rate = ready_saa(peasycap->pusb_device);
if (0 > rate) {
JOM(8, "not ready to capture after %i ms ...\n", PATIENCE);
- JOM(8, "... saa register 0x1F has 0x%02X\n", \
+ JOM(8, "... saa register 0x1F has 0x%02X\n",
read_saa(peasycap->pusb_device, 0x1F));
ntsc = peasycap->ntsc;
} else {
peasycap_standard = &easycap_standard[0];
while (0xFFFF != peasycap_standard->mask) {
if (true == ntsc) {
- if (NTSC_M == \
+ if (NTSC_M ==
peasycap_standard->v4l2_standard.index) {
- peasycap->inputset[input].standard_offset = \
- peasycap_standard - \
+ peasycap->inputset[input].standard_offset =
+ peasycap_standard -
&easycap_standard[0];
break;
}
} else {
- if (PAL_BGHIN == \
+ if (PAL_BGHIN ==
peasycap_standard->v4l2_standard.index) {
- peasycap->inputset[input].standard_offset = \
+ peasycap->inputset[input].standard_offset =
peasycap_standard -
&easycap_standard[0];
break;
SAM("ERROR: standard not found\n");
return -EINVAL;
}
-JOM(8, "%i=peasycap->inputset[%i].standard_offset\n", \
+JOM(8, "%i=peasycap->inputset[%i].standard_offset\n",
peasycap->inputset[input].standard_offset, input);
}
peasycap->format_offset = -8192;
return -ENOENT;
}
if (0 > peasycap->standard_offset) {
- SAM("MISTAKE: %i=peasycap->standard_offset\n", \
+ SAM("MISTAKE: %i=peasycap->standard_offset\n",
peasycap->standard_offset);
return -ENOENT;
}
if (0 > peasycap->format_offset) {
- SAM("MISTAKE: %i=peasycap->format_offset\n", \
+ SAM("MISTAKE: %i=peasycap->format_offset\n",
peasycap->format_offset);
return -ENOENT;
}
return -ENODEV;
}
rc = usb_set_interface(peasycap->pusb_device,
- peasycap->video_interface, \
+ peasycap->video_interface,
peasycap->video_altsetting_off);
if (0 != rc) {
SAM("ERROR: usb_set_interface() returned %i\n", rc);
if (input == peasycap->inputset[input].input) {
off = peasycap->inputset[input].standard_offset;
if (off != peasycap->standard_offset) {
- rc = adjust_standard(peasycap, \
+ rc = adjust_standard(peasycap,
easycap_standard[off].v4l2_standard.id);
if (0 != rc) {
SAM("ERROR: adjust_standard() returned %i\n", rc);
return -EFAULT;
}
- JOM(8, "%i=peasycap->standard_offset\n", \
+ JOM(8, "%i=peasycap->standard_offset\n",
peasycap->standard_offset);
} else {
- JOM(8, "%i=peasycap->standard_offset unchanged\n", \
+ JOM(8, "%i=peasycap->standard_offset unchanged\n",
peasycap->standard_offset);
}
off = peasycap->inputset[input].format_offset;
if (off != peasycap->format_offset) {
- rc = adjust_format(peasycap, \
- easycap_format[off].v4l2_format.fmt.pix.width, \
- easycap_format[off].v4l2_format.fmt.pix.height, \
- easycap_format[off].v4l2_format.fmt.pix.pixelformat, \
+ rc = adjust_format(peasycap,
+ easycap_format[off].v4l2_format.fmt.pix.width,
+ easycap_format[off].v4l2_format.fmt.pix.height,
+ easycap_format[off].v4l2_format.fmt.pix.pixelformat,
easycap_format[off].v4l2_format.fmt.pix.field, false);
if (0 > rc) {
SAM("ERROR: adjust_format() returned %i\n", rc);
}
JOM(8, "%i=peasycap->format_offset\n", peasycap->format_offset);
} else {
- JOM(8, "%i=peasycap->format_offset unchanged\n", \
+ JOM(8, "%i=peasycap->format_offset unchanged\n",
peasycap->format_offset);
}
mood = peasycap->inputset[input].brightness;
return -ENODEV;
}
rc = usb_set_interface(peasycap->pusb_device,
- peasycap->video_interface, \
+ peasycap->video_interface,
peasycap->video_altsetting_on);
if (0 != rc) {
SAM("ERROR: usb_set_interface() returned %i\n", rc);
isbuf = pdata_urb->isbuf;
purb->interval = 1;
purb->dev = peasycap->pusb_device;
- purb->pipe = \
- usb_rcvisocpipe(peasycap->pusb_device,\
+ purb->pipe =
+ usb_rcvisocpipe(peasycap->pusb_device,
peasycap->video_endpointnumber);
purb->transfer_flags = URB_ISO_ASAP;
- purb->transfer_buffer = \
+ purb->transfer_buffer =
peasycap->video_isoc_buffer[isbuf].pgo;
- purb->transfer_buffer_length = \
+ purb->transfer_buffer_length =
peasycap->video_isoc_buffer_size;
purb->complete = easycap_complete;
purb->context = peasycap;
purb->start_frame = 0;
- purb->number_of_packets = \
+ purb->number_of_packets =
peasycap->video_isoc_framesperdesc;
- for (j = 0; j < peasycap->\
+ for (j = 0; j < peasycap->
video_isoc_framesperdesc; j++) {
- purb->iso_frame_desc[j].\
- offset = j * \
- peasycap->\
+ purb->iso_frame_desc[j].
+ offset = j *
+ peasycap->
video_isoc_maxframesize;
- purb->iso_frame_desc[j].\
- length = peasycap->\
+ purb->iso_frame_desc[j].
+ length = peasycap->
video_isoc_maxframesize;
}
rc = usb_submit_urb(purb, GFP_KERNEL);
if (0 != rc) {
isbad++;
- SAM("ERROR: usb_submit_urb() failed " \
+ SAM("ERROR: usb_submit_urb() failed "
"for urb with rc:\n");
switch (rc) {
case -ENOMEM: {
- SAM("ERROR: -ENOMEM=" \
+ SAM("ERROR: -ENOMEM="
"usb_submit_urb()\n");
break;
}
case -ENODEV: {
- SAM("ERROR: -ENODEV=" \
+ SAM("ERROR: -ENODEV="
"usb_submit_urb()\n");
break;
}
case -ENXIO: {
- SAM("ERROR: -ENXIO=" \
+ SAM("ERROR: -ENXIO="
"usb_submit_urb()\n");
break;
}
case -EINVAL: {
- SAM("ERROR: -EINVAL=" \
+ SAM("ERROR: -EINVAL="
"usb_submit_urb()\n");
break;
}
case -EAGAIN: {
- SAM("ERROR: -EAGAIN=" \
+ SAM("ERROR: -EAGAIN="
"usb_submit_urb()\n");
break;
}
case -EFBIG: {
- SAM("ERROR: -EFBIG=" \
+ SAM("ERROR: -EFBIG="
"usb_submit_urb()\n");
break;
}
case -EPIPE: {
- SAM("ERROR: -EPIPE=" \
+ SAM("ERROR: -EPIPE="
"usb_submit_urb()\n");
break;
}
case -EMSGSIZE: {
- SAM("ERROR: -EMSGSIZE=" \
+ SAM("ERROR: -EMSGSIZE="
"usb_submit_urb()\n");
break;
}
break;
}
default: {
- SAM("ERROR: %i=" \
- "usb_submit_urb()\n",\
+ SAM("ERROR: %i="
+ "usb_submit_urb()\n",
rc);
break;
}
if (isbad) {
JOM(4, "attempting cleanup instead of submitting\n");
list_for_each(plist_head, (peasycap->purb_video_head)) {
- pdata_urb = list_entry(plist_head, struct data_urb, \
+ pdata_urb = list_entry(plist_head, struct data_urb,
list_head);
if (NULL != pdata_urb) {
purb = pdata_urb->purb;
JOM(4, "killing video urbs\n");
m = 0;
list_for_each(plist_head, (peasycap->purb_video_head)) {
- pdata_urb = list_entry(plist_head, struct data_urb, \
+ pdata_urb = list_entry(plist_head, struct data_urb,
list_head);
if (NULL != pdata_urb) {
if (NULL != pdata_urb->purb) {
return -EFAULT;
}
} else {
- JOM(8, "%i=video_isoc_streaming, no video urbs killed\n", \
+ JOM(8, "%i=video_isoc_streaming, no video urbs killed\n",
peasycap->video_isoc_streaming);
}
return 0;
pdata_urb = list_entry(plist_head, struct data_urb, list_head);
if ((struct data_urb *)NULL != pdata_urb) {
kfree(pdata_urb); pdata_urb = (struct data_urb *)NULL;
- peasycap->allocation_video_struct -= \
+ peasycap->allocation_video_struct -=
sizeof(struct data_urb);
m++;
}
m = 0;
for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) {
if ((void *)NULL != peasycap->video_isoc_buffer[k].pgo) {
- free_pages((unsigned long)\
- (peasycap->video_isoc_buffer[k].pgo), \
+ free_pages((unsigned long)
+ (peasycap->video_isoc_buffer[k].pgo),
VIDEO_ISOC_ORDER);
peasycap->video_isoc_buffer[k].pgo = (void *)NULL;
- peasycap->allocation_video_page -= \
+ peasycap->allocation_video_page -=
((unsigned int)(0x01 << VIDEO_ISOC_ORDER));
m++;
}
for (k = 0; k < FIELD_BUFFER_MANY; k++) {
for (m = 0; m < FIELD_BUFFER_SIZE/PAGE_SIZE; m++) {
if ((void *)NULL != peasycap->field_buffer[k][m].pgo) {
- free_page((unsigned long)\
+ free_page((unsigned long)
(peasycap->field_buffer[k][m].pgo));
peasycap->field_buffer[k][m].pgo = (void *)NULL;
peasycap->allocation_video_page -= 1;
for (k = 0; k < FRAME_BUFFER_MANY; k++) {
for (m = 0; m < FRAME_BUFFER_SIZE/PAGE_SIZE; m++) {
if ((void *)NULL != peasycap->frame_buffer[k][m].pgo) {
- free_page((unsigned long)\
+ free_page((unsigned long)
(peasycap->frame_buffer[k][m].pgo));
peasycap->frame_buffer[k][m].pgo = (void *)NULL;
peasycap->allocation_video_page -= 1;
pdata_urb = list_entry(plist_head, struct data_urb, list_head);
if ((struct data_urb *)NULL != pdata_urb) {
kfree(pdata_urb); pdata_urb = (struct data_urb *)NULL;
- peasycap->allocation_audio_struct -= \
+ peasycap->allocation_audio_struct -=
sizeof(struct data_urb);
m++;
}
m = 0;
for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) {
if ((void *)NULL != peasycap->audio_isoc_buffer[k].pgo) {
- free_pages((unsigned long)\
- (peasycap->audio_isoc_buffer[k].pgo), \
+ free_pages((unsigned long)
+ (peasycap->audio_isoc_buffer[k].pgo),
AUDIO_ISOC_ORDER);
peasycap->audio_isoc_buffer[k].pgo = (void *)NULL;
- peasycap->allocation_audio_page -= \
+ peasycap->allocation_audio_page -=
((unsigned int)(0x01 << AUDIO_ISOC_ORDER));
m++;
}
}
-JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n", \
+JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n",
m * (0x01 << AUDIO_ISOC_ORDER));
/*---------------------------------------------------------------------------*/
#if !defined(EASYCAP_NEEDS_ALSA)
return -ERESTARTSYS;
}
if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
- SAY("ERROR: bad peasycap: 0x%08lX\n", \
+ SAY("ERROR: bad peasycap: 0x%08lX\n",
(unsigned long int) peasycap);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS;
*/
/*---------------------------------------------------------------------------*/
miss = 0;
-while ((peasycap->field_read == peasycap->field_fill) || \
- (0 != (0xFF00 & peasycap->field_buffer\
- [peasycap->field_read][0].kount)) || \
- (ifield != (0x00FF & peasycap->field_buffer\
+while ((peasycap->field_read == peasycap->field_fill) ||
+ (0 != (0xFF00 & peasycap->field_buffer
+ [peasycap->field_read][0].kount)) ||
+ (ifield != (0x00FF & peasycap->field_buffer
[peasycap->field_read][0].kount))) {
if (mode)
return -EAGAIN;
- JOM(8, "first wait on wq_video, " \
- "%i=field_read %i=field_fill\n", \
+ JOM(8, "first wait on wq_video, "
+ "%i=field_read %i=field_fill\n",
peasycap->field_read, peasycap->field_fill);
- if (0 != (wait_event_interruptible(peasycap->wq_video, \
- (peasycap->video_idle || peasycap->video_eof || \
- ((peasycap->field_read != peasycap->field_fill) && \
- (0 == (0xFF00 & peasycap->field_buffer\
- [peasycap->field_read][0].kount)) && \
- (ifield == (0x00FF & peasycap->field_buffer\
+ if (0 != (wait_event_interruptible(peasycap->wq_video,
+ (peasycap->video_idle || peasycap->video_eof ||
+ ((peasycap->field_read != peasycap->field_fill) &&
+ (0 == (0xFF00 & peasycap->field_buffer
+ [peasycap->field_read][0].kount)) &&
+ (ifield == (0x00FF & peasycap->field_buffer
[peasycap->field_read][0].kount))))))) {
SAM("aborted by signal\n");
return -EIO;
}
if (peasycap->video_idle) {
- JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n", \
+ JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n",
peasycap->video_idle);
return -EAGAIN;
}
else
ifield = 1;
miss = 0;
-while ((peasycap->field_read == peasycap->field_fill) || \
- (0 != (0xFF00 & peasycap->field_buffer\
- [peasycap->field_read][0].kount)) || \
- (ifield != (0x00FF & peasycap->field_buffer\
+while ((peasycap->field_read == peasycap->field_fill) ||
+ (0 != (0xFF00 & peasycap->field_buffer
+ [peasycap->field_read][0].kount)) ||
+ (ifield != (0x00FF & peasycap->field_buffer
[peasycap->field_read][0].kount))) {
if (mode)
return -EAGAIN;
- JOM(8, "second wait on wq_video, " \
- "%i=field_read %i=field_fill\n", \
+ JOM(8, "second wait on wq_video, "
+ "%i=field_read %i=field_fill\n",
peasycap->field_read, peasycap->field_fill);
- if (0 != (wait_event_interruptible(peasycap->wq_video, \
- (peasycap->video_idle || peasycap->video_eof || \
- ((peasycap->field_read != peasycap->field_fill) && \
- (0 == (0xFF00 & peasycap->field_buffer\
- [peasycap->field_read][0].kount)) && \
- (ifield == (0x00FF & peasycap->field_buffer\
- [peasycap->field_read][0].\
+ if (0 != (wait_event_interruptible(peasycap->wq_video,
+ (peasycap->video_idle || peasycap->video_eof ||
+ ((peasycap->field_read != peasycap->field_fill) &&
+ (0 == (0xFF00 & peasycap->field_buffer
+ [peasycap->field_read][0].kount)) &&
+ (ifield == (0x00FF & peasycap->field_buffer
+ [peasycap->field_read][0].
kount))))))) {
SAM("aborted by signal\n");
return -EIO;
}
if (peasycap->video_idle) {
- JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n", \
+ JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n",
peasycap->video_idle);
return -EAGAIN;
}
peasycap->frame_fill = 0;
if (0x01 & easycap_standard[peasycap->standard_offset].mask) {
- peasycap->frame_buffer[peasycap->frame_read][0].kount = \
+ peasycap->frame_buffer[peasycap->frame_read][0].kount =
V4L2_FIELD_TOP;
} else {
- peasycap->frame_buffer[peasycap->frame_read][0].kount = \
+ peasycap->frame_buffer[peasycap->frame_read][0].kount =
V4L2_FIELD_BOTTOM;
}
badinput = false;
input = 0x07 & peasycap->field_buffer[peasycap->field_read][0].input;
-JOM(8, "===== parity %i, input 0x%02X, field buffer %i --> " \
- "frame buffer %i\n", \
- peasycap->field_buffer[peasycap->field_read][0].kount,\
- peasycap->field_buffer[peasycap->field_read][0].input,\
+JOM(8, "===== parity %i, input 0x%02X, field buffer %i --> "
+ "frame buffer %i\n",
+ peasycap->field_buffer[peasycap->field_read][0].kount,
+ peasycap->field_buffer[peasycap->field_read][0].input,
peasycap->field_read, peasycap->frame_fill);
JOM(8, "===== %i=bytesperpixel\n", peasycap->bytesperpixel);
if (true == peasycap->offerfields)
*/
/*---------------------------------------------------------------------------*/
if (peasycap->field_read == peasycap->field_fill) {
- SAM("ERROR: on entry, still filling field buffer %i\n", \
+ SAM("ERROR: on entry, still filling field buffer %i\n",
peasycap->field_read);
return 0;
}
bytesperpixel = peasycap->bytesperpixel;
decimatepixel = peasycap->decimatepixel;
-if ((2 != bytesperpixel) && \
- (3 != bytesperpixel) && \
+if ((2 != bytesperpixel) &&
+ (3 != bytesperpixel) &&
(4 != bytesperpixel)) {
SAM("MISTAKE: %i=bytesperpixel\n", bytesperpixel);
return -EFAULT;
multiplier = 1;
w2 = 2 * multiplier * (peasycap->width);
-w3 = bytesperpixel * \
- multiplier * \
+w3 = bytesperpixel *
+ multiplier *
(peasycap->width);
-wz = multiplier * \
- (peasycap->height) * \
- multiplier * \
+wz = multiplier *
+ (peasycap->height) *
+ multiplier *
(peasycap->width);
kex = peasycap->field_read; mex = 0;
odd = false;
if ((true == odd) && (false == decimatepixel)) {
- JOM(8, " initial skipping %4i bytes p.%4i\n", \
+ JOM(8, " initial skipping %4i bytes p.%4i\n",
w3/multiplier, mad);
pad += (w3 / multiplier); rad -= (w3 / multiplier);
}
return -EFAULT;
}
- more = (bytesperpixel * \
+ more = (bytesperpixel *
much) / 2;
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
if (1 < bytesperpixel) {
** BREAKAGE. BEWARE.
**/
rad2 = rad + bytesperpixel - 1;
- much = ((((2 * \
+ much = ((((2 *
rad2)/bytesperpixel)/2) * 2);
- rump = ((bytesperpixel * \
+ rump = ((bytesperpixel *
much) / 2) - rad;
more = rad;
}
margin = 0;
if (much == rex) {
mask |= 0x04;
- if ((mex + 1) < FIELD_BUFFER_SIZE/ \
+ if ((mex + 1) < FIELD_BUFFER_SIZE/
PAGE_SIZE) {
- margin = *((__u8 *)(peasycap->\
- field_buffer\
+ margin = *((__u8 *)(peasycap->
+ field_buffer
[kex][mex + 1].pgo));
} else
mask |= 0x08;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
} else {
- SAM("MISTAKE: %i=bytesperpixel\n", \
+ SAM("MISTAKE: %i=bytesperpixel\n",
bytesperpixel);
return -EFAULT;
}
if (rump)
caches++;
if (true == badinput) {
- JOM(8, "ERROR: 0x%02X=->field_buffer" \
- "[%i][%i].input, " \
- "0x%02X=(0x08|->input)\n", \
- peasycap->field_buffer\
- [kex][mex].input, kex, mex, \
+ JOM(8, "ERROR: 0x%02X=->field_buffer"
+ "[%i][%i].input, "
+ "0x%02X=(0x08|->input)\n",
+ peasycap->field_buffer
+ [kex][mex].input, kex, mex,
(0x08|peasycap->input));
}
- rc = redaub(peasycap, pad, pex, much, more, \
+ rc = redaub(peasycap, pad, pex, much, more,
mask, margin, isuy);
if (0 > rc) {
SAM("ERROR: redaub() failed\n");
mex++;
pex = peasycap->field_buffer[kex][mex].pgo;
rex = PAGE_SIZE;
- if (peasycap->field_buffer[kex][mex].input != \
+ if (peasycap->field_buffer[kex][mex].input !=
(0x08|peasycap->input))
badinput = true;
}
do {
if (!rad) {
mad++;
- pad = peasycap->frame_buffer\
+ pad = peasycap->frame_buffer
[kad][mad].pgo;
rad = PAGE_SIZE;
}
return -EFAULT;
}
- more = (bytesperpixel * \
+ more = (bytesperpixel *
much) / 4;
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
if (1 < bytesperpixel) {
** BREAKAGE. BEWARE.
**/
rad2 = rad + bytesperpixel - 1;
- much = ((((2 * rad2)/bytesperpixel)/2)\
+ much = ((((2 * rad2)/bytesperpixel)/2)
* 4);
- rump = ((bytesperpixel * \
+ rump = ((bytesperpixel *
much) / 4) - rad;
more = rad;
}
margin = 0;
if (much == rex) {
mask |= 0x04;
- if ((mex + 1) < FIELD_BUFFER_SIZE/ \
+ if ((mex + 1) < FIELD_BUFFER_SIZE/
PAGE_SIZE) {
- margin = *((__u8 *)(peasycap->\
- field_buffer\
+ margin = *((__u8 *)(peasycap->
+ field_buffer
[kex][mex + 1].pgo));
}
else
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
} else {
- SAM("MISTAKE: %i=bytesperpixel\n", \
+ SAM("MISTAKE: %i=bytesperpixel\n",
bytesperpixel);
return -EFAULT;
}
caches++;
if (true == badinput) {
- JOM(8, "ERROR: 0x%02X=->field_buffer" \
- "[%i][%i].input, " \
- "0x%02X=(0x08|->input)\n", \
- peasycap->field_buffer\
- [kex][mex].input, kex, mex, \
+ JOM(8, "ERROR: 0x%02X=->field_buffer"
+ "[%i][%i].input, "
+ "0x%02X=(0x08|->input)\n",
+ peasycap->field_buffer
+ [kex][mex].input, kex, mex,
(0x08|peasycap->input));
}
- rc = redaub(peasycap, pad, pex, much, more, \
+ rc = redaub(peasycap, pad, pex, much, more,
mask, margin, isuy);
if (0 > rc) {
SAM("ERROR: redaub() failed\n");
mex++;
pex = peasycap->field_buffer[kex][mex].pgo;
rex = PAGE_SIZE;
- if (peasycap->field_buffer[kex][mex].input != \
+ if (peasycap->field_buffer[kex][mex].input !=
(0x08|peasycap->input))
badinput = true;
}
mex++;
pex = peasycap->field_buffer[kex][mex].pgo;
rex = PAGE_SIZE;
- if (peasycap->field_buffer[kex][mex].input != \
+ if (peasycap->field_buffer[kex][mex].input !=
(0x08|peasycap->input)) {
- JOM(8, "ERROR: 0x%02X=->field_buffer"\
- "[%i][%i].input, " \
- "0x%02X=(0x08|->input)\n", \
- peasycap->field_buffer\
- [kex][mex].input, kex, mex, \
+ JOM(8, "ERROR: 0x%02X=->field_buffer"
+ "[%i][%i].input, "
+ "0x%02X=(0x08|->input)\n",
+ peasycap->field_buffer
+ [kex][mex].input, kex, mex,
(0x08|peasycap->input));
badinput = true;
}
c3 = (mad + 1)*PAGE_SIZE - rad;
if (false == decimatepixel) {
- if (bytesperpixel * \
- cz != c3) \
- SAM("ERROR: discrepancy %i in bytes written\n", \
- c3 - (bytesperpixel * \
+ if (bytesperpixel *
+ cz != c3)
+ SAM("ERROR: discrepancy %i in bytes written\n",
+ c3 - (bytesperpixel *
cz));
} else {
if (false == odd) {
- if (bytesperpixel * \
+ if (bytesperpixel *
cz != (4 * c3))
- SAM("ERROR: discrepancy %i in bytes written\n", \
- (2*c3)-(bytesperpixel * \
+ SAM("ERROR: discrepancy %i in bytes written\n",
+ (2*c3)-(bytesperpixel *
cz));
} else {
if (0 != c3)
- SAM("ERROR: discrepancy %i " \
+ SAM("ERROR: discrepancy %i "
"in bytes written\n", c3);
}
}
JOM(8, "+++++ field2frame(): frame buffer %i is full\n", kad);
if (peasycap->field_read == peasycap->field_fill)
- SAM("WARNING: on exit, filling field buffer %i\n", \
+ SAM("WARNING: on exit, filling field buffer %i\n",
peasycap->field_read);
/*---------------------------------------------------------------------------*/
/*
/*---------------------------------------------------------------------------*/
do_gettimeofday(&timeval);
if (peasycap->timeval6.tv_sec) {
- below = ((long long int)(1000000)) * \
- ((long long int)(timeval.tv_sec - \
- peasycap->timeval6.tv_sec)) + \
+ below = ((long long int)(1000000)) *
+ ((long long int)(timeval.tv_sec -
+ peasycap->timeval6.tv_sec)) +
(long long int)(timeval.tv_usec - peasycap->timeval6.tv_usec);
above = (long long int)1000000;
above = sdr.quotient;
remainder = (__u32)sdr.remainder;
- JOM(8, "video streaming at %3lli.%03i fields per second\n", above, \
+ JOM(8, "video streaming at %3lli.%03i fields per second\n", above,
(remainder/1000));
}
peasycap->timeval6 = timeval;
*/
/*---------------------------------------------------------------------------*/
int
-redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, \
+redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
__u8 mask, __u8 margin, bool isuy)
{
static __s32 ay[256], bu[256], rv[256], gu[256], gv[256];
}
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] - gu[(int)u] - gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: %i=rump\n", \
+ SAM("MISTAKE: %i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
}
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] - gu[(int)u] - gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: %i=rump\n", \
+ SAM("MISTAKE: %i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
if (true == isuy) {
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
- s32 = ay[(int)y] - gu[(int)u] - \
+ s32 = ay[(int)y] - gu[(int)u] -
gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: " \
- "%i=rump\n", \
+ SAM("MISTAKE: "
+ "%i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
if (true == isuy) {
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
- s32 = ay[(int)y] - gu[(int)u] - \
+ s32 = ay[(int)y] - gu[(int)u] -
gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: " \
- "%i=rump\n", \
+ SAM("MISTAKE: "
+ "%i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
}
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] - gu[(int)u] - gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: %i=rump\n", \
+ SAM("MISTAKE: %i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
}
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] - gu[(int)u] - gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: %i=rump\n", \
+ SAM("MISTAKE: %i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
if (true == isuy) {
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
- s32 = ay[(int)y] - gu[(int)u] - \
+ s32 = ay[(int)y] - gu[(int)u] -
gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: " \
- "%i=rump\n", \
- bytesperpixel - \
+ SAM("MISTAKE: "
+ "%i=rump\n",
+ bytesperpixel -
rump);
return -EFAULT;
}
if (true == isuy) {
s32 = ay[(int)y] + rv[(int)v];
- r = (255 < s32) ? 255 : ((0 > s32) ? \
+ r = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
- s32 = ay[(int)y] - gu[(int)u] - \
+ s32 = ay[(int)y] - gu[(int)u] -
gv[(int)v];
- g = (255 < s32) ? 255 : ((0 > s32) ? \
+ g = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
s32 = ay[(int)y] + bu[(int)u];
- b = (255 < s32) ? 255 : ((0 > s32) ? \
+ b = (255 < s32) ? 255 : ((0 > s32) ?
0 : (__u8)s32);
if ((true == last) && rump) {
break;
}
default: {
- SAM("MISTAKE: " \
- "%i=rump\n", \
+ SAM("MISTAKE: "
+ "%i=rump\n",
bytesperpixel - rump);
return -EFAULT;
}
break;
JOM(16, "%2i=urb\n", i);
last = peasycap->video_isoc_sequence;
-if ((((VIDEO_ISOC_BUFFER_MANY - 1) == last) && \
- (0 != i)) || \
- (((VIDEO_ISOC_BUFFER_MANY - 1) != last) && \
+if ((((VIDEO_ISOC_BUFFER_MANY - 1) == last) &&
+ (0 != i)) ||
+ (((VIDEO_ISOC_BUFFER_MANY - 1) != last) &&
((last + 1) != i))) {
JOM(16, "ERROR: out-of-order urbs %i,%i ... continuing\n", last, i);
}
peasycap->video_isoc_sequence = i;
if (peasycap->video_idle) {
- JOM(16, "%i=video_idle %i=video_isoc_streaming\n", \
+ JOM(16, "%i=video_idle %i=video_isoc_streaming\n",
peasycap->video_idle, peasycap->video_isoc_streaming);
if (peasycap->video_isoc_streaming) {
rc = usb_submit_urb(purb, GFP_ATOMIC);
break;
}
}
- if (-ENODEV != rc) \
- SAM("ERROR: while %i=video_idle, " \
- "usb_submit_urb() " \
- "failed with rc:\n", \
+ if (-ENODEV != rc)
+ SAM("ERROR: while %i=video_idle, "
+ "usb_submit_urb() "
+ "failed with rc:\n",
peasycap->video_idle);
}
}
} else {
for (i = 0; i < purb->number_of_packets; i++) {
if (0 != purb->iso_frame_desc[i].status) {
- (peasycap->field_buffer\
+ (peasycap->field_buffer
[peasycap->field_fill][0].kount) |= 0x8000 ;
switch (purb->iso_frame_desc[i].status) {
case 0: {
frameactual = purb->iso_frame_desc[i].actual_length;
frameoffset = purb->iso_frame_desc[i].offset;
- JOM(16, "frame[%2i]:" \
- "%4i=status " \
- "%4i=actual " \
- "%4i=length " \
- "%5i=offset\n", \
+ JOM(16, "frame[%2i]:"
+ "%4i=status "
+ "%4i=actual "
+ "%4i=length "
+ "%5i=offset\n",
i, framestatus, frameactual, framelength, frameoffset);
if (!purb->iso_frame_desc[i].status) {
more = purb->iso_frame_desc[i].actual_length;
- pfield_buffer = &peasycap->field_buffer\
+ pfield_buffer = &peasycap->field_buffer
[peasycap->field_fill][peasycap->field_page];
- videofieldamount = (peasycap->field_page * \
- PAGE_SIZE) + \
+ videofieldamount = (peasycap->field_page *
+ PAGE_SIZE) +
(int)(pfield_buffer->pto - pfield_buffer->pgo);
if (4 == more)
peasycap->video_mt++;
if (4 < more) {
if (peasycap->video_mt) {
- JOM(8, "%4i empty video urb frames\n", \
+ JOM(8, "%4i empty video urb frames\n",
peasycap->video_mt);
peasycap->video_mt = 0;
}
SAM("ERROR: bad peasycap->field_fill\n");
return;
}
- if (FIELD_BUFFER_SIZE/PAGE_SIZE <= \
+ if (FIELD_BUFFER_SIZE/PAGE_SIZE <=
peasycap->field_page) {
SAM("ERROR: bad peasycap->field_page\n");
return;
}
- pfield_buffer = &peasycap->field_buffer\
+ pfield_buffer = &peasycap->field_buffer
[peasycap->field_fill][peasycap->field_page];
- pu = (__u8 *)(purb->transfer_buffer + \
+ pu = (__u8 *)(purb->transfer_buffer +
purb->iso_frame_desc[i].offset);
if (0x80 & *pu)
leap = 8;
*/
/*---------------------------------------------------------------------------*/
if ((8 == more) || override) {
- if (videofieldamount > \
+ if (videofieldamount >
peasycap->videofieldamount) {
- if (2 == videofieldamount - \
- peasycap->\
+ if (2 == videofieldamount -
+ peasycap->
videofieldamount) {
- (peasycap->field_buffer\
- [peasycap->field_fill]\
+ (peasycap->field_buffer
+ [peasycap->field_fill]
[0].kount) |= 0x0100;
- peasycap->video_junk += (1 + \
+ peasycap->video_junk += (1 +
VIDEO_JUNK_TOLERATE);
} else
- (peasycap->field_buffer\
- [peasycap->field_fill]\
+ (peasycap->field_buffer
+ [peasycap->field_fill]
[0].kount) |= 0x4000;
- } else if (videofieldamount < \
- peasycap->\
+ } else if (videofieldamount <
+ peasycap->
videofieldamount) {
- (peasycap->field_buffer\
- [peasycap->field_fill]\
+ (peasycap->field_buffer
+ [peasycap->field_fill]
[0].kount) |= 0x2000;
}
- bad = 0xFF00 & peasycap->field_buffer\
- [peasycap->field_fill]\
+ bad = 0xFF00 & peasycap->field_buffer
+ [peasycap->field_fill]
[0].kount;
if (!bad) {
(peasycap->video_junk)--;
- if (-VIDEO_JUNK_TOLERATE > \
- peasycap->video_junk) \
- peasycap->video_junk =\
+ if (-VIDEO_JUNK_TOLERATE >
+ peasycap->video_junk)
+ peasycap->video_junk =
-VIDEO_JUNK_TOLERATE;
- peasycap->field_read = \
- (peasycap->\
+ peasycap->field_read =
+ (peasycap->
field_fill)++;
- if (FIELD_BUFFER_MANY <= \
- peasycap->\
+ if (FIELD_BUFFER_MANY <=
+ peasycap->
field_fill)
- peasycap->\
+ peasycap->
field_fill = 0;
peasycap->field_page = 0;
- pfield_buffer = &peasycap->\
- field_buffer\
- [peasycap->\
- field_fill]\
- [peasycap->\
+ pfield_buffer = &peasycap->
+ field_buffer
+ [peasycap->
+ field_fill]
+ [peasycap->
field_page];
- pfield_buffer->pto = \
+ pfield_buffer->pto =
pfield_buffer->pgo;
- JOM(8, "bumped to: %i="\
- "peasycap->" \
- "field_fill %i="\
- "parity\n", \
- peasycap->field_fill, \
- 0x00FF & \
+ JOM(8, "bumped to: %i="
+ "peasycap->"
+ "field_fill %i="
+ "parity\n",
+ peasycap->field_fill,
+ 0x00FF &
pfield_buffer->kount);
- JOM(8, "field buffer %i has "\
- "%i bytes fit to be "\
- "read\n", \
- peasycap->field_read, \
+ JOM(8, "field buffer %i has "
+ "%i bytes fit to be "
+ "read\n",
+ peasycap->field_read,
videofieldamount);
- JOM(8, "wakeup call to "\
- "wq_video, " \
- "%i=field_read "\
- "%i=field_fill "\
- "%i=parity\n", \
- peasycap->field_read, \
- peasycap->field_fill, \
- 0x00FF & peasycap->\
- field_buffer\
- [peasycap->\
+ JOM(8, "wakeup call to "
+ "wq_video, "
+ "%i=field_read "
+ "%i=field_fill "
+ "%i=parity\n",
+ peasycap->field_read,
+ peasycap->field_fill,
+ 0x00FF & peasycap->
+ field_buffer
+ [peasycap->
field_read][0].kount);
- wake_up_interruptible\
- (&(peasycap->\
+ wake_up_interruptible
+ (&(peasycap->
wq_video));
- do_gettimeofday\
+ do_gettimeofday
(&peasycap->timeval7);
} else {
peasycap->video_junk++;
- if (bad & 0x0010) \
- peasycap->video_junk += \
+ if (bad & 0x0010)
+ peasycap->video_junk +=
(1 + VIDEO_JUNK_TOLERATE/2);
- JOM(8, "field buffer %i had %i " \
- "bytes, now discarded: "\
- "0x%04X\n", \
- peasycap->field_fill, \
- videofieldamount,\
- (0xFF00 & \
- peasycap->field_buffer\
- [peasycap->field_fill][0].\
+ JOM(8, "field buffer %i had %i "
+ "bytes, now discarded: "
+ "0x%04X\n",
+ peasycap->field_fill,
+ videofieldamount,
+ (0xFF00 &
+ peasycap->field_buffer
+ [peasycap->field_fill][0].
kount));
(peasycap->field_fill)++;
- if (FIELD_BUFFER_MANY <= \
+ if (FIELD_BUFFER_MANY <=
peasycap->field_fill)
peasycap->field_fill = 0;
peasycap->field_page = 0;
- pfield_buffer = \
- &peasycap->field_buffer\
- [peasycap->field_fill]\
+ pfield_buffer =
+ &peasycap->field_buffer
+ [peasycap->field_fill]
[peasycap->field_page];
- pfield_buffer->pto = \
+ pfield_buffer->pto =
pfield_buffer->pgo;
- JOM(8, "bumped to: %i=peasycap->" \
- "field_fill %i=parity\n", \
- peasycap->field_fill, \
+ JOM(8, "bumped to: %i=peasycap->"
+ "field_fill %i=parity\n",
+ peasycap->field_fill,
0x00FF & pfield_buffer->kount);
}
if (8 == more) {
- JOM(8, "end-of-field: received " \
- "parity byte 0x%02X\n", \
+ JOM(8, "end-of-field: received "
+ "parity byte 0x%02X\n",
(0xFF & *pu));
if (0x40 & *pu)
pfield_buffer->kount = 0x0000;
else
pfield_buffer->kount = 0x0001;
- pfield_buffer->input = 0x08 | \
+ pfield_buffer->input = 0x08 |
(0x07 & peasycap->input);
- JOM(8, "end-of-field: 0x%02X=kount\n",\
+ JOM(8, "end-of-field: 0x%02X=kount\n",
0xFF & pfield_buffer->kount);
}
}
SAM("ERROR: bad peasycap->field_fill\n");
return;
}
- if (FIELD_BUFFER_SIZE/PAGE_SIZE <= \
+ if (FIELD_BUFFER_SIZE/PAGE_SIZE <=
peasycap->field_page) {
SAM("ERROR: bad peasycap->field_page\n");
return;
}
- pfield_buffer = &peasycap->field_buffer\
+ pfield_buffer = &peasycap->field_buffer
[peasycap->field_fill][peasycap->field_page];
while (more) {
- pfield_buffer = &peasycap->field_buffer\
- [peasycap->field_fill]\
+ pfield_buffer = &peasycap->field_buffer
+ [peasycap->field_fill]
[peasycap->field_page];
- if (PAGE_SIZE < (pfield_buffer->pto - \
+ if (PAGE_SIZE < (pfield_buffer->pto -
pfield_buffer->pgo)) {
SAM("ERROR: bad pfield_buffer->pto\n");
return;
}
- if (PAGE_SIZE == (pfield_buffer->pto - \
+ if (PAGE_SIZE == (pfield_buffer->pto -
pfield_buffer->pgo)) {
(peasycap->field_page)++;
- if (FIELD_BUFFER_SIZE/PAGE_SIZE <= \
+ if (FIELD_BUFFER_SIZE/PAGE_SIZE <=
peasycap->field_page) {
- JOM(16, "wrapping peasycap->" \
+ JOM(16, "wrapping peasycap->"
"field_page\n");
peasycap->field_page = 0;
}
- pfield_buffer = &peasycap->\
- field_buffer\
- [peasycap->field_fill]\
+ pfield_buffer = &peasycap->
+ field_buffer
+ [peasycap->field_fill]
[peasycap->field_page];
- pfield_buffer->pto = \
+ pfield_buffer->pto =
pfield_buffer->pgo;
- pfield_buffer->input = 0x08 | \
+ pfield_buffer->input = 0x08 |
(0x07 & peasycap->input);
- if ((peasycap->field_buffer[peasycap->\
- field_fill][0]).\
- input != \
+ if ((peasycap->field_buffer[peasycap->
+ field_fill][0]).
+ input !=
pfield_buffer->input)
- (peasycap->field_buffer\
- [peasycap->field_fill]\
+ (peasycap->field_buffer
+ [peasycap->field_fill]
[0]).kount |= 0x1000;
}
- much = PAGE_SIZE - (int)(pfield_buffer->pto - \
+ much = PAGE_SIZE - (int)(pfield_buffer->pto -
pfield_buffer->pgo);
if (much > more)
SAM("0x%08X\n", rc); break;
}
}
- if (-ENODEV != rc) \
- SAM("ERROR: while %i=video_idle, " \
- "usb_submit_urb() " \
- "failed with rc:\n", \
+ if (-ENODEV != rc)
+ SAM("ERROR: while %i=video_idle, "
+ "usb_submit_urb() "
+ "failed with rc:\n",
peasycap->video_idle);
}
}
*/
/*---------------------------------------------------------------------------*/
int
-easycap_usb_probe(struct usb_interface *pusb_interface, \
+easycap_usb_probe(struct usb_interface *pusb_interface,
const struct usb_device_id *pusb_device_id)
{
struct usb_device *pusb_device, *pusb_device1;
* GET POINTER TO STRUCTURE usb_device
*/
/*---------------------------------------------------------------------------*/
-pusb_device1 = container_of(pusb_interface->dev.parent, \
+pusb_device1 = container_of(pusb_interface->dev.parent,
struct usb_device, dev);
if ((struct usb_device *)NULL == pusb_device1) {
SAY("ERROR: pusb_device1 is NULL\n");
bInterfaceClass = pusb_interface_descriptor->bInterfaceClass;
bInterfaceSubClass = pusb_interface_descriptor->bInterfaceSubClass;
-JOT(4, "intf[%i]: pusb_interface->num_altsetting=%i\n", \
+JOT(4, "intf[%i]: pusb_interface->num_altsetting=%i\n",
bInterfaceNumber, pusb_interface->num_altsetting);
-JOT(4, "intf[%i]: pusb_interface->cur_altsetting - " \
- "pusb_interface->altsetting=%li\n", bInterfaceNumber, \
- (long int)(pusb_interface->cur_altsetting - \
+JOT(4, "intf[%i]: pusb_interface->cur_altsetting - "
+ "pusb_interface->altsetting=%li\n", bInterfaceNumber,
+ (long int)(pusb_interface->cur_altsetting -
pusb_interface->altsetting));
switch (bInterfaceClass) {
case USB_CLASS_AUDIO: {
- JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_AUDIO\n", \
+ JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_AUDIO\n",
bInterfaceNumber, bInterfaceClass); break;
}
case USB_CLASS_VIDEO: {
- JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VIDEO\n", \
+ JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VIDEO\n",
bInterfaceNumber, bInterfaceClass); break;
}
case USB_CLASS_VENDOR_SPEC: {
- JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VENDOR_SPEC\n", \
+ JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VENDOR_SPEC\n",
bInterfaceNumber, bInterfaceClass); break;
}
default:
}
switch (bInterfaceSubClass) {
case 0x01: {
- JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOCONTROL\n", \
+ JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOCONTROL\n",
bInterfaceNumber, bInterfaceSubClass); break;
}
case 0x02: {
- JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOSTREAMING\n", \
+ JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOSTREAMING\n",
bInterfaceNumber, bInterfaceSubClass); break;
}
case 0x03: {
- JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=MIDISTREAMING\n", \
+ JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=MIDISTREAMING\n",
bInterfaceNumber, bInterfaceSubClass); break;
}
default:
/*---------------------------------------------------------------------------*/
pusb_interface_assoc_descriptor = pusb_interface->intf_assoc;
if (NULL != pusb_interface_assoc_descriptor) {
- JOT(4, "intf[%i]: bFirstInterface=0x%02X bInterfaceCount=0x%02X\n", \
- bInterfaceNumber, \
- pusb_interface_assoc_descriptor->bFirstInterface, \
+ JOT(4, "intf[%i]: bFirstInterface=0x%02X bInterfaceCount=0x%02X\n",
+ bInterfaceNumber,
+ pusb_interface_assoc_descriptor->bFirstInterface,
pusb_interface_assoc_descriptor->bInterfaceCount);
} else {
-JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n", \
+JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n",
bInterfaceNumber);
}
/*---------------------------------------------------------------------------*/
SAM("allocated 0x%08lX=peasycap\n", (unsigned long int) peasycap);
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
- SAM("where 0x%08lX=&peasycap->video_device\n", \
+ SAM("where 0x%08lX=&peasycap->video_device\n",
(unsigned long int) &peasycap->video_device);
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
- SAM("and 0x%08lX=&peasycap->v4l2_device\n", \
+ SAM("and 0x%08lX=&peasycap->v4l2_device\n",
(unsigned long int) &peasycap->v4l2_device);
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
peasycap->minor = -1;
strcpy(&peasycap->telltale[0], TELLTALE);
kref_init(&peasycap->kref);
- JOM(8, "intf[%i]: after kref_init(..._video) " \
- "%i=peasycap->kref.refcount.counter\n", \
+ JOM(8, "intf[%i]: after kref_init(..._video) "
+ "%i=peasycap->kref.refcount.counter\n",
bInterfaceNumber, peasycap->kref.refcount.counter);
/* module params */
*/
/*---------------------------------------------------------------------------*/
for (ndong = 0; ndong < DONGLE_MANY; ndong++) {
- if ((NULL == easycapdc60_dongle[ndong].peasycap) && \
- (!mutex_is_locked(&easycapdc60_dongle\
- [ndong].mutex_video)) && \
- (!mutex_is_locked(&easycapdc60_dongle\
+ if ((NULL == easycapdc60_dongle[ndong].peasycap) &&
+ (!mutex_is_locked(&easycapdc60_dongle
+ [ndong].mutex_video)) &&
+ (!mutex_is_locked(&easycapdc60_dongle
[ndong].mutex_audio))) {
easycapdc60_dongle[ndong].peasycap = peasycap;
peasycap->isdongle = ndong;
- JOM(8, "intf[%i]: peasycap-->easycap" \
- "_dongle[%i].peasycap\n", \
+ JOM(8, "intf[%i]: peasycap-->easycap"
+ "_dongle[%i].peasycap\n",
bInterfaceNumber, ndong);
break;
}
m = 0;
mask = 0;
while (0xFFFF != easycap_standard[i].mask) {
- if (NTSC_M == easycap_standard[i].\
+ if (NTSC_M == easycap_standard[i].
v4l2_standard.index) {
m++;
for (k = 0; k < INPUT_MANY; k++) {
- peasycap->inputset[k].\
+ peasycap->inputset[k].
standard_offset = i;
}
mask = easycap_standard[i].mask;
m = 0;
mask = 0;
while (0xFFFF != easycap_standard[i].mask) {
- if (PAL_BGHIN == easycap_standard[i].\
+ if (PAL_BGHIN == easycap_standard[i].
v4l2_standard.index) {
m++;
for (k = 0; k < INPUT_MANY; k++) {
- peasycap->inputset[k].\
+ peasycap->inputset[k].
standard_offset = i;
}
mask = easycap_standard[i].mask;
}
if (1 != m) {
- SAM("MISTAKE: easycap.inputset[].standard_offset " \
+ SAM("MISTAKE: easycap.inputset[].standard_offset "
"unpopulated, %i=m\n", m);
return -ENOENT;
}
i = 0;
m = 0;
while (0 != peasycap_format->v4l2_format.fmt.pix.width) {
- if (((peasycap_format->mask & 0x0F) == (mask & 0x0F)) && \
- (peasycap_format->\
- v4l2_format.fmt.pix.field == \
- V4L2_FIELD_NONE) && \
- (peasycap_format->\
- v4l2_format.fmt.pix.pixelformat == \
- V4L2_PIX_FMT_UYVY) && \
- (peasycap_format->\
- v4l2_format.fmt.pix.width == \
- 640) && \
- (peasycap_format->\
+ if (((peasycap_format->mask & 0x0F) == (mask & 0x0F)) &&
+ (peasycap_format->
+ v4l2_format.fmt.pix.field ==
+ V4L2_FIELD_NONE) &&
+ (peasycap_format->
+ v4l2_format.fmt.pix.pixelformat ==
+ V4L2_PIX_FMT_UYVY) &&
+ (peasycap_format->
+ v4l2_format.fmt.pix.width ==
+ 640) &&
+ (peasycap_format->
v4l2_format.fmt.pix.height == 480)) {
m++;
for (k = 0; k < INPUT_MANY; k++)
i++;
}
if (4 != m) {
- SAM("MISTAKE: easycap.inputset[].brightness,... " \
+ SAM("MISTAKE: easycap.inputset[].brightness,... "
"underpopulated\n");
return -ENOENT;
}
*/
/*---------------------------------------------------------------------------*/
for (ndong = 0; ndong < DONGLE_MANY; ndong++) {
- if (pusb_device == easycapdc60_dongle[ndong].peasycap->\
+ if (pusb_device == easycapdc60_dongle[ndong].peasycap->
pusb_device) {
peasycap = easycapdc60_dongle[ndong].peasycap;
- JOT(8, "intf[%i]: easycapdc60_dongle[%i].peasycap-->" \
+ JOT(8, "intf[%i]: easycapdc60_dongle[%i].peasycap-->"
"peasycap\n", bInterfaceNumber, ndong);
break;
}
}
if (DONGLE_MANY <= ndong) {
- SAY("ERROR: peasycap is unknown when probing interface %i\n", \
+ SAY("ERROR: peasycap is unknown when probing interface %i\n",
bInterfaceNumber);
return -ENODEV;
}
if (NULL == peasycap) {
- SAY("ERROR: peasycap is NULL when probing interface %i\n", \
+ SAY("ERROR: peasycap is NULL when probing interface %i\n",
bInterfaceNumber);
return -ENODEV;
}
SAY("ERROR: pv4l2_device is NULL\n");
return -ENODEV;
}
- peasycap = (struct easycap *) \
+ peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device);
}
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
}
/*---------------------------------------------------------------------------*/
-if ((USB_CLASS_VIDEO == bInterfaceClass) || \
+if ((USB_CLASS_VIDEO == bInterfaceClass) ||
(USB_CLASS_VENDOR_SPEC == bInterfaceClass)) {
if (-1 == peasycap->video_interface) {
peasycap->video_interface = bInterfaceNumber;
- JOM(4, "setting peasycap->video_interface=%i\n", \
+ JOM(4, "setting peasycap->video_interface=%i\n",
peasycap->video_interface);
} else {
if (peasycap->video_interface != bInterfaceNumber) {
- SAM("ERROR: attempting to reset " \
+ SAM("ERROR: attempting to reset "
"peasycap->video_interface\n");
- SAM("...... continuing with " \
- "%i=peasycap->video_interface\n", \
+ SAM("...... continuing with "
+ "%i=peasycap->video_interface\n",
peasycap->video_interface);
}
}
-} else if ((USB_CLASS_AUDIO == bInterfaceClass) && \
+} else if ((USB_CLASS_AUDIO == bInterfaceClass) &&
(0x02 == bInterfaceSubClass)) {
if (-1 == peasycap->audio_interface) {
peasycap->audio_interface = bInterfaceNumber;
- JOM(4, "setting peasycap->audio_interface=%i\n", \
+ JOM(4, "setting peasycap->audio_interface=%i\n",
peasycap->audio_interface);
} else {
if (peasycap->audio_interface != bInterfaceNumber) {
- SAM("ERROR: attempting to reset " \
+ SAM("ERROR: attempting to reset "
"peasycap->audio_interface\n");
- SAM("...... continuing with " \
- "%i=peasycap->audio_interface\n", \
+ SAM("...... continuing with "
+ "%i=peasycap->audio_interface\n",
peasycap->audio_interface);
}
}
return -EFAULT;
}
pusb_interface_descriptor = &(pusb_host_interface->desc);
- if ((struct usb_interface_descriptor *)NULL == \
+ if ((struct usb_interface_descriptor *)NULL ==
pusb_interface_descriptor) {
SAM("ERROR: pusb_interface_descriptor is NULL\n");
return -EFAULT;
}
- JOM(4, "intf[%i]alt[%i]: desc.bDescriptorType=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bDescriptorType=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bDescriptorType);
- JOM(4, "intf[%i]alt[%i]: desc.bInterfaceNumber=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bInterfaceNumber=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceNumber);
- JOM(4, "intf[%i]alt[%i]: desc.bAlternateSetting=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bAlternateSetting=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bAlternateSetting);
- JOM(4, "intf[%i]alt[%i]: desc.bNumEndpoints=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bNumEndpoints=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bNumEndpoints);
- JOM(4, "intf[%i]alt[%i]: desc.bInterfaceClass=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bInterfaceClass=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceClass);
- JOM(4, "intf[%i]alt[%i]: desc.bInterfaceSubClass=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bInterfaceSubClass=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceSubClass);
- JOM(4, "intf[%i]alt[%i]: desc.bInterfaceProtocol=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.bInterfaceProtocol=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceProtocol);
- JOM(4, "intf[%i]alt[%i]: desc.iInterface=0x%02X\n", \
+ JOM(4, "intf[%i]alt[%i]: desc.iInterface=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->iInterface);
ISOCwMaxPacketSize = -1;
INTbEndpointAddress = 0;
if (0 == pusb_interface_descriptor->bNumEndpoints)
- JOM(4, "intf[%i]alt[%i] has no endpoints\n", \
+ JOM(4, "intf[%i]alt[%i] has no endpoints\n",
bInterfaceNumber, i);
/*---------------------------------------------------------------------------*/
for (j = 0; j < pusb_interface_descriptor->bNumEndpoints; j++) {
wMaxPacketSize = le16_to_cpu(pepd->wMaxPacketSize);
bEndpointAddress = pepd->bEndpointAddress;
- JOM(4, "intf[%i]alt[%i]end[%i]: bEndpointAddress=0x%X\n", \
- bInterfaceNumber, i, j, \
+ JOM(4, "intf[%i]alt[%i]end[%i]: bEndpointAddress=0x%X\n",
+ bInterfaceNumber, i, j,
pepd->bEndpointAddress);
- JOM(4, "intf[%i]alt[%i]end[%i]: bmAttributes=0x%X\n", \
- bInterfaceNumber, i, j, \
+ JOM(4, "intf[%i]alt[%i]end[%i]: bmAttributes=0x%X\n",
+ bInterfaceNumber, i, j,
pepd->bmAttributes);
- JOM(4, "intf[%i]alt[%i]end[%i]: wMaxPacketSize=%i\n", \
- bInterfaceNumber, i, j, \
+ JOM(4, "intf[%i]alt[%i]end[%i]: wMaxPacketSize=%i\n",
+ bInterfaceNumber, i, j,
pepd->wMaxPacketSize);
JOM(4, "intf[%i]alt[%i]end[%i]: bInterval=%i\n",
- bInterfaceNumber, i, j, \
+ bInterfaceNumber, i, j,
pepd->bInterval);
if (pepd->bEndpointAddress & USB_DIR_IN) {
- JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n",\
+ JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n",
bInterfaceNumber, i, j);
isin = 1;
} else {
- JOM(4, "intf[%i]alt[%i]end[%i] is an OUT endpoint\n",\
+ JOM(4, "intf[%i]alt[%i]end[%i] is an OUT endpoint\n",
bInterfaceNumber, i, j);
SAM("ERROR: OUT endpoint unexpected\n");
SAM("...... continuing\n");
isin = 0;
}
- if ((pepd->bmAttributes & \
- USB_ENDPOINT_XFERTYPE_MASK) == \
+ if ((pepd->bmAttributes &
+ USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_ISOC) {
- JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n",\
+ JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n",
bInterfaceNumber, i, j);
if (isin) {
switch (bInterfaceClass) {
case USB_CLASS_VIDEO:
case USB_CLASS_VENDOR_SPEC: {
if (!peasycap) {
- SAM("MISTAKE: " \
+ SAM("MISTAKE: "
"peasycap is NULL\n");
return -EFAULT;
}
if (pepd->wMaxPacketSize) {
if (8 > isokalt) {
okalt[isokalt] = i;
- JOM(4,\
- "%i=okalt[%i]\n", \
- okalt[isokalt], \
+ JOM(4,
+ "%i=okalt[%i]\n",
+ okalt[isokalt],
isokalt);
- okepn[isokalt] = \
- pepd->\
- bEndpointAddress & \
+ okepn[isokalt] =
+ pepd->
+ bEndpointAddress &
0x0F;
- JOM(4,\
- "%i=okepn[%i]\n", \
- okepn[isokalt], \
+ JOM(4,
+ "%i=okepn[%i]\n",
+ okepn[isokalt],
isokalt);
- okmps[isokalt] = \
- le16_to_cpu(pepd->\
+ okmps[isokalt] =
+ le16_to_cpu(pepd->
wMaxPacketSize);
- JOM(4,\
- "%i=okmps[%i]\n", \
- okmps[isokalt], \
+ JOM(4,
+ "%i=okmps[%i]\n",
+ okmps[isokalt],
isokalt);
isokalt++;
}
} else {
- if (-1 == peasycap->\
+ if (-1 == peasycap->
video_altsetting_off) {
- peasycap->\
- video_altsetting_off =\
+ peasycap->
+ video_altsetting_off =
i;
- JOM(4, "%i=video_" \
- "altsetting_off " \
- "<====\n", \
- peasycap->\
+ JOM(4, "%i=video_"
+ "altsetting_off "
+ "<====\n",
+ peasycap->
video_altsetting_off);
} else {
- SAM("ERROR: peasycap" \
- "->video_altsetting_" \
+ SAM("ERROR: peasycap"
+ "->video_altsetting_"
"off already set\n");
- SAM("...... " \
- "continuing with " \
- "%i=peasycap->video_" \
- "altsetting_off\n", \
- peasycap->\
+ SAM("...... "
+ "continuing with "
+ "%i=peasycap->video_"
+ "altsetting_off\n",
+ peasycap->
video_altsetting_off);
}
}
if (0x02 != bInterfaceSubClass)
break;
if (!peasycap) {
- SAM("MISTAKE: " \
+ SAM("MISTAKE: "
"peasycap is NULL\n");
return -EFAULT;
}
if (pepd->wMaxPacketSize) {
if (8 > isokalt) {
okalt[isokalt] = i ;
- JOM(4,\
- "%i=okalt[%i]\n", \
- okalt[isokalt], \
+ JOM(4,
+ "%i=okalt[%i]\n",
+ okalt[isokalt],
isokalt);
- okepn[isokalt] = \
- pepd->\
- bEndpointAddress & \
+ okepn[isokalt] =
+ pepd->
+ bEndpointAddress &
0x0F;
- JOM(4,\
- "%i=okepn[%i]\n", \
- okepn[isokalt], \
+ JOM(4,
+ "%i=okepn[%i]\n",
+ okepn[isokalt],
isokalt);
- okmps[isokalt] = \
- le16_to_cpu(pepd->\
+ okmps[isokalt] =
+ le16_to_cpu(pepd->
wMaxPacketSize);
- JOM(4,\
- "%i=okmps[%i]\n",\
- okmps[isokalt], \
+ JOM(4,
+ "%i=okmps[%i]\n",
+ okmps[isokalt],
isokalt);
isokalt++;
}
} else {
- if (-1 == peasycap->\
+ if (-1 == peasycap->
audio_altsetting_off) {
- peasycap->\
- audio_altsetting_off =\
+ peasycap->
+ audio_altsetting_off =
i;
- JOM(4, "%i=audio_" \
- "altsetting_off " \
- "<====\n", \
- peasycap->\
+ JOM(4, "%i=audio_"
+ "altsetting_off "
+ "<====\n",
+ peasycap->
audio_altsetting_off);
} else {
- SAM("ERROR: peasycap" \
- "->audio_altsetting_" \
+ SAM("ERROR: peasycap"
+ "->audio_altsetting_"
"off already set\n");
- SAM("...... " \
- "continuing with " \
- "%i=peasycap->\
- audio_altsetting_" \
+ SAM("...... "
+ "continuing with "
+ "%i=peasycap->"
+ "audio_altsetting_"
"off\n",
- peasycap->\
+ peasycap->
audio_altsetting_off);
}
}
break;
}
}
- } else if ((pepd->bmAttributes & \
- USB_ENDPOINT_XFERTYPE_MASK) ==\
+ } else if ((pepd->bmAttributes &
+ USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK) {
- JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n",\
+ JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n",
bInterfaceNumber, i, j);
- } else if ((pepd->bmAttributes & \
- USB_ENDPOINT_XFERTYPE_MASK) ==\
+ } else if ((pepd->bmAttributes &
+ USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_INT) {
- JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n",\
+ JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n",
bInterfaceNumber, i, j);
} else {
- JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n",\
+ JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n",
bInterfaceNumber, i, j);
}
if (0 == pepd->wMaxPacketSize) {
- JOM(4, "intf[%i]alt[%i]end[%i] " \
- "has zero packet size\n", \
+ JOM(4, "intf[%i]alt[%i]end[%i] "
+ "has zero packet size\n",
bInterfaceNumber, i, j);
}
}
* PERFORM INITIALIZATION OF THE PROBED INTERFACE
*/
/*---------------------------------------------------------------------------*/
-JOM(4, "initialization begins for interface %i\n", \
+JOM(4, "initialization begins for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber);
switch (bInterfaceNumber) {
/*---------------------------------------------------------------------------*/
return -ENOENT;
} else {
peasycap->video_altsetting_on = okalt[isokalt - 1];
- JOM(4, "%i=video_altsetting_on <====\n", \
+ JOM(4, "%i=video_altsetting_on <====\n",
peasycap->video_altsetting_on);
}
/*---------------------------------------------------------------------------*/
if (USB_2_0_MAXPACKETSIZE > maxpacketsize) {
peasycap->video_isoc_maxframesize = maxpacketsize;
} else {
- peasycap->video_isoc_maxframesize = \
+ peasycap->video_isoc_maxframesize =
USB_2_0_MAXPACKETSIZE;
}
- JOM(4, "%i=video_isoc_maxframesize\n", \
+ JOM(4, "%i=video_isoc_maxframesize\n",
peasycap->video_isoc_maxframesize);
if (0 >= peasycap->video_isoc_maxframesize) {
SAM("ERROR: bad video_isoc_maxframesize\n");
return -ENOENT;
}
peasycap->video_isoc_framesperdesc = VIDEO_ISOC_FRAMESPERDESC;
- JOM(4, "%i=video_isoc_framesperdesc\n", \
+ JOM(4, "%i=video_isoc_framesperdesc\n",
peasycap->video_isoc_framesperdesc);
if (0 >= peasycap->video_isoc_framesperdesc) {
SAM("ERROR: bad video_isoc_framesperdesc\n");
return -ENOENT;
}
- peasycap->video_isoc_buffer_size = \
- peasycap->video_isoc_maxframesize * \
+ peasycap->video_isoc_buffer_size =
+ peasycap->video_isoc_maxframesize *
peasycap->video_isoc_framesperdesc;
- JOM(4, "%i=video_isoc_buffer_size\n", \
+ JOM(4, "%i=video_isoc_buffer_size\n",
peasycap->video_isoc_buffer_size);
- if ((PAGE_SIZE << VIDEO_ISOC_ORDER) < \
+ if ((PAGE_SIZE << VIDEO_ISOC_ORDER) <
peasycap->video_isoc_buffer_size) {
SAM("MISTAKE: peasycap->video_isoc_buffer_size too big\n");
return -EFAULT;
INIT_LIST_HEAD(&(peasycap->urb_video_head));
peasycap->purb_video_head = &(peasycap->urb_video_head);
/*---------------------------------------------------------------------------*/
- JOM(4, "allocating %i frame buffers of size %li\n", \
+ JOM(4, "allocating %i frame buffers of size %li\n",
FRAME_BUFFER_MANY, (long int)FRAME_BUFFER_SIZE);
- JOM(4, ".... each scattered over %li pages\n", \
+ JOM(4, ".... each scattered over %li pages\n",
FRAME_BUFFER_SIZE/PAGE_SIZE);
for (k = 0; k < FRAME_BUFFER_MANY; k++) {
for (m = 0; m < FRAME_BUFFER_SIZE/PAGE_SIZE; m++) {
if ((void *)NULL != peasycap->frame_buffer[k][m].pgo)
- SAM("attempting to reallocate frame " \
+ SAM("attempting to reallocate frame "
" buffers\n");
else {
pbuf = (void *)__get_free_page(GFP_KERNEL);
if ((void *)NULL == pbuf) {
- SAM("ERROR: Could not allocate frame "\
+ SAM("ERROR: Could not allocate frame "
"buffer %i page %i\n", k, m);
return -ENOMEM;
} else
peasycap->allocation_video_page += 1;
peasycap->frame_buffer[k][m].pgo = pbuf;
}
- peasycap->frame_buffer[k][m].pto = \
+ peasycap->frame_buffer[k][m].pto =
peasycap->frame_buffer[k][m].pgo;
}
}
peasycap->frame_fill = 0;
peasycap->frame_read = 0;
- JOM(4, "allocation of frame buffers done: %i pages\n", k * \
+ JOM(4, "allocation of frame buffers done: %i pages\n", k *
m);
/*---------------------------------------------------------------------------*/
- JOM(4, "allocating %i field buffers of size %li\n", \
+ JOM(4, "allocating %i field buffers of size %li\n",
FIELD_BUFFER_MANY, (long int)FIELD_BUFFER_SIZE);
- JOM(4, ".... each scattered over %li pages\n", \
+ JOM(4, ".... each scattered over %li pages\n",
FIELD_BUFFER_SIZE/PAGE_SIZE);
for (k = 0; k < FIELD_BUFFER_MANY; k++) {
for (m = 0; m < FIELD_BUFFER_SIZE/PAGE_SIZE; m++) {
if ((void *)NULL != peasycap->field_buffer[k][m].pgo) {
- SAM("ERROR: attempting to reallocate " \
+ SAM("ERROR: attempting to reallocate "
"field buffers\n");
} else {
pbuf = (void *) __get_free_page(GFP_KERNEL);
if ((void *)NULL == pbuf) {
- SAM("ERROR: Could not allocate field" \
+ SAM("ERROR: Could not allocate field"
" buffer %i page %i\n", k, m);
return -ENOMEM;
}
peasycap->allocation_video_page += 1;
peasycap->field_buffer[k][m].pgo = pbuf;
}
- peasycap->field_buffer[k][m].pto = \
+ peasycap->field_buffer[k][m].pto =
peasycap->field_buffer[k][m].pgo;
}
peasycap->field_buffer[k][0].kount = 0x0200;
peasycap->field_fill = 0;
peasycap->field_page = 0;
peasycap->field_read = 0;
- JOM(4, "allocation of field buffers done: %i pages\n", k * \
+ JOM(4, "allocation of field buffers done: %i pages\n", k *
m);
/*---------------------------------------------------------------------------*/
- JOM(4, "allocating %i isoc video buffers of size %i\n", \
- VIDEO_ISOC_BUFFER_MANY, \
+ JOM(4, "allocating %i isoc video buffers of size %i\n",
+ VIDEO_ISOC_BUFFER_MANY,
peasycap->video_isoc_buffer_size);
JOM(4, ".... each occupying contiguous memory pages\n");
for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) {
pbuf = (void *)__get_free_pages(GFP_KERNEL, VIDEO_ISOC_ORDER);
if (NULL == pbuf) {
- SAM("ERROR: Could not allocate isoc video buffer " \
+ SAM("ERROR: Could not allocate isoc video buffer "
"%i\n", k);
return -ENOMEM;
} else
- peasycap->allocation_video_page += \
+ peasycap->allocation_video_page +=
((unsigned int)(0x01 << VIDEO_ISOC_ORDER));
peasycap->video_isoc_buffer[k].pgo = pbuf;
- peasycap->video_isoc_buffer[k].pto = pbuf + \
+ peasycap->video_isoc_buffer[k].pto = pbuf +
peasycap->video_isoc_buffer_size;
peasycap->video_isoc_buffer[k].kount = k;
}
- JOM(4, "allocation of isoc video buffers done: %i pages\n", \
+ JOM(4, "allocation of isoc video buffers done: %i pages\n",
k * (0x01 << VIDEO_ISOC_ORDER));
/*---------------------------------------------------------------------------*/
/*
*/
/*---------------------------------------------------------------------------*/
JOM(4, "allocating %i struct urb.\n", VIDEO_ISOC_BUFFER_MANY);
- JOM(4, "using %i=peasycap->video_isoc_framesperdesc\n", \
+ JOM(4, "using %i=peasycap->video_isoc_framesperdesc\n",
peasycap->video_isoc_framesperdesc);
- JOM(4, "using %i=peasycap->video_isoc_maxframesize\n", \
+ JOM(4, "using %i=peasycap->video_isoc_maxframesize\n",
peasycap->video_isoc_maxframesize);
- JOM(4, "using %i=peasycap->video_isoc_buffer_sizen", \
+ JOM(4, "using %i=peasycap->video_isoc_buffer_sizen",
peasycap->video_isoc_buffer_size);
for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) {
- purb = usb_alloc_urb(peasycap->video_isoc_framesperdesc, \
+ purb = usb_alloc_urb(peasycap->video_isoc_framesperdesc,
GFP_KERNEL);
if (NULL == purb) {
- SAM("ERROR: usb_alloc_urb returned NULL for buffer " \
+ SAM("ERROR: usb_alloc_urb returned NULL for buffer "
"%i\n", k);
return -ENOMEM;
} else
SAM("ERROR: Could not allocate struct data_urb.\n");
return -ENOMEM;
} else
- peasycap->allocation_video_struct += \
+ peasycap->allocation_video_struct +=
sizeof(struct data_urb);
pdata_urb->purb = purb;
pdata_urb->isbuf = k;
pdata_urb->length = 0;
- list_add_tail(&(pdata_urb->list_head), \
+ list_add_tail(&(pdata_urb->list_head),
peasycap->purb_video_head);
/*---------------------------------------------------------------------------*/
/*
JOM(4, "initializing video urbs thus:\n");
JOM(4, " purb->interval = 1;\n");
JOM(4, " purb->dev = peasycap->pusb_device;\n");
- JOM(4, " purb->pipe = usb_rcvisocpipe" \
- "(peasycap->pusb_device,%i);\n", \
+ JOM(4, " purb->pipe = usb_rcvisocpipe"
+ "(peasycap->pusb_device,%i);\n",
peasycap->video_endpointnumber);
JOM(4, " purb->transfer_flags = URB_ISO_ASAP;\n");
- JOM(4, " purb->transfer_buffer = peasycap->" \
+ JOM(4, " purb->transfer_buffer = peasycap->"
"video_isoc_buffer[.].pgo;\n");
- JOM(4, " purb->transfer_buffer_length = %i;\n", \
+ JOM(4, " purb->transfer_buffer_length = %i;\n",
peasycap->video_isoc_buffer_size);
JOM(4, " purb->complete = easycap_complete;\n");
JOM(4, " purb->context = peasycap;\n");
JOM(4, " purb->start_frame = 0;\n");
- JOM(4, " purb->number_of_packets = %i;\n", \
+ JOM(4, " purb->number_of_packets = %i;\n",
peasycap->video_isoc_framesperdesc);
- JOM(4, " for (j = 0; j < %i; j++)\n", \
+ JOM(4, " for (j = 0; j < %i; j++)\n",
peasycap->video_isoc_framesperdesc);
JOM(4, " {\n");
- JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n",\
+ JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n",
peasycap->video_isoc_maxframesize);
- JOM(4, " purb->iso_frame_desc[j].length = %i;\n", \
+ JOM(4, " purb->iso_frame_desc[j].length = %i;\n",
peasycap->video_isoc_maxframesize);
JOM(4, " }\n");
}
purb->interval = 1;
purb->dev = peasycap->pusb_device;
- purb->pipe = usb_rcvisocpipe(peasycap->pusb_device, \
+ purb->pipe = usb_rcvisocpipe(peasycap->pusb_device,
peasycap->video_endpointnumber);
purb->transfer_flags = URB_ISO_ASAP;
purb->transfer_buffer = peasycap->video_isoc_buffer[k].pgo;
- purb->transfer_buffer_length = \
+ purb->transfer_buffer_length =
peasycap->video_isoc_buffer_size;
purb->complete = easycap_complete;
purb->context = peasycap;
purb->start_frame = 0;
purb->number_of_packets = peasycap->video_isoc_framesperdesc;
for (j = 0; j < peasycap->video_isoc_framesperdesc; j++) {
- purb->iso_frame_desc[j].offset = j * \
+ purb->iso_frame_desc[j].offset = j *
peasycap->video_isoc_maxframesize;
- purb->iso_frame_desc[j].length = \
+ purb->iso_frame_desc[j].length =
peasycap->video_isoc_maxframesize;
}
}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
- if (0 != (v4l2_device_register(&(pusb_interface->dev), \
+ if (0 != (v4l2_device_register(&(pusb_interface->dev),
&(peasycap->v4l2_device)))) {
SAM("v4l2_device_register() failed\n");
return -ENODEV;
} else {
- JOM(4, "registered device instance: %s\n", \
+ JOM(4, "registered device instance: %s\n",
&(peasycap->v4l2_device.name[0]));
}
/*---------------------------------------------------------------------------*/
video_set_drvdata(&(peasycap->video_device), (void *)peasycap);
- if (0 != (video_register_device(&(peasycap->video_device), \
+ if (0 != (video_register_device(&(peasycap->video_device),
VFL_TYPE_GRABBER, -1))) {
err("Not able to register with videodev");
videodev_release(&(peasycap->video_device));
return -ENODEV;
} else {
(peasycap->registered_video)++;
- SAM("registered with videodev: %i=minor\n", \
+ SAM("registered with videodev: %i=minor\n",
peasycap->video_device.minor);
peasycap->minor = peasycap->video_device.minor;
}
*/
/*--------------------------------------------------------------------------*/
usb_set_intfdata(pusb_interface, peasycap);
- JOM(4, "no initialization required for interface %i\n", \
+ JOM(4, "no initialization required for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber);
break;
}
return -ENOENT;
} else {
peasycap->audio_altsetting_on = okalt[isokalt - 1];
- JOM(4, "%i=audio_altsetting_on <====\n", \
+ JOM(4, "%i=audio_altsetting_on <====\n",
peasycap->audio_altsetting_on);
}
JOM(4, "%i=audio_endpointnumber\n", peasycap->audio_endpointnumber);
peasycap->audio_isoc_maxframesize = okmps[isokalt - 1];
- JOM(4, "%i=audio_isoc_maxframesize\n", \
+ JOM(4, "%i=audio_isoc_maxframesize\n",
peasycap->audio_isoc_maxframesize);
if (0 >= peasycap->audio_isoc_maxframesize) {
SAM("ERROR: bad audio_isoc_maxframesize\n");
peasycap->audio_pages_per_fragment = PAGES_PER_AUDIO_FRAGMENT;
} else {
SAM("hardware is unidentified:\n");
- SAM("%i=audio_isoc_maxframesize\n", \
+ SAM("%i=audio_isoc_maxframesize\n",
peasycap->audio_isoc_maxframesize);
return -ENOENT;
}
- peasycap->audio_bytes_per_fragment = \
- peasycap->audio_pages_per_fragment * \
+ peasycap->audio_bytes_per_fragment =
+ peasycap->audio_pages_per_fragment *
PAGE_SIZE ;
- peasycap->audio_buffer_page_many = (AUDIO_FRAGMENT_MANY * \
+ peasycap->audio_buffer_page_many = (AUDIO_FRAGMENT_MANY *
peasycap->audio_pages_per_fragment);
JOM(4, "%6i=AUDIO_FRAGMENT_MANY\n", AUDIO_FRAGMENT_MANY);
- JOM(4, "%6i=audio_pages_per_fragment\n", \
+ JOM(4, "%6i=audio_pages_per_fragment\n",
peasycap->audio_pages_per_fragment);
- JOM(4, "%6i=audio_bytes_per_fragment\n", \
+ JOM(4, "%6i=audio_bytes_per_fragment\n",
peasycap->audio_bytes_per_fragment);
- JOM(4, "%6i=audio_buffer_page_many\n", \
+ JOM(4, "%6i=audio_buffer_page_many\n",
peasycap->audio_buffer_page_many);
peasycap->audio_isoc_framesperdesc = AUDIO_ISOC_FRAMESPERDESC;
- JOM(4, "%i=audio_isoc_framesperdesc\n", \
+ JOM(4, "%i=audio_isoc_framesperdesc\n",
peasycap->audio_isoc_framesperdesc);
if (0 >= peasycap->audio_isoc_framesperdesc) {
SAM("ERROR: bad audio_isoc_framesperdesc\n");
return -ENOENT;
}
- peasycap->audio_isoc_buffer_size = \
- peasycap->audio_isoc_maxframesize * \
+ peasycap->audio_isoc_buffer_size =
+ peasycap->audio_isoc_maxframesize *
peasycap->audio_isoc_framesperdesc;
- JOM(4, "%i=audio_isoc_buffer_size\n", \
+ JOM(4, "%i=audio_isoc_buffer_size\n",
peasycap->audio_isoc_buffer_size);
if (AUDIO_ISOC_BUFFER_SIZE < peasycap->audio_isoc_buffer_size) {
SAM("MISTAKE: audio_isoc_buffer_size bigger "
- "than %li=AUDIO_ISOC_BUFFER_SIZE\n", \
+ "than %li=AUDIO_ISOC_BUFFER_SIZE\n",
AUDIO_ISOC_BUFFER_SIZE);
return -EFAULT;
}
#if !defined(EASYCAP_NEEDS_ALSA)
JOM(4, "allocating an audio buffer\n");
- JOM(4, ".... scattered over %i pages\n", \
+ JOM(4, ".... scattered over %i pages\n",
peasycap->audio_buffer_page_many);
for (k = 0; k < peasycap->audio_buffer_page_many; k++) {
} else {
pbuf = (void *) __get_free_page(GFP_KERNEL);
if ((void *)NULL == pbuf) {
- SAM("ERROR: Could not allocate audio " \
+ SAM("ERROR: Could not allocate audio "
"buffer page %i\n", k);
return -ENOMEM;
} else
JOM(4, "allocation of audio buffer done: %i pages\n", k);
#endif /*!EASYCAP_NEEDS_ALSA*/
/*---------------------------------------------------------------------------*/
- JOM(4, "allocating %i isoc audio buffers of size %i\n", \
+ JOM(4, "allocating %i isoc audio buffers of size %i\n",
AUDIO_ISOC_BUFFER_MANY, peasycap->audio_isoc_buffer_size);
JOM(4, ".... each occupying contiguous memory pages\n");
for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) {
pbuf = (void *)__get_free_pages(GFP_KERNEL, AUDIO_ISOC_ORDER);
if (NULL == pbuf) {
- SAM("ERROR: Could not allocate isoc audio buffer " \
+ SAM("ERROR: Could not allocate isoc audio buffer "
"%i\n", k);
return -ENOMEM;
} else
- peasycap->allocation_audio_page += \
+ peasycap->allocation_audio_page +=
((unsigned int)(0x01 << AUDIO_ISOC_ORDER));
peasycap->audio_isoc_buffer[k].pgo = pbuf;
- peasycap->audio_isoc_buffer[k].pto = pbuf + \
+ peasycap->audio_isoc_buffer[k].pto = pbuf +
peasycap->audio_isoc_buffer_size;
peasycap->audio_isoc_buffer[k].kount = k;
}
*/
/*---------------------------------------------------------------------------*/
JOM(4, "allocating %i struct urb.\n", AUDIO_ISOC_BUFFER_MANY);
- JOM(4, "using %i=peasycap->audio_isoc_framesperdesc\n", \
+ JOM(4, "using %i=peasycap->audio_isoc_framesperdesc\n",
peasycap->audio_isoc_framesperdesc);
- JOM(4, "using %i=peasycap->audio_isoc_maxframesize\n", \
+ JOM(4, "using %i=peasycap->audio_isoc_maxframesize\n",
peasycap->audio_isoc_maxframesize);
- JOM(4, "using %i=peasycap->audio_isoc_buffer_size\n", \
+ JOM(4, "using %i=peasycap->audio_isoc_buffer_size\n",
peasycap->audio_isoc_buffer_size);
for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) {
- purb = usb_alloc_urb(peasycap->audio_isoc_framesperdesc, \
+ purb = usb_alloc_urb(peasycap->audio_isoc_framesperdesc,
GFP_KERNEL);
if (NULL == purb) {
- SAM("ERROR: usb_alloc_urb returned NULL for buffer " \
+ SAM("ERROR: usb_alloc_urb returned NULL for buffer "
"%i\n", k);
return -ENOMEM;
} else
SAM("ERROR: Could not allocate struct data_urb.\n");
return -ENOMEM;
} else
- peasycap->allocation_audio_struct += \
+ peasycap->allocation_audio_struct +=
sizeof(struct data_urb);
pdata_urb->purb = purb;
pdata_urb->isbuf = k;
pdata_urb->length = 0;
- list_add_tail(&(pdata_urb->list_head), \
+ list_add_tail(&(pdata_urb->list_head),
peasycap->purb_audio_head);
/*---------------------------------------------------------------------------*/
/*
JOM(4, "initializing audio urbs thus:\n");
JOM(4, " purb->interval = 1;\n");
JOM(4, " purb->dev = peasycap->pusb_device;\n");
- JOM(4, " purb->pipe = usb_rcvisocpipe(peasycap->" \
- "pusb_device,%i);\n", \
+ JOM(4, " purb->pipe = usb_rcvisocpipe(peasycap->"
+ "pusb_device,%i);\n",
peasycap->audio_endpointnumber);
JOM(4, " purb->transfer_flags = URB_ISO_ASAP;\n");
- JOM(4, " purb->transfer_buffer = " \
+ JOM(4, " purb->transfer_buffer = "
"peasycap->audio_isoc_buffer[.].pgo;\n");
- JOM(4, " purb->transfer_buffer_length = %i;\n", \
+ JOM(4, " purb->transfer_buffer_length = %i;\n",
peasycap->audio_isoc_buffer_size);
#if defined(EASYCAP_NEEDS_ALSA)
JOM(4, " purb->complete = easycap_alsa_complete;\n");
#endif /*EASYCAP_NEEDS_ALSA*/
JOM(4, " purb->context = peasycap;\n");
JOM(4, " purb->start_frame = 0;\n");
- JOM(4, " purb->number_of_packets = %i;\n", \
+ JOM(4, " purb->number_of_packets = %i;\n",
peasycap->audio_isoc_framesperdesc);
- JOM(4, " for (j = 0; j < %i; j++)\n", \
+ JOM(4, " for (j = 0; j < %i; j++)\n",
peasycap->audio_isoc_framesperdesc);
JOM(4, " {\n");
- JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n",\
+ JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n",
peasycap->audio_isoc_maxframesize);
- JOM(4, " purb->iso_frame_desc[j].length = %i;\n", \
+ JOM(4, " purb->iso_frame_desc[j].length = %i;\n",
peasycap->audio_isoc_maxframesize);
JOM(4, " }\n");
}
purb->interval = 1;
purb->dev = peasycap->pusb_device;
- purb->pipe = usb_rcvisocpipe(peasycap->pusb_device, \
+ purb->pipe = usb_rcvisocpipe(peasycap->pusb_device,
peasycap->audio_endpointnumber);
purb->transfer_flags = URB_ISO_ASAP;
purb->transfer_buffer = peasycap->audio_isoc_buffer[k].pgo;
- purb->transfer_buffer_length = \
+ purb->transfer_buffer_length =
peasycap->audio_isoc_buffer_size;
#if defined(EASYCAP_NEEDS_ALSA)
purb->complete = easycap_alsa_complete;
purb->start_frame = 0;
purb->number_of_packets = peasycap->audio_isoc_framesperdesc;
for (j = 0; j < peasycap->audio_isoc_framesperdesc; j++) {
- purb->iso_frame_desc[j].offset = j * \
+ purb->iso_frame_desc[j].offset = j *
peasycap->audio_isoc_maxframesize;
- purb->iso_frame_desc[j].length = \
+ purb->iso_frame_desc[j].length =
peasycap->audio_isoc_maxframesize;
}
}
err("easycap_alsa_probe() returned %i\n", rc);
return -ENODEV;
} else {
- JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n",\
+ JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n",
(int)peasycap->kref.refcount.counter);
kref_get(&peasycap->kref);
(peasycap->registered_audio)++;
usb_set_intfdata(pusb_interface, NULL);
return -ENODEV;
} else {
- JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n",\
+ JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n",
(int)peasycap->kref.refcount.counter);
kref_get(&peasycap->kref);
(peasycap->registered_audio)++;
return -EINVAL;
}
}
-SAM("ends successfully for interface %i\n", \
+SAM("ends successfully for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber);
return 0;
}
SAY("ERROR: pv4l2_device is NULL\n");
return;
}
- peasycap = (struct easycap *) \
+ peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device);
}
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
m = 0;
list_for_each(plist_head, (peasycap->purb_video_head))
{
- pdata_urb = list_entry(plist_head, \
+ pdata_urb = list_entry(plist_head,
struct data_urb, list_head);
if ((struct data_urb *)NULL != pdata_urb) {
- if ((struct urb *)NULL != \
+ if ((struct urb *)NULL !=
pdata_urb->purb) {
usb_kill_urb(pdata_urb->purb);
m++;
if ((struct list_head *)NULL != peasycap->purb_audio_head) {
JOM(4, "killing audio urbs\n");
m = 0;
- list_for_each(plist_head, \
+ list_for_each(plist_head,
(peasycap->purb_audio_head)) {
- pdata_urb = list_entry(plist_head, \
+ pdata_urb = list_entry(plist_head,
struct data_urb, list_head);
if ((struct data_urb *)NULL != pdata_urb) {
- if ((struct urb *)NULL != \
+ if ((struct urb *)NULL !=
pdata_urb->purb) {
usb_kill_urb(pdata_urb->purb);
m++;
case 0: {
if (0 <= kd && DONGLE_MANY > kd) {
wake_up_interruptible(&peasycap->wq_video);
- JOM(4, "about to lock easycapdc60_dongle[%i].mutex_video\n", \
+ JOM(4, "about to lock easycapdc60_dongle[%i].mutex_video\n",
kd);
- if (mutex_lock_interruptible(&easycapdc60_dongle[kd].\
+ if (mutex_lock_interruptible(&easycapdc60_dongle[kd].
mutex_video)) {
- SAY("ERROR: cannot lock easycapdc60_dongle[%i]." \
+ SAY("ERROR: cannot lock easycapdc60_dongle[%i]."
"mutex_video\n", kd);
return;
}
case 2: {
if (0 <= kd && DONGLE_MANY > kd) {
wake_up_interruptible(&peasycap->wq_audio);
- JOM(4, "about to lock easycapdc60_dongle[%i].mutex_audio\n", \
+ JOM(4, "about to lock easycapdc60_dongle[%i].mutex_audio\n",
kd);
- if (mutex_lock_interruptible(&easycapdc60_dongle[kd].\
+ if (mutex_lock_interruptible(&easycapdc60_dongle[kd].
mutex_audio)) {
- SAY("ERROR: cannot lock easycapdc60_dongle[%i]." \
+ SAY("ERROR: cannot lock easycapdc60_dongle[%i]."
"mutex_audio\n", kd);
return;
}
}
JOM(4, "locked easycapdc60_dongle[%i].mutex_audio\n", kd);
}
-JOM(4, "intf[%i]: %i=peasycap->kref.refcount.counter\n", \
+JOM(4, "intf[%i]: %i=peasycap->kref.refcount.counter\n",
bInterfaceNumber, (int)peasycap->kref.refcount.counter);
kref_put(&peasycap->kref, easycap_delete);
JOT(4, "intf[%i]: kref_put() done.\n", bInterfaceNumber);
int k, rc;
SAY("========easycap=======\n");
-JOT(4, "begins. %i=debug %i=bars %i=gain\n", easycap_debug, easycap_bars, \
+JOT(4, "begins. %i=debug %i=bars %i=gain\n", easycap_debug, easycap_bars,
easycap_gain);
SAY("version: " EASYCAP_DRIVER_VERSION "\n");
#if defined(EASYCAP_DEBUG)
MODULE_PARM_DESC(debug, "Debug level: 0(default),1,2,...,9");
#endif /*EASYCAP_DEBUG*/
-MODULE_PARM_DESC(bars, \
+MODULE_PARM_DESC(bars,
"Testcard bars on input signal failure: 0=>no, 1=>yes(default)");
MODULE_PARM_DESC(gain, "Audio gain: 0,...,16(default),...31");
/*****************************************************************************/
.mask = 0x00FF & PAL_BGHIN ,
.v4l2_standard = {
.index = PAL_BGHIN,
- .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | \
+ .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H |
V4L2_STD_PAL_I | V4L2_STD_PAL_N),
.name = "PAL_BGHIN",
.frameperiod = {1, 25},
.mask = 0x8000 | (0x00FF & PAL_BGHIN_SLOW),
.v4l2_standard = {
.index = PAL_BGHIN_SLOW,
- .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | \
- V4L2_STD_PAL_I | V4L2_STD_PAL_N | \
+ .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H |
+ V4L2_STD_PAL_I | V4L2_STD_PAL_N |
(((v4l2_std_id)0x01) << 32)),
.name = "PAL_BGHIN_SLOW",
.frameperiod = {1, 5},
strcat(&easycap_format[n].name[0], &name2[0]);
strcat(&easycap_format[n].name[0], &name3[0]);
strcat(&easycap_format[n].name[0], &name4[0]);
- easycap_format[n].mask = \
+ easycap_format[n].mask =
mask1 | mask2 | mask3 | mask4;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.width = width;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.height = height;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.pixelformat = pixelformat;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.field = field;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.bytesperline = bytesperline;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.sizeimage = sizeimage;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.colorspace = colorspace;
- easycap_format[n].v4l2_format\
+ easycap_format[n].v4l2_format
.fmt.pix.priv = 0;
n++;
}
return n;
}
/*---------------------------------------------------------------------------*/
-struct v4l2_queryctrl easycap_control[] = \
+struct v4l2_queryctrl easycap_control[] =
{{
.id = V4L2_CID_BRIGHTNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
.rate_max = 48000,
.channels_min = 2,
.channels_max = 2,
- .buffer_bytes_max = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT * \
+ .buffer_bytes_max = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT *
AUDIO_FRAGMENT_MANY,
.period_bytes_min = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT,
.period_bytes_max = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT * 2,
}
#if defined(EASYCAP_NEEDS_CARD_CREATE)
- if (0 != snd_card_create(SNDRV_DEFAULT_IDX1, "easycap_alsa", \
- THIS_MODULE, 0, \
+ if (0 != snd_card_create(SNDRV_DEFAULT_IDX1, "easycap_alsa",
+ THIS_MODULE, 0,
&psnd_card)) {
SAY("ERROR: Cannot do ALSA snd_card_create()\n");
return -EFAULT;
}
#else
- psnd_card = snd_card_new(SNDRV_DEFAULT_IDX1, "easycap_alsa", \
+ psnd_card = snd_card_new(SNDRV_DEFAULT_IDX1, "easycap_alsa",
THIS_MODULE, 0);
if (NULL == psnd_card) {
SAY("ERROR: Cannot do ALSA snd_card_new()\n");
return -EFAULT;
}
- snd_pcm_set_ops(psnd_pcm, SNDRV_PCM_STREAM_CAPTURE, \
+ snd_pcm_set_ops(psnd_pcm, SNDRV_PCM_STREAM_CAPTURE,
&easycap_alsa_pcm_ops);
psnd_pcm->info_flags = 0;
strcpy(&psnd_pcm->name[0], &psnd_card->id[0]);
}
much = 0;
if (peasycap->audio_idle) {
- JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n", \
+ JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n",
peasycap->audio_idle, peasycap->audio_isoc_streaming);
if (peasycap->audio_isoc_streaming)
goto resubmit;
peasycap->audio_mt++;
else {
if (peasycap->audio_mt) {
- JOM(12, "%4i empty audio urb frames\n", \
+ JOM(12, "%4i empty audio urb frames\n",
peasycap->audio_mt);
peasycap->audio_mt = 0;
}
- p1 = (__u8 *)(purb->transfer_buffer + \
+ p1 = (__u8 *)(purb->transfer_buffer +
purb->iso_frame_desc[i].offset);
/*---------------------------------------------------------------------------*/
if (false == peasycap->microphone) {
if (much > more)
much = more;
- memcpy(prt->dma_area + \
- peasycap->dma_fill, \
+ memcpy(prt->dma_area +
+ peasycap->dma_fill,
p1, much);
p1 += much;
more -= much;
} else {
#if defined(UPSAMPLE)
if (much % 16)
- JOM(8, "MISTAKE? much" \
+ JOM(8, "MISTAKE? much"
" is not divisible by 16\n");
- if (much > (16 * \
+ if (much > (16 *
more))
- much = 16 * \
+ much = 16 *
more;
- p2 = (__u8 *)(prt->dma_area + \
+ p2 = (__u8 *)(prt->dma_area +
peasycap->dma_fill);
for (j = 0; j < (much/16); j++) {
newaudio = ((int) *p1) - 128;
- newaudio = 128 * \
+ newaudio = 128 *
newaudio;
- delta = (newaudio - oldaudio) \
+ delta = (newaudio - oldaudio)
/ 4;
s16 = oldaudio + delta;
for (k = 0; k < 4; k++) {
*p2 = (0x00FF & s16);
- *(p2 + 1) = (0xFF00 & \
+ *(p2 + 1) = (0xFF00 &
s16) >> 8;
p2 += 2;
*p2 = (0x00FF & s16);
- *(p2 + 1) = (0xFF00 & \
+ *(p2 + 1) = (0xFF00 &
s16) >> 8;
p2 += 2;
s16 += delta;
#else /*!UPSAMPLE*/
if (much > (2 * more))
much = 2 * more;
- p2 = (__u8 *)(prt->dma_area + \
+ p2 = (__u8 *)(prt->dma_area +
peasycap->dma_fill);
for (j = 0; j < (much / 2); j++) {
s16 = ((int) *p1) - 128;
- s16 = 128 * \
+ s16 = 128 *
s16;
*p2 = (0x00FF & s16);
- *(p2 + 1) = (0xFF00 & s16) >> \
+ *(p2 + 1) = (0xFF00 & s16) >>
8;
p1++; p2 += 2;
more--;
}
peasycap->dma_fill += much;
if (peasycap->dma_fill >= peasycap->dma_next) {
- isfragment = peasycap->dma_fill / \
+ isfragment = peasycap->dma_fill /
fragment_bytes;
if (0 > isfragment) {
- SAM("MISTAKE: isfragment is " \
+ SAM("MISTAKE: isfragment is "
"negative\n");
return;
}
- peasycap->dma_read = (isfragment \
+ peasycap->dma_read = (isfragment
- 1) * fragment_bytes;
- peasycap->dma_next = (isfragment \
+ peasycap->dma_next = (isfragment
+ 1) * fragment_bytes;
if (dma_bytes < peasycap->dma_next) {
- peasycap->dma_next = \
+ peasycap->dma_next =
fragment_bytes;
}
if (0 <= peasycap->dma_read) {
- JOM(8, "snd_pcm_period_elap" \
- "sed(), %i=" \
- "isfragment\n", \
+ JOM(8, "snd_pcm_period_elap"
+ "sed(), %i="
+ "isfragment\n",
isfragment);
snd_pcm_period_elapsed(pss);
}
}
}
} else {
- JOM(12, "discarding audio samples because " \
- "%i=purb->iso_frame_desc[i].status\n", \
+ JOM(12, "discarding audio samples because "
+ "%i=purb->iso_frame_desc[i].status\n",
purb->iso_frame_desc[i].status);
}
rc = usb_submit_urb(purb, GFP_ATOMIC);
if (0 != rc) {
if ((-ENODEV != rc) && (-ENOENT != rc)) {
- SAM("ERROR: while %i=audio_idle, " \
- "usb_submit_urb() failed " \
+ SAM("ERROR: while %i=audio_idle, "
+ "usb_submit_urb() failed "
"with rc:\n", peasycap->audio_idle);
}
switch (rc) {
}
/*****************************************************************************/
int
-easycap_alsa_hw_params(struct snd_pcm_substream *pss, \
+easycap_alsa_hw_params(struct snd_pcm_substream *pss,
struct snd_pcm_hw_params *phw)
{
int rc;
JOM(16, "ALSA decides %8i =frame_bits\n", (int)pss->runtime->frame_bits);
JOM(16, "ALSA decides %8i =min_align\n", (int)pss->runtime->min_align);
JOM(12, "ALSA decides %8i =hw_ptr_base\n", (int)pss->runtime->hw_ptr_base);
-JOM(12, "ALSA decides %8i =hw_ptr_interrupt\n", \
+JOM(12, "ALSA decides %8i =hw_ptr_interrupt\n",
(int)pss->runtime->hw_ptr_interrupt);
if (prt->dma_bytes != 4 * ((int)prt->period_size) * ((int)prt->periods)) {
SAY("MISTAKE: unexpected ALSA parameters\n");
struct easycap *peasycap;
int retval;
-JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START, \
+JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START,
SNDRV_PCM_TRIGGER_STOP);
if (NULL == pss) {
SAY("ERROR: pss is NULL\n");
return -EFAULT;
}
if ((0 != peasycap->audio_eof) || (0 != peasycap->audio_idle)) {
- JOM(8, "returning -EIO because " \
- "%i=audio_idle %i=audio_eof\n", \
+ JOM(8, "returning -EIO because "
+ "%i=audio_idle %i=audio_eof\n",
peasycap->audio_idle, peasycap->audio_eof);
return -EIO;
}
}
offset = ((snd_pcm_uframes_t)peasycap->dma_read)/4;
JOM(8, "ALSA decides %8i =hw_ptr_base\n", (int)pss->runtime->hw_ptr_base);
-JOM(8, "ALSA decides %8i =hw_ptr_interrupt\n", \
+JOM(8, "ALSA decides %8i =hw_ptr_interrupt\n",
(int)pss->runtime->hw_ptr_interrupt);
-JOM(8, "%7i=offset %7i=dma_read %7i=dma_next\n", \
+JOM(8, "%7i=offset %7i=dma_read %7i=dma_next\n",
(int)offset, peasycap->dma_read, peasycap->dma_next);
return offset;
}
}
much = 0;
if (peasycap->audio_idle) {
- JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n", \
+ JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n",
peasycap->audio_idle, peasycap->audio_isoc_streaming);
if (peasycap->audio_isoc_streaming) {
rc = usb_submit_urb(purb, GFP_ATOMIC);
if (0 != rc) {
if (-ENODEV != rc && -ENOENT != rc) {
- SAM("ERROR: while %i=audio_idle, " \
- "usb_submit_urb() failed with rc:\n", \
+ SAM("ERROR: while %i=audio_idle, "
+ "usb_submit_urb() failed with rc:\n",
peasycap->audio_idle);
}
switch (rc) {
peasycap->audio_mt++;
else {
if (peasycap->audio_mt) {
- JOM(12, "%4i empty audio urb frames\n", \
+ JOM(12, "%4i empty audio urb frames\n",
peasycap->audio_mt);
peasycap->audio_mt = 0;
}
- p1 = (__u8 *)(purb->transfer_buffer + \
+ p1 = (__u8 *)(purb->transfer_buffer +
purb->iso_frame_desc[i].offset);
leap = 0;
SAM("MISTAKE: more is negative\n");
return;
}
- if (peasycap->audio_buffer_page_many <= \
+ if (peasycap->audio_buffer_page_many <=
peasycap->audio_fill) {
- SAM("ERROR: bad " \
+ SAM("ERROR: bad "
"peasycap->audio_fill\n");
return;
}
- paudio_buffer = &peasycap->audio_buffer\
+ paudio_buffer = &peasycap->audio_buffer
[peasycap->audio_fill];
- if (PAGE_SIZE < (paudio_buffer->pto - \
+ if (PAGE_SIZE < (paudio_buffer->pto -
paudio_buffer->pgo)) {
SAM("ERROR: bad paudio_buffer->pto\n");
return;
}
- if (PAGE_SIZE == (paudio_buffer->pto - \
+ if (PAGE_SIZE == (paudio_buffer->pto -
paudio_buffer->pgo)) {
#if defined(TESTTONE)
- easyoss_testtone(peasycap, \
+ easyoss_testtone(peasycap,
peasycap->audio_fill);
#endif /*TESTTONE*/
- paudio_buffer->pto = \
+ paudio_buffer->pto =
paudio_buffer->pgo;
(peasycap->audio_fill)++;
- if (peasycap->\
- audio_buffer_page_many <= \
+ if (peasycap->
+ audio_buffer_page_many <=
peasycap->audio_fill)
peasycap->audio_fill = 0;
- JOM(8, "bumped peasycap->" \
- "audio_fill to %i\n", \
+ JOM(8, "bumped peasycap->"
+ "audio_fill to %i\n",
peasycap->audio_fill);
- paudio_buffer = &peasycap->\
- audio_buffer\
+ paudio_buffer = &peasycap->
+ audio_buffer
[peasycap->audio_fill];
- paudio_buffer->pto = \
+ paudio_buffer->pto =
paudio_buffer->pgo;
- if (!(peasycap->audio_fill % \
- peasycap->\
+ if (!(peasycap->audio_fill %
+ peasycap->
audio_pages_per_fragment)) {
- JOM(12, "wakeup call on wq_" \
- "audio, %i=frag reading %i" \
- "=fragment fill\n", \
- (peasycap->audio_read / \
- peasycap->\
- audio_pages_per_fragment), \
- (peasycap->audio_fill / \
- peasycap->\
+ JOM(12, "wakeup call on wq_"
+ "audio, %i=frag reading %i"
+ "=fragment fill\n",
+ (peasycap->audio_read /
+ peasycap->
+ audio_pages_per_fragment),
+ (peasycap->audio_fill /
+ peasycap->
audio_pages_per_fragment));
- wake_up_interruptible\
+ wake_up_interruptible
(&(peasycap->wq_audio));
}
}
- much = PAGE_SIZE - (int)(paudio_buffer->pto -\
+ much = PAGE_SIZE - (int)(paudio_buffer->pto -
paudio_buffer->pgo);
if (false == peasycap->microphone) {
} else {
#if defined(UPSAMPLE)
if (much % 16)
- JOM(8, "MISTAKE? much" \
+ JOM(8, "MISTAKE? much"
" is not divisible by 16\n");
- if (much > (16 * \
+ if (much > (16 *
more))
- much = 16 * \
+ much = 16 *
more;
p2 = (__u8 *)paudio_buffer->pto;
for (j = 0; j < (much/16); j++) {
newaudio = ((int) *p1) - 128;
- newaudio = 128 * \
+ newaudio = 128 *
newaudio;
- delta = (newaudio - oldaudio) \
+ delta = (newaudio - oldaudio)
/ 4;
s16 = oldaudio + delta;
for (k = 0; k < 4; k++) {
*p2 = (0x00FF & s16);
- *(p2 + 1) = (0xFF00 & \
+ *(p2 + 1) = (0xFF00 &
s16) >> 8;
p2 += 2;
*p2 = (0x00FF & s16);
- *(p2 + 1) = (0xFF00 & \
+ *(p2 + 1) = (0xFF00 &
s16) >> 8;
p2 += 2;
for (j = 0; j < (much / 2); j++) {
s16 = ((int) *p1) - 128;
- s16 = 128 * \
+ s16 = 128 *
s16;
*p2 = (0x00FF & s16);
- *(p2 + 1) = (0xFF00 & s16) >> \
+ *(p2 + 1) = (0xFF00 & s16) >>
8;
p1++; p2 += 2;
more--;
}
}
} else {
- JOM(12, "discarding audio samples because " \
- "%i=purb->iso_frame_desc[i].status\n", \
+ JOM(12, "discarding audio samples because "
+ "%i=purb->iso_frame_desc[i].status\n",
purb->iso_frame_desc[i].status);
}
rc = usb_submit_urb(purb, GFP_ATOMIC);
if (0 != rc) {
if (-ENODEV != rc && -ENOENT != rc) {
- SAM("ERROR: while %i=audio_idle, " \
- "usb_submit_urb() failed " \
+ SAM("ERROR: while %i=audio_idle, "
+ "usb_submit_urb() failed "
"with rc:\n", peasycap->audio_idle);
}
switch (rc) {
SAY("ERROR: pv4l2_device is NULL\n");
return -EFAULT;
}
- peasycap = (struct easycap *) \
+ peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device);
}
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
}
/*****************************************************************************/
ssize_t
-easyoss_read(struct file *file, char __user *puserspacebuffer, \
+easyoss_read(struct file *file, char __user *puserspacebuffer,
size_t kount, loff_t *poff)
{
struct timeval timeval;
return -ERESTARTSYS;
}
if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
- SAY("ERROR: bad peasycap: 0x%08lX\n", \
+ SAY("ERROR: bad peasycap: 0x%08lX\n",
(unsigned long int) peasycap);
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS;
else
JOT(8, "BLOCKING kount=%i, *poff=%i\n", (int)kount, (int)(*poff));
-if ((0 > peasycap->audio_read) || \
+if ((0 > peasycap->audio_read) ||
(peasycap->audio_buffer_page_many <= peasycap->audio_read)) {
SAM("ERROR: peasycap->audio_read out of range\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT;
}
-JOM(12, "before wait, %i=frag read %i=frag fill\n", \
- (peasycap->audio_read / peasycap->audio_pages_per_fragment), \
+JOM(12, "before wait, %i=frag read %i=frag fill\n",
+ (peasycap->audio_read / peasycap->audio_pages_per_fragment),
(peasycap->audio_fill / peasycap->audio_pages_per_fragment));
fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment);
-while ((fragment == (peasycap->audio_fill / \
- peasycap->audio_pages_per_fragment)) || \
+while ((fragment == (peasycap->audio_fill /
+ peasycap->audio_pages_per_fragment)) ||
(0 == (PAGE_SIZE - (pdata_buffer->pto - pdata_buffer->pgo)))) {
if (file->f_flags & O_NONBLOCK) {
JOM(16, "returning -EAGAIN as instructed\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EAGAIN;
}
- rc = wait_event_interruptible(peasycap->wq_audio, \
- (peasycap->audio_idle || peasycap->audio_eof || \
- ((fragment != (peasycap->audio_fill / \
- peasycap->audio_pages_per_fragment)) && \
+ rc = wait_event_interruptible(peasycap->wq_audio,
+ (peasycap->audio_idle || peasycap->audio_eof ||
+ ((fragment != (peasycap->audio_fill /
+ peasycap->audio_pages_per_fragment)) &&
(0 < (PAGE_SIZE - (pdata_buffer->pto - pdata_buffer->pgo))))));
if (0 != rc) {
SAM("aborted by signal\n");
return -ERESTARTSYS;
}
if (peasycap->audio_eof) {
- JOM(8, "returning 0 because %i=audio_eof\n", \
+ JOM(8, "returning 0 because %i=audio_eof\n",
peasycap->audio_eof);
kill_audio_urbs(peasycap);
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return 0;
}
if (peasycap->audio_idle) {
- JOM(16, "returning 0 because %i=audio_idle\n", \
+ JOM(16, "returning 0 because %i=audio_idle\n",
peasycap->audio_idle);
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return 0;
return 0;
}
}
-JOM(12, "after wait, %i=frag read %i=frag fill\n", \
- (peasycap->audio_read / peasycap->audio_pages_per_fragment), \
+JOM(12, "after wait, %i=frag read %i=frag fill\n",
+ (peasycap->audio_read / peasycap->audio_pages_per_fragment),
(peasycap->audio_fill / peasycap->audio_pages_per_fragment));
szret = (size_t)0;
fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment);
-while (fragment == (peasycap->audio_read / \
+while (fragment == (peasycap->audio_read /
peasycap->audio_pages_per_fragment)) {
if (NULL == pdata_buffer->pgo) {
SAM("ERROR: pdata_buffer->pgo is NULL\n");
(peasycap->audio_read)++;
if (peasycap->audio_buffer_page_many <= peasycap->audio_read)
peasycap->audio_read = 0;
- JOM(12, "bumped peasycap->audio_read to %i\n", \
+ JOM(12, "bumped peasycap->audio_read to %i\n",
peasycap->audio_read);
- if (fragment != (peasycap->audio_read / \
+ if (fragment != (peasycap->audio_read /
peasycap->audio_pages_per_fragment))
break;
- if ((0 > peasycap->audio_read) || \
- (peasycap->audio_buffer_page_many <= \
+ if ((0 > peasycap->audio_read) ||
+ (peasycap->audio_buffer_page_many <=
peasycap->audio_read)) {
SAM("ERROR: peasycap->audio_read out of range\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
more = kount1;
if (more > kount)
more = kount;
- JOM(12, "agreed to send %li bytes from page %i\n", \
+ JOM(12, "agreed to send %li bytes from page %i\n",
more, peasycap->audio_read);
if (!more)
break;
/*---------------------------------------------------------------------------*/
p0 = (unsigned char *)pdata_buffer->pgo; l0 = 0; lm = more/2;
while (l0 < lm) {
- SUMMER(p0, &peasycap->audio_sample, &peasycap->audio_niveau, \
+ SUMMER(p0, &peasycap->audio_sample, &peasycap->audio_niveau,
&peasycap->audio_square); l0++; p0 += 2;
}
/*---------------------------------------------------------------------------*/
puserspacebuffer += more;
kount -= (size_t)more;
}
-JOM(12, "after read, %i=frag read %i=frag fill\n", \
- (peasycap->audio_read / peasycap->audio_pages_per_fragment), \
+JOM(12, "after read, %i=frag read %i=frag fill\n",
+ (peasycap->audio_read / peasycap->audio_pages_per_fragment),
(peasycap->audio_fill / peasycap->audio_pages_per_fragment));
if (kount < 0) {
- SAM("MISTAKE: %li=kount %li=szret\n", \
+ SAM("MISTAKE: %li=kount %li=szret\n",
(long int)kount, (long int)szret);
}
/*---------------------------------------------------------------------------*/
mean = peasycap->audio_niveau;
sdr = signed_div(mean, peasycap->audio_sample);
- JOM(8, "%8lli=mean %8lli=meansquare after %lli samples, =>\n", \
+ JOM(8, "%8lli=mean %8lli=meansquare after %lli samples, =>\n",
sdr.quotient, above, peasycap->audio_sample);
sdr = signed_div(above, 32768);
sdr.quotient = 192000;
} else {
peasycap->audio_bytes += (long long int) szret;
- below = ((long long int)(1000000)) * \
- ((long long int)(timeval.tv_sec - \
- peasycap->timeval3.tv_sec)) + \
+ below = ((long long int)(1000000)) *
+ ((long long int)(timeval.tv_sec -
+ peasycap->timeval3.tv_sec)) +
(long long int)(timeval.tv_usec - peasycap->timeval3.tv_usec);
above = 1000000 * ((long long int) peasycap->audio_bytes);
SAM("ERROR: peasycap->pusb_device has become NULL\n");
return -ENODEV;
}
-rc = usb_set_interface(peasycap->pusb_device, peasycap->audio_interface, \
+rc = usb_set_interface(peasycap->pusb_device, peasycap->audio_interface,
peasycap->audio_altsetting_on);
-JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface, \
+JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface,
peasycap->audio_altsetting_on, rc);
rc = wakeup_device(peasycap->pusb_device);
if (!peasycap->audio_isoc_streaming) {
JOM(4, "initial submission of all audio urbs\n");
rc = usb_set_interface(peasycap->pusb_device,
- peasycap->audio_interface, \
+ peasycap->audio_interface,
peasycap->audio_altsetting_on);
- JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", \
- peasycap->audio_interface, \
+ JOM(8, "usb_set_interface(.,%i,%i) returned %i\n",
+ peasycap->audio_interface,
peasycap->audio_altsetting_on, rc);
isbad = 0; nospc = 0; m = 0;
purb->interval = 1;
purb->dev = peasycap->pusb_device;
- purb->pipe = \
- usb_rcvisocpipe(peasycap->pusb_device,\
+ purb->pipe =
+ usb_rcvisocpipe(peasycap->pusb_device,
peasycap->audio_endpointnumber);
purb->transfer_flags = URB_ISO_ASAP;
- purb->transfer_buffer = \
+ purb->transfer_buffer =
peasycap->audio_isoc_buffer[isbuf].pgo;
- purb->transfer_buffer_length = \
+ purb->transfer_buffer_length =
peasycap->audio_isoc_buffer_size;
#if defined(EASYCAP_NEEDS_ALSA)
purb->complete = easycap_alsa_complete;
#endif /*EASYCAP_NEEDS_ALSA*/
purb->context = peasycap;
purb->start_frame = 0;
- purb->number_of_packets = \
+ purb->number_of_packets =
peasycap->audio_isoc_framesperdesc;
- for (j = 0; j < peasycap->\
- audio_isoc_framesperdesc; \
+ for (j = 0; j < peasycap->
+ audio_isoc_framesperdesc;
j++) {
- purb->iso_frame_desc[j].offset = j * \
- peasycap->\
+ purb->iso_frame_desc[j].offset = j *
+ peasycap->
audio_isoc_maxframesize;
- purb->iso_frame_desc[j].length = \
- peasycap->\
+ purb->iso_frame_desc[j].length =
+ peasycap->
audio_isoc_maxframesize;
}
rc = usb_submit_urb(purb, GFP_KERNEL);
if (0 != rc) {
isbad++;
- SAM("ERROR: usb_submit_urb() failed" \
+ SAM("ERROR: usb_submit_urb() failed"
" for urb with rc:\n");
switch (rc) {
case -ENODEV: {
if (isbad) {
JOM(4, "attempting cleanup instead of submitting\n");
list_for_each(plist_head, (peasycap->purb_audio_head)) {
- pdata_urb = list_entry(plist_head, struct data_urb, \
+ pdata_urb = list_entry(plist_head, struct data_urb,
list_head);
if (NULL != pdata_urb) {
purb = pdata_urb->purb;
return -EFAULT;
}
} else {
- JOM(8, "%i=audio_isoc_streaming, no audio urbs killed\n", \
+ JOM(8, "%i=audio_isoc_streaming, no audio urbs killed\n",
peasycap->audio_isoc_streaming);
}
return 0;