aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-03-25 06:06:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:40 -0400
commit58e2ded892cf05023bf533936cadc9d264e8a20f (patch)
tree7efad045270c691a186cef0ba5b851cb2623937e /drivers
parent33f5b07e30b1daf98416f2e621a6201f6fff9041 (diff)
V4L/DVB (11212): gspca - vc032x: Use YVYU format for sensor mi1320_soc.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/vc032x.c442
1 files changed, 412 insertions, 30 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 8aab2fb95ac6..4c802fb12cd6 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -37,6 +37,8 @@ struct sd {
37 __u8 lightfreq; 37 __u8 lightfreq;
38 __u8 sharpness; 38 __u8 sharpness;
39 39
40 u8 image_offset;
41
40 char bridge; 42 char bridge;
41#define BRIDGE_VC0321 0 43#define BRIDGE_VC0321 0
42#define BRIDGE_VC0323 1 44#define BRIDGE_VC0323 1
@@ -156,7 +158,44 @@ static const struct v4l2_pix_format vc0323_mode[] = {
156 .colorspace = V4L2_COLORSPACE_JPEG, 158 .colorspace = V4L2_COLORSPACE_JPEG,
157 .priv = 2}, 159 .priv = 2},
158}; 160};
159 161static const struct v4l2_pix_format bi_mode[] = {
162/*fixme: jeg does not work
163 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
164 .bytesperline = 320,
165 .sizeimage = 320 * 240 * 3 / 8 + 590,
166 .colorspace = V4L2_COLORSPACE_JPEG,
167 .priv = 5},
168*/
169 {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
170 .bytesperline = 320,
171 .sizeimage = 320 * 240 * 2,
172 .colorspace = V4L2_COLORSPACE_SRGB,
173 .priv = 4},
174/*
175 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
176 .bytesperline = 640,
177 .sizeimage = 640 * 480 * 3 / 8 + 590,
178 .colorspace = V4L2_COLORSPACE_JPEG,
179 .priv = 3},
180*/
181 {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
182 .bytesperline = 640,
183 .sizeimage = 640 * 480 * 2,
184 .colorspace = V4L2_COLORSPACE_SRGB,
185 .priv = 2},
186/*
187 {1280, 1024, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
188 .bytesperline = 1280,
189 .sizeimage = 1280 * 1024 * 1 / 4 + 590,
190 .colorspace = V4L2_COLORSPACE_JPEG,
191 .priv = 1},
192*/
193 {1280, 1024, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
194 .bytesperline = 1280,
195 .sizeimage = 1280 * 1024 * 2,
196 .colorspace = V4L2_COLORSPACE_SRGB,
197 .priv = 0},
198};
160static const struct v4l2_pix_format svga_mode[] = { 199static const struct v4l2_pix_format svga_mode[] = {
161 {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, 200 {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
162 .bytesperline = 800, 201 .bytesperline = 800,
@@ -892,6 +931,109 @@ static const __u8 mi1320_initQVGA_data[][4] = {
892 {} 931 {}
893}; 932};
894 933
934static const u8 mi1320_soc_InitVGA[][4] = {
935 {0xb3, 0x01, 0x01, 0xcc},
936 {0xb0, 0x03, 0x19, 0xcc},
937 {0xb0, 0x04, 0x02, 0xcc},
938 {0x00, 0x00, 0x30, 0xdd},
939 {0xb3, 0x00, 0x64, 0xcc},
940 {0xb3, 0x00, 0x67, 0xcc},
941 {0xb3, 0x05, 0x01, 0xcc},
942 {0xb3, 0x06, 0x01, 0xcc},
943 {0xb3, 0x08, 0x01, 0xcc},
944 {0xb3, 0x09, 0x0c, 0xcc},
945 {0xb3, 0x34, 0x02, 0xcc},
946 {0xb3, 0x35, 0xc8, 0xcc},
947 {0xb3, 0x02, 0x00, 0xcc},
948 {0xb3, 0x03, 0x0a, 0xcc},
949 {0xb3, 0x04, 0x05, 0xcc},
950 {0xb3, 0x20, 0x00, 0xcc},
951 {0xb3, 0x21, 0x00, 0xcc},
952 {0xb3, 0x22, 0x01, 0xcc},
953 {0xb3, 0x23, 0xe0, 0xcc},
954 {0xb3, 0x14, 0x00, 0xcc},
955 {0xb3, 0x15, 0x00, 0xcc},
956 {0xb3, 0x16, 0x02, 0xcc},
957 {0xb3, 0x17, 0x7f, 0xcc},
958 {0xb3, 0x00, 0x67, 0xcc},
959 {0xb8, 0x00, 0x00, 0xcc},
960 {0xbc, 0x00, 0x71, 0xcc},
961 {0xbc, 0x01, 0x01, 0xcc},
962 {0xb3, 0x5c, 0x01, 0xcc},
963 {0xf0, 0x00, 0x02, 0xbb},
964 {0x00, 0x00, 0x10, 0xdd},
965 {0xc8, 0x00, 0x00, 0xbb},
966 {0x00, 0x00, 0x30, 0xdd},
967 {0xf0, 0x00, 0x00, 0xbb},
968 {0x00, 0x00, 0x10, 0xdd},
969 {0x07, 0x00, 0xe0, 0xbb},
970 {0x08, 0x00, 0x0b, 0xbb},
971 {0x21, 0x00, 0x0c, 0xbb},
972 {0x20, 0x01, 0x03, 0xbb},
973 {0xbf, 0xc0, 0x26, 0xcc},
974 {0xbf, 0xc1, 0x02, 0xcc},
975 {0xbf, 0xcc, 0x04, 0xcc},
976 {0xb3, 0x01, 0x41, 0xcc},
977 {0xf0, 0x00, 0x00, 0xbb},
978 {0x05, 0x01, 0x78, 0xbb},
979 {0x06, 0x00, 0x11, 0xbb},
980 {0x07, 0x01, 0x42, 0xbb},
981 {0x08, 0x00, 0x11, 0xbb},
982 {0x20, 0x01, 0x03, 0xbb},
983 {0x21, 0x80, 0x00, 0xbb},
984 {0x22, 0x0d, 0x0f, 0xbb},
985 {0x24, 0x80, 0x00, 0xbb},
986 {0x59, 0x00, 0xff, 0xbb},
987 {0xf0, 0x00, 0x02, 0xbb},
988 {0x39, 0x03, 0xca, 0xbb},
989 {0x3a, 0x06, 0x80, 0xbb},
990 {0x3b, 0x01, 0x52, 0xbb},
991 {0x3c, 0x05, 0x40, 0xbb},
992 {0x57, 0x01, 0x9c, 0xbb},
993 {0x58, 0x01, 0xee, 0xbb},
994 {0x59, 0x00, 0xf0, 0xbb},
995 {0x5a, 0x01, 0x20, 0xbb},
996 {0x5c, 0x1d, 0x17, 0xbb},
997 {0x5d, 0x22, 0x1c, 0xbb},
998 {0x64, 0x1e, 0x1c, 0xbb},
999 {0x5b, 0x00, 0x00, 0xbb},
1000 {0xf0, 0x00, 0x02, 0xbb},
1001 {0x22, 0xa0, 0x78, 0xbb},
1002 {0x23, 0xa0, 0x78, 0xbb},
1003 {0x24, 0x7f, 0x00, 0xbb},
1004 {0x28, 0xea, 0x02, 0xbb},
1005 {0x29, 0x86, 0x7a, 0xbb},
1006 {0x5e, 0x52, 0x4c, 0xbb},
1007 {0x5f, 0x20, 0x24, 0xbb},
1008 {0x60, 0x00, 0x02, 0xbb},
1009 {0x02, 0x00, 0xee, 0xbb},
1010 {0x03, 0x39, 0x23, 0xbb},
1011 {0x04, 0x07, 0x24, 0xbb},
1012 {0x09, 0x00, 0xc0, 0xbb},
1013 {0x0a, 0x00, 0x79, 0xbb},
1014 {0x0b, 0x00, 0x04, 0xbb},
1015 {0x0c, 0x00, 0x5c, 0xbb},
1016 {0x0d, 0x00, 0xd9, 0xbb},
1017 {0x0e, 0x00, 0x53, 0xbb},
1018 {0x0f, 0x00, 0x21, 0xbb},
1019 {0x10, 0x00, 0xa4, 0xbb},
1020 {0x11, 0x00, 0xe5, 0xbb},
1021 {0x15, 0x00, 0x00, 0xbb},
1022 {0x16, 0x00, 0x00, 0xbb},
1023 {0x17, 0x00, 0x00, 0xbb},
1024 {0x18, 0x00, 0x00, 0xbb},
1025 {0x19, 0x00, 0x00, 0xbb},
1026 {0x1a, 0x00, 0x00, 0xbb},
1027 {0x1b, 0x00, 0x00, 0xbb},
1028 {0x1c, 0x00, 0x00, 0xbb},
1029 {0x1d, 0x00, 0x00, 0xbb},
1030 {0x1e, 0x00, 0x00, 0xbb},
1031 {0xf0, 0x00, 0x01, 0xbb},
1032 {0x06, 0xe0, 0x0e, 0xbb},
1033 {0x06, 0x60, 0x0e, 0xbb},
1034 {0xb3, 0x5c, 0x01, 0xcc},
1035 {}
1036};
895static const u8 mi1320_soc_InitVGA_JPG[][4] = { 1037static const u8 mi1320_soc_InitVGA_JPG[][4] = {
896 {0xb3, 0x01, 0x01, 0xcc}, 1038 {0xb3, 0x01, 0x01, 0xcc},
897 {0xb0, 0x03, 0x19, 0xcc}, 1039 {0xb0, 0x03, 0x19, 0xcc},
@@ -1007,6 +1149,119 @@ static const u8 mi1320_soc_InitVGA_JPG[][4] = {
1007 {0xb3, 0x5c, 0x01, 0xcc}, 1149 {0xb3, 0x5c, 0x01, 0xcc},
1008 {} 1150 {}
1009}; 1151};
1152static const u8 mi1320_soc_InitQVGA[][4] = {
1153 {0xb3, 0x01, 0x01, 0xcc},
1154 {0xb0, 0x03, 0x19, 0xcc},
1155 {0xb0, 0x04, 0x02, 0xcc},
1156 {0x00, 0x00, 0x30, 0xdd},
1157 {0xb3, 0x00, 0x64, 0xcc},
1158 {0xb3, 0x00, 0x67, 0xcc},
1159 {0xb3, 0x05, 0x01, 0xcc},
1160 {0xb3, 0x06, 0x01, 0xcc},
1161 {0xb3, 0x08, 0x01, 0xcc},
1162 {0xb3, 0x09, 0x0c, 0xcc},
1163 {0xb3, 0x34, 0x02, 0xcc},
1164 {0xb3, 0x35, 0xc8, 0xcc},
1165 {0xb3, 0x02, 0x00, 0xcc},
1166 {0xb3, 0x03, 0x0a, 0xcc},
1167 {0xb3, 0x04, 0x05, 0xcc},
1168 {0xb3, 0x20, 0x00, 0xcc},
1169 {0xb3, 0x21, 0x00, 0xcc},
1170 {0xb3, 0x22, 0x01, 0xcc},
1171 {0xb3, 0x23, 0xe0, 0xcc},
1172 {0xb3, 0x14, 0x00, 0xcc},
1173 {0xb3, 0x15, 0x00, 0xcc},
1174 {0xb3, 0x16, 0x02, 0xcc},
1175 {0xb3, 0x17, 0x7f, 0xcc},
1176 {0xb3, 0x00, 0x67, 0xcc},
1177 {0xb8, 0x00, 0x00, 0xcc},
1178 {0xbc, 0x00, 0xd1, 0xcc},
1179 {0xbc, 0x01, 0x01, 0xcc},
1180 {0xb3, 0x5c, 0x01, 0xcc},
1181 {0xf0, 0x00, 0x02, 0xbb},
1182 {0x00, 0x00, 0x10, 0xdd},
1183 {0xc8, 0x00, 0x00, 0xbb},
1184 {0x00, 0x00, 0x30, 0xdd},
1185 {0xf0, 0x00, 0x00, 0xbb},
1186 {0x00, 0x00, 0x10, 0xdd},
1187 {0x07, 0x00, 0xe0, 0xbb},
1188 {0x08, 0x00, 0x0b, 0xbb},
1189 {0x21, 0x00, 0x0c, 0xbb},
1190 {0x20, 0x01, 0x03, 0xbb},
1191 {0xbf, 0xc0, 0x26, 0xcc},
1192 {0xbf, 0xc1, 0x02, 0xcc},
1193 {0xbf, 0xcc, 0x04, 0xcc},
1194 {0xbc, 0x02, 0x18, 0xcc},
1195 {0xbc, 0x03, 0x50, 0xcc},
1196 {0xbc, 0x04, 0x18, 0xcc},
1197 {0xbc, 0x05, 0x00, 0xcc},
1198 {0xbc, 0x06, 0x00, 0xcc},
1199 {0xbc, 0x08, 0x30, 0xcc},
1200 {0xbc, 0x09, 0x40, 0xcc},
1201 {0xbc, 0x0a, 0x10, 0xcc},
1202 {0xbc, 0x0b, 0x00, 0xcc},
1203 {0xbc, 0x0c, 0x00, 0xcc},
1204 {0xb3, 0x01, 0x41, 0xcc},
1205 {0xf0, 0x00, 0x00, 0xbb},
1206 {0x05, 0x01, 0x78, 0xbb},
1207 {0x06, 0x00, 0x11, 0xbb},
1208 {0x07, 0x01, 0x42, 0xbb},
1209 {0x08, 0x00, 0x11, 0xbb},
1210 {0x20, 0x01, 0x03, 0xbb},
1211 {0x21, 0x80, 0x00, 0xbb},
1212 {0x22, 0x0d, 0x0f, 0xbb},
1213 {0x24, 0x80, 0x00, 0xbb},
1214 {0x59, 0x00, 0xff, 0xbb},
1215 {0xf0, 0x00, 0x02, 0xbb},
1216 {0x39, 0x03, 0xca, 0xbb},
1217 {0x3a, 0x06, 0x80, 0xbb},
1218 {0x3b, 0x01, 0x52, 0xbb},
1219 {0x3c, 0x05, 0x40, 0xbb},
1220 {0x57, 0x01, 0x9c, 0xbb},
1221 {0x58, 0x01, 0xee, 0xbb},
1222 {0x59, 0x00, 0xf0, 0xbb},
1223 {0x5a, 0x01, 0x20, 0xbb},
1224 {0x5c, 0x1d, 0x17, 0xbb},
1225 {0x5d, 0x22, 0x1c, 0xbb},
1226 {0x64, 0x1e, 0x1c, 0xbb},
1227 {0x5b, 0x00, 0x00, 0xbb},
1228 {0xf0, 0x00, 0x02, 0xbb},
1229 {0x22, 0xa0, 0x78, 0xbb},
1230 {0x23, 0xa0, 0x78, 0xbb},
1231 {0x24, 0x7f, 0x00, 0xbb},
1232 {0x28, 0xea, 0x02, 0xbb},
1233 {0x29, 0x86, 0x7a, 0xbb},
1234 {0x5e, 0x52, 0x4c, 0xbb},
1235 {0x5f, 0x20, 0x24, 0xbb},
1236 {0x60, 0x00, 0x02, 0xbb},
1237 {0x02, 0x00, 0xee, 0xbb},
1238 {0x03, 0x39, 0x23, 0xbb},
1239 {0x04, 0x07, 0x24, 0xbb},
1240 {0x09, 0x00, 0xc0, 0xbb},
1241 {0x0a, 0x00, 0x79, 0xbb},
1242 {0x0b, 0x00, 0x04, 0xbb},
1243 {0x0c, 0x00, 0x5c, 0xbb},
1244 {0x0d, 0x00, 0xd9, 0xbb},
1245 {0x0e, 0x00, 0x53, 0xbb},
1246 {0x0f, 0x00, 0x21, 0xbb},
1247 {0x10, 0x00, 0xa4, 0xbb},
1248 {0x11, 0x00, 0xe5, 0xbb},
1249 {0x15, 0x00, 0x00, 0xbb},
1250 {0x16, 0x00, 0x00, 0xbb},
1251 {0x17, 0x00, 0x00, 0xbb},
1252 {0x18, 0x00, 0x00, 0xbb},
1253 {0x19, 0x00, 0x00, 0xbb},
1254 {0x1a, 0x00, 0x00, 0xbb},
1255 {0x1b, 0x00, 0x00, 0xbb},
1256 {0x1c, 0x00, 0x00, 0xbb},
1257 {0x1d, 0x00, 0x00, 0xbb},
1258 {0x1e, 0x00, 0x00, 0xbb},
1259 {0xf0, 0x00, 0x01, 0xbb},
1260 {0x06, 0xe0, 0x0e, 0xbb},
1261 {0x06, 0x60, 0x0e, 0xbb},
1262 {0xb3, 0x5c, 0x01, 0xcc},
1263 {}
1264};
1010static const u8 mi1320_soc_InitQVGA_JPG[][4] = { 1265static const u8 mi1320_soc_InitQVGA_JPG[][4] = {
1011 {0xb3, 0x01, 0x01, 0xcc}, 1266 {0xb3, 0x01, 0x01, 0xcc},
1012 {0xb0, 0x03, 0x19, 0xcc}, 1267 {0xb0, 0x03, 0x19, 0xcc},
@@ -1269,6 +1524,129 @@ static const u8 mi1320_soc_InitSXGA_JPG[][4] = {
1269 {0x2f, 0x90, 0x00, 0xbb}, 1524 {0x2f, 0x90, 0x00, 0xbb},
1270 {} 1525 {}
1271}; 1526};
1527static const u8 mi1320_soc_InitSXGA[][4] = {
1528 {0xb3, 0x01, 0x01, 0xcc},
1529 {0xb0, 0x03, 0x19, 0xcc},
1530 {0x00, 0x00, 0x30, 0xdd},
1531 {0xb3, 0x00, 0x64, 0xcc},
1532 {0xb3, 0x00, 0x67, 0xcc},
1533 {0xb3, 0x05, 0x01, 0xcc},
1534 {0xb3, 0x06, 0x01, 0xcc},
1535 {0xb3, 0x08, 0x01, 0xcc},
1536 {0xb3, 0x09, 0x0c, 0xcc},
1537 {0xb3, 0x34, 0x02, 0xcc},
1538 {0xb3, 0x35, 0xc8, 0xcc},
1539 {0xb3, 0x02, 0x00, 0xcc},
1540 {0xb3, 0x03, 0x0a, 0xcc},
1541 {0xb3, 0x04, 0x05, 0xcc},
1542 {0xb3, 0x20, 0x00, 0xcc},
1543 {0xb3, 0x21, 0x00, 0xcc},
1544 {0xb3, 0x22, 0x04, 0xcc},
1545 {0xb3, 0x23, 0x00, 0xcc},
1546 {0xb3, 0x14, 0x00, 0xcc},
1547 {0xb3, 0x15, 0x00, 0xcc},
1548 {0xb3, 0x16, 0x04, 0xcc},
1549 {0xb3, 0x17, 0xff, 0xcc},
1550 {0xb3, 0x00, 0x67, 0xcc},
1551 {0xbc, 0x00, 0x71, 0xcc},
1552 {0xbc, 0x01, 0x01, 0xcc},
1553 {0xb3, 0x5c, 0x01, 0xcc},
1554 {0xf0, 0x00, 0x02, 0xbb},
1555 {0x00, 0x00, 0x30, 0xdd},
1556 {0xc8, 0x9f, 0x0b, 0xbb},
1557 {0x00, 0x00, 0x20, 0xdd},
1558 {0x5b, 0x00, 0x01, 0xbb},
1559 {0x00, 0x00, 0x20, 0xdd},
1560 {0xf0, 0x00, 0x00, 0xbb},
1561 {0x00, 0x00, 0x30, 0xdd},
1562 {0x20, 0x01, 0x03, 0xbb},
1563 {0x00, 0x00, 0x20, 0xdd},
1564 {0xbf, 0xc0, 0x26, 0xcc},
1565 {0xbf, 0xc1, 0x02, 0xcc},
1566 {0xbf, 0xcc, 0x04, 0xcc},
1567 {0xb3, 0x01, 0x41, 0xcc},
1568 {0xf0, 0x00, 0x00, 0xbb},
1569 {0x05, 0x01, 0x78, 0xbb},
1570 {0x06, 0x00, 0x11, 0xbb},
1571 {0x07, 0x01, 0x42, 0xbb},
1572 {0x08, 0x00, 0x11, 0xbb},
1573 {0x20, 0x01, 0x03, 0xbb},
1574 {0x21, 0x80, 0x00, 0xbb},
1575 {0x22, 0x0d, 0x0f, 0xbb},
1576 {0x24, 0x80, 0x00, 0xbb},
1577 {0x59, 0x00, 0xff, 0xbb},
1578 {0xf0, 0x00, 0x02, 0xbb},
1579 {0x39, 0x03, 0xca, 0xbb},
1580 {0x3a, 0x06, 0x80, 0xbb},
1581 {0x3b, 0x01, 0x52, 0xbb},
1582 {0x3c, 0x05, 0x40, 0xbb},
1583 {0x57, 0x01, 0x9c, 0xbb},
1584 {0x58, 0x01, 0xee, 0xbb},
1585 {0x59, 0x00, 0xf0, 0xbb},
1586 {0x5a, 0x01, 0x20, 0xbb},
1587 {0x5c, 0x1d, 0x17, 0xbb},
1588 {0x5d, 0x22, 0x1c, 0xbb},
1589 {0x64, 0x1e, 0x1c, 0xbb},
1590 {0x5b, 0x00, 0x00, 0xbb},
1591 {0xf0, 0x00, 0x02, 0xbb},
1592 {0x22, 0xa0, 0x78, 0xbb},
1593 {0x23, 0xa0, 0x78, 0xbb},
1594 {0x24, 0x7f, 0x00, 0xbb},
1595 {0x28, 0xea, 0x02, 0xbb},
1596 {0x29, 0x86, 0x7a, 0xbb},
1597 {0x5e, 0x52, 0x4c, 0xbb},
1598 {0x5f, 0x20, 0x24, 0xbb},
1599 {0x60, 0x00, 0x02, 0xbb},
1600 {0x02, 0x00, 0xee, 0xbb},
1601 {0x03, 0x39, 0x23, 0xbb},
1602 {0x04, 0x07, 0x24, 0xbb},
1603 {0x09, 0x00, 0xc0, 0xbb},
1604 {0x0a, 0x00, 0x79, 0xbb},
1605 {0x0b, 0x00, 0x04, 0xbb},
1606 {0x0c, 0x00, 0x5c, 0xbb},
1607 {0x0d, 0x00, 0xd9, 0xbb},
1608 {0x0e, 0x00, 0x53, 0xbb},
1609 {0x0f, 0x00, 0x21, 0xbb},
1610 {0x10, 0x00, 0xa4, 0xbb},
1611 {0x11, 0x00, 0xe5, 0xbb},
1612 {0x15, 0x00, 0x00, 0xbb},
1613 {0x16, 0x00, 0x00, 0xbb},
1614 {0x17, 0x00, 0x00, 0xbb},
1615 {0x18, 0x00, 0x00, 0xbb},
1616 {0x19, 0x00, 0x00, 0xbb},
1617 {0x1a, 0x00, 0x00, 0xbb},
1618 {0x1b, 0x00, 0x00, 0xbb},
1619 {0x1c, 0x00, 0x00, 0xbb},
1620 {0x1d, 0x00, 0x00, 0xbb},
1621 {0x1e, 0x00, 0x00, 0xbb},
1622 {0xf0, 0x00, 0x01, 0xbb},
1623 {0x06, 0xe0, 0x0e, 0xbb},
1624 {0x06, 0x60, 0x0e, 0xbb},
1625 {0xb3, 0x5c, 0x01, 0xcc},
1626 {0xf0, 0x00, 0x00, 0xbb},
1627 {0x05, 0x01, 0x13, 0xbb},
1628 {0x06, 0x00, 0x11, 0xbb},
1629 {0x07, 0x00, 0x85, 0xbb},
1630 {0x08, 0x00, 0x27, 0xbb},
1631 {0x20, 0x01, 0x03, 0xbb},
1632 {0x21, 0x80, 0x00, 0xbb},
1633 {0x22, 0x0d, 0x0f, 0xbb},
1634 {0x24, 0x80, 0x00, 0xbb},
1635 {0x59, 0x00, 0xff, 0xbb},
1636 {0xf0, 0x00, 0x02, 0xbb},
1637 {0x39, 0x03, 0x0d, 0xbb},
1638 {0x3a, 0x06, 0x1b, 0xbb},
1639 {0x3b, 0x00, 0x95, 0xbb},
1640 {0x3c, 0x04, 0xdb, 0xbb},
1641 {0x57, 0x02, 0x00, 0xbb},
1642 {0x58, 0x02, 0x66, 0xbb},
1643 {0x59, 0x00, 0xff, 0xbb},
1644 {0x5a, 0x01, 0x33, 0xbb},
1645 {0x5c, 0x12, 0x0d, 0xbb},
1646 {0x5d, 0x16, 0x11, 0xbb},
1647 {0x64, 0x5e, 0x1c, 0xbb},
1648 {}
1649};
1272static const __u8 po3130_gamma[17] = { 1650static const __u8 po3130_gamma[17] = {
1273 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, 1651 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1274 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff 1652 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
@@ -2516,20 +2894,23 @@ static int sd_config(struct gspca_dev *gspca_dev,
2516 cam->cam_mode = vc0321_mode; 2894 cam->cam_mode = vc0321_mode;
2517 cam->nmodes = ARRAY_SIZE(vc0321_mode); 2895 cam->nmodes = ARRAY_SIZE(vc0321_mode);
2518 } else { 2896 } else {
2519 if (sensor != SENSOR_PO1200) { 2897 switch (sensor) {
2520 cam->cam_mode = vc0323_mode; 2898 case SENSOR_PO1200:
2521 switch (sensor) {
2522 case SENSOR_MI1310_SOC:
2523 case SENSOR_MI1320_SOC:
2524 cam->nmodes = ARRAY_SIZE(vc0323_mode);
2525 break;
2526 default: /* no SXGA */
2527 cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
2528 break;
2529 }
2530 } else {
2531 cam->cam_mode = svga_mode; 2899 cam->cam_mode = svga_mode;
2532 cam->nmodes = ARRAY_SIZE(svga_mode); 2900 cam->nmodes = ARRAY_SIZE(svga_mode);
2901 break;
2902 case SENSOR_MI1310_SOC:
2903 cam->cam_mode = vc0323_mode;
2904 cam->nmodes = ARRAY_SIZE(vc0323_mode);
2905 break;
2906 case SENSOR_MI1320_SOC:
2907 cam->cam_mode = bi_mode;
2908 cam->nmodes = ARRAY_SIZE(bi_mode);
2909 break;
2910 default:
2911 cam->cam_mode = vc0323_mode;
2912 cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
2913 break;
2533 } 2914 }
2534 } 2915 }
2535 2916
@@ -2632,6 +3013,14 @@ static int sd_start(struct gspca_dev *gspca_dev)
2632 const __u8 *GammaT = NULL; 3013 const __u8 *GammaT = NULL;
2633 const __u8 *MatrixT = NULL; 3014 const __u8 *MatrixT = NULL;
2634 int mode; 3015 int mode;
3016 static const u8 (*mi1320_soc_init[])[4] = {
3017 mi1320_soc_InitSXGA,
3018 mi1320_soc_InitSXGA_JPG,
3019 mi1320_soc_InitVGA,
3020 mi1320_soc_InitVGA_JPG,
3021 mi1320_soc_InitQVGA,
3022 mi1320_soc_InitQVGA_JPG
3023 };
2635 3024
2636 /* Assume start use the good resolution from gspca_dev->mode */ 3025 /* Assume start use the good resolution from gspca_dev->mode */
2637 if (sd->bridge == BRIDGE_VC0321) { 3026 if (sd->bridge == BRIDGE_VC0321) {
@@ -2639,6 +3028,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
2639 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfed); 3028 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfed);
2640 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfee); 3029 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfee);
2641 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfef); 3030 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfef);
3031 sd->image_offset = 46;
3032 } else {
3033 if (gspca_dev->cam.cam_mode[gspca_dev->curr_mode].pixelformat
3034 == V4L2_PIX_FMT_JPEG)
3035 sd->image_offset = 0;
3036 else
3037 sd->image_offset = 32;
2642 } 3038 }
2643 3039
2644 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; 3040 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
@@ -2701,17 +3097,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
2701 case SENSOR_MI1320_SOC: 3097 case SENSOR_MI1320_SOC:
2702 GammaT = mi1320_gamma; 3098 GammaT = mi1320_gamma;
2703 MatrixT = mi1320_matrix; 3099 MatrixT = mi1320_matrix;
2704 switch (mode) { 3100 init = mi1320_soc_init[mode];
2705 case 1:
2706 init = mi1320_soc_InitQVGA_JPG; /* 320x240 */
2707 break;
2708 case 0:
2709 init = mi1320_soc_InitVGA_JPG; /* 640x480 */
2710 break;
2711 default:
2712 init = mi1320_soc_InitSXGA_JPG; /* 1280x1024 */
2713 break;
2714 }
2715 break; 3101 break;
2716 case SENSOR_PO3130NC: 3102 case SENSOR_PO3130NC:
2717 GammaT = po3130_gamma; 3103 GammaT = po3130_gamma;
@@ -2783,12 +3169,8 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2783 "vc032x header packet found len %d", len); 3169 "vc032x header packet found len %d", len);
2784 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, 3170 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
2785 data, 0); 3171 data, 0);
2786 if (sd->bridge == BRIDGE_VC0321) { 3172 data += sd->image_offset;
2787#define VCHDRSZ 46 3173 len -= sd->image_offset;
2788 data += VCHDRSZ;
2789 len -= VCHDRSZ;
2790#undef VCHDRSZ
2791 }
2792 gspca_frame_add(gspca_dev, FIRST_PACKET, frame, 3174 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2793 data, len); 3175 data, len);
2794 return; 3176 return;