diff options
Diffstat (limited to 'drivers/media/video/gspca/t613.c')
-rw-r--r-- | drivers/media/video/gspca/t613.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index 91b555c34c68..f034c748fc7e 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #define MAX_GAMMA 0x10 /* 0 to 15 */ | 31 | #define MAX_GAMMA 0x10 /* 0 to 15 */ |
32 | 32 | ||
33 | #define V4L2_CID_EFFECTS (V4L2_CID_PRIVATE_BASE + 3) | 33 | #define V4L2_CID_EFFECTS (V4L2_CID_PRIVATE_BASE + 0) |
34 | 34 | ||
35 | MODULE_AUTHOR("Leandro Costantino <le_costantino@pixartargentina.com.ar>"); | 35 | MODULE_AUTHOR("Leandro Costantino <le_costantino@pixartargentina.com.ar>"); |
36 | MODULE_DESCRIPTION("GSPCA/T613 (JPEG Compliance) USB Camera Driver"); | 36 | MODULE_DESCRIPTION("GSPCA/T613 (JPEG Compliance) USB Camera Driver"); |
@@ -233,7 +233,7 @@ static char *effects_control[] = { | |||
233 | static struct v4l2_pix_format vga_mode_t16[] = { | 233 | static struct v4l2_pix_format vga_mode_t16[] = { |
234 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 234 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
235 | .bytesperline = 160, | 235 | .bytesperline = 160, |
236 | .sizeimage = 160 * 120 * 3 / 8 + 590, | 236 | .sizeimage = 160 * 120 * 4 / 8 + 590, |
237 | .colorspace = V4L2_COLORSPACE_JPEG, | 237 | .colorspace = V4L2_COLORSPACE_JPEG, |
238 | .priv = 4}, | 238 | .priv = 4}, |
239 | {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 239 | {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
@@ -391,7 +391,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
391 | NULL, 0, 500); | 391 | NULL, 0, 500); |
392 | return; | 392 | return; |
393 | } | 393 | } |
394 | if (len <= sizeof gspca_dev->usb_buf) { | 394 | if (len <= USB_BUF_SZ) { |
395 | memcpy(gspca_dev->usb_buf, buffer, len); | 395 | memcpy(gspca_dev->usb_buf, buffer, len); |
396 | usb_control_msg(gspca_dev->dev, | 396 | usb_control_msg(gspca_dev->dev, |
397 | usb_sndctrlpipe(gspca_dev->dev, 0), | 397 | usb_sndctrlpipe(gspca_dev->dev, 0), |
@@ -552,6 +552,13 @@ static int init_default_parameters(struct gspca_dev *gspca_dev) | |||
552 | return 0; | 552 | return 0; |
553 | } | 553 | } |
554 | 554 | ||
555 | /* this function is called at probe and resume time */ | ||
556 | static int sd_init(struct gspca_dev *gspca_dev) | ||
557 | { | ||
558 | init_default_parameters(gspca_dev); | ||
559 | return 0; | ||
560 | } | ||
561 | |||
555 | static void setbrightness(struct gspca_dev *gspca_dev) | 562 | static void setbrightness(struct gspca_dev *gspca_dev) |
556 | { | 563 | { |
557 | struct sd *sd = (struct sd *) gspca_dev; | 564 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -893,18 +900,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
893 | setcolors(gspca_dev); | 900 | setcolors(gspca_dev); |
894 | } | 901 | } |
895 | 902 | ||
896 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
897 | { | ||
898 | } | ||
899 | |||
900 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
901 | { | ||
902 | } | ||
903 | |||
904 | static void sd_close(struct gspca_dev *gspca_dev) | ||
905 | { | ||
906 | } | ||
907 | |||
908 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 903 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
909 | struct gspca_frame *frame, /* target */ | 904 | struct gspca_frame *frame, /* target */ |
910 | __u8 *data, /* isoc packet */ | 905 | __u8 *data, /* isoc packet */ |
@@ -972,24 +967,14 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
972 | return -EINVAL; | 967 | return -EINVAL; |
973 | } | 968 | } |
974 | 969 | ||
975 | /* this function is called at open time */ | ||
976 | static int sd_open(struct gspca_dev *gspca_dev) | ||
977 | { | ||
978 | init_default_parameters(gspca_dev); | ||
979 | return 0; | ||
980 | } | ||
981 | |||
982 | /* sub-driver description */ | 970 | /* sub-driver description */ |
983 | static const struct sd_desc sd_desc = { | 971 | static const struct sd_desc sd_desc = { |
984 | .name = MODULE_NAME, | 972 | .name = MODULE_NAME, |
985 | .ctrls = sd_ctrls, | 973 | .ctrls = sd_ctrls, |
986 | .nctrls = ARRAY_SIZE(sd_ctrls), | 974 | .nctrls = ARRAY_SIZE(sd_ctrls), |
987 | .config = sd_config, | 975 | .config = sd_config, |
988 | .open = sd_open, | 976 | .init = sd_init, |
989 | .start = sd_start, | 977 | .start = sd_start, |
990 | .stopN = sd_stopN, | ||
991 | .stop0 = sd_stop0, | ||
992 | .close = sd_close, | ||
993 | .pkt_scan = sd_pkt_scan, | 978 | .pkt_scan = sd_pkt_scan, |
994 | .querymenu = sd_querymenu, | 979 | .querymenu = sd_querymenu, |
995 | }; | 980 | }; |
@@ -1014,6 +999,10 @@ static struct usb_driver sd_driver = { | |||
1014 | .id_table = device_table, | 999 | .id_table = device_table, |
1015 | .probe = sd_probe, | 1000 | .probe = sd_probe, |
1016 | .disconnect = gspca_disconnect, | 1001 | .disconnect = gspca_disconnect, |
1002 | #ifdef CONFIG_PM | ||
1003 | .suspend = gspca_suspend, | ||
1004 | .resume = gspca_resume, | ||
1005 | #endif | ||
1017 | }; | 1006 | }; |
1018 | 1007 | ||
1019 | /* -- module insert / remove -- */ | 1008 | /* -- module insert / remove -- */ |