• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/media/video/

Lines Matching refs:qcam

30 /* qcam-lib.c -- Library for programming with the Connectix QuickCam.
104 struct qcam {
122 static unsigned int maxpoll = 250; /* Maximum busy-loop count for qcam I/O */
132 * immediately attempt to initialize qcam */
136 static struct qcam *qcams[MAX_CAMS];
139 static inline int read_lpstatus(struct qcam *q)
144 static inline int read_lpdata(struct qcam *q)
149 static inline void write_lpdata(struct qcam *q, int d)
154 static void write_lpcontrol(struct qcam *q, int d)
174 static int qc_waithand(struct qcam *q, int val)
212 /* Waithand2 is used when the qcam is in bidirectional mode, and the
217 static unsigned int qc_waithand2(struct qcam *q, int val)
245 static int qc_command(struct qcam *q, int command)
262 static int qc_readparam(struct qcam *q)
285 static int qc_detect(struct qcam *q)
327 static int qc_setscanmode(struct qcam *q)
372 static void qc_reset(struct qcam *q)
405 static void qc_set(struct qcam *q)
459 static inline int qc_readbytes(struct qcam *q, char buffer[])
550 static long qc_capture(struct qcam *q, char __user *buf, unsigned long len)
637 struct qcam *qcam = video_drvdata(file);
639 strlcpy(vcap->driver, qcam->v4l2_dev.name, sizeof(vcap->driver));
688 struct qcam *qcam = video_drvdata(file);
693 ctrl->value = qcam->brightness;
696 ctrl->value = qcam->contrast;
699 ctrl->value = qcam->whitebal;
711 struct qcam *qcam = video_drvdata(file);
714 mutex_lock(&qcam->lock);
717 qcam->brightness = ctrl->value;
720 qcam->contrast = ctrl->value;
723 qcam->whitebal = ctrl->value;
730 qc_setscanmode(qcam);
731 qcam->status |= QC_PARAM_CHANGE;
733 mutex_unlock(&qcam->lock);
739 struct qcam *qcam = video_drvdata(file);
742 pix->width = qcam->width / qcam->transfer_scale;
743 pix->height = qcam->height / qcam->transfer_scale;
744 pix->pixelformat = (qcam->bpp == 4) ? V4L2_PIX_FMT_Y4 : V4L2_PIX_FMT_Y6;
746 pix->bytesperline = qcam->width;
747 pix->sizeimage = qcam->width * qcam->height;
780 struct qcam *qcam = video_drvdata(file);
786 qcam->width = 320;
787 qcam->height = 240;
789 qcam->transfer_scale = 4;
791 qcam->transfer_scale = 2;
793 qcam->transfer_scale = 1;
795 qcam->bpp = 6;
797 qcam->bpp = 4;
799 mutex_lock(&qcam->lock);
800 qc_setscanmode(qcam);
803 qcam->status |= QC_PARAM_CHANGE;
804 mutex_unlock(&qcam->lock);
833 struct qcam *qcam = video_drvdata(file);
835 parport_claim_or_block(qcam->pdev);
837 mutex_lock(&qcam->lock);
839 qc_reset(qcam);
842 if (qcam->status & QC_PARAM_CHANGE)
843 qc_set(qcam);
845 len = qc_capture(qcam, buf, count);
847 mutex_unlock(&qcam->lock);
849 parport_release(qcam->pdev);
876 static struct qcam *qcam_init(struct parport *port)
878 struct qcam *qcam;
881 qcam = kzalloc(sizeof(struct qcam), GFP_KERNEL);
882 if (qcam == NULL)
885 v4l2_dev = &qcam->v4l2_dev;
886 strlcpy(v4l2_dev->name, "bw-qcam", sizeof(v4l2_dev->name));
893 qcam->pport = port;
894 qcam->pdev = parport_register_device(port, "bw-qcam", NULL, NULL,
896 if (qcam->pdev == NULL) {
898 kfree(qcam);
902 strlcpy(qcam->vdev.name, "Connectix QuickCam", sizeof(qcam->vdev.name));
903 qcam->vdev.v4l2_dev = v4l2_dev;
904 qcam->vdev.fops = &qcam_fops;
905 qcam->vdev.ioctl_ops = &qcam_ioctl_ops;
906 qcam->vdev.release = video_device_release_empty;
907 video_set_drvdata(&qcam->vdev, qcam);
909 mutex_init(&qcam->lock);
911 qcam->port_mode = (QC_ANY | QC_NOTSET);
912 qcam->width = 320;
913 qcam->height = 240;
914 qcam->bpp = 4;
915 qcam->transfer_scale = 2;
916 qcam->contrast = 192;
917 qcam->brightness = 180;
918 qcam->whitebal = 105;
919 qcam->top = 1;
920 qcam->left = 14;
921 qcam->mode = -1;
922 qcam->status = QC_PARAM_CHANGE;
923 return qcam;
926 static int qc_calibrate(struct qcam *q)
958 struct qcam *qcam;
965 qcam = qcam_init(port);
966 if (qcam == NULL)
969 parport_claim_or_block(qcam->pdev);
971 qc_reset(qcam);
973 if (qc_detect(qcam) == 0) {
974 parport_release(qcam->pdev);
975 parport_unregister_device(qcam->pdev);
976 kfree(qcam);
979 qc_calibrate(qcam);
981 parport_release(qcam->pdev);
983 v4l2_info(&qcam->v4l2_dev, "Connectix Quickcam on %s\n", qcam->pport->name);
985 if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
986 parport_unregister_device(qcam->pdev);
987 kfree(qcam);
991 qcams[num_cams++] = qcam;
996 static void close_bwqcam(struct qcam *qcam)
998 video_unregister_device(&qcam->vdev);
999 parport_unregister_device(qcam->pdev);
1000 kfree(qcam);
1024 "bw-qcam: bad port specifier \"%s\"\n",
1047 struct qcam *qcam = qcams[i];
1048 if (qcam && qcam->pdev->port == port) {
1050 close_bwqcam(qcam);
1056 .name = "bw-qcam",