diff options
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_po1030.h')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_po1030.h | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.h b/drivers/media/video/gspca/m5602/m5602_po1030.h index 68f34c97bf44..a0b75ff61d79 100644 --- a/drivers/media/video/gspca/m5602/m5602_po1030.h +++ b/drivers/media/video/gspca/m5602/m5602_po1030.h | |||
@@ -1,8 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the po1030 sensor. | 2 | * Driver for the po1030 sensor. |
3 | * This is probably a pixel plus sensor but we haven't identified it yet | ||
4 | * | 3 | * |
5 | * Copyright (c) 2008 Erik Andren | 4 | * Copyright (c) 2008 Erik Andrén |
6 | * Copyright (c) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project. | 5 | * Copyright (c) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project. |
7 | * Copyright (c) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br> | 6 | * Copyright (c) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br> |
8 | * | 7 | * |
@@ -109,10 +108,13 @@ | |||
109 | #define PO1030_REG_YCONTRAST 0x74 | 108 | #define PO1030_REG_YCONTRAST 0x74 |
110 | #define PO1030_REG_YSATURATION 0x75 | 109 | #define PO1030_REG_YSATURATION 0x75 |
111 | 110 | ||
111 | #define PO1030_HFLIP (1 << 7) | ||
112 | #define PO1030_VFLIP (1 << 6) | ||
113 | |||
112 | /*****************************************************************************/ | 114 | /*****************************************************************************/ |
113 | 115 | ||
114 | #define PO1030_GLOBAL_GAIN_DEFAULT 0x12 | 116 | #define PO1030_GLOBAL_GAIN_DEFAULT 0x12 |
115 | #define PO1030_EXPOSURE_DEFAULT 0xf0ff | 117 | #define PO1030_EXPOSURE_DEFAULT 0x0085 |
116 | #define PO1030_BLUE_GAIN_DEFAULT 0x40 | 118 | #define PO1030_BLUE_GAIN_DEFAULT 0x40 |
117 | #define PO1030_RED_GAIN_DEFAULT 0x40 | 119 | #define PO1030_RED_GAIN_DEFAULT 0x40 |
118 | 120 | ||
@@ -121,7 +123,6 @@ | |||
121 | /* Kernel module parameters */ | 123 | /* Kernel module parameters */ |
122 | extern int force_sensor; | 124 | extern int force_sensor; |
123 | extern int dump_sensor; | 125 | extern int dump_sensor; |
124 | extern unsigned int m5602_debug; | ||
125 | 126 | ||
126 | int po1030_probe(struct sd *sd); | 127 | int po1030_probe(struct sd *sd); |
127 | int po1030_init(struct sd *sd); | 128 | int po1030_init(struct sd *sd); |
@@ -142,6 +143,10 @@ int po1030_get_red_balance(struct gspca_dev *gspca_dev, __s32 *val); | |||
142 | int po1030_set_red_balance(struct gspca_dev *gspca_dev, __s32 val); | 143 | int po1030_set_red_balance(struct gspca_dev *gspca_dev, __s32 val); |
143 | int po1030_get_blue_balance(struct gspca_dev *gspca_dev, __s32 *val); | 144 | int po1030_get_blue_balance(struct gspca_dev *gspca_dev, __s32 *val); |
144 | int po1030_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val); | 145 | int po1030_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val); |
146 | int po1030_get_hflip(struct gspca_dev *gspca_dev, __s32 *val); | ||
147 | int po1030_set_hflip(struct gspca_dev *gspca_dev, __s32 val); | ||
148 | int po1030_get_vflip(struct gspca_dev *gspca_dev, __s32 *val); | ||
149 | int po1030_set_vflip(struct gspca_dev *gspca_dev, __s32 val); | ||
145 | 150 | ||
146 | static struct m5602_sensor po1030 = { | 151 | static struct m5602_sensor po1030 = { |
147 | .name = "PO1030", | 152 | .name = "PO1030", |
@@ -152,7 +157,7 @@ static struct m5602_sensor po1030 = { | |||
152 | .init = po1030_init, | 157 | .init = po1030_init, |
153 | .power_down = po1030_power_down, | 158 | .power_down = po1030_power_down, |
154 | 159 | ||
155 | .nctrls = 4, | 160 | .nctrls = 6, |
156 | .ctrls = { | 161 | .ctrls = { |
157 | { | 162 | { |
158 | { | 163 | { |
@@ -160,7 +165,7 @@ static struct m5602_sensor po1030 = { | |||
160 | .type = V4L2_CTRL_TYPE_INTEGER, | 165 | .type = V4L2_CTRL_TYPE_INTEGER, |
161 | .name = "gain", | 166 | .name = "gain", |
162 | .minimum = 0x00, | 167 | .minimum = 0x00, |
163 | .maximum = 0xff, | 168 | .maximum = 0x4f, |
164 | .step = 0x1, | 169 | .step = 0x1, |
165 | .default_value = PO1030_GLOBAL_GAIN_DEFAULT, | 170 | .default_value = PO1030_GLOBAL_GAIN_DEFAULT, |
166 | .flags = V4L2_CTRL_FLAG_SLIDER | 171 | .flags = V4L2_CTRL_FLAG_SLIDER |
@@ -173,7 +178,7 @@ static struct m5602_sensor po1030 = { | |||
173 | .type = V4L2_CTRL_TYPE_INTEGER, | 178 | .type = V4L2_CTRL_TYPE_INTEGER, |
174 | .name = "exposure", | 179 | .name = "exposure", |
175 | .minimum = 0x00, | 180 | .minimum = 0x00, |
176 | .maximum = 0xffff, | 181 | .maximum = 0x02ff, |
177 | .step = 0x1, | 182 | .step = 0x1, |
178 | .default_value = PO1030_EXPOSURE_DEFAULT, | 183 | .default_value = PO1030_EXPOSURE_DEFAULT, |
179 | .flags = V4L2_CTRL_FLAG_SLIDER | 184 | .flags = V4L2_CTRL_FLAG_SLIDER |
@@ -206,8 +211,33 @@ static struct m5602_sensor po1030 = { | |||
206 | }, | 211 | }, |
207 | .set = po1030_set_blue_balance, | 212 | .set = po1030_set_blue_balance, |
208 | .get = po1030_get_blue_balance | 213 | .get = po1030_get_blue_balance |
214 | }, { | ||
215 | { | ||
216 | .id = V4L2_CID_HFLIP, | ||
217 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
218 | .name = "horizontal flip", | ||
219 | .minimum = 0, | ||
220 | .maximum = 1, | ||
221 | .step = 1, | ||
222 | .default_value = 0, | ||
223 | }, | ||
224 | .set = po1030_set_hflip, | ||
225 | .get = po1030_get_hflip | ||
226 | }, { | ||
227 | { | ||
228 | .id = V4L2_CID_VFLIP, | ||
229 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
230 | .name = "vertical flip", | ||
231 | .minimum = 0, | ||
232 | .maximum = 1, | ||
233 | .step = 1, | ||
234 | .default_value = 0, | ||
235 | }, | ||
236 | .set = po1030_set_vflip, | ||
237 | .get = po1030_get_vflip | ||
209 | } | 238 | } |
210 | }, | 239 | }, |
240 | |||
211 | .nmodes = 1, | 241 | .nmodes = 1, |
212 | .modes = { | 242 | .modes = { |
213 | { | 243 | { |
@@ -381,7 +411,7 @@ static const unsigned char init_po1030[][4] = | |||
381 | 411 | ||
382 | /* Set the y window to 1 */ | 412 | /* Set the y window to 1 */ |
383 | {SENSOR, PO1030_REG_WINDOWY_H, 0x00}, | 413 | {SENSOR, PO1030_REG_WINDOWY_H, 0x00}, |
384 | {SENSOR, PO1030_REG_WINDOWX_L, 0x01}, | 414 | {SENSOR, PO1030_REG_WINDOWY_L, 0x01}, |
385 | 415 | ||
386 | {SENSOR, PO1030_REG_WINDOWWIDTH_H, 0x02}, | 416 | {SENSOR, PO1030_REG_WINDOWWIDTH_H, 0x02}, |
387 | {SENSOR, PO1030_REG_WINDOWWIDTH_L, 0x87}, | 417 | {SENSOR, PO1030_REG_WINDOWWIDTH_L, 0x87}, |