aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac7311.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/pac7311.c')
-rw-r--r--drivers/media/video/gspca/pac7311.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index 14cc49a4c2cc..c2d4b6a4dcf4 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -23,8 +23,8 @@
23 23
24#include "gspca.h" 24#include "gspca.h"
25 25
26#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) 26#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4)
27static const char version[] = "2.1.3"; 27static const char version[] = "2.1.4";
28 28
29MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li"); 29MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li");
30MODULE_DESCRIPTION("Pixart PAC7311"); 30MODULE_DESCRIPTION("Pixart PAC7311");
@@ -37,7 +37,6 @@ struct sd {
37 int avg_lum; 37 int avg_lum;
38 38
39 unsigned char brightness; 39 unsigned char brightness;
40#define BRIGHTNESS_MAX 0x20
41 unsigned char contrast; 40 unsigned char contrast;
42 unsigned char colors; 41 unsigned char colors;
43 unsigned char autogain; 42 unsigned char autogain;
@@ -58,21 +57,21 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
58static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); 57static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
59 58
60static struct ctrl sd_ctrls[] = { 59static struct ctrl sd_ctrls[] = {
61#define SD_BRIGHTNESS 0
62 { 60 {
63 { 61 {
64 .id = V4L2_CID_BRIGHTNESS, 62 .id = V4L2_CID_BRIGHTNESS,
65 .type = V4L2_CTRL_TYPE_INTEGER, 63 .type = V4L2_CTRL_TYPE_INTEGER,
66 .name = "Brightness", 64 .name = "Brightness",
67 .minimum = 0, 65 .minimum = 0,
66#define BRIGHTNESS_MAX 0x20
68 .maximum = BRIGHTNESS_MAX, 67 .maximum = BRIGHTNESS_MAX,
69 .step = 1, 68 .step = 1,
70 .default_value = 0x10, 69#define BRIGHTNESS_DEF 0x10
70 .default_value = BRIGHTNESS_DEF,
71 }, 71 },
72 .set = sd_setbrightness, 72 .set = sd_setbrightness,
73 .get = sd_getbrightness, 73 .get = sd_getbrightness,
74 }, 74 },
75#define SD_CONTRAST 1
76 { 75 {
77 { 76 {
78 .id = V4L2_CID_CONTRAST, 77 .id = V4L2_CID_CONTRAST,
@@ -81,12 +80,12 @@ static struct ctrl sd_ctrls[] = {
81 .minimum = 0, 80 .minimum = 0,
82 .maximum = 255, 81 .maximum = 255,
83 .step = 1, 82 .step = 1,
84 .default_value = 127, 83#define CONTRAST_DEF 127
84 .default_value = CONTRAST_DEF,
85 }, 85 },
86 .set = sd_setcontrast, 86 .set = sd_setcontrast,
87 .get = sd_getcontrast, 87 .get = sd_getcontrast,
88 }, 88 },
89#define SD_COLOR 2
90 { 89 {
91 { 90 {
92 .id = V4L2_CID_SATURATION, 91 .id = V4L2_CID_SATURATION,
@@ -95,12 +94,12 @@ static struct ctrl sd_ctrls[] = {
95 .minimum = 0, 94 .minimum = 0,
96 .maximum = 255, 95 .maximum = 255,
97 .step = 1, 96 .step = 1,
98 .default_value = 127, 97#define COLOR_DEF 127
98 .default_value = COLOR_DEF,
99 }, 99 },
100 .set = sd_setcolors, 100 .set = sd_setcolors,
101 .get = sd_getcolors, 101 .get = sd_getcolors,
102 }, 102 },
103#define SD_AUTOGAIN 3
104 { 103 {
105 { 104 {
106 .id = V4L2_CID_AUTOGAIN, 105 .id = V4L2_CID_AUTOGAIN,
@@ -109,7 +108,8 @@ static struct ctrl sd_ctrls[] = {
109 .minimum = 0, 108 .minimum = 0,
110 .maximum = 1, 109 .maximum = 1,
111 .step = 1, 110 .step = 1,
112 .default_value = 1, 111#define AUTOGAIN_DEF 1
112 .default_value = AUTOGAIN_DEF,
113 }, 113 },
114 .set = sd_setautogain, 114 .set = sd_setautogain,
115 .get = sd_getautogain, 115 .get = sd_getautogain,
@@ -124,7 +124,7 @@ static struct cam_mode vga_mode[] = {
124 124
125#define PAC7311_JPEG_HEADER_SIZE (sizeof pac7311_jpeg_header) /* (594) */ 125#define PAC7311_JPEG_HEADER_SIZE (sizeof pac7311_jpeg_header) /* (594) */
126 126
127const unsigned char pac7311_jpeg_header[] = { 127static const __u8 pac7311_jpeg_header[] = {
128 0xff, 0xd8, 128 0xff, 0xd8,
129 0xff, 0xe0, 0x00, 0x03, 0x20, 129 0xff, 0xe0, 0x00, 0x03, 0x20,
130 0xff, 0xc0, 0x00, 0x11, 0x08, 130 0xff, 0xc0, 0x00, 0x11, 0x08,
@@ -195,8 +195,8 @@ const unsigned char pac7311_jpeg_header[] = {
195}; 195};
196 196
197static void reg_w(struct usb_device *dev, 197static void reg_w(struct usb_device *dev,
198 __u16 index, 198 __u16 index,
199 char *buffer, __u16 len) 199 const char *buffer, __u16 len)
200{ 200{
201 __u8 tmpbuf[8]; 201 __u8 tmpbuf[8];
202 202
@@ -263,10 +263,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
263 cam->cam_mode = vga_mode; 263 cam->cam_mode = vga_mode;
264 cam->nmodes = ARRAY_SIZE(vga_mode); 264 cam->nmodes = ARRAY_SIZE(vga_mode);
265 265
266 sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; 266 sd->brightness = BRIGHTNESS_DEF;
267 sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; 267 sd->contrast = CONTRAST_DEF;
268 sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; 268 sd->colors = COLOR_DEF;
269 sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; 269 sd->autogain = AUTOGAIN_DEF;
270 return 0; 270 return 0;
271} 271}
272 272
@@ -278,7 +278,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)
278/*jfm: inverted?*/ 278/*jfm: inverted?*/
279 brightness = BRIGHTNESS_MAX - sd->brightness; 279 brightness = BRIGHTNESS_MAX - sd->brightness;
280 pac7311_reg_write(gspca_dev->dev, 0xff, 0x04); 280 pac7311_reg_write(gspca_dev->dev, 0xff, 0x04);
281 /* pac7311_reg_write(gspca_dev->dev, 0x0e, 0x00); */ 281/* pac7311_reg_write(gspca_dev->dev, 0x0e, 0x00); */
282 pac7311_reg_write(gspca_dev->dev, 0x0f, brightness); 282 pac7311_reg_write(gspca_dev->dev, 0x0f, brightness);
283 /* load registers to sensor (Bit 0, auto clear) */ 283 /* load registers to sensor (Bit 0, auto clear) */
284 pac7311_reg_write(gspca_dev->dev, 0x11, 0x01); 284 pac7311_reg_write(gspca_dev->dev, 0x11, 0x01);
@@ -502,7 +502,7 @@ static void setautogain(struct gspca_dev *gspca_dev, int luma)
502 502
503static void sd_pkt_scan(struct gspca_dev *gspca_dev, 503static void sd_pkt_scan(struct gspca_dev *gspca_dev,
504 struct gspca_frame *frame, /* target */ 504 struct gspca_frame *frame, /* target */
505 unsigned char *data, /* isoc packet */ 505 __u8 *data, /* isoc packet */
506 int len) /* iso packet length */ 506 int len) /* iso packet length */
507{ 507{
508 struct sd *sd = (struct sd *) gspca_dev; 508 struct sd *sd = (struct sd *) gspca_dev;