Lines 242-252
Link Here
|
242 |
SCAM_MSG("vidioc_querybuf called - invalid buf type\n"); |
242 |
SCAM_MSG("vidioc_querybuf called - invalid buf type\n"); |
243 |
return -EINVAL; |
243 |
return -EINVAL; |
244 |
} |
244 |
} |
245 |
if(vidbuf->memory != V4L2_MEMORY_MMAP) |
245 |
vidbuf->memory = V4L2_MEMORY_MMAP; |
246 |
{ |
|
|
247 |
SCAM_MSG("vidioc_querybuf called - invalid memory type\n"); |
248 |
return -EINVAL; |
249 |
} |
250 |
vidbuf->length = SMARTCAM_BUFFER_SIZE; |
246 |
vidbuf->length = SMARTCAM_BUFFER_SIZE; |
251 |
vidbuf->bytesused = formats[format].sizeimage; |
247 |
vidbuf->bytesused = formats[format].sizeimage; |
252 |
vidbuf->flags = V4L2_BUF_FLAG_MAPPED; |
248 |
vidbuf->flags = V4L2_BUF_FLAG_MAPPED; |
Lines 538-544
Link Here
|
538 |
{ |
534 |
{ |
539 |
int mask = (POLLOUT | POLLWRNORM); /* writable */ |
535 |
int mask = (POLLOUT | POLLWRNORM); /* writable */ |
540 |
if (last_read_frame != frame_sequence) |
536 |
if (last_read_frame != frame_sequence) |
541 |
mask |= (POLLIN | POLLRDNORM) /* readable */ |
537 |
mask |= (POLLIN | POLLRDNORM); /* readable */ |
542 |
|
538 |
|
543 |
SCAM_MSG("(%s) %s called\n", current->comm, __FUNCTION__); |
539 |
SCAM_MSG("(%s) %s called\n", current->comm, __FUNCTION__); |
544 |
|
540 |
|
Lines 553-559
Link Here
|
553 |
return 0; |
549 |
return 0; |
554 |
} |
550 |
} |
555 |
|
551 |
|
556 |
static const struct file_operations smartcam_fops = { |
552 |
static const struct v4l2_file_operations smartcam_fops = { |
557 |
.owner = THIS_MODULE, |
553 |
.owner = THIS_MODULE, |
558 |
.open = smartcam_open, |
554 |
.open = smartcam_open, |
559 |
.release = smartcam_release, |
555 |
.release = smartcam_release, |
Lines 562-568
Link Here
|
562 |
.poll = smartcam_poll, |
558 |
.poll = smartcam_poll, |
563 |
.ioctl = video_ioctl2, /* V4L2 ioctl handler */ |
559 |
.ioctl = video_ioctl2, /* V4L2 ioctl handler */ |
564 |
.mmap = smartcam_mmap, |
560 |
.mmap = smartcam_mmap, |
565 |
.llseek = no_llseek, |
|
|
566 |
}; |
561 |
}; |
567 |
|
562 |
|
568 |
static const struct v4l2_ioctl_ops smartcam_ioctl_ops = { |
563 |
static const struct v4l2_ioctl_ops smartcam_ioctl_ops = { |
Lines 594-599
Link Here
|
594 |
#endif |
589 |
#endif |
595 |
}; |
590 |
}; |
596 |
|
591 |
|
|
|
592 |
#define VID_TYPE_CAPTURE 1 |
597 |
static struct video_device smartcam_vid = { |
593 |
static struct video_device smartcam_vid = { |
598 |
.name = "smartcam", |
594 |
.name = "smartcam", |
599 |
.vfl_type = VID_TYPE_CAPTURE, |
595 |
.vfl_type = VID_TYPE_CAPTURE, |