Commit | Line | Data |
---|---|---|
77110abb RJ |
1 | /* |
2 | * Driver for MT9M111 CMOS Image Sensor from Micron | |
3 | * | |
4 | * Copyright (C) 2008, Robert Jarzmik <robert.jarzmik@free.fr> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | */ | |
10 | #include <linux/videodev2.h> | |
11 | #include <linux/slab.h> | |
12 | #include <linux/i2c.h> | |
13 | #include <linux/log2.h> | |
14 | #include <linux/gpio.h> | |
15 | #include <linux/delay.h> | |
16 | ||
17 | #include <media/v4l2-common.h> | |
18 | #include <media/v4l2-chip-ident.h> | |
19 | #include <media/soc_camera.h> | |
20 | ||
21 | /* | |
22 | * mt9m111 i2c address is 0x5d or 0x48 (depending on SAddr pin) | |
23 | * The platform has to define i2c_board_info and call i2c_register_board_info() | |
24 | */ | |
25 | ||
26 | /* mt9m111: Sensor register addresses */ | |
27 | #define MT9M111_CHIP_VERSION 0x000 | |
28 | #define MT9M111_ROW_START 0x001 | |
29 | #define MT9M111_COLUMN_START 0x002 | |
30 | #define MT9M111_WINDOW_HEIGHT 0x003 | |
31 | #define MT9M111_WINDOW_WIDTH 0x004 | |
32 | #define MT9M111_HORIZONTAL_BLANKING_B 0x005 | |
33 | #define MT9M111_VERTICAL_BLANKING_B 0x006 | |
34 | #define MT9M111_HORIZONTAL_BLANKING_A 0x007 | |
35 | #define MT9M111_VERTICAL_BLANKING_A 0x008 | |
36 | #define MT9M111_SHUTTER_WIDTH 0x009 | |
37 | #define MT9M111_ROW_SPEED 0x00a | |
38 | #define MT9M111_EXTRA_DELAY 0x00b | |
39 | #define MT9M111_SHUTTER_DELAY 0x00c | |
40 | #define MT9M111_RESET 0x00d | |
41 | #define MT9M111_READ_MODE_B 0x020 | |
42 | #define MT9M111_READ_MODE_A 0x021 | |
43 | #define MT9M111_FLASH_CONTROL 0x023 | |
44 | #define MT9M111_GREEN1_GAIN 0x02b | |
45 | #define MT9M111_BLUE_GAIN 0x02c | |
46 | #define MT9M111_RED_GAIN 0x02d | |
47 | #define MT9M111_GREEN2_GAIN 0x02e | |
48 | #define MT9M111_GLOBAL_GAIN 0x02f | |
49 | #define MT9M111_CONTEXT_CONTROL 0x0c8 | |
50 | #define MT9M111_PAGE_MAP 0x0f0 | |
51 | #define MT9M111_BYTE_WISE_ADDR 0x0f1 | |
52 | ||
53 | #define MT9M111_RESET_SYNC_CHANGES (1 << 15) | |
54 | #define MT9M111_RESET_RESTART_BAD_FRAME (1 << 9) | |
55 | #define MT9M111_RESET_SHOW_BAD_FRAMES (1 << 8) | |
56 | #define MT9M111_RESET_RESET_SOC (1 << 5) | |
57 | #define MT9M111_RESET_OUTPUT_DISABLE (1 << 4) | |
58 | #define MT9M111_RESET_CHIP_ENABLE (1 << 3) | |
59 | #define MT9M111_RESET_ANALOG_STANDBY (1 << 2) | |
60 | #define MT9M111_RESET_RESTART_FRAME (1 << 1) | |
61 | #define MT9M111_RESET_RESET_MODE (1 << 0) | |
62 | ||
63 | #define MT9M111_RMB_MIRROR_COLS (1 << 1) | |
64 | #define MT9M111_RMB_MIRROR_ROWS (1 << 0) | |
65 | #define MT9M111_CTXT_CTRL_RESTART (1 << 15) | |
66 | #define MT9M111_CTXT_CTRL_DEFECTCOR_B (1 << 12) | |
67 | #define MT9M111_CTXT_CTRL_RESIZE_B (1 << 10) | |
68 | #define MT9M111_CTXT_CTRL_CTRL2_B (1 << 9) | |
69 | #define MT9M111_CTXT_CTRL_GAMMA_B (1 << 8) | |
70 | #define MT9M111_CTXT_CTRL_XENON_EN (1 << 7) | |
71 | #define MT9M111_CTXT_CTRL_READ_MODE_B (1 << 3) | |
72 | #define MT9M111_CTXT_CTRL_LED_FLASH_EN (1 << 2) | |
73 | #define MT9M111_CTXT_CTRL_VBLANK_SEL_B (1 << 1) | |
74 | #define MT9M111_CTXT_CTRL_HBLANK_SEL_B (1 << 0) | |
75 | /* | |
76 | * mt9m111: Colorpipe register addresses (0x100..0x1ff) | |
77 | */ | |
78 | #define MT9M111_OPER_MODE_CTRL 0x106 | |
79 | #define MT9M111_OUTPUT_FORMAT_CTRL 0x108 | |
80 | #define MT9M111_REDUCER_XZOOM_B 0x1a0 | |
81 | #define MT9M111_REDUCER_XSIZE_B 0x1a1 | |
82 | #define MT9M111_REDUCER_YZOOM_B 0x1a3 | |
83 | #define MT9M111_REDUCER_YSIZE_B 0x1a4 | |
84 | #define MT9M111_REDUCER_XZOOM_A 0x1a6 | |
85 | #define MT9M111_REDUCER_XSIZE_A 0x1a7 | |
86 | #define MT9M111_REDUCER_YZOOM_A 0x1a9 | |
87 | #define MT9M111_REDUCER_YSIZE_A 0x1aa | |
88 | ||
89 | #define MT9M111_OUTPUT_FORMAT_CTRL2_A 0x13a | |
90 | #define MT9M111_OUTPUT_FORMAT_CTRL2_B 0x19b | |
91 | ||
92 | #define MT9M111_OPMODE_AUTOEXPO_EN (1 << 14) | |
93 | ||
94 | ||
95 | #define MT9M111_OUTFMT_PROCESSED_BAYER (1 << 14) | |
96 | #define MT9M111_OUTFMT_BYPASS_IFP (1 << 10) | |
97 | #define MT9M111_OUTFMT_INV_PIX_CLOCK (1 << 9) | |
98 | #define MT9M111_OUTFMT_RGB (1 << 8) | |
99 | #define MT9M111_OUTFMT_RGB565 (0x0 << 6) | |
100 | #define MT9M111_OUTFMT_RGB555 (0x1 << 6) | |
101 | #define MT9M111_OUTFMT_RGB444x (0x2 << 6) | |
102 | #define MT9M111_OUTFMT_RGBx444 (0x3 << 6) | |
103 | #define MT9M111_OUTFMT_TST_RAMP_OFF (0x0 << 4) | |
104 | #define MT9M111_OUTFMT_TST_RAMP_COL (0x1 << 4) | |
105 | #define MT9M111_OUTFMT_TST_RAMP_ROW (0x2 << 4) | |
106 | #define MT9M111_OUTFMT_TST_RAMP_FRAME (0x3 << 4) | |
107 | #define MT9M111_OUTFMT_SHIFT_3_UP (1 << 3) | |
108 | #define MT9M111_OUTFMT_AVG_CHROMA (1 << 2) | |
109 | #define MT9M111_OUTFMT_SWAP_YCbCr_C_Y (1 << 1) | |
110 | #define MT9M111_OUTFMT_SWAP_RGB_EVEN (1 << 1) | |
111 | #define MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr (1 << 0) | |
112 | /* | |
113 | * mt9m111: Camera control register addresses (0x200..0x2ff not implemented) | |
114 | */ | |
115 | ||
116 | #define reg_read(reg) mt9m111_reg_read(icd, MT9M111_##reg) | |
117 | #define reg_write(reg, val) mt9m111_reg_write(icd, MT9M111_##reg, (val)) | |
118 | #define reg_set(reg, val) mt9m111_reg_set(icd, MT9M111_##reg, (val)) | |
119 | #define reg_clear(reg, val) mt9m111_reg_clear(icd, MT9M111_##reg, (val)) | |
120 | ||
121 | #define MT9M111_MIN_DARK_ROWS 8 | |
122 | #define MT9M111_MIN_DARK_COLS 24 | |
123 | #define MT9M111_MAX_HEIGHT 1024 | |
124 | #define MT9M111_MAX_WIDTH 1280 | |
125 | ||
126 | #define COL_FMT(_name, _depth, _fourcc, _colorspace) \ | |
127 | { .name = _name, .depth = _depth, .fourcc = _fourcc, \ | |
128 | .colorspace = _colorspace } | |
129 | #define RGB_FMT(_name, _depth, _fourcc) \ | |
130 | COL_FMT(_name, _depth, _fourcc, V4L2_COLORSPACE_SRGB) | |
88f4b899 RJ |
131 | #define JPG_FMT(_name, _depth, _fourcc) \ |
132 | COL_FMT(_name, _depth, _fourcc, V4L2_COLORSPACE_JPEG) | |
77110abb RJ |
133 | |
134 | static const struct soc_camera_data_format mt9m111_colour_formats[] = { | |
88f4b899 RJ |
135 | JPG_FMT("CbYCrY 16 bit", 16, V4L2_PIX_FMT_UYVY), |
136 | JPG_FMT("CrYCbY 16 bit", 16, V4L2_PIX_FMT_VYUY), | |
137 | JPG_FMT("YCbYCr 16 bit", 16, V4L2_PIX_FMT_YUYV), | |
138 | JPG_FMT("YCrYCb 16 bit", 16, V4L2_PIX_FMT_YVYU), | |
77110abb RJ |
139 | RGB_FMT("RGB 565", 16, V4L2_PIX_FMT_RGB565), |
140 | RGB_FMT("RGB 555", 16, V4L2_PIX_FMT_RGB555), | |
141 | RGB_FMT("Bayer (sRGB) 10 bit", 10, V4L2_PIX_FMT_SBGGR16), | |
142 | RGB_FMT("Bayer (sRGB) 8 bit", 8, V4L2_PIX_FMT_SBGGR8), | |
143 | }; | |
144 | ||
145 | enum mt9m111_context { | |
146 | HIGHPOWER = 0, | |
147 | LOWPOWER, | |
148 | }; | |
149 | ||
150 | struct mt9m111 { | |
151 | struct i2c_client *client; | |
152 | struct soc_camera_device icd; | |
153 | int model; /* V4L2_IDENT_MT9M111* codes from v4l2-chip-ident.h */ | |
154 | enum mt9m111_context context; | |
155 | unsigned int left, top, width, height; | |
156 | u32 pixfmt; | |
157 | unsigned char autoexposure; | |
158 | unsigned char datawidth; | |
159 | unsigned int powered:1; | |
160 | unsigned int hflip:1; | |
161 | unsigned int vflip:1; | |
162 | unsigned int swap_rgb_even_odd:1; | |
163 | unsigned int swap_rgb_red_blue:1; | |
164 | unsigned int swap_yuv_y_chromas:1; | |
165 | unsigned int swap_yuv_cb_cr:1; | |
166 | }; | |
167 | ||
168 | static int reg_page_map_set(struct i2c_client *client, const u16 reg) | |
169 | { | |
170 | int ret; | |
171 | u16 page; | |
172 | static int lastpage = -1; /* PageMap cache value */ | |
173 | ||
174 | page = (reg >> 8); | |
175 | if (page == lastpage) | |
176 | return 0; | |
177 | if (page > 2) | |
178 | return -EINVAL; | |
179 | ||
180 | ret = i2c_smbus_write_word_data(client, MT9M111_PAGE_MAP, swab16(page)); | |
506c629a | 181 | if (!ret) |
77110abb RJ |
182 | lastpage = page; |
183 | return ret; | |
184 | } | |
185 | ||
186 | static int mt9m111_reg_read(struct soc_camera_device *icd, const u16 reg) | |
187 | { | |
188 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
189 | struct i2c_client *client = mt9m111->client; | |
190 | int ret; | |
191 | ||
192 | ret = reg_page_map_set(client, reg); | |
193 | if (!ret) | |
194 | ret = swab16(i2c_smbus_read_word_data(client, (reg & 0xff))); | |
195 | ||
196 | dev_dbg(&icd->dev, "read reg.%03x -> %04x\n", reg, ret); | |
197 | return ret; | |
198 | } | |
199 | ||
200 | static int mt9m111_reg_write(struct soc_camera_device *icd, const u16 reg, | |
201 | const u16 data) | |
202 | { | |
203 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
204 | struct i2c_client *client = mt9m111->client; | |
205 | int ret; | |
206 | ||
207 | ret = reg_page_map_set(client, reg); | |
506c629a | 208 | if (!ret) |
77110abb RJ |
209 | ret = i2c_smbus_write_word_data(mt9m111->client, (reg & 0xff), |
210 | swab16(data)); | |
211 | dev_dbg(&icd->dev, "write reg.%03x = %04x -> %d\n", reg, data, ret); | |
212 | return ret; | |
213 | } | |
214 | ||
215 | static int mt9m111_reg_set(struct soc_camera_device *icd, const u16 reg, | |
216 | const u16 data) | |
217 | { | |
218 | int ret; | |
219 | ||
220 | ret = mt9m111_reg_read(icd, reg); | |
221 | if (ret >= 0) | |
222 | ret = mt9m111_reg_write(icd, reg, ret | data); | |
223 | return ret; | |
224 | } | |
225 | ||
226 | static int mt9m111_reg_clear(struct soc_camera_device *icd, const u16 reg, | |
227 | const u16 data) | |
228 | { | |
229 | int ret; | |
230 | ||
231 | ret = mt9m111_reg_read(icd, reg); | |
232 | return mt9m111_reg_write(icd, reg, ret & ~data); | |
233 | } | |
234 | ||
235 | static int mt9m111_set_context(struct soc_camera_device *icd, | |
236 | enum mt9m111_context ctxt) | |
237 | { | |
238 | int valB = MT9M111_CTXT_CTRL_RESTART | MT9M111_CTXT_CTRL_DEFECTCOR_B | |
239 | | MT9M111_CTXT_CTRL_RESIZE_B | MT9M111_CTXT_CTRL_CTRL2_B | |
240 | | MT9M111_CTXT_CTRL_GAMMA_B | MT9M111_CTXT_CTRL_READ_MODE_B | |
241 | | MT9M111_CTXT_CTRL_VBLANK_SEL_B | |
242 | | MT9M111_CTXT_CTRL_HBLANK_SEL_B; | |
243 | int valA = MT9M111_CTXT_CTRL_RESTART; | |
244 | ||
245 | if (ctxt == HIGHPOWER) | |
246 | return reg_write(CONTEXT_CONTROL, valB); | |
247 | else | |
248 | return reg_write(CONTEXT_CONTROL, valA); | |
249 | } | |
250 | ||
251 | static int mt9m111_setup_rect(struct soc_camera_device *icd) | |
252 | { | |
253 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
506c629a | 254 | int ret, is_raw_format; |
77110abb RJ |
255 | int width = mt9m111->width; |
256 | int height = mt9m111->height; | |
257 | ||
258 | if ((mt9m111->pixfmt == V4L2_PIX_FMT_SBGGR8) | |
259 | || (mt9m111->pixfmt == V4L2_PIX_FMT_SBGGR16)) | |
260 | is_raw_format = 1; | |
261 | else | |
262 | is_raw_format = 0; | |
263 | ||
506c629a GL |
264 | ret = reg_write(COLUMN_START, mt9m111->left); |
265 | if (!ret) | |
77110abb RJ |
266 | ret = reg_write(ROW_START, mt9m111->top); |
267 | ||
268 | if (is_raw_format) { | |
506c629a | 269 | if (!ret) |
77110abb | 270 | ret = reg_write(WINDOW_WIDTH, width); |
506c629a | 271 | if (!ret) |
77110abb RJ |
272 | ret = reg_write(WINDOW_HEIGHT, height); |
273 | } else { | |
506c629a | 274 | if (!ret) |
77110abb | 275 | ret = reg_write(REDUCER_XZOOM_B, MT9M111_MAX_WIDTH); |
506c629a | 276 | if (!ret) |
77110abb | 277 | ret = reg_write(REDUCER_YZOOM_B, MT9M111_MAX_HEIGHT); |
506c629a | 278 | if (!ret) |
77110abb | 279 | ret = reg_write(REDUCER_XSIZE_B, width); |
506c629a | 280 | if (!ret) |
77110abb | 281 | ret = reg_write(REDUCER_YSIZE_B, height); |
506c629a | 282 | if (!ret) |
77110abb | 283 | ret = reg_write(REDUCER_XZOOM_A, MT9M111_MAX_WIDTH); |
506c629a | 284 | if (!ret) |
77110abb | 285 | ret = reg_write(REDUCER_YZOOM_A, MT9M111_MAX_HEIGHT); |
506c629a | 286 | if (!ret) |
77110abb | 287 | ret = reg_write(REDUCER_XSIZE_A, width); |
506c629a | 288 | if (!ret) |
77110abb RJ |
289 | ret = reg_write(REDUCER_YSIZE_A, height); |
290 | } | |
291 | ||
292 | return ret; | |
293 | } | |
294 | ||
295 | static int mt9m111_setup_pixfmt(struct soc_camera_device *icd, u16 outfmt) | |
296 | { | |
297 | int ret; | |
298 | ||
299 | ret = reg_write(OUTPUT_FORMAT_CTRL2_A, outfmt); | |
506c629a | 300 | if (!ret) |
77110abb RJ |
301 | ret = reg_write(OUTPUT_FORMAT_CTRL2_B, outfmt); |
302 | return ret; | |
303 | } | |
304 | ||
305 | static int mt9m111_setfmt_bayer8(struct soc_camera_device *icd) | |
306 | { | |
307 | return mt9m111_setup_pixfmt(icd, MT9M111_OUTFMT_PROCESSED_BAYER); | |
308 | } | |
309 | ||
310 | static int mt9m111_setfmt_bayer10(struct soc_camera_device *icd) | |
311 | { | |
77110abb RJ |
312 | return mt9m111_setup_pixfmt(icd, MT9M111_OUTFMT_BYPASS_IFP); |
313 | } | |
314 | ||
315 | static int mt9m111_setfmt_rgb565(struct soc_camera_device *icd) | |
316 | { | |
317 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
318 | int val = 0; | |
319 | ||
320 | if (mt9m111->swap_rgb_red_blue) | |
321 | val |= MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr; | |
322 | if (mt9m111->swap_rgb_even_odd) | |
323 | val |= MT9M111_OUTFMT_SWAP_RGB_EVEN; | |
324 | val |= MT9M111_OUTFMT_RGB | MT9M111_OUTFMT_RGB565; | |
325 | ||
326 | return mt9m111_setup_pixfmt(icd, val); | |
327 | } | |
328 | ||
329 | static int mt9m111_setfmt_rgb555(struct soc_camera_device *icd) | |
330 | { | |
331 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
332 | int val = 0; | |
333 | ||
334 | if (mt9m111->swap_rgb_red_blue) | |
335 | val |= MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr; | |
336 | if (mt9m111->swap_rgb_even_odd) | |
337 | val |= MT9M111_OUTFMT_SWAP_RGB_EVEN; | |
338 | val |= MT9M111_OUTFMT_RGB | MT9M111_OUTFMT_RGB555; | |
339 | ||
340 | return mt9m111_setup_pixfmt(icd, val); | |
341 | } | |
342 | ||
343 | static int mt9m111_setfmt_yuv(struct soc_camera_device *icd) | |
344 | { | |
345 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
346 | int val = 0; | |
347 | ||
348 | if (mt9m111->swap_yuv_cb_cr) | |
349 | val |= MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr; | |
350 | if (mt9m111->swap_yuv_y_chromas) | |
351 | val |= MT9M111_OUTFMT_SWAP_YCbCr_C_Y; | |
352 | ||
353 | return mt9m111_setup_pixfmt(icd, val); | |
354 | } | |
355 | ||
356 | static int mt9m111_enable(struct soc_camera_device *icd) | |
357 | { | |
358 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
81034663 | 359 | struct soc_camera_link *icl = mt9m111->client->dev.platform_data; |
77110abb RJ |
360 | int ret; |
361 | ||
81034663 SH |
362 | if (icl->power) { |
363 | ret = icl->power(&mt9m111->client->dev, 1); | |
364 | if (ret < 0) { | |
365 | dev_err(icd->vdev->parent, | |
366 | "Platform failed to power-on the camera.\n"); | |
367 | return ret; | |
368 | } | |
369 | } | |
370 | ||
77110abb | 371 | ret = reg_set(RESET, MT9M111_RESET_CHIP_ENABLE); |
506c629a | 372 | if (!ret) |
77110abb RJ |
373 | mt9m111->powered = 1; |
374 | return ret; | |
375 | } | |
376 | ||
377 | static int mt9m111_disable(struct soc_camera_device *icd) | |
378 | { | |
379 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
81034663 | 380 | struct soc_camera_link *icl = mt9m111->client->dev.platform_data; |
77110abb RJ |
381 | int ret; |
382 | ||
383 | ret = reg_clear(RESET, MT9M111_RESET_CHIP_ENABLE); | |
506c629a | 384 | if (!ret) |
77110abb | 385 | mt9m111->powered = 0; |
81034663 SH |
386 | |
387 | if (icl->power) | |
388 | icl->power(&mt9m111->client->dev, 0); | |
389 | ||
77110abb RJ |
390 | return ret; |
391 | } | |
392 | ||
393 | static int mt9m111_reset(struct soc_camera_device *icd) | |
394 | { | |
395 | int ret; | |
396 | ||
397 | ret = reg_set(RESET, MT9M111_RESET_RESET_MODE); | |
506c629a | 398 | if (!ret) |
77110abb | 399 | ret = reg_set(RESET, MT9M111_RESET_RESET_SOC); |
506c629a | 400 | if (!ret) |
77110abb RJ |
401 | ret = reg_clear(RESET, MT9M111_RESET_RESET_MODE |
402 | | MT9M111_RESET_RESET_SOC); | |
403 | return ret; | |
404 | } | |
405 | ||
406 | static int mt9m111_start_capture(struct soc_camera_device *icd) | |
407 | { | |
408 | return 0; | |
409 | } | |
410 | ||
411 | static int mt9m111_stop_capture(struct soc_camera_device *icd) | |
412 | { | |
413 | return 0; | |
414 | } | |
415 | ||
416 | static unsigned long mt9m111_query_bus_param(struct soc_camera_device *icd) | |
417 | { | |
bd73b36f GL |
418 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); |
419 | struct soc_camera_link *icl = mt9m111->client->dev.platform_data; | |
420 | unsigned long flags = SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING | | |
77110abb RJ |
421 | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH | |
422 | SOCAM_DATAWIDTH_8; | |
bd73b36f GL |
423 | |
424 | return soc_camera_apply_sensor_flags(icl, flags); | |
77110abb RJ |
425 | } |
426 | ||
427 | static int mt9m111_set_bus_param(struct soc_camera_device *icd, unsigned long f) | |
428 | { | |
429 | return 0; | |
430 | } | |
431 | ||
432 | static int mt9m111_set_pixfmt(struct soc_camera_device *icd, u32 pixfmt) | |
433 | { | |
434 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
506c629a | 435 | int ret; |
77110abb RJ |
436 | |
437 | switch (pixfmt) { | |
438 | case V4L2_PIX_FMT_SBGGR8: | |
439 | ret = mt9m111_setfmt_bayer8(icd); | |
440 | break; | |
441 | case V4L2_PIX_FMT_SBGGR16: | |
442 | ret = mt9m111_setfmt_bayer10(icd); | |
443 | break; | |
444 | case V4L2_PIX_FMT_RGB555: | |
445 | ret = mt9m111_setfmt_rgb555(icd); | |
446 | break; | |
447 | case V4L2_PIX_FMT_RGB565: | |
448 | ret = mt9m111_setfmt_rgb565(icd); | |
449 | break; | |
88f4b899 RJ |
450 | case V4L2_PIX_FMT_UYVY: |
451 | mt9m111->swap_yuv_y_chromas = 0; | |
452 | mt9m111->swap_yuv_cb_cr = 0; | |
453 | ret = mt9m111_setfmt_yuv(icd); | |
454 | break; | |
455 | case V4L2_PIX_FMT_VYUY: | |
456 | mt9m111->swap_yuv_y_chromas = 0; | |
457 | mt9m111->swap_yuv_cb_cr = 1; | |
458 | ret = mt9m111_setfmt_yuv(icd); | |
459 | break; | |
77110abb | 460 | case V4L2_PIX_FMT_YUYV: |
88f4b899 RJ |
461 | mt9m111->swap_yuv_y_chromas = 1; |
462 | mt9m111->swap_yuv_cb_cr = 0; | |
463 | ret = mt9m111_setfmt_yuv(icd); | |
464 | break; | |
465 | case V4L2_PIX_FMT_YVYU: | |
466 | mt9m111->swap_yuv_y_chromas = 1; | |
467 | mt9m111->swap_yuv_cb_cr = 1; | |
77110abb RJ |
468 | ret = mt9m111_setfmt_yuv(icd); |
469 | break; | |
470 | default: | |
471 | dev_err(&icd->dev, "Pixel format not handled : %x\n", pixfmt); | |
472 | ret = -EINVAL; | |
473 | } | |
474 | ||
506c629a | 475 | if (!ret) |
77110abb RJ |
476 | mt9m111->pixfmt = pixfmt; |
477 | ||
478 | return ret; | |
479 | } | |
480 | ||
d8fac217 GL |
481 | static int mt9m111_set_fmt(struct soc_camera_device *icd, |
482 | __u32 pixfmt, struct v4l2_rect *rect) | |
77110abb RJ |
483 | { |
484 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
506c629a | 485 | int ret; |
77110abb RJ |
486 | |
487 | mt9m111->left = rect->left; | |
488 | mt9m111->top = rect->top; | |
489 | mt9m111->width = rect->width; | |
490 | mt9m111->height = rect->height; | |
491 | ||
492 | dev_dbg(&icd->dev, "%s fmt=%x left=%d, top=%d, width=%d, height=%d\n", | |
493 | __func__, pixfmt, mt9m111->left, mt9m111->top, mt9m111->width, | |
494 | mt9m111->height); | |
495 | ||
496 | ret = mt9m111_setup_rect(icd); | |
506c629a | 497 | if (!ret) |
77110abb | 498 | ret = mt9m111_set_pixfmt(icd, pixfmt); |
506c629a | 499 | return ret; |
77110abb RJ |
500 | } |
501 | ||
d8fac217 GL |
502 | static int mt9m111_try_fmt(struct soc_camera_device *icd, |
503 | struct v4l2_format *f) | |
77110abb RJ |
504 | { |
505 | if (f->fmt.pix.height > MT9M111_MAX_HEIGHT) | |
506 | f->fmt.pix.height = MT9M111_MAX_HEIGHT; | |
507 | if (f->fmt.pix.width > MT9M111_MAX_WIDTH) | |
508 | f->fmt.pix.width = MT9M111_MAX_WIDTH; | |
509 | ||
510 | return 0; | |
511 | } | |
512 | ||
513 | static int mt9m111_get_chip_id(struct soc_camera_device *icd, | |
514 | struct v4l2_chip_ident *id) | |
515 | { | |
516 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
517 | ||
518 | if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) | |
519 | return -EINVAL; | |
520 | ||
521 | if (id->match_chip != mt9m111->client->addr) | |
522 | return -ENODEV; | |
523 | ||
524 | id->ident = mt9m111->model; | |
525 | id->revision = 0; | |
526 | ||
527 | return 0; | |
528 | } | |
529 | ||
530 | #ifdef CONFIG_VIDEO_ADV_DEBUG | |
531 | static int mt9m111_get_register(struct soc_camera_device *icd, | |
532 | struct v4l2_register *reg) | |
533 | { | |
534 | int val; | |
535 | ||
536 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
537 | ||
538 | if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) | |
539 | return -EINVAL; | |
540 | if (reg->match_chip != mt9m111->client->addr) | |
541 | return -ENODEV; | |
542 | ||
543 | val = mt9m111_reg_read(icd, reg->reg); | |
544 | reg->val = (u64)val; | |
545 | ||
546 | if (reg->val > 0xffff) | |
547 | return -EIO; | |
548 | ||
549 | return 0; | |
550 | } | |
551 | ||
552 | static int mt9m111_set_register(struct soc_camera_device *icd, | |
553 | struct v4l2_register *reg) | |
554 | { | |
555 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
556 | ||
557 | if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) | |
558 | return -EINVAL; | |
559 | ||
560 | if (reg->match_chip != mt9m111->client->addr) | |
561 | return -ENODEV; | |
562 | ||
563 | if (mt9m111_reg_write(icd, reg->reg, reg->val) < 0) | |
564 | return -EIO; | |
565 | ||
566 | return 0; | |
567 | } | |
568 | #endif | |
569 | ||
570 | static const struct v4l2_queryctrl mt9m111_controls[] = { | |
571 | { | |
572 | .id = V4L2_CID_VFLIP, | |
573 | .type = V4L2_CTRL_TYPE_BOOLEAN, | |
574 | .name = "Flip Verticaly", | |
575 | .minimum = 0, | |
576 | .maximum = 1, | |
577 | .step = 1, | |
578 | .default_value = 0, | |
579 | }, { | |
580 | .id = V4L2_CID_HFLIP, | |
581 | .type = V4L2_CTRL_TYPE_BOOLEAN, | |
582 | .name = "Flip Horizontaly", | |
583 | .minimum = 0, | |
584 | .maximum = 1, | |
585 | .step = 1, | |
586 | .default_value = 0, | |
587 | }, { /* gain = 1/32*val (=>gain=1 if val==32) */ | |
588 | .id = V4L2_CID_GAIN, | |
589 | .type = V4L2_CTRL_TYPE_INTEGER, | |
590 | .name = "Gain", | |
591 | .minimum = 0, | |
592 | .maximum = 63 * 2 * 2, | |
593 | .step = 1, | |
594 | .default_value = 32, | |
595 | .flags = V4L2_CTRL_FLAG_SLIDER, | |
596 | }, { | |
597 | .id = V4L2_CID_EXPOSURE_AUTO, | |
598 | .type = V4L2_CTRL_TYPE_BOOLEAN, | |
599 | .name = "Auto Exposure", | |
600 | .minimum = 0, | |
601 | .maximum = 1, | |
602 | .step = 1, | |
603 | .default_value = 1, | |
604 | } | |
605 | }; | |
606 | ||
607 | static int mt9m111_video_probe(struct soc_camera_device *); | |
608 | static void mt9m111_video_remove(struct soc_camera_device *); | |
609 | static int mt9m111_get_control(struct soc_camera_device *, | |
610 | struct v4l2_control *); | |
611 | static int mt9m111_set_control(struct soc_camera_device *, | |
612 | struct v4l2_control *); | |
613 | static int mt9m111_resume(struct soc_camera_device *icd); | |
614 | static int mt9m111_init(struct soc_camera_device *icd); | |
615 | static int mt9m111_release(struct soc_camera_device *icd); | |
616 | ||
617 | static struct soc_camera_ops mt9m111_ops = { | |
618 | .owner = THIS_MODULE, | |
619 | .probe = mt9m111_video_probe, | |
620 | .remove = mt9m111_video_remove, | |
621 | .init = mt9m111_init, | |
622 | .resume = mt9m111_resume, | |
623 | .release = mt9m111_release, | |
624 | .start_capture = mt9m111_start_capture, | |
625 | .stop_capture = mt9m111_stop_capture, | |
d8fac217 GL |
626 | .set_fmt = mt9m111_set_fmt, |
627 | .try_fmt = mt9m111_try_fmt, | |
77110abb RJ |
628 | .query_bus_param = mt9m111_query_bus_param, |
629 | .set_bus_param = mt9m111_set_bus_param, | |
630 | .controls = mt9m111_controls, | |
631 | .num_controls = ARRAY_SIZE(mt9m111_controls), | |
632 | .get_control = mt9m111_get_control, | |
633 | .set_control = mt9m111_set_control, | |
634 | .get_chip_id = mt9m111_get_chip_id, | |
635 | #ifdef CONFIG_VIDEO_ADV_DEBUG | |
636 | .get_register = mt9m111_get_register, | |
637 | .set_register = mt9m111_set_register, | |
638 | #endif | |
639 | }; | |
640 | ||
641 | static int mt9m111_set_flip(struct soc_camera_device *icd, int flip, int mask) | |
642 | { | |
643 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
644 | int ret; | |
645 | ||
646 | if (mt9m111->context == HIGHPOWER) { | |
647 | if (flip) | |
648 | ret = reg_set(READ_MODE_B, mask); | |
649 | else | |
650 | ret = reg_clear(READ_MODE_B, mask); | |
651 | } else { | |
652 | if (flip) | |
653 | ret = reg_set(READ_MODE_A, mask); | |
654 | else | |
655 | ret = reg_clear(READ_MODE_A, mask); | |
656 | } | |
657 | ||
658 | return ret; | |
659 | } | |
660 | ||
661 | static int mt9m111_get_global_gain(struct soc_camera_device *icd) | |
662 | { | |
0f28b793 | 663 | int data; |
77110abb RJ |
664 | |
665 | data = reg_read(GLOBAL_GAIN); | |
666 | if (data >= 0) | |
0f28b793 | 667 | return (data & 0x2f) * (1 << ((data >> 10) & 1)) * |
668 | (1 << ((data >> 9) & 1)); | |
669 | return data; | |
77110abb | 670 | } |
0f28b793 | 671 | |
77110abb RJ |
672 | static int mt9m111_set_global_gain(struct soc_camera_device *icd, int gain) |
673 | { | |
674 | u16 val; | |
675 | ||
676 | if (gain > 63 * 2 * 2) | |
677 | return -EINVAL; | |
678 | ||
679 | icd->gain = gain; | |
680 | if ((gain >= 64 * 2) && (gain < 63 * 2 * 2)) | |
681 | val = (1 << 10) | (1 << 9) | (gain / 4); | |
682 | else if ((gain >= 64) && (gain < 64 * 2)) | |
506c629a | 683 | val = (1 << 9) | (gain / 2); |
77110abb RJ |
684 | else |
685 | val = gain; | |
686 | ||
687 | return reg_write(GLOBAL_GAIN, val); | |
688 | } | |
689 | ||
690 | static int mt9m111_set_autoexposure(struct soc_camera_device *icd, int on) | |
691 | { | |
692 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
693 | int ret; | |
694 | ||
695 | if (on) | |
696 | ret = reg_set(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN); | |
697 | else | |
698 | ret = reg_clear(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN); | |
699 | ||
506c629a | 700 | if (!ret) |
77110abb RJ |
701 | mt9m111->autoexposure = on; |
702 | ||
703 | return ret; | |
704 | } | |
705 | static int mt9m111_get_control(struct soc_camera_device *icd, | |
706 | struct v4l2_control *ctrl) | |
707 | { | |
708 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
709 | int data; | |
710 | ||
711 | switch (ctrl->id) { | |
712 | case V4L2_CID_VFLIP: | |
713 | if (mt9m111->context == HIGHPOWER) | |
714 | data = reg_read(READ_MODE_B); | |
715 | else | |
716 | data = reg_read(READ_MODE_A); | |
717 | ||
718 | if (data < 0) | |
719 | return -EIO; | |
720 | ctrl->value = !!(data & MT9M111_RMB_MIRROR_ROWS); | |
721 | break; | |
722 | case V4L2_CID_HFLIP: | |
723 | if (mt9m111->context == HIGHPOWER) | |
724 | data = reg_read(READ_MODE_B); | |
725 | else | |
726 | data = reg_read(READ_MODE_A); | |
727 | ||
728 | if (data < 0) | |
729 | return -EIO; | |
730 | ctrl->value = !!(data & MT9M111_RMB_MIRROR_COLS); | |
731 | break; | |
732 | case V4L2_CID_GAIN: | |
733 | data = mt9m111_get_global_gain(icd); | |
734 | if (data < 0) | |
735 | return data; | |
736 | ctrl->value = data; | |
737 | break; | |
738 | case V4L2_CID_EXPOSURE_AUTO: | |
739 | ctrl->value = mt9m111->autoexposure; | |
740 | break; | |
741 | } | |
742 | return 0; | |
743 | } | |
744 | ||
745 | static int mt9m111_set_control(struct soc_camera_device *icd, | |
746 | struct v4l2_control *ctrl) | |
747 | { | |
748 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
749 | const struct v4l2_queryctrl *qctrl; | |
506c629a | 750 | int ret; |
77110abb RJ |
751 | |
752 | qctrl = soc_camera_find_qctrl(&mt9m111_ops, ctrl->id); | |
753 | ||
754 | if (!qctrl) | |
755 | return -EINVAL; | |
756 | ||
757 | switch (ctrl->id) { | |
758 | case V4L2_CID_VFLIP: | |
759 | mt9m111->vflip = ctrl->value; | |
760 | ret = mt9m111_set_flip(icd, ctrl->value, | |
761 | MT9M111_RMB_MIRROR_ROWS); | |
762 | break; | |
763 | case V4L2_CID_HFLIP: | |
764 | mt9m111->hflip = ctrl->value; | |
765 | ret = mt9m111_set_flip(icd, ctrl->value, | |
766 | MT9M111_RMB_MIRROR_COLS); | |
767 | break; | |
768 | case V4L2_CID_GAIN: | |
769 | ret = mt9m111_set_global_gain(icd, ctrl->value); | |
770 | break; | |
771 | case V4L2_CID_EXPOSURE_AUTO: | |
772 | ret = mt9m111_set_autoexposure(icd, ctrl->value); | |
773 | break; | |
774 | default: | |
775 | ret = -EINVAL; | |
776 | } | |
777 | ||
506c629a | 778 | return ret; |
77110abb RJ |
779 | } |
780 | ||
ba77531f | 781 | static int mt9m111_restore_state(struct soc_camera_device *icd) |
77110abb RJ |
782 | { |
783 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
784 | ||
785 | mt9m111_set_context(icd, mt9m111->context); | |
786 | mt9m111_set_pixfmt(icd, mt9m111->pixfmt); | |
787 | mt9m111_setup_rect(icd); | |
788 | mt9m111_set_flip(icd, mt9m111->hflip, MT9M111_RMB_MIRROR_COLS); | |
789 | mt9m111_set_flip(icd, mt9m111->vflip, MT9M111_RMB_MIRROR_ROWS); | |
790 | mt9m111_set_global_gain(icd, icd->gain); | |
791 | mt9m111_set_autoexposure(icd, mt9m111->autoexposure); | |
792 | return 0; | |
793 | } | |
794 | ||
795 | static int mt9m111_resume(struct soc_camera_device *icd) | |
796 | { | |
797 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
798 | int ret = 0; | |
799 | ||
800 | if (mt9m111->powered) { | |
801 | ret = mt9m111_enable(icd); | |
506c629a GL |
802 | if (!ret) |
803 | ret = mt9m111_reset(icd); | |
804 | if (!ret) | |
805 | ret = mt9m111_restore_state(icd); | |
77110abb RJ |
806 | } |
807 | return ret; | |
808 | } | |
809 | ||
810 | static int mt9m111_init(struct soc_camera_device *icd) | |
811 | { | |
812 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
813 | int ret; | |
814 | ||
815 | mt9m111->context = HIGHPOWER; | |
816 | ret = mt9m111_enable(icd); | |
506c629a GL |
817 | if (!ret) |
818 | ret = mt9m111_reset(icd); | |
819 | if (!ret) | |
820 | ret = mt9m111_set_context(icd, mt9m111->context); | |
821 | if (!ret) | |
822 | ret = mt9m111_set_autoexposure(icd, mt9m111->autoexposure); | |
823 | if (ret) | |
77110abb | 824 | dev_err(&icd->dev, "mt9m111 init failed: %d\n", ret); |
506c629a | 825 | return ret; |
77110abb RJ |
826 | } |
827 | ||
828 | static int mt9m111_release(struct soc_camera_device *icd) | |
829 | { | |
830 | int ret; | |
831 | ||
832 | ret = mt9m111_disable(icd); | |
833 | if (ret < 0) | |
834 | dev_err(&icd->dev, "mt9m111 release failed: %d\n", ret); | |
835 | ||
506c629a | 836 | return ret; |
77110abb RJ |
837 | } |
838 | ||
839 | /* | |
840 | * Interface active, can use i2c. If it fails, it can indeed mean, that | |
841 | * this wasn't our capture interface, so, we wait for the right one | |
842 | */ | |
843 | static int mt9m111_video_probe(struct soc_camera_device *icd) | |
844 | { | |
845 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
846 | s32 data; | |
847 | int ret; | |
848 | ||
849 | /* | |
850 | * We must have a parent by now. And it cannot be a wrong one. | |
851 | * So this entire test is completely redundant. | |
852 | */ | |
853 | if (!icd->dev.parent || | |
854 | to_soc_camera_host(icd->dev.parent)->nr != icd->iface) | |
855 | return -ENODEV; | |
856 | ||
857 | ret = mt9m111_enable(icd); | |
858 | if (ret) | |
859 | goto ei2c; | |
860 | ret = mt9m111_reset(icd); | |
861 | if (ret) | |
862 | goto ei2c; | |
863 | ||
864 | data = reg_read(CHIP_VERSION); | |
865 | ||
866 | switch (data) { | |
867 | case 0x143a: | |
868 | mt9m111->model = V4L2_IDENT_MT9M111; | |
869 | icd->formats = mt9m111_colour_formats; | |
870 | icd->num_formats = ARRAY_SIZE(mt9m111_colour_formats); | |
871 | break; | |
872 | default: | |
873 | ret = -ENODEV; | |
874 | dev_err(&icd->dev, | |
875 | "No MT9M111 chip detected, register read %x\n", data); | |
876 | goto ei2c; | |
877 | } | |
878 | ||
879 | dev_info(&icd->dev, "Detected a MT9M111 chip ID 0x143a\n"); | |
880 | ||
881 | ret = soc_camera_video_start(icd); | |
882 | if (ret) | |
883 | goto eisis; | |
884 | ||
885 | mt9m111->autoexposure = 1; | |
886 | ||
887 | mt9m111->swap_rgb_even_odd = 1; | |
888 | mt9m111->swap_rgb_red_blue = 1; | |
889 | ||
890 | return 0; | |
891 | eisis: | |
892 | ei2c: | |
893 | return ret; | |
894 | } | |
895 | ||
896 | static void mt9m111_video_remove(struct soc_camera_device *icd) | |
897 | { | |
898 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | |
899 | ||
900 | dev_dbg(&icd->dev, "Video %x removed: %p, %p\n", mt9m111->client->addr, | |
901 | mt9m111->icd.dev.parent, mt9m111->icd.vdev); | |
902 | soc_camera_video_stop(&mt9m111->icd); | |
903 | } | |
904 | ||
905 | static int mt9m111_probe(struct i2c_client *client, | |
906 | const struct i2c_device_id *did) | |
907 | { | |
908 | struct mt9m111 *mt9m111; | |
909 | struct soc_camera_device *icd; | |
910 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); | |
911 | struct soc_camera_link *icl = client->dev.platform_data; | |
912 | int ret; | |
913 | ||
914 | if (!icl) { | |
915 | dev_err(&client->dev, "MT9M111 driver needs platform data\n"); | |
916 | return -EINVAL; | |
917 | } | |
918 | ||
919 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) { | |
920 | dev_warn(&adapter->dev, | |
921 | "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n"); | |
922 | return -EIO; | |
923 | } | |
924 | ||
925 | mt9m111 = kzalloc(sizeof(struct mt9m111), GFP_KERNEL); | |
926 | if (!mt9m111) | |
927 | return -ENOMEM; | |
928 | ||
929 | mt9m111->client = client; | |
930 | i2c_set_clientdata(client, mt9m111); | |
931 | ||
932 | /* Second stage probe - when a capture adapter is there */ | |
933 | icd = &mt9m111->icd; | |
934 | icd->ops = &mt9m111_ops; | |
935 | icd->control = &client->dev; | |
936 | icd->x_min = MT9M111_MIN_DARK_COLS; | |
937 | icd->y_min = MT9M111_MIN_DARK_ROWS; | |
938 | icd->x_current = icd->x_min; | |
939 | icd->y_current = icd->y_min; | |
940 | icd->width_min = MT9M111_MIN_DARK_ROWS; | |
941 | icd->width_max = MT9M111_MAX_WIDTH; | |
942 | icd->height_min = MT9M111_MIN_DARK_COLS; | |
943 | icd->height_max = MT9M111_MAX_HEIGHT; | |
944 | icd->y_skip_top = 0; | |
945 | icd->iface = icl->bus_id; | |
946 | ||
947 | ret = soc_camera_device_register(icd); | |
948 | if (ret) | |
949 | goto eisdr; | |
950 | return 0; | |
951 | ||
952 | eisdr: | |
953 | kfree(mt9m111); | |
954 | return ret; | |
955 | } | |
956 | ||
957 | static int mt9m111_remove(struct i2c_client *client) | |
958 | { | |
959 | struct mt9m111 *mt9m111 = i2c_get_clientdata(client); | |
960 | soc_camera_device_unregister(&mt9m111->icd); | |
961 | kfree(mt9m111); | |
962 | ||
963 | return 0; | |
964 | } | |
965 | ||
966 | static const struct i2c_device_id mt9m111_id[] = { | |
967 | { "mt9m111", 0 }, | |
968 | { } | |
969 | }; | |
970 | MODULE_DEVICE_TABLE(i2c, mt9m111_id); | |
971 | ||
972 | static struct i2c_driver mt9m111_i2c_driver = { | |
973 | .driver = { | |
974 | .name = "mt9m111", | |
975 | }, | |
976 | .probe = mt9m111_probe, | |
977 | .remove = mt9m111_remove, | |
978 | .id_table = mt9m111_id, | |
979 | }; | |
980 | ||
981 | static int __init mt9m111_mod_init(void) | |
982 | { | |
983 | return i2c_add_driver(&mt9m111_i2c_driver); | |
984 | } | |
985 | ||
986 | static void __exit mt9m111_mod_exit(void) | |
987 | { | |
988 | i2c_del_driver(&mt9m111_i2c_driver); | |
989 | } | |
990 | ||
991 | module_init(mt9m111_mod_init); | |
992 | module_exit(mt9m111_mod_exit); | |
993 | ||
994 | MODULE_DESCRIPTION("Micron MT9M111 Camera driver"); | |
995 | MODULE_AUTHOR("Robert Jarzmik"); | |
996 | MODULE_LICENSE("GPL"); |