aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac207.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/pac207.c')
-rw-r--r--drivers/media/video/gspca/pac207.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index ab83d7b69348..b580af92d231 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -27,8 +27,8 @@
27 27
28#include "gspca.h" 28#include "gspca.h"
29 29
30#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) 30#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5)
31static const char version[] = "2.1.4"; 31static const char version[] = "2.1.5";
32 32
33MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>"); 33MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>");
34MODULE_DESCRIPTION("Pixart PAC207"); 34MODULE_DESCRIPTION("Pixart PAC207");
@@ -157,9 +157,18 @@ static struct ctrl sd_ctrls[] = {
157 }, 157 },
158}; 158};
159 159
160static struct cam_mode sif_mode[] = { 160static struct v4l2_pix_format sif_mode[] = {
161 {V4L2_PIX_FMT_PAC207, 176, 144, 1}, 161 {176, 144, V4L2_PIX_FMT_PAC207, V4L2_FIELD_NONE,
162 {V4L2_PIX_FMT_PAC207, 352, 288, 0}, 162 .bytesperline = 176,
163 .sizeimage = (176 + 2) * 144,
164 /* uncompressed, add 2 bytes / line for line header */
165 .colorspace = V4L2_COLORSPACE_SRGB,
166 .priv = 1},
167 {352, 288, V4L2_PIX_FMT_PAC207, V4L2_FIELD_NONE,
168 .bytesperline = 352,
169 .sizeimage = 352 * 288 / 2, /* compressed */
170 .colorspace = V4L2_COLORSPACE_SRGB,
171 .priv = 0},
163}; 172};
164 173
165static const __u8 pac207_sensor_init[][8] = { 174static const __u8 pac207_sensor_init[][8] = {
@@ -346,19 +355,6 @@ static void sd_close(struct gspca_dev *gspca_dev)
346{ 355{
347} 356}
348 357
349static int sd_get_buff_size_op(struct gspca_dev *gspca_dev, int mode)
350{
351 switch (gspca_dev->cam.cam_mode[mode].width) {
352 case 176: /* 176x144 */
353 /* uncompressed, add 2 bytes / line for line header */
354 return (176 + 2) * 144;
355 case 352: /* 352x288 */
356 /* compressed */
357 return 352 * 288 / 2;
358 }
359 return -EIO; /* should never happen */
360}
361
362/* auto gain and exposure algorithm based on the knee algorithm described here: 358/* auto gain and exposure algorithm based on the knee algorithm described here:
363 * <http://ytse.tricolour.net/docs/LowLightOptimization.html> */ 359 * <http://ytse.tricolour.net/docs/LowLightOptimization.html> */
364static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) 360static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
@@ -632,7 +628,6 @@ static const struct sd_desc sd_desc = {
632 .close = sd_close, 628 .close = sd_close,
633 .dq_callback = pac207_do_auto_gain, 629 .dq_callback = pac207_do_auto_gain,
634 .pkt_scan = sd_pkt_scan, 630 .pkt_scan = sd_pkt_scan,
635 .get_buff_size = sd_get_buff_size_op,
636}; 631};
637 632
638/* -- module initialisation -- */ 633/* -- module initialisation -- */