diff options
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 4 | ||||
-rw-r--r-- | drivers/media/video/gspca/ov534.c | 32 | ||||
-rw-r--r-- | drivers/media/video/gspca/ov534_9.c | 1 | ||||
-rw-r--r-- | drivers/media/video/gspca/pac7311.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/sn9c20x.c | 37 | ||||
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 2 |
6 files changed, 31 insertions, 47 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 137166d73945..31721eadc597 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -1653,7 +1653,7 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1653 | enum v4l2_buf_type buf_type) | 1653 | enum v4l2_buf_type buf_type) |
1654 | { | 1654 | { |
1655 | struct gspca_dev *gspca_dev = video_drvdata(file); | 1655 | struct gspca_dev *gspca_dev = video_drvdata(file); |
1656 | int ret; | 1656 | int i, ret; |
1657 | 1657 | ||
1658 | if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 1658 | if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1659 | return -EINVAL; | 1659 | return -EINVAL; |
@@ -1678,6 +1678,8 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1678 | wake_up_interruptible(&gspca_dev->wq); | 1678 | wake_up_interruptible(&gspca_dev->wq); |
1679 | 1679 | ||
1680 | /* empty the transfer queues */ | 1680 | /* empty the transfer queues */ |
1681 | for (i = 0; i < gspca_dev->nframes; i++) | ||
1682 | gspca_dev->frame[i].v4l2_buf.flags &= ~BUF_ALL_FLAGS; | ||
1681 | atomic_set(&gspca_dev->fr_q, 0); | 1683 | atomic_set(&gspca_dev->fr_q, 0); |
1682 | atomic_set(&gspca_dev->fr_i, 0); | 1684 | atomic_set(&gspca_dev->fr_i, 0); |
1683 | gspca_dev->fr_o = 0; | 1685 | gspca_dev->fr_o = 0; |
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index b5acb1e4b4e7..80c81dd6d68b 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -96,7 +96,7 @@ static void setbrightness(struct gspca_dev *gspca_dev); | |||
96 | static void setcontrast(struct gspca_dev *gspca_dev); | 96 | static void setcontrast(struct gspca_dev *gspca_dev); |
97 | static void setgain(struct gspca_dev *gspca_dev); | 97 | static void setgain(struct gspca_dev *gspca_dev); |
98 | static void setexposure(struct gspca_dev *gspca_dev); | 98 | static void setexposure(struct gspca_dev *gspca_dev); |
99 | static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val); | 99 | static void setagc(struct gspca_dev *gspca_dev); |
100 | static void setawb(struct gspca_dev *gspca_dev); | 100 | static void setawb(struct gspca_dev *gspca_dev); |
101 | static void setaec(struct gspca_dev *gspca_dev); | 101 | static void setaec(struct gspca_dev *gspca_dev); |
102 | static void setsharpness(struct gspca_dev *gspca_dev); | 102 | static void setsharpness(struct gspca_dev *gspca_dev); |
@@ -189,7 +189,7 @@ static const struct ctrl sd_ctrls[] = { | |||
189 | .step = 1, | 189 | .step = 1, |
190 | .default_value = 1, | 190 | .default_value = 1, |
191 | }, | 191 | }, |
192 | .set = sd_setagc | 192 | .set_control = setagc |
193 | }, | 193 | }, |
194 | [AWB] = { | 194 | [AWB] = { |
195 | { | 195 | { |
@@ -851,6 +851,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev) | |||
851 | int i; | 851 | int i; |
852 | 852 | ||
853 | for (i = 0; i < 5; i++) { | 853 | for (i = 0; i < 5; i++) { |
854 | msleep(10); | ||
854 | data = ov534_reg_read(gspca_dev, OV534_REG_STATUS); | 855 | data = ov534_reg_read(gspca_dev, OV534_REG_STATUS); |
855 | 856 | ||
856 | switch (data) { | 857 | switch (data) { |
@@ -1242,10 +1243,6 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1242 | 1243 | ||
1243 | cam->ctrls = sd->ctrls; | 1244 | cam->ctrls = sd->ctrls; |
1244 | 1245 | ||
1245 | /* the auto white balance control works only when auto gain is set */ | ||
1246 | if (sd_ctrls[AGC].qctrl.default_value == 0) | ||
1247 | gspca_dev->ctrl_inac |= (1 << AWB); | ||
1248 | |||
1249 | cam->cam_mode = ov772x_mode; | 1246 | cam->cam_mode = ov772x_mode; |
1250 | cam->nmodes = ARRAY_SIZE(ov772x_mode); | 1247 | cam->nmodes = ARRAY_SIZE(ov772x_mode); |
1251 | 1248 | ||
@@ -1486,29 +1483,6 @@ scan_next: | |||
1486 | } while (remaining_len > 0); | 1483 | } while (remaining_len > 0); |
1487 | } | 1484 | } |
1488 | 1485 | ||
1489 | static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val) | ||
1490 | { | ||
1491 | struct sd *sd = (struct sd *) gspca_dev; | ||
1492 | |||
1493 | sd->ctrls[AGC].val = val; | ||
1494 | |||
1495 | /* the auto white balance control works only | ||
1496 | * when auto gain is set */ | ||
1497 | if (val) { | ||
1498 | gspca_dev->ctrl_inac &= ~(1 << AWB); | ||
1499 | } else { | ||
1500 | gspca_dev->ctrl_inac |= (1 << AWB); | ||
1501 | if (sd->ctrls[AWB].val) { | ||
1502 | sd->ctrls[AWB].val = 0; | ||
1503 | if (gspca_dev->streaming) | ||
1504 | setawb(gspca_dev); | ||
1505 | } | ||
1506 | } | ||
1507 | if (gspca_dev->streaming) | ||
1508 | setagc(gspca_dev); | ||
1509 | return gspca_dev->usb_err; | ||
1510 | } | ||
1511 | |||
1512 | static int sd_querymenu(struct gspca_dev *gspca_dev, | 1486 | static int sd_querymenu(struct gspca_dev *gspca_dev, |
1513 | struct v4l2_querymenu *menu) | 1487 | struct v4l2_querymenu *menu) |
1514 | { | 1488 | { |
diff --git a/drivers/media/video/gspca/ov534_9.c b/drivers/media/video/gspca/ov534_9.c index b5797308a39b..1fd41f0d2e95 100644 --- a/drivers/media/video/gspca/ov534_9.c +++ b/drivers/media/video/gspca/ov534_9.c | |||
@@ -1008,6 +1008,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev) | |||
1008 | int i; | 1008 | int i; |
1009 | 1009 | ||
1010 | for (i = 0; i < 5; i++) { | 1010 | for (i = 0; i < 5; i++) { |
1011 | msleep(10); | ||
1011 | data = reg_r(gspca_dev, OV534_REG_STATUS); | 1012 | data = reg_r(gspca_dev, OV534_REG_STATUS); |
1012 | 1013 | ||
1013 | switch (data) { | 1014 | switch (data) { |
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c index 2cb7d95f7be7..115da169f32a 100644 --- a/drivers/media/video/gspca/pac7311.c +++ b/drivers/media/video/gspca/pac7311.c | |||
@@ -418,7 +418,7 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
418 | struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; | 418 | struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; |
419 | 419 | ||
420 | gspca_dev->vdev.ctrl_handler = hdl; | 420 | gspca_dev->vdev.ctrl_handler = hdl; |
421 | v4l2_ctrl_handler_init(hdl, 4); | 421 | v4l2_ctrl_handler_init(hdl, 5); |
422 | 422 | ||
423 | sd->contrast = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 423 | sd->contrast = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
424 | V4L2_CID_CONTRAST, 0, 15, 1, 7); | 424 | V4L2_CID_CONTRAST, 0, 15, 1, 7); |
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index ad098202d7f0..b9c6f17eabb2 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -1761,7 +1761,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1761 | V4L2_CID_SATURATION, 0, 255, 1, 127); | 1761 | V4L2_CID_SATURATION, 0, 255, 1, 127); |
1762 | sd->hue = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1762 | sd->hue = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1763 | V4L2_CID_HUE, -180, 180, 1, 0); | 1763 | V4L2_CID_HUE, -180, 180, 1, 0); |
1764 | v4l2_ctrl_cluster(4, &sd->brightness); | ||
1765 | 1764 | ||
1766 | sd->gamma = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1765 | sd->gamma = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1767 | V4L2_CID_GAMMA, 0, 255, 1, 0x10); | 1766 | V4L2_CID_GAMMA, 0, 255, 1, 0x10); |
@@ -1770,7 +1769,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1770 | V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0x28); | 1769 | V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0x28); |
1771 | sd->red = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1770 | sd->red = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1772 | V4L2_CID_RED_BALANCE, 0, 127, 1, 0x28); | 1771 | V4L2_CID_RED_BALANCE, 0, 127, 1, 0x28); |
1773 | v4l2_ctrl_cluster(2, &sd->blue); | ||
1774 | 1772 | ||
1775 | if (sd->sensor != SENSOR_OV9655 && sd->sensor != SENSOR_SOI968 && | 1773 | if (sd->sensor != SENSOR_OV9655 && sd->sensor != SENSOR_SOI968 && |
1776 | sd->sensor != SENSOR_OV7670 && sd->sensor != SENSOR_MT9M001 && | 1774 | sd->sensor != SENSOR_OV7670 && sd->sensor != SENSOR_MT9M001 && |
@@ -1779,7 +1777,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1779 | V4L2_CID_HFLIP, 0, 1, 1, 0); | 1777 | V4L2_CID_HFLIP, 0, 1, 1, 0); |
1780 | sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1778 | sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1781 | V4L2_CID_VFLIP, 0, 1, 1, 0); | 1779 | V4L2_CID_VFLIP, 0, 1, 1, 0); |
1782 | v4l2_ctrl_cluster(2, &sd->hflip); | ||
1783 | } | 1780 | } |
1784 | 1781 | ||
1785 | if (sd->sensor != SENSOR_SOI968 && sd->sensor != SENSOR_MT9VPRB && | 1782 | if (sd->sensor != SENSOR_SOI968 && sd->sensor != SENSOR_MT9VPRB && |
@@ -1794,6 +1791,20 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1794 | V4L2_CID_GAIN, 0, 28, 1, 0); | 1791 | V4L2_CID_GAIN, 0, 28, 1, 0); |
1795 | sd->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1792 | sd->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1796 | V4L2_CID_AUTOGAIN, 0, 1, 1, 1); | 1793 | V4L2_CID_AUTOGAIN, 0, 1, 1, 1); |
1794 | } | ||
1795 | |||
1796 | sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | ||
1797 | V4L2_CID_JPEG_COMPRESSION_QUALITY, 50, 90, 1, 80); | ||
1798 | if (hdl->error) { | ||
1799 | pr_err("Could not initialize controls\n"); | ||
1800 | return hdl->error; | ||
1801 | } | ||
1802 | |||
1803 | v4l2_ctrl_cluster(4, &sd->brightness); | ||
1804 | v4l2_ctrl_cluster(2, &sd->blue); | ||
1805 | if (sd->hflip) | ||
1806 | v4l2_ctrl_cluster(2, &sd->hflip); | ||
1807 | if (sd->autogain) { | ||
1797 | if (sd->sensor == SENSOR_SOI968) | 1808 | if (sd->sensor == SENSOR_SOI968) |
1798 | /* this sensor doesn't have the exposure control and | 1809 | /* this sensor doesn't have the exposure control and |
1799 | autogain is clustered with gain instead. This works | 1810 | autogain is clustered with gain instead. This works |
@@ -1803,13 +1814,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1803 | /* Otherwise autogain is clustered with exposure. */ | 1814 | /* Otherwise autogain is clustered with exposure. */ |
1804 | v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, false); | 1815 | v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, false); |
1805 | } | 1816 | } |
1806 | |||
1807 | sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | ||
1808 | V4L2_CID_JPEG_COMPRESSION_QUALITY, 50, 90, 1, 80); | ||
1809 | if (hdl->error) { | ||
1810 | pr_err("Could not initialize controls\n"); | ||
1811 | return hdl->error; | ||
1812 | } | ||
1813 | return 0; | 1817 | return 0; |
1814 | } | 1818 | } |
1815 | 1819 | ||
@@ -2066,10 +2070,13 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
2066 | set_gamma(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma)); | 2070 | set_gamma(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma)); |
2067 | set_redblue(gspca_dev, v4l2_ctrl_g_ctrl(sd->blue), | 2071 | set_redblue(gspca_dev, v4l2_ctrl_g_ctrl(sd->blue), |
2068 | v4l2_ctrl_g_ctrl(sd->red)); | 2072 | v4l2_ctrl_g_ctrl(sd->red)); |
2069 | set_gain(gspca_dev, v4l2_ctrl_g_ctrl(sd->gain)); | 2073 | if (sd->gain) |
2070 | set_exposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure)); | 2074 | set_gain(gspca_dev, v4l2_ctrl_g_ctrl(sd->gain)); |
2071 | set_hvflip(gspca_dev, v4l2_ctrl_g_ctrl(sd->hflip), | 2075 | if (sd->exposure) |
2072 | v4l2_ctrl_g_ctrl(sd->vflip)); | 2076 | set_exposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure)); |
2077 | if (sd->hflip) | ||
2078 | set_hvflip(gspca_dev, v4l2_ctrl_g_ctrl(sd->hflip), | ||
2079 | v4l2_ctrl_g_ctrl(sd->vflip)); | ||
2073 | 2080 | ||
2074 | reg_w1(gspca_dev, 0x1007, 0x20); | 2081 | reg_w1(gspca_dev, 0x1007, 0x20); |
2075 | reg_w1(gspca_dev, 0x1061, 0x03); | 2082 | reg_w1(gspca_dev, 0x1061, 0x03); |
@@ -2172,7 +2179,7 @@ static void sd_dqcallback(struct gspca_dev *gspca_dev) | |||
2172 | struct sd *sd = (struct sd *) gspca_dev; | 2179 | struct sd *sd = (struct sd *) gspca_dev; |
2173 | int avg_lum; | 2180 | int avg_lum; |
2174 | 2181 | ||
2175 | if (!v4l2_ctrl_g_ctrl(sd->autogain)) | 2182 | if (sd->autogain == NULL || !v4l2_ctrl_g_ctrl(sd->autogain)) |
2176 | return; | 2183 | return; |
2177 | 2184 | ||
2178 | avg_lum = atomic_read(&sd->avg_lum); | 2185 | avg_lum = atomic_read(&sd->avg_lum); |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 4d1696d1a7f4..f38faa9b37c3 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -3120,7 +3120,7 @@ static const struct sd_desc sd_desc = { | |||
3120 | | (SENSOR_ ## sensor << 8) \ | 3120 | | (SENSOR_ ## sensor << 8) \ |
3121 | | (flags) | 3121 | | (flags) |
3122 | static const struct usb_device_id device_table[] = { | 3122 | static const struct usb_device_id device_table[] = { |
3123 | {USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)}, | 3123 | {USB_DEVICE(0x0458, 0x7025), BSF(SN9C120, MI0360B, F_PDN_INV)}, |
3124 | {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)}, | 3124 | {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)}, |
3125 | {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)}, | 3125 | {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)}, |
3126 | {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)}, | 3126 | {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)}, |