diff options
author | Luca Risolia <luca.risolia@studio.unibo.it> | 2006-04-24 10:28:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 00:58:24 -0400 |
commit | 0230185d337be9810eeaf4a873fa1fa9f7bc52bf (patch) | |
tree | b6c97d58318195539581e1af3fd93266b79e2e99 /drivers/media/video/zc0301 | |
parent | 2b455db6d456ef2d44808a8377fd3bc832e08317 (diff) |
V4L/DVB (3838): ZC0301 driver updates
ZC0301 driver updates:
- Add support for PB-0330 image sensor
- Generic documentation cleanups and updates
Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/zc0301')
-rw-r--r-- | drivers/media/video/zc0301/Kconfig | 6 | ||||
-rw-r--r-- | drivers/media/video/zc0301/Makefile | 2 | ||||
-rw-r--r-- | drivers/media/video/zc0301/zc0301_core.c | 4 | ||||
-rw-r--r-- | drivers/media/video/zc0301/zc0301_pas202bcb.c | 4 | ||||
-rw-r--r-- | drivers/media/video/zc0301/zc0301_pb0330.c | 187 | ||||
-rw-r--r-- | drivers/media/video/zc0301/zc0301_sensor.h | 26 |
6 files changed, 216 insertions, 13 deletions
diff --git a/drivers/media/video/zc0301/Kconfig b/drivers/media/video/zc0301/Kconfig index 115833e4f4dd..a859a6920189 100644 --- a/drivers/media/video/zc0301/Kconfig +++ b/drivers/media/video/zc0301/Kconfig | |||
@@ -1,9 +1,9 @@ | |||
1 | config USB_ZC0301 | 1 | config USB_ZC0301 |
2 | tristate "USB ZC0301 Image Processor and Control Chip support" | 2 | tristate "USB ZC0301[P] Image Processor and Control Chip support" |
3 | depends on USB && VIDEO_V4L1 | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on the ZC0301 | 5 | Say Y here if you want support for cameras based on the ZC0301 or |
6 | Image Processor and Control Chip. | 6 | ZC0301P Image Processors and Control Chips. |
7 | 7 | ||
8 | See <file:Documentation/video4linux/zc0301.txt> for more info. | 8 | See <file:Documentation/video4linux/zc0301.txt> for more info. |
9 | 9 | ||
diff --git a/drivers/media/video/zc0301/Makefile b/drivers/media/video/zc0301/Makefile index d749199d8f06..d9e6d97fade6 100644 --- a/drivers/media/video/zc0301/Makefile +++ b/drivers/media/video/zc0301/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | zc0301-objs := zc0301_core.o zc0301_pas202bcb.o | 1 | zc0301-objs := zc0301_core.o zc0301_pb0330.o zc0301_pas202bcb.o |
2 | 2 | ||
3 | obj-$(CONFIG_USB_ZC0301) += zc0301.o | 3 | obj-$(CONFIG_USB_ZC0301) += zc0301.o |
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c index 0fad39754f7a..7b7a3629bd81 100644 --- a/drivers/media/video/zc0301/zc0301_core.c +++ b/drivers/media/video/zc0301/zc0301_core.c | |||
@@ -52,8 +52,8 @@ | |||
52 | #define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia" | 52 | #define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia" |
53 | #define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" | 53 | #define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" |
54 | #define ZC0301_MODULE_LICENSE "GPL" | 54 | #define ZC0301_MODULE_LICENSE "GPL" |
55 | #define ZC0301_MODULE_VERSION "1:1.03" | 55 | #define ZC0301_MODULE_VERSION "1:1.04" |
56 | #define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 3) | 56 | #define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 4) |
57 | 57 | ||
58 | /*****************************************************************************/ | 58 | /*****************************************************************************/ |
59 | 59 | ||
diff --git a/drivers/media/video/zc0301/zc0301_pas202bcb.c b/drivers/media/video/zc0301/zc0301_pas202bcb.c index eaadf0252049..ecfd39a56df1 100644 --- a/drivers/media/video/zc0301/zc0301_pas202bcb.c +++ b/drivers/media/video/zc0301/zc0301_pas202bcb.c | |||
@@ -1,10 +1,10 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * Plug-in for PAS202BCB image sensor connected to the ZC030! Image * | 2 | * Plug-in for PAS202BCB image sensor connected to the ZC0301[P] Image * |
3 | * Processor and Control Chip * | 3 | * Processor and Control Chip * |
4 | * * | 4 | * * |
5 | * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> * | 5 | * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> * |
6 | * * | 6 | * * |
7 | * Initialization values of the ZC0301 have been taken from the SPCA5XX * | 7 | * Initialization values of the ZC0301[P] have been taken from the SPCA5XX * |
8 | * driver maintained by Michel Xhaard <mxhaard@magic.fr> * | 8 | * driver maintained by Michel Xhaard <mxhaard@magic.fr> * |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
diff --git a/drivers/media/video/zc0301/zc0301_pb0330.c b/drivers/media/video/zc0301/zc0301_pb0330.c new file mode 100644 index 000000000000..ed8542e6c50f --- /dev/null +++ b/drivers/media/video/zc0301/zc0301_pb0330.c | |||
@@ -0,0 +1,187 @@ | |||
1 | /*************************************************************************** | ||
2 | * Plug-in for PB-0330 image sensor connected to the ZC0301[P] Image * | ||
3 | * Processor and Control Chip * | ||
4 | * * | ||
5 | * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> * | ||
6 | * * | ||
7 | * Initialization values of the ZC0301[P] have been taken from the SPCA5XX * | ||
8 | * driver maintained by Michel Xhaard <mxhaard@magic.fr> * | ||
9 | * * | ||
10 | * This program is free software; you can redistribute it and/or modify * | ||
11 | * it under the terms of the GNU General Public License as published by * | ||
12 | * the Free Software Foundation; either version 2 of the License, or * | ||
13 | * (at your option) any later version. * | ||
14 | * * | ||
15 | * This program is distributed in the hope that it will be useful, * | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
18 | * GNU General Public License for more details. * | ||
19 | * * | ||
20 | * You should have received a copy of the GNU General Public License * | ||
21 | * along with this program; if not, write to the Free Software * | ||
22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * | ||
23 | ***************************************************************************/ | ||
24 | |||
25 | #include <linux/delay.h> | ||
26 | #include "zc0301_sensor.h" | ||
27 | |||
28 | |||
29 | static struct zc0301_sensor pb0330; | ||
30 | |||
31 | |||
32 | static int pb0330_init(struct zc0301_device* cam) | ||
33 | { | ||
34 | int err = 0; | ||
35 | |||
36 | err += zc0301_write_reg(cam, 0x0000, 0x01); | ||
37 | err += zc0301_write_reg(cam, 0x0008, 0x03); | ||
38 | err += zc0301_write_reg(cam, 0x0010, 0x0A); | ||
39 | err += zc0301_write_reg(cam, 0x0002, 0x00); | ||
40 | err += zc0301_write_reg(cam, 0x0003, 0x02); | ||
41 | err += zc0301_write_reg(cam, 0x0004, 0x80); | ||
42 | err += zc0301_write_reg(cam, 0x0005, 0x01); | ||
43 | err += zc0301_write_reg(cam, 0x0006, 0xE0); | ||
44 | err += zc0301_write_reg(cam, 0x0001, 0x01); | ||
45 | err += zc0301_write_reg(cam, 0x0012, 0x05); | ||
46 | err += zc0301_write_reg(cam, 0x0012, 0x07); | ||
47 | err += zc0301_write_reg(cam, 0x0098, 0x00); | ||
48 | err += zc0301_write_reg(cam, 0x009A, 0x00); | ||
49 | err += zc0301_write_reg(cam, 0x011A, 0x00); | ||
50 | err += zc0301_write_reg(cam, 0x011C, 0x00); | ||
51 | err += zc0301_write_reg(cam, 0x0012, 0x05); | ||
52 | |||
53 | err += zc0301_i2c_write(cam, 0x01, 0x0006); | ||
54 | err += zc0301_i2c_write(cam, 0x02, 0x0011); | ||
55 | err += zc0301_i2c_write(cam, 0x03, 0x01E7); | ||
56 | err += zc0301_i2c_write(cam, 0x04, 0x0287); | ||
57 | err += zc0301_i2c_write(cam, 0x06, 0x0003); | ||
58 | err += zc0301_i2c_write(cam, 0x07, 0x3002); | ||
59 | err += zc0301_i2c_write(cam, 0x20, 0x1100); | ||
60 | err += zc0301_i2c_write(cam, 0x2F, 0xF7B0); | ||
61 | err += zc0301_i2c_write(cam, 0x30, 0x0005); | ||
62 | err += zc0301_i2c_write(cam, 0x31, 0x0000); | ||
63 | err += zc0301_i2c_write(cam, 0x34, 0x0100); | ||
64 | err += zc0301_i2c_write(cam, 0x35, 0x0060); | ||
65 | err += zc0301_i2c_write(cam, 0x3D, 0x068F); | ||
66 | err += zc0301_i2c_write(cam, 0x40, 0x01E0); | ||
67 | err += zc0301_i2c_write(cam, 0x58, 0x0078); | ||
68 | err += zc0301_i2c_write(cam, 0x62, 0x0411); | ||
69 | |||
70 | err += zc0301_write_reg(cam, 0x0087, 0x10); | ||
71 | err += zc0301_write_reg(cam, 0x0101, 0x37); | ||
72 | err += zc0301_write_reg(cam, 0x0012, 0x05); | ||
73 | err += zc0301_write_reg(cam, 0x0100, 0x0D); | ||
74 | err += zc0301_write_reg(cam, 0x0189, 0x06); | ||
75 | err += zc0301_write_reg(cam, 0x01AD, 0x00); | ||
76 | err += zc0301_write_reg(cam, 0x01C5, 0x03); | ||
77 | err += zc0301_write_reg(cam, 0x01CB, 0x13); | ||
78 | err += zc0301_write_reg(cam, 0x0250, 0x08); | ||
79 | err += zc0301_write_reg(cam, 0x0301, 0x08); | ||
80 | err += zc0301_write_reg(cam, 0x01A8, 0x60); | ||
81 | err += zc0301_write_reg(cam, 0x018D, 0x6C); | ||
82 | err += zc0301_write_reg(cam, 0x01AD, 0x09); | ||
83 | err += zc0301_write_reg(cam, 0x01AE, 0x15); | ||
84 | err += zc0301_write_reg(cam, 0x010A, 0x50); | ||
85 | err += zc0301_write_reg(cam, 0x010B, 0xF8); | ||
86 | err += zc0301_write_reg(cam, 0x010C, 0xF8); | ||
87 | err += zc0301_write_reg(cam, 0x010D, 0xF8); | ||
88 | err += zc0301_write_reg(cam, 0x010E, 0x50); | ||
89 | err += zc0301_write_reg(cam, 0x010F, 0xF8); | ||
90 | err += zc0301_write_reg(cam, 0x0110, 0xF8); | ||
91 | err += zc0301_write_reg(cam, 0x0111, 0xF8); | ||
92 | err += zc0301_write_reg(cam, 0x0112, 0x50); | ||
93 | err += zc0301_write_reg(cam, 0x0008, 0x03); | ||
94 | err += zc0301_write_reg(cam, 0x01C6, 0x08); | ||
95 | err += zc0301_write_reg(cam, 0x01CB, 0x0F); | ||
96 | err += zc0301_write_reg(cam, 0x010A, 0x50); | ||
97 | err += zc0301_write_reg(cam, 0x010B, 0xF8); | ||
98 | err += zc0301_write_reg(cam, 0x010C, 0xF8); | ||
99 | err += zc0301_write_reg(cam, 0x010D, 0xF8); | ||
100 | err += zc0301_write_reg(cam, 0x010E, 0x50); | ||
101 | err += zc0301_write_reg(cam, 0x010F, 0xF8); | ||
102 | err += zc0301_write_reg(cam, 0x0110, 0xF8); | ||
103 | err += zc0301_write_reg(cam, 0x0111, 0xF8); | ||
104 | err += zc0301_write_reg(cam, 0x0112, 0x50); | ||
105 | err += zc0301_write_reg(cam, 0x0180, 0x00); | ||
106 | err += zc0301_write_reg(cam, 0x0019, 0x00); | ||
107 | |||
108 | err += zc0301_i2c_write(cam, 0x05, 0x0066); | ||
109 | err += zc0301_i2c_write(cam, 0x09, 0x02B2); | ||
110 | err += zc0301_i2c_write(cam, 0x10, 0x0002); | ||
111 | |||
112 | err += zc0301_write_reg(cam, 0x011D, 0x60); | ||
113 | err += zc0301_write_reg(cam, 0x0190, 0x00); | ||
114 | err += zc0301_write_reg(cam, 0x0191, 0x07); | ||
115 | err += zc0301_write_reg(cam, 0x0192, 0x8C); | ||
116 | err += zc0301_write_reg(cam, 0x0195, 0x00); | ||
117 | err += zc0301_write_reg(cam, 0x0196, 0x00); | ||
118 | err += zc0301_write_reg(cam, 0x0197, 0x8A); | ||
119 | err += zc0301_write_reg(cam, 0x018C, 0x10); | ||
120 | err += zc0301_write_reg(cam, 0x018F, 0x20); | ||
121 | err += zc0301_write_reg(cam, 0x01A9, 0x14); | ||
122 | err += zc0301_write_reg(cam, 0x01AA, 0x24); | ||
123 | err += zc0301_write_reg(cam, 0x001D, 0xD7); | ||
124 | err += zc0301_write_reg(cam, 0x001E, 0xF0); | ||
125 | err += zc0301_write_reg(cam, 0x001F, 0xF8); | ||
126 | err += zc0301_write_reg(cam, 0x0020, 0xFF); | ||
127 | err += zc0301_write_reg(cam, 0x01AD, 0x09); | ||
128 | err += zc0301_write_reg(cam, 0x01AE, 0x15); | ||
129 | err += zc0301_write_reg(cam, 0x0180, 0x40); | ||
130 | err += zc0301_write_reg(cam, 0x0180, 0x42); | ||
131 | |||
132 | msleep(100); | ||
133 | |||
134 | return err; | ||
135 | } | ||
136 | |||
137 | |||
138 | static struct zc0301_sensor pb0330 = { | ||
139 | .name = "PB-0330", | ||
140 | .init = &pb0330_init, | ||
141 | .cropcap = { | ||
142 | .bounds = { | ||
143 | .left = 0, | ||
144 | .top = 0, | ||
145 | .width = 640, | ||
146 | .height = 480, | ||
147 | }, | ||
148 | .defrect = { | ||
149 | .left = 0, | ||
150 | .top = 0, | ||
151 | .width = 640, | ||
152 | .height = 480, | ||
153 | }, | ||
154 | }, | ||
155 | .pix_format = { | ||
156 | .width = 640, | ||
157 | .height = 480, | ||
158 | .pixelformat = V4L2_PIX_FMT_JPEG, | ||
159 | .priv = 8, | ||
160 | }, | ||
161 | }; | ||
162 | |||
163 | |||
164 | int zc0301_probe_pb0330(struct zc0301_device* cam) | ||
165 | { | ||
166 | int r0, err = 0; | ||
167 | |||
168 | err += zc0301_write_reg(cam, 0x0000, 0x01); | ||
169 | err += zc0301_write_reg(cam, 0x0010, 0x0a); | ||
170 | err += zc0301_write_reg(cam, 0x0001, 0x01); | ||
171 | err += zc0301_write_reg(cam, 0x0012, 0x03); | ||
172 | err += zc0301_write_reg(cam, 0x0012, 0x01); | ||
173 | |||
174 | msleep(10); | ||
175 | |||
176 | r0 = zc0301_i2c_read(cam, 0x00, 2); | ||
177 | |||
178 | if (r0 < 0 || err) | ||
179 | return -EIO; | ||
180 | |||
181 | if (r0 != 0x8243) | ||
182 | return -ENODEV; | ||
183 | |||
184 | zc0301_attach_sensor(cam, &pb0330); | ||
185 | |||
186 | return 0; | ||
187 | } | ||
diff --git a/drivers/media/video/zc0301/zc0301_sensor.h b/drivers/media/video/zc0301/zc0301_sensor.h index 1f95c28b1015..4363a915b1f4 100644 --- a/drivers/media/video/zc0301/zc0301_sensor.h +++ b/drivers/media/video/zc0301/zc0301_sensor.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * API for image sensors connected to the ZC030! Image Processor and * | 2 | * API for image sensors connected to the ZC0301 Image Processor and * |
3 | * Control Chip * | 3 | * Control Chip * |
4 | * * | 4 | * * |
5 | * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> * | 5 | * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> * |
@@ -35,11 +35,13 @@ struct zc0301_sensor; | |||
35 | /*****************************************************************************/ | 35 | /*****************************************************************************/ |
36 | 36 | ||
37 | extern int zc0301_probe_pas202bcb(struct zc0301_device* cam); | 37 | extern int zc0301_probe_pas202bcb(struct zc0301_device* cam); |
38 | extern int zc0301_probe_pb0330(struct zc0301_device* cam); | ||
38 | 39 | ||
39 | #define ZC0301_SENSOR_TABLE \ | 40 | #define ZC0301_SENSOR_TABLE \ |
40 | /* Weak detections must go at the end of the list */ \ | 41 | /* Weak detections must go at the end of the list */ \ |
41 | static int (*zc0301_sensor_table[])(struct zc0301_device*) = { \ | 42 | static int (*zc0301_sensor_table[])(struct zc0301_device*) = { \ |
42 | &zc0301_probe_pas202bcb, \ | 43 | &zc0301_probe_pas202bcb, \ |
44 | &zc0301_probe_pb0330, \ | ||
43 | NULL, \ | 45 | NULL, \ |
44 | }; | 46 | }; |
45 | 47 | ||
@@ -58,14 +60,28 @@ zc0301_attach_sensor(struct zc0301_device* cam, struct zc0301_sensor* sensor); | |||
58 | 60 | ||
59 | #define ZC0301_ID_TABLE \ | 61 | #define ZC0301_ID_TABLE \ |
60 | static const struct usb_device_id zc0301_id_table[] = { \ | 62 | static const struct usb_device_id zc0301_id_table[] = { \ |
61 | { ZC0301_USB_DEVICE(0x041e, 0x4017, 0xff), }, \ | 63 | { ZC0301_USB_DEVICE(0x041e, 0x4017, 0xff), }, /* ICM105 */ \ |
62 | { ZC0301_USB_DEVICE(0x041e, 0x401c, 0xff), }, /* PAS106 */ \ | 64 | { ZC0301_USB_DEVICE(0x041e, 0x401c, 0xff), }, /* PAS106 */ \ |
63 | { ZC0301_USB_DEVICE(0x041e, 0x401e, 0xff), }, /* HV7131B */ \ | 65 | { ZC0301_USB_DEVICE(0x041e, 0x401e, 0xff), }, /* HV7131 */ \ |
66 | { ZC0301_USB_DEVICE(0x041e, 0x401f, 0xff), }, /* TAS5130 */ \ | ||
67 | { ZC0301_USB_DEVICE(0x041e, 0x4022, 0xff), }, \ | ||
64 | { ZC0301_USB_DEVICE(0x041e, 0x4034, 0xff), }, /* PAS106 */ \ | 68 | { ZC0301_USB_DEVICE(0x041e, 0x4034, 0xff), }, /* PAS106 */ \ |
65 | { ZC0301_USB_DEVICE(0x041e, 0x4035, 0xff), }, /* PAS106 */ \ | 69 | { ZC0301_USB_DEVICE(0x041e, 0x4035, 0xff), }, /* PAS106 */ \ |
66 | { ZC0301_USB_DEVICE(0x046d, 0x08ae, 0xff), }, /* PAS202BCB */ \ | 70 | { ZC0301_USB_DEVICE(0x041e, 0x4036, 0xff), }, /* HV7131 */ \ |
71 | { ZC0301_USB_DEVICE(0x041e, 0x403a, 0xff), }, /* HV7131 */ \ | ||
72 | { ZC0301_USB_DEVICE(0x0458, 0x7007, 0xff), }, /* TAS5130 */ \ | ||
73 | { ZC0301_USB_DEVICE(0x0458, 0x700C, 0xff), }, /* TAS5130 */ \ | ||
74 | { ZC0301_USB_DEVICE(0x0458, 0x700f, 0xff), }, /* TAS5130 */ \ | ||
75 | { ZC0301_USB_DEVICE(0x046d, 0x08ae, 0xff), }, /* PAS202 */ \ | ||
76 | { ZC0301_USB_DEVICE(0x055f, 0xd003, 0xff), }, /* TAS5130 */ \ | ||
77 | { ZC0301_USB_DEVICE(0x055f, 0xd004, 0xff), }, /* TAS5130 */ \ | ||
78 | { ZC0301_USB_DEVICE(0x046d, 0x08ae, 0xff), }, /* PAS202 */ \ | ||
67 | { ZC0301_USB_DEVICE(0x0ac8, 0x0301, 0xff), }, \ | 79 | { ZC0301_USB_DEVICE(0x0ac8, 0x0301, 0xff), }, \ |
68 | { ZC0301_USB_DEVICE(0x10fd, 0x8050, 0xff), }, /* TAS5130D */ \ | 80 | { ZC0301_USB_DEVICE(0x0ac8, 0x301b, 0xff), }, /* PB-0330/HV7131 */ \ |
81 | { ZC0301_USB_DEVICE(0x0ac8, 0x303b, 0xff), }, /* PB-0330 */ \ | ||
82 | { ZC0301_USB_DEVICE(0x10fd, 0x0128, 0xff), }, /* TAS5130 */ \ | ||
83 | { ZC0301_USB_DEVICE(0x10fd, 0x8050, 0xff), }, /* TAS5130 */ \ | ||
84 | { ZC0301_USB_DEVICE(0x10fd, 0x804e, 0xff), }, /* TAS5130 */ \ | ||
69 | { } \ | 85 | { } \ |
70 | }; | 86 | }; |
71 | 87 | ||