diff options
Diffstat (limited to 'drivers/media/video/gspca/spca506.c')
-rw-r--r-- | drivers/media/video/gspca/spca506.c | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/drivers/media/video/gspca/spca506.c b/drivers/media/video/gspca/spca506.c index 614fb3ad7711..2d249b00bdcd 100644 --- a/drivers/media/video/gspca/spca506.c +++ b/drivers/media/video/gspca/spca506.c | |||
@@ -25,8 +25,8 @@ | |||
25 | 25 | ||
26 | #include "gspca.h" | 26 | #include "gspca.h" |
27 | 27 | ||
28 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 28 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5) |
29 | static const char version[] = "2.1.0"; | 29 | static const char version[] = "2.1.5"; |
30 | 30 | ||
31 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 31 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
32 | MODULE_DESCRIPTION("GSPCA/SPCA506 USB Camera Driver"); | 32 | MODULE_DESCRIPTION("GSPCA/SPCA506 USB Camera Driver"); |
@@ -34,11 +34,11 @@ MODULE_LICENSE("GPL"); | |||
34 | 34 | ||
35 | /* specific webcam descriptor */ | 35 | /* specific webcam descriptor */ |
36 | struct sd { | 36 | struct sd { |
37 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 37 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
38 | 38 | ||
39 | int buflen; | 39 | int buflen; |
40 | unsigned char tmpbuf[640 * 480 * 3]; /* YYUV per line */ | 40 | __u8 tmpbuf[640 * 480 * 3]; /* YYUV per line */ |
41 | unsigned char tmpbuf2[640 * 480 * 2]; /* YUYV */ | 41 | __u8 tmpbuf2[640 * 480 * 2]; /* YUYV */ |
42 | 42 | ||
43 | unsigned char brightness; | 43 | unsigned char brightness; |
44 | unsigned char contrast; | 44 | unsigned char contrast; |
@@ -117,12 +117,32 @@ static struct ctrl sd_ctrls[] = { | |||
117 | }, | 117 | }, |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct cam_mode vga_mode[] = { | 120 | static struct v4l2_pix_format vga_mode[] = { |
121 | {V4L2_PIX_FMT_YUYV, 160, 120, 5}, | 121 | {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, |
122 | {V4L2_PIX_FMT_YUYV, 176, 144, 4}, | 122 | .bytesperline = 160 * 2, |
123 | {V4L2_PIX_FMT_YUYV, 320, 240, 2}, | 123 | .sizeimage = 160 * 120 * 2, |
124 | {V4L2_PIX_FMT_YUYV, 352, 288, 1}, | 124 | .colorspace = V4L2_COLORSPACE_SRGB, |
125 | {V4L2_PIX_FMT_YUYV, 640, 480, 0}, | 125 | .priv = 5}, |
126 | {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, | ||
127 | .bytesperline = 176 * 2, | ||
128 | .sizeimage = 176 * 144 * 2, | ||
129 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
130 | .priv = 4}, | ||
131 | {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, | ||
132 | .bytesperline = 320 * 2, | ||
133 | .sizeimage = 320 * 240 * 2, | ||
134 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
135 | .priv = 2}, | ||
136 | {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, | ||
137 | .bytesperline = 352 * 2, | ||
138 | .sizeimage = 352 * 288 * 2, | ||
139 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
140 | .priv = 1}, | ||
141 | {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, | ||
142 | .bytesperline = 640 * 2, | ||
143 | .sizeimage = 640 * 480 * 2, | ||
144 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
145 | .priv = 0}, | ||
126 | }; | 146 | }; |
127 | 147 | ||
128 | #define SPCA50X_OFFSET_DATA 10 | 148 | #define SPCA50X_OFFSET_DATA 10 |
@@ -169,7 +189,7 @@ static void spca506_WriteI2c(struct gspca_dev *gspca_dev, __u16 valeur, | |||
169 | __u16 reg) | 189 | __u16 reg) |
170 | { | 190 | { |
171 | int retry = 60; | 191 | int retry = 60; |
172 | unsigned char Data[2]; | 192 | __u8 Data[2]; |
173 | 193 | ||
174 | reg_w(gspca_dev->dev, 0x07, reg, 0x0001); | 194 | reg_w(gspca_dev->dev, 0x07, reg, 0x0001); |
175 | reg_w(gspca_dev->dev, 0x07, valeur, 0x0000); | 195 | reg_w(gspca_dev->dev, 0x07, valeur, 0x0000); |
@@ -183,8 +203,8 @@ static void spca506_WriteI2c(struct gspca_dev *gspca_dev, __u16 valeur, | |||
183 | static int spca506_ReadI2c(struct gspca_dev *gspca_dev, __u16 reg) | 203 | static int spca506_ReadI2c(struct gspca_dev *gspca_dev, __u16 reg) |
184 | { | 204 | { |
185 | int retry = 60; | 205 | int retry = 60; |
186 | unsigned char Data[2]; | 206 | __u8 Data[2]; |
187 | unsigned char value; | 207 | __u8 value; |
188 | 208 | ||
189 | reg_w(gspca_dev->dev, 0x07, SAA7113_I2C_BASE_WRITE, 0x0004); | 209 | reg_w(gspca_dev->dev, 0x07, SAA7113_I2C_BASE_WRITE, 0x0004); |
190 | reg_w(gspca_dev->dev, 0x07, reg, 0x0001); | 210 | reg_w(gspca_dev->dev, 0x07, reg, 0x0001); |
@@ -513,7 +533,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
513 | reg_w(dev, 0x05, 0x00, 0x0004); | 533 | reg_w(dev, 0x05, 0x00, 0x0004); |
514 | reg_w(dev, 0x03, 0x10, 0x0001); | 534 | reg_w(dev, 0x03, 0x10, 0x0001); |
515 | reg_w(dev, 0x03, 0x78, 0x0000); | 535 | reg_w(dev, 0x03, 0x78, 0x0000); |
516 | switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { | 536 | switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) { |
517 | case 0: | 537 | case 0: |
518 | spca506_Setsize(gspca_dev, 0, 0x10, 0x10); | 538 | spca506_Setsize(gspca_dev, 0, 0x10, 0x10); |
519 | break; | 539 | break; |
@@ -593,7 +613,7 @@ static void yyuv_decode(unsigned char *out, | |||
593 | 613 | ||
594 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 614 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
595 | struct gspca_frame *frame, /* target */ | 615 | struct gspca_frame *frame, /* target */ |
596 | unsigned char *data, /* isoc packet */ | 616 | __u8 *data, /* isoc packet */ |
597 | int len) /* iso packet length */ | 617 | int len) /* iso packet length */ |
598 | { | 618 | { |
599 | struct sd *sd = (struct sd *) gspca_dev; | 619 | struct sd *sd = (struct sd *) gspca_dev; |