diff options
Diffstat (limited to 'drivers/media/video/gspca/vc032x.c')
-rw-r--r-- | drivers/media/video/gspca/vc032x.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index f4a52956e0d9..bd4c226c9a07 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -69,6 +69,7 @@ static struct ctrl sd_ctrls[] = { | |||
69 | .set = sd_setautogain, | 69 | .set = sd_setautogain, |
70 | .get = sd_getautogain, | 70 | .get = sd_getautogain, |
71 | }, | 71 | }, |
72 | #define LIGHTFREQ_IDX 1 | ||
72 | { | 73 | { |
73 | { | 74 | { |
74 | .id = V4L2_CID_POWER_LINE_FREQUENCY, | 75 | .id = V4L2_CID_POWER_LINE_FREQUENCY, |
@@ -87,12 +88,12 @@ static struct ctrl sd_ctrls[] = { | |||
87 | }; | 88 | }; |
88 | 89 | ||
89 | static struct v4l2_pix_format vc0321_mode[] = { | 90 | static struct v4l2_pix_format vc0321_mode[] = { |
90 | {320, 240, V4L2_PIX_FMT_YUV420, V4L2_FIELD_NONE, | 91 | {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE, |
91 | .bytesperline = 320, | 92 | .bytesperline = 320, |
92 | .sizeimage = 320 * 240 * 2, | 93 | .sizeimage = 320 * 240 * 2, |
93 | .colorspace = V4L2_COLORSPACE_SRGB, | 94 | .colorspace = V4L2_COLORSPACE_SRGB, |
94 | .priv = 1}, | 95 | .priv = 1}, |
95 | {640, 480, V4L2_PIX_FMT_YUV420, V4L2_FIELD_NONE, | 96 | {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE, |
96 | .bytesperline = 640, | 97 | .bytesperline = 640, |
97 | .sizeimage = 640 * 480 * 2, | 98 | .sizeimage = 640 * 480 * 2, |
98 | .colorspace = V4L2_COLORSPACE_SRGB, | 99 | .colorspace = V4L2_COLORSPACE_SRGB, |
@@ -1463,6 +1464,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1463 | sd->qindex = 7; | 1464 | sd->qindex = 7; |
1464 | sd->autogain = AUTOGAIN_DEF; | 1465 | sd->autogain = AUTOGAIN_DEF; |
1465 | sd->lightfreq = FREQ_DEF; | 1466 | sd->lightfreq = FREQ_DEF; |
1467 | if (sd->sensor != SENSOR_OV7670) | ||
1468 | gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX); | ||
1466 | 1469 | ||
1467 | if (sd->bridge == BRIDGE_VC0321) { | 1470 | if (sd->bridge == BRIDGE_VC0321) { |
1468 | reg_r(gspca_dev, 0x8a, 0, 3); | 1471 | reg_r(gspca_dev, 0x8a, 0, 3); |
@@ -1474,8 +1477,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1474 | return 0; | 1477 | return 0; |
1475 | } | 1478 | } |
1476 | 1479 | ||
1477 | /* this function is called at open time */ | 1480 | /* this function is called at probe and time */ |
1478 | static int sd_open(struct gspca_dev *gspca_dev) | 1481 | static int sd_init(struct gspca_dev *gspca_dev) |
1479 | { | 1482 | { |
1480 | return 0; | 1483 | return 0; |
1481 | } | 1484 | } |
@@ -1637,19 +1640,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
1637 | reg_w(dev, 0x89, 0xffff, 0xffff); | 1640 | reg_w(dev, 0x89, 0xffff, 0xffff); |
1638 | } | 1641 | } |
1639 | 1642 | ||
1640 | /* this function is called at close time */ | ||
1641 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1642 | { | ||
1643 | /* struct usb_device *dev = gspca_dev->dev; | ||
1644 | __u8 buffread; | ||
1645 | |||
1646 | reg_w(dev, 0x89, 0xffff, 0xffff); | ||
1647 | reg_w(dev, 0xa0, 0x01, 0xb301); | ||
1648 | reg_w(dev, 0xa0, 0x09, 0xb303); | ||
1649 | reg_w(dev, 0x89, 0xffff, 0xffff); | ||
1650 | */ | ||
1651 | } | ||
1652 | |||
1653 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1643 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1654 | struct gspca_frame *frame, /* target */ | 1644 | struct gspca_frame *frame, /* target */ |
1655 | __u8 *data, /* isoc packet */ | 1645 | __u8 *data, /* isoc packet */ |
@@ -1738,11 +1728,10 @@ static const struct sd_desc sd_desc = { | |||
1738 | .ctrls = sd_ctrls, | 1728 | .ctrls = sd_ctrls, |
1739 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1729 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1740 | .config = sd_config, | 1730 | .config = sd_config, |
1741 | .open = sd_open, | 1731 | .init = sd_init, |
1742 | .start = sd_start, | 1732 | .start = sd_start, |
1743 | .stopN = sd_stopN, | 1733 | .stopN = sd_stopN, |
1744 | .stop0 = sd_stop0, | 1734 | .stop0 = sd_stop0, |
1745 | .close = sd_close, | ||
1746 | .pkt_scan = sd_pkt_scan, | 1735 | .pkt_scan = sd_pkt_scan, |
1747 | .querymenu = sd_querymenu, | 1736 | .querymenu = sd_querymenu, |
1748 | }; | 1737 | }; |
@@ -1774,6 +1763,10 @@ static struct usb_driver sd_driver = { | |||
1774 | .id_table = device_table, | 1763 | .id_table = device_table, |
1775 | .probe = sd_probe, | 1764 | .probe = sd_probe, |
1776 | .disconnect = gspca_disconnect, | 1765 | .disconnect = gspca_disconnect, |
1766 | #ifdef CONFIG_PM | ||
1767 | .suspend = gspca_suspend, | ||
1768 | .resume = gspca_resume, | ||
1769 | #endif | ||
1777 | }; | 1770 | }; |
1778 | 1771 | ||
1779 | /* -- module insert / remove -- */ | 1772 | /* -- module insert / remove -- */ |