/drivers/media/video/gspca/sonixj.c

https://bitbucket.org/ndreys/linux-sunxi · C · 3115 lines · 2582 code · 218 blank · 315 comment · 197 complexity · a3e7656da81cae8cfe5226b4f8068b60 MD5 · raw file

Large files are truncated click here to view the full file

  1. /*
  2. * Sonix sn9c102p sn9c105 sn9c120 (jpeg) subdriver
  3. *
  4. * Copyright (C) 2009-2010 Jean-Fran??ois Moine <http://moinejf.free.fr>
  5. * Copyright (C) 2005 Michel Xhaard mxhaard@magic.fr
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #define MODULE_NAME "sonixj"
  22. #include <linux/input.h>
  23. #include "gspca.h"
  24. #include "jpeg.h"
  25. MODULE_AUTHOR("Jean-Fran??ois Moine <http://moinejf.free.fr>");
  26. MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver");
  27. MODULE_LICENSE("GPL");
  28. /* controls */
  29. enum e_ctrl {
  30. BRIGHTNESS,
  31. CONTRAST,
  32. COLORS,
  33. BLUE,
  34. RED,
  35. GAMMA,
  36. AUTOGAIN,
  37. HFLIP,
  38. VFLIP,
  39. SHARPNESS,
  40. ILLUM,
  41. FREQ,
  42. NCTRLS /* number of controls */
  43. };
  44. /* specific webcam descriptor */
  45. struct sd {
  46. struct gspca_dev gspca_dev; /* !! must be the first item */
  47. struct gspca_ctrl ctrls[NCTRLS];
  48. atomic_t avg_lum;
  49. u32 exposure;
  50. struct work_struct work;
  51. struct workqueue_struct *work_thread;
  52. u32 pktsz; /* (used by pkt_scan) */
  53. u16 npkt;
  54. s8 nchg;
  55. s8 short_mark;
  56. u8 quality; /* image quality */
  57. #define QUALITY_MIN 25
  58. #define QUALITY_MAX 90
  59. #define QUALITY_DEF 70
  60. u8 reg01;
  61. u8 reg17;
  62. u8 reg18;
  63. u8 flags;
  64. s8 ag_cnt;
  65. #define AG_CNT_START 13
  66. u8 bridge;
  67. #define BRIDGE_SN9C102P 0
  68. #define BRIDGE_SN9C105 1
  69. #define BRIDGE_SN9C110 2
  70. #define BRIDGE_SN9C120 3
  71. u8 sensor; /* Type of image sensor chip */
  72. u8 i2c_addr;
  73. u8 jpeg_hdr[JPEG_HDR_SZ];
  74. };
  75. enum sensors {
  76. SENSOR_ADCM1700,
  77. SENSOR_GC0307,
  78. SENSOR_HV7131R,
  79. SENSOR_MI0360,
  80. SENSOR_MI0360B,
  81. SENSOR_MO4000,
  82. SENSOR_MT9V111,
  83. SENSOR_OM6802,
  84. SENSOR_OV7630,
  85. SENSOR_OV7648,
  86. SENSOR_OV7660,
  87. SENSOR_PO1030,
  88. SENSOR_PO2030N,
  89. SENSOR_SOI768,
  90. SENSOR_SP80708,
  91. };
  92. static void qual_upd(struct work_struct *work);
  93. /* device flags */
  94. #define F_PDN_INV 0x01 /* inverse pin S_PWR_DN / sn_xxx tables */
  95. #define F_ILLUM 0x02 /* presence of illuminator */
  96. /* sn9c1xx definitions */
  97. /* register 0x01 */
  98. #define S_PWR_DN 0x01 /* sensor power down */
  99. #define S_PDN_INV 0x02 /* inverse pin S_PWR_DN */
  100. #define V_TX_EN 0x04 /* video transfer enable */
  101. #define LED 0x08 /* output to pin LED */
  102. #define SCL_SEL_OD 0x20 /* open-drain mode */
  103. #define SYS_SEL_48M 0x40 /* system clock 0: 24MHz, 1: 48MHz */
  104. /* register 0x17 */
  105. #define MCK_SIZE_MASK 0x1f /* sensor master clock */
  106. #define SEN_CLK_EN 0x20 /* enable sensor clock */
  107. #define DEF_EN 0x80 /* defect pixel by 0: soft, 1: hard */
  108. /* V4L2 controls supported by the driver */
  109. static void setbrightness(struct gspca_dev *gspca_dev);
  110. static void setcontrast(struct gspca_dev *gspca_dev);
  111. static void setcolors(struct gspca_dev *gspca_dev);
  112. static void setredblue(struct gspca_dev *gspca_dev);
  113. static void setgamma(struct gspca_dev *gspca_dev);
  114. static void setautogain(struct gspca_dev *gspca_dev);
  115. static void sethvflip(struct gspca_dev *gspca_dev);
  116. static void setsharpness(struct gspca_dev *gspca_dev);
  117. static void setillum(struct gspca_dev *gspca_dev);
  118. static void setfreq(struct gspca_dev *gspca_dev);
  119. static const struct ctrl sd_ctrls[NCTRLS] = {
  120. [BRIGHTNESS] = {
  121. {
  122. .id = V4L2_CID_BRIGHTNESS,
  123. .type = V4L2_CTRL_TYPE_INTEGER,
  124. .name = "Brightness",
  125. .minimum = 0,
  126. .maximum = 0xff,
  127. .step = 1,
  128. .default_value = 0x80,
  129. },
  130. .set_control = setbrightness
  131. },
  132. [CONTRAST] = {
  133. {
  134. .id = V4L2_CID_CONTRAST,
  135. .type = V4L2_CTRL_TYPE_INTEGER,
  136. .name = "Contrast",
  137. .minimum = 0,
  138. #define CONTRAST_MAX 127
  139. .maximum = CONTRAST_MAX,
  140. .step = 1,
  141. .default_value = 63,
  142. },
  143. .set_control = setcontrast
  144. },
  145. [COLORS] = {
  146. {
  147. .id = V4L2_CID_SATURATION,
  148. .type = V4L2_CTRL_TYPE_INTEGER,
  149. .name = "Saturation",
  150. .minimum = 0,
  151. .maximum = 40,
  152. .step = 1,
  153. #define COLORS_DEF 25
  154. .default_value = COLORS_DEF,
  155. },
  156. .set_control = setcolors
  157. },
  158. [BLUE] = {
  159. {
  160. .id = V4L2_CID_BLUE_BALANCE,
  161. .type = V4L2_CTRL_TYPE_INTEGER,
  162. .name = "Blue Balance",
  163. .minimum = 24,
  164. .maximum = 40,
  165. .step = 1,
  166. .default_value = 32,
  167. },
  168. .set_control = setredblue
  169. },
  170. [RED] = {
  171. {
  172. .id = V4L2_CID_RED_BALANCE,
  173. .type = V4L2_CTRL_TYPE_INTEGER,
  174. .name = "Red Balance",
  175. .minimum = 24,
  176. .maximum = 40,
  177. .step = 1,
  178. .default_value = 32,
  179. },
  180. .set_control = setredblue
  181. },
  182. [GAMMA] = {
  183. {
  184. .id = V4L2_CID_GAMMA,
  185. .type = V4L2_CTRL_TYPE_INTEGER,
  186. .name = "Gamma",
  187. .minimum = 0,
  188. .maximum = 40,
  189. .step = 1,
  190. #define GAMMA_DEF 20
  191. .default_value = GAMMA_DEF,
  192. },
  193. .set_control = setgamma
  194. },
  195. [AUTOGAIN] = {
  196. {
  197. .id = V4L2_CID_AUTOGAIN,
  198. .type = V4L2_CTRL_TYPE_BOOLEAN,
  199. .name = "Auto Gain",
  200. .minimum = 0,
  201. .maximum = 1,
  202. .step = 1,
  203. .default_value = 1
  204. },
  205. .set_control = setautogain
  206. },
  207. [HFLIP] = {
  208. {
  209. .id = V4L2_CID_HFLIP,
  210. .type = V4L2_CTRL_TYPE_BOOLEAN,
  211. .name = "Mirror",
  212. .minimum = 0,
  213. .maximum = 1,
  214. .step = 1,
  215. .default_value = 0,
  216. },
  217. .set_control = sethvflip
  218. },
  219. [VFLIP] = {
  220. {
  221. .id = V4L2_CID_VFLIP,
  222. .type = V4L2_CTRL_TYPE_BOOLEAN,
  223. .name = "Vflip",
  224. .minimum = 0,
  225. .maximum = 1,
  226. .step = 1,
  227. .default_value = 0,
  228. },
  229. .set_control = sethvflip
  230. },
  231. [SHARPNESS] = {
  232. {
  233. .id = V4L2_CID_SHARPNESS,
  234. .type = V4L2_CTRL_TYPE_INTEGER,
  235. .name = "Sharpness",
  236. .minimum = 0,
  237. .maximum = 255,
  238. .step = 1,
  239. .default_value = 90,
  240. },
  241. .set_control = setsharpness
  242. },
  243. [ILLUM] = {
  244. {
  245. .id = V4L2_CID_ILLUMINATORS_1,
  246. .type = V4L2_CTRL_TYPE_BOOLEAN,
  247. .name = "Illuminator / infrared",
  248. .minimum = 0,
  249. .maximum = 1,
  250. .step = 1,
  251. .default_value = 0,
  252. },
  253. .set_control = setillum
  254. },
  255. /* ov7630/ov7648/ov7660 only */
  256. [FREQ] = {
  257. {
  258. .id = V4L2_CID_POWER_LINE_FREQUENCY,
  259. .type = V4L2_CTRL_TYPE_MENU,
  260. .name = "Light frequency filter",
  261. .minimum = 0,
  262. .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */
  263. .step = 1,
  264. .default_value = 1,
  265. },
  266. .set_control = setfreq
  267. },
  268. };
  269. /* table of the disabled controls */
  270. static const __u32 ctrl_dis[] = {
  271. [SENSOR_ADCM1700] = (1 << AUTOGAIN) |
  272. (1 << HFLIP) |
  273. (1 << VFLIP) |
  274. (1 << FREQ),
  275. [SENSOR_GC0307] = (1 << HFLIP) |
  276. (1 << VFLIP) |
  277. (1 << FREQ),
  278. [SENSOR_HV7131R] = (1 << HFLIP) |
  279. (1 << FREQ),
  280. [SENSOR_MI0360] = (1 << HFLIP) |
  281. (1 << VFLIP) |
  282. (1 << FREQ),
  283. [SENSOR_MI0360B] = (1 << HFLIP) |
  284. (1 << VFLIP) |
  285. (1 << FREQ),
  286. [SENSOR_MO4000] = (1 << HFLIP) |
  287. (1 << VFLIP) |
  288. (1 << FREQ),
  289. [SENSOR_MT9V111] = (1 << HFLIP) |
  290. (1 << VFLIP) |
  291. (1 << FREQ),
  292. [SENSOR_OM6802] = (1 << HFLIP) |
  293. (1 << VFLIP) |
  294. (1 << FREQ),
  295. [SENSOR_OV7630] = (1 << HFLIP),
  296. [SENSOR_OV7648] = (1 << HFLIP),
  297. [SENSOR_OV7660] = (1 << AUTOGAIN) |
  298. (1 << HFLIP) |
  299. (1 << VFLIP),
  300. [SENSOR_PO1030] = (1 << AUTOGAIN) |
  301. (1 << HFLIP) |
  302. (1 << VFLIP) |
  303. (1 << FREQ),
  304. [SENSOR_PO2030N] = (1 << AUTOGAIN) |
  305. (1 << FREQ),
  306. [SENSOR_SOI768] = (1 << AUTOGAIN) |
  307. (1 << HFLIP) |
  308. (1 << VFLIP) |
  309. (1 << FREQ),
  310. [SENSOR_SP80708] = (1 << AUTOGAIN) |
  311. (1 << HFLIP) |
  312. (1 << VFLIP) |
  313. (1 << FREQ),
  314. };
  315. static const struct v4l2_pix_format cif_mode[] = {
  316. {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  317. .bytesperline = 352,
  318. .sizeimage = 352 * 288 * 4 / 8 + 590,
  319. .colorspace = V4L2_COLORSPACE_JPEG,
  320. .priv = 0},
  321. };
  322. static const struct v4l2_pix_format vga_mode[] = {
  323. {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  324. .bytesperline = 160,
  325. .sizeimage = 160 * 120 * 4 / 8 + 590,
  326. .colorspace = V4L2_COLORSPACE_JPEG,
  327. .priv = 2},
  328. {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  329. .bytesperline = 320,
  330. .sizeimage = 320 * 240 * 3 / 8 + 590,
  331. .colorspace = V4L2_COLORSPACE_JPEG,
  332. .priv = 1},
  333. {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  334. .bytesperline = 640,
  335. /* Note 3 / 8 is not large enough, not even 5 / 8 is ?! */
  336. .sizeimage = 640 * 480 * 3 / 4 + 590,
  337. .colorspace = V4L2_COLORSPACE_JPEG,
  338. .priv = 0},
  339. };
  340. static const u8 sn_adcm1700[0x1c] = {
  341. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  342. 0x00, 0x43, 0x60, 0x00, 0x1a, 0x00, 0x00, 0x00,
  343. /* reg8 reg9 rega regb regc regd rege regf */
  344. 0x80, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  345. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  346. 0x03, 0x00, 0x05, 0x01, 0x05, 0x16, 0x12, 0x42,
  347. /* reg18 reg19 reg1a reg1b */
  348. 0x06, 0x00, 0x00, 0x00
  349. };
  350. static const u8 sn_gc0307[0x1c] = {
  351. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  352. 0x00, 0x61, 0x62, 0x00, 0x1a, 0x00, 0x00, 0x00,
  353. /* reg8 reg9 rega regb regc regd rege regf */
  354. 0x80, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  355. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  356. 0x03, 0x00, 0x03, 0x01, 0x08, 0x28, 0x1e, 0x02,
  357. /* reg18 reg19 reg1a reg1b */
  358. 0x06, 0x00, 0x00, 0x00
  359. };
  360. static const u8 sn_hv7131[0x1c] = {
  361. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  362. 0x00, 0x03, 0x60, 0x00, 0x1a, 0x20, 0x20, 0x20,
  363. /* reg8 reg9 rega regb regc regd rege regf */
  364. 0x81, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  365. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  366. 0x03, 0x00, 0x00, 0x01, 0x03, 0x28, 0x1e, 0x41,
  367. /* reg18 reg19 reg1a reg1b */
  368. 0x0a, 0x00, 0x00, 0x00
  369. };
  370. static const u8 sn_mi0360[0x1c] = {
  371. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  372. 0x00, 0x63, 0x40, 0x00, 0x1a, 0x20, 0x20, 0x20,
  373. /* reg8 reg9 rega regb regc regd rege regf */
  374. 0x81, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  375. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  376. 0x03, 0x00, 0x00, 0x02, 0x0a, 0x28, 0x1e, 0x61,
  377. /* reg18 reg19 reg1a reg1b */
  378. 0x06, 0x00, 0x00, 0x00
  379. };
  380. static const u8 sn_mi0360b[0x1c] = {
  381. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  382. 0x00, 0x61, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
  383. /* reg8 reg9 rega regb regc regd rege regf */
  384. 0x81, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  385. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  386. 0x03, 0x00, 0x00, 0x02, 0x0a, 0x28, 0x1e, 0x40,
  387. /* reg18 reg19 reg1a reg1b */
  388. 0x06, 0x00, 0x00, 0x00
  389. };
  390. static const u8 sn_mo4000[0x1c] = {
  391. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  392. 0x00, 0x23, 0x60, 0x00, 0x1a, 0x00, 0x20, 0x18,
  393. /* reg8 reg9 rega regb regc regd rege regf */
  394. 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  395. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  396. 0x03, 0x00, 0x0b, 0x0f, 0x14, 0x28, 0x1e, 0x40,
  397. /* reg18 reg19 reg1a reg1b */
  398. 0x08, 0x00, 0x00, 0x00
  399. };
  400. static const u8 sn_mt9v111[0x1c] = {
  401. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  402. 0x00, 0x61, 0x40, 0x00, 0x1a, 0x20, 0x20, 0x20,
  403. /* reg8 reg9 rega regb regc regd rege regf */
  404. 0x81, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  405. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  406. 0x03, 0x00, 0x00, 0x02, 0x1c, 0x28, 0x1e, 0x40,
  407. /* reg18 reg19 reg1a reg1b */
  408. 0x06, 0x00, 0x00, 0x00
  409. };
  410. static const u8 sn_om6802[0x1c] = {
  411. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  412. 0x00, 0x23, 0x72, 0x00, 0x1a, 0x20, 0x20, 0x19,
  413. /* reg8 reg9 rega regb regc regd rege regf */
  414. 0x80, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  415. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  416. 0x03, 0x00, 0x51, 0x01, 0x00, 0x28, 0x1e, 0x40,
  417. /* reg18 reg19 reg1a reg1b */
  418. 0x05, 0x00, 0x00, 0x00
  419. };
  420. static const u8 sn_ov7630[0x1c] = {
  421. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  422. 0x00, 0x21, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
  423. /* reg8 reg9 rega regb regc regd rege regf */
  424. 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  425. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  426. 0x03, 0x00, 0x04, 0x01, 0x0a, 0x28, 0x1e, 0xc2,
  427. /* reg18 reg19 reg1a reg1b */
  428. 0x0b, 0x00, 0x00, 0x00
  429. };
  430. static const u8 sn_ov7648[0x1c] = {
  431. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  432. 0x00, 0x63, 0x40, 0x00, 0x1a, 0x20, 0x20, 0x20,
  433. /* reg8 reg9 rega regb regc regd rege regf */
  434. 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  435. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  436. 0x03, 0x00, 0x00, 0x01, 0x00, 0x28, 0x1e, 0x00,
  437. /* reg18 reg19 reg1a reg1b */
  438. 0x0b, 0x00, 0x00, 0x00
  439. };
  440. static const u8 sn_ov7660[0x1c] = {
  441. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  442. 0x00, 0x61, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
  443. /* reg8 reg9 rega regb regc regd rege regf */
  444. 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  445. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  446. 0x03, 0x00, 0x01, 0x01, 0x08, 0x28, 0x1e, 0x20,
  447. /* reg18 reg19 reg1a reg1b */
  448. 0x07, 0x00, 0x00, 0x00
  449. };
  450. static const u8 sn_po1030[0x1c] = {
  451. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  452. 0x00, 0x21, 0x62, 0x00, 0x1a, 0x20, 0x20, 0x20,
  453. /* reg8 reg9 rega regb regc regd rege regf */
  454. 0x81, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  455. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  456. 0x03, 0x00, 0x00, 0x06, 0x06, 0x28, 0x1e, 0x00,
  457. /* reg18 reg19 reg1a reg1b */
  458. 0x07, 0x00, 0x00, 0x00
  459. };
  460. static const u8 sn_po2030n[0x1c] = {
  461. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  462. 0x00, 0x63, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
  463. /* reg8 reg9 rega regb regc regd rege regf */
  464. 0x81, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  465. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  466. 0x03, 0x00, 0x00, 0x01, 0x14, 0x28, 0x1e, 0x00,
  467. /* reg18 reg19 reg1a reg1b */
  468. 0x07, 0x00, 0x00, 0x00
  469. };
  470. static const u8 sn_soi768[0x1c] = {
  471. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  472. 0x00, 0x21, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00,
  473. /* reg8 reg9 rega regb regc regd rege regf */
  474. 0x81, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  475. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  476. 0x03, 0x00, 0x00, 0x01, 0x08, 0x28, 0x1e, 0x00,
  477. /* reg18 reg19 reg1a reg1b */
  478. 0x07, 0x00, 0x00, 0x00
  479. };
  480. static const u8 sn_sp80708[0x1c] = {
  481. /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */
  482. 0x00, 0x63, 0x60, 0x00, 0x1a, 0x20, 0x20, 0x20,
  483. /* reg8 reg9 rega regb regc regd rege regf */
  484. 0x81, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  485. /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */
  486. 0x03, 0x00, 0x00, 0x03, 0x04, 0x28, 0x1e, 0x00,
  487. /* reg18 reg19 reg1a reg1b */
  488. 0x07, 0x00, 0x00, 0x00
  489. };
  490. /* sequence specific to the sensors - !! index = SENSOR_xxx */
  491. static const u8 *sn_tb[] = {
  492. [SENSOR_ADCM1700] = sn_adcm1700,
  493. [SENSOR_GC0307] = sn_gc0307,
  494. [SENSOR_HV7131R] = sn_hv7131,
  495. [SENSOR_MI0360] = sn_mi0360,
  496. [SENSOR_MI0360B] = sn_mi0360b,
  497. [SENSOR_MO4000] = sn_mo4000,
  498. [SENSOR_MT9V111] = sn_mt9v111,
  499. [SENSOR_OM6802] = sn_om6802,
  500. [SENSOR_OV7630] = sn_ov7630,
  501. [SENSOR_OV7648] = sn_ov7648,
  502. [SENSOR_OV7660] = sn_ov7660,
  503. [SENSOR_PO1030] = sn_po1030,
  504. [SENSOR_PO2030N] = sn_po2030n,
  505. [SENSOR_SOI768] = sn_soi768,
  506. [SENSOR_SP80708] = sn_sp80708,
  507. };
  508. /* default gamma table */
  509. static const u8 gamma_def[17] = {
  510. 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99,
  511. 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff
  512. };
  513. /* gamma for sensor ADCM1700 */
  514. static const u8 gamma_spec_0[17] = {
  515. 0x0f, 0x39, 0x5a, 0x74, 0x86, 0x95, 0xa6, 0xb4,
  516. 0xbd, 0xc4, 0xcc, 0xd4, 0xd5, 0xde, 0xe4, 0xed, 0xf5
  517. };
  518. /* gamma for sensors HV7131R and MT9V111 */
  519. static const u8 gamma_spec_1[17] = {
  520. 0x08, 0x3a, 0x52, 0x65, 0x75, 0x83, 0x91, 0x9d,
  521. 0xa9, 0xb4, 0xbe, 0xc8, 0xd2, 0xdb, 0xe4, 0xed, 0xf5
  522. };
  523. /* gamma for sensor GC0307 */
  524. static const u8 gamma_spec_2[17] = {
  525. 0x14, 0x37, 0x50, 0x6a, 0x7c, 0x8d, 0x9d, 0xab,
  526. 0xb5, 0xbf, 0xc2, 0xcb, 0xd1, 0xd6, 0xdb, 0xe1, 0xeb
  527. };
  528. /* gamma for sensor SP80708 */
  529. static const u8 gamma_spec_3[17] = {
  530. 0x0a, 0x2d, 0x4e, 0x68, 0x7d, 0x8f, 0x9f, 0xab,
  531. 0xb7, 0xc2, 0xcc, 0xd3, 0xd8, 0xde, 0xe2, 0xe5, 0xe6
  532. };
  533. /* color matrix and offsets */
  534. static const u8 reg84[] = {
  535. 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, /* YR YG YB gains */
  536. 0xe8, 0x0f, 0xda, 0x0f, 0x40, 0x00, /* UR UG UB */
  537. 0x3e, 0x00, 0xcd, 0x0f, 0xf7, 0x0f, /* VR VG VB */
  538. 0x00, 0x00, 0x00 /* YUV offsets */
  539. };
  540. #define DELAY 0xdd
  541. static const u8 adcm1700_sensor_init[][8] = {
  542. {0xa0, 0x51, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x10},
  543. {0xb0, 0x51, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10}, /* reset */
  544. {DELAY, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  545. {0xb0, 0x51, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10},
  546. {DELAY, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  547. {0xb0, 0x51, 0x0c, 0xe0, 0x2e, 0x00, 0x00, 0x10},
  548. {0xb0, 0x51, 0x10, 0x02, 0x02, 0x00, 0x00, 0x10},
  549. {0xb0, 0x51, 0x14, 0x0e, 0x0e, 0x00, 0x00, 0x10},
  550. {0xb0, 0x51, 0x1c, 0x00, 0x80, 0x00, 0x00, 0x10},
  551. {0xb0, 0x51, 0x20, 0x01, 0x00, 0x00, 0x00, 0x10},
  552. {DELAY, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  553. {0xb0, 0x51, 0x04, 0x04, 0x00, 0x00, 0x00, 0x10},
  554. {DELAY, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  555. {0xb0, 0x51, 0x04, 0x01, 0x00, 0x00, 0x00, 0x10},
  556. {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10},
  557. {0xb0, 0x51, 0x14, 0x01, 0x00, 0x00, 0x00, 0x10},
  558. {0xb0, 0x51, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10},
  559. {}
  560. };
  561. static const u8 adcm1700_sensor_param1[][8] = {
  562. {0xb0, 0x51, 0x26, 0xf9, 0x01, 0x00, 0x00, 0x10}, /* exposure? */
  563. {0xd0, 0x51, 0x1e, 0x8e, 0x8e, 0x8e, 0x8e, 0x10},
  564. {0xa0, 0x51, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x10},
  565. {0xb0, 0x51, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10},
  566. {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10},
  567. {0xb0, 0x51, 0x32, 0x00, 0x72, 0x00, 0x00, 0x10},
  568. {0xd0, 0x51, 0x1e, 0xbe, 0xd7, 0xe8, 0xbe, 0x10}, /* exposure? */
  569. {0xa0, 0x51, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x10},
  570. {0xb0, 0x51, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10},
  571. {0xa0, 0x51, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x10},
  572. {0xb0, 0x51, 0x32, 0x00, 0xa2, 0x00, 0x00, 0x10},
  573. {}
  574. };
  575. static const u8 gc0307_sensor_init[][8] = {
  576. {0xa0, 0x21, 0x43, 0x00, 0x00, 0x00, 0x00, 0x10},
  577. {0xa0, 0x21, 0x44, 0xa2, 0x00, 0x00, 0x00, 0x10},
  578. {0xa0, 0x21, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10},
  579. {0xa0, 0x21, 0x02, 0x70, 0x00, 0x00, 0x00, 0x10},
  580. {0xa0, 0x21, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
  581. {0xa0, 0x21, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x10},
  582. {0xa0, 0x21, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x10},
  583. {0xa0, 0x21, 0x11, 0x05, 0x00, 0x00, 0x00, 0x10},
  584. {0xa0, 0x21, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10},
  585. {0xa0, 0x21, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10},
  586. {0xa0, 0x21, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10},
  587. {0xa0, 0x21, 0x08, 0x02, 0x00, 0x00, 0x00, 0x10},
  588. {0xa0, 0x21, 0x09, 0x01, 0x00, 0x00, 0x00, 0x10},
  589. {0xa0, 0x21, 0x0a, 0xe8, 0x00, 0x00, 0x00, 0x10},
  590. {0xa0, 0x21, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x10},
  591. {0xa0, 0x21, 0x0c, 0x80, 0x00, 0x00, 0x00, 0x10},
  592. {0xa0, 0x21, 0x0d, 0x22, 0x00, 0x00, 0x00, 0x10},
  593. {0xa0, 0x21, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x10},
  594. {0xa0, 0x21, 0x0f, 0xb2, 0x00, 0x00, 0x00, 0x10},
  595. {0xa0, 0x21, 0x12, 0x70, 0x00, 0x00, 0x00, 0x10},
  596. {DELAY, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /*delay 10ms*/
  597. {0xa0, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10},
  598. {0xa0, 0x21, 0x15, 0xb8, 0x00, 0x00, 0x00, 0x10},
  599. {0xa0, 0x21, 0x16, 0x13, 0x00, 0x00, 0x00, 0x10},
  600. {0xa0, 0x21, 0x17, 0x52, 0x00, 0x00, 0x00, 0x10},
  601. {0xa0, 0x21, 0x18, 0x50, 0x00, 0x00, 0x00, 0x10},
  602. {0xa0, 0x21, 0x1e, 0x0d, 0x00, 0x00, 0x00, 0x10},
  603. {0xa0, 0x21, 0x1f, 0x32, 0x00, 0x00, 0x00, 0x10},
  604. {0xa0, 0x21, 0x61, 0x90, 0x00, 0x00, 0x00, 0x10},
  605. {0xa0, 0x21, 0x63, 0x70, 0x00, 0x00, 0x00, 0x10},
  606. {0xa0, 0x21, 0x65, 0x98, 0x00, 0x00, 0x00, 0x10},
  607. {0xa0, 0x21, 0x67, 0x90, 0x00, 0x00, 0x00, 0x10},
  608. {0xa0, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
  609. {0xa0, 0x21, 0x04, 0x96, 0x00, 0x00, 0x00, 0x10},
  610. {0xa0, 0x21, 0x45, 0x27, 0x00, 0x00, 0x00, 0x10},
  611. {0xa0, 0x21, 0x47, 0x2c, 0x00, 0x00, 0x00, 0x10},
  612. {0xa0, 0x21, 0x43, 0x47, 0x00, 0x00, 0x00, 0x10},
  613. {0xa0, 0x21, 0x44, 0xd8, 0x00, 0x00, 0x00, 0x10},
  614. {}
  615. };
  616. static const u8 gc0307_sensor_param1[][8] = {
  617. {0xa0, 0x21, 0x68, 0x13, 0x00, 0x00, 0x00, 0x10},
  618. {0xd0, 0x21, 0x61, 0x80, 0x00, 0x80, 0x00, 0x10},
  619. {0xc0, 0x21, 0x65, 0x80, 0x00, 0x80, 0x00, 0x10},
  620. {0xc0, 0x21, 0x63, 0xa0, 0x00, 0xa6, 0x00, 0x10},
  621. /*param3*/
  622. {0xa0, 0x21, 0x01, 0x6e, 0x00, 0x00, 0x00, 0x10},
  623. {0xa0, 0x21, 0x02, 0x88, 0x00, 0x00, 0x00, 0x10},
  624. {}
  625. };
  626. static const u8 hv7131r_sensor_init[][8] = {
  627. {0xc1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10},
  628. {0xb1, 0x11, 0x34, 0x17, 0x7f, 0x00, 0x00, 0x10},
  629. {0xd1, 0x11, 0x40, 0xff, 0x7f, 0x7f, 0x7f, 0x10},
  630. /* {0x91, 0x11, 0x44, 0x00, 0x00, 0x00, 0x00, 0x10}, */
  631. {0xd1, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
  632. {0xd1, 0x11, 0x14, 0x01, 0xe2, 0x02, 0x82, 0x10},
  633. /* {0x91, 0x11, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10}, */
  634. {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
  635. {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
  636. {0xc1, 0x11, 0x25, 0x00, 0x61, 0xa8, 0x00, 0x10},
  637. {0xa1, 0x11, 0x30, 0x22, 0x00, 0x00, 0x00, 0x10},
  638. {0xc1, 0x11, 0x31, 0x20, 0x2e, 0x20, 0x00, 0x10},
  639. {0xc1, 0x11, 0x25, 0x00, 0xc3, 0x50, 0x00, 0x10},
  640. {0xa1, 0x11, 0x30, 0x07, 0x00, 0x00, 0x00, 0x10}, /* gain14 */
  641. {0xc1, 0x11, 0x31, 0x10, 0x10, 0x10, 0x00, 0x10}, /* r g b 101a10 */
  642. {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
  643. {0xa1, 0x11, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
  644. {0xa1, 0x11, 0x21, 0xd0, 0x00, 0x00, 0x00, 0x10},
  645. {0xa1, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
  646. {0xa1, 0x11, 0x23, 0x09, 0x00, 0x00, 0x00, 0x10},
  647. {0xa1, 0x11, 0x01, 0x08, 0x00, 0x00, 0x00, 0x10},
  648. {0xa1, 0x11, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
  649. {0xa1, 0x11, 0x21, 0xd0, 0x00, 0x00, 0x00, 0x10},
  650. {0xa1, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
  651. {0xa1, 0x11, 0x23, 0x10, 0x00, 0x00, 0x00, 0x10},
  652. {0xa1, 0x11, 0x01, 0x18, 0x00, 0x00, 0x00, 0x10},
  653. /* set sensor clock */
  654. {}
  655. };
  656. static const u8 mi0360_sensor_init[][8] = {
  657. {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
  658. {0xb1, 0x5d, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x10},
  659. {0xb1, 0x5d, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x10},
  660. {0xd1, 0x5d, 0x01, 0x00, 0x08, 0x00, 0x16, 0x10},
  661. {0xd1, 0x5d, 0x03, 0x01, 0xe2, 0x02, 0x82, 0x10},
  662. {0xd1, 0x5d, 0x05, 0x00, 0x09, 0x00, 0x53, 0x10},
  663. {0xb1, 0x5d, 0x0d, 0x00, 0x02, 0x00, 0x00, 0x10},
  664. {0xd1, 0x5d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
  665. {0xd1, 0x5d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x10},
  666. {0xd1, 0x5d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x10},
  667. {0xd1, 0x5d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
  668. {0xd1, 0x5d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
  669. {0xd1, 0x5d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x10},
  670. {0xd1, 0x5d, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10},
  671. {0xd1, 0x5d, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10},
  672. {0xd1, 0x5d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x10},
  673. {0xd1, 0x5d, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x10},
  674. {0xb1, 0x5d, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10},
  675. {0xd1, 0x5d, 0x20, 0x91, 0x01, 0x00, 0x00, 0x10},
  676. {0xd1, 0x5d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
  677. {0xd1, 0x5d, 0x24, 0x00, 0x00, 0x00, 0x00, 0x10},
  678. {0xd1, 0x5d, 0x26, 0x00, 0x00, 0x00, 0x24, 0x10},
  679. {0xd1, 0x5d, 0x2f, 0xf7, 0xB0, 0x00, 0x04, 0x10},
  680. {0xd1, 0x5d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x10},
  681. {0xd1, 0x5d, 0x33, 0x00, 0x00, 0x01, 0x00, 0x10},
  682. {0xb1, 0x5d, 0x3d, 0x06, 0x8f, 0x00, 0x00, 0x10},
  683. {0xd1, 0x5d, 0x40, 0x01, 0xe0, 0x00, 0xd1, 0x10},
  684. {0xb1, 0x5d, 0x44, 0x00, 0x82, 0x00, 0x00, 0x10},
  685. {0xd1, 0x5d, 0x58, 0x00, 0x78, 0x00, 0x43, 0x10},
  686. {0xd1, 0x5d, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x10},
  687. {0xd1, 0x5d, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x10},
  688. {0xd1, 0x5d, 0x5e, 0x00, 0x00, 0xa3, 0x1d, 0x10},
  689. {0xb1, 0x5d, 0x62, 0x04, 0x11, 0x00, 0x00, 0x10},
  690. {0xb1, 0x5d, 0x20, 0x91, 0x01, 0x00, 0x00, 0x10},
  691. {0xb1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
  692. {0xb1, 0x5d, 0x09, 0x00, 0x64, 0x00, 0x00, 0x10},
  693. {0xd1, 0x5d, 0x2b, 0x00, 0xa0, 0x00, 0xb0, 0x10},
  694. {0xd1, 0x5d, 0x2d, 0x00, 0xa0, 0x00, 0xa0, 0x10},
  695. {0xb1, 0x5d, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x10}, /* sensor clck ?2 */
  696. {0xb1, 0x5d, 0x06, 0x00, 0x30, 0x00, 0x00, 0x10},
  697. {0xb1, 0x5d, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x10},
  698. {0xb1, 0x5d, 0x09, 0x02, 0x35, 0x00, 0x00, 0x10}, /* exposure 2 */
  699. {0xd1, 0x5d, 0x2b, 0x00, 0xb9, 0x00, 0xe3, 0x10},
  700. {0xd1, 0x5d, 0x2d, 0x00, 0x5f, 0x00, 0xb9, 0x10}, /* 42 */
  701. /* {0xb1, 0x5d, 0x35, 0x00, 0x67, 0x00, 0x00, 0x10}, * gain orig */
  702. /* {0xb1, 0x5d, 0x35, 0x00, 0x20, 0x00, 0x00, 0x10}, * gain */
  703. {0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10}, /* update */
  704. {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10}, /* sensor on */
  705. {}
  706. };
  707. static const u8 mi0360b_sensor_init[][8] = {
  708. {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10},
  709. {0xb1, 0x5d, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x10},
  710. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /*delay 20ms*/
  711. {0xb1, 0x5d, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x10},
  712. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /*delay 20ms*/
  713. {0xd1, 0x5d, 0x01, 0x00, 0x08, 0x00, 0x16, 0x10},
  714. {0xd1, 0x5d, 0x03, 0x01, 0xe2, 0x02, 0x82, 0x10},
  715. {0xd1, 0x5d, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10},
  716. {0xb1, 0x5d, 0x0d, 0x00, 0x02, 0x00, 0x00, 0x10},
  717. {0xd1, 0x5d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
  718. {0xd1, 0x5d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x10},
  719. {0xd1, 0x5d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x10},
  720. {0xd1, 0x5d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
  721. {0xd1, 0x5d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
  722. {0xd1, 0x5d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x10},
  723. {0xd1, 0x5d, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10},
  724. {0xd1, 0x5d, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10},
  725. {0xd1, 0x5d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x10},
  726. {0xd1, 0x5d, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x10},
  727. {0xb1, 0x5d, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10},
  728. {0xd1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
  729. {0xd1, 0x5d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
  730. {0xd1, 0x5d, 0x24, 0x00, 0x00, 0x00, 0x00, 0x10},
  731. {0xd1, 0x5d, 0x26, 0x00, 0x00, 0x00, 0x24, 0x10},
  732. {0xd1, 0x5d, 0x2f, 0xf7, 0xb0, 0x00, 0x04, 0x10},
  733. {0xd1, 0x5d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x10},
  734. {0xd1, 0x5d, 0x33, 0x00, 0x00, 0x01, 0x00, 0x10},
  735. {0xb1, 0x5d, 0x3d, 0x06, 0x8f, 0x00, 0x00, 0x10},
  736. {0xd1, 0x5d, 0x40, 0x01, 0xe0, 0x00, 0xd1, 0x10},
  737. {0xb1, 0x5d, 0x44, 0x00, 0x82, 0x00, 0x00, 0x10},
  738. {0xd1, 0x5d, 0x58, 0x00, 0x78, 0x00, 0x43, 0x10},
  739. {0xd1, 0x5d, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x10},
  740. {0xd1, 0x5d, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x10},
  741. {0xd1, 0x5d, 0x5e, 0x00, 0x00, 0xa3, 0x1d, 0x10},
  742. {0xb1, 0x5d, 0x62, 0x04, 0x11, 0x00, 0x00, 0x10},
  743. {0xb1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
  744. {0xb1, 0x5d, 0x20, 0x11, 0x01, 0x00, 0x00, 0x10},
  745. {0xb1, 0x5d, 0x09, 0x00, 0x64, 0x00, 0x00, 0x10},
  746. {0xd1, 0x5d, 0x2b, 0x00, 0x33, 0x00, 0xa0, 0x10},
  747. {0xd1, 0x5d, 0x2d, 0x00, 0xa0, 0x00, 0x33, 0x10},
  748. {}
  749. };
  750. static const u8 mi0360b_sensor_param1[][8] = {
  751. {0xb1, 0x5d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
  752. {0xb1, 0x5d, 0x06, 0x00, 0x53, 0x00, 0x00, 0x10},
  753. {0xb1, 0x5d, 0x05, 0x00, 0x09, 0x00, 0x00, 0x10},
  754. {0xb1, 0x5d, 0x09, 0x02, 0x35, 0x00, 0x00, 0x10}, /* exposure 2 */
  755. {0xd1, 0x5d, 0x2b, 0x00, 0xd1, 0x01, 0xc9, 0x10},
  756. {0xd1, 0x5d, 0x2d, 0x00, 0xed, 0x00, 0xd1, 0x10},
  757. {0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10}, /* update */
  758. {0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10}, /* sensor on */
  759. {}
  760. };
  761. static const u8 mo4000_sensor_init[][8] = {
  762. {0xa1, 0x21, 0x01, 0x02, 0x00, 0x00, 0x00, 0x10},
  763. {0xa1, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10},
  764. {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
  765. {0xa1, 0x21, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10},
  766. {0xa1, 0x21, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10},
  767. {0xa1, 0x21, 0x05, 0x04, 0x00, 0x00, 0x00, 0x10},
  768. {0xa1, 0x21, 0x06, 0x80, 0x00, 0x00, 0x00, 0x10},
  769. {0xa1, 0x21, 0x06, 0x81, 0x00, 0x00, 0x00, 0x10},
  770. {0xa1, 0x21, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x10},
  771. {0xa1, 0x21, 0x11, 0x00, 0x00, 0x00, 0x00, 0x10},
  772. {0xa1, 0x21, 0x11, 0x20, 0x00, 0x00, 0x00, 0x10},
  773. {0xa1, 0x21, 0x11, 0x30, 0x00, 0x00, 0x00, 0x10},
  774. {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10},
  775. {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10},
  776. {0xa1, 0x21, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
  777. {0xa1, 0x21, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10},
  778. {0xa1, 0x21, 0x0f, 0x20, 0x00, 0x00, 0x00, 0x10},
  779. {0xa1, 0x21, 0x10, 0x20, 0x00, 0x00, 0x00, 0x10},
  780. {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
  781. {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10},
  782. {}
  783. };
  784. static const u8 mt9v111_sensor_init[][8] = {
  785. {0xb1, 0x5c, 0x0d, 0x00, 0x01, 0x00, 0x00, 0x10}, /* reset? */
  786. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 20ms */
  787. {0xb1, 0x5c, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x10},
  788. {0xb1, 0x5c, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10}, /* IFP select */
  789. {0xb1, 0x5c, 0x08, 0x04, 0x80, 0x00, 0x00, 0x10}, /* output fmt ctrl */
  790. {0xb1, 0x5c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}, /* op mode ctrl */
  791. {0xb1, 0x5c, 0x01, 0x00, 0x04, 0x00, 0x00, 0x10}, /* sensor select */
  792. {0xb1, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x00, 0x10}, /* row start */
  793. {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10}, /* col start */
  794. {0xb1, 0x5c, 0x03, 0x01, 0xe7, 0x00, 0x00, 0x10}, /* window height */
  795. {0xb1, 0x5c, 0x04, 0x02, 0x87, 0x00, 0x00, 0x10}, /* window width */
  796. {0xb1, 0x5c, 0x07, 0x30, 0x02, 0x00, 0x00, 0x10}, /* output ctrl */
  797. {0xb1, 0x5c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x10}, /* shutter delay */
  798. {0xb1, 0x5c, 0x12, 0x00, 0xb0, 0x00, 0x00, 0x10}, /* zoom col start */
  799. {0xb1, 0x5c, 0x13, 0x00, 0x7c, 0x00, 0x00, 0x10}, /* zoom row start */
  800. {0xb1, 0x5c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x10}, /* digital zoom */
  801. {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, /* read mode */
  802. {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
  803. {}
  804. };
  805. static const u8 mt9v111_sensor_param1[][8] = {
  806. {0xd1, 0x5c, 0x2b, 0x00, 0x33, 0x00, 0xad, 0x10}, /* G1 and B gains */
  807. {0xd1, 0x5c, 0x2d, 0x00, 0xad, 0x00, 0x33, 0x10}, /* R and G2 gains */
  808. {0xb1, 0x5c, 0x06, 0x00, 0x40, 0x00, 0x00, 0x10}, /* vert blanking */
  809. {0xb1, 0x5c, 0x05, 0x00, 0x09, 0x00, 0x00, 0x10}, /* horiz blanking */
  810. {0xb1, 0x5c, 0x35, 0x01, 0xc0, 0x00, 0x00, 0x10}, /* global gain */
  811. {}
  812. };
  813. static const u8 om6802_init0[2][8] = {
  814. /*fixme: variable*/
  815. {0xa0, 0x34, 0x29, 0x0e, 0x00, 0x00, 0x00, 0x10},
  816. {0xa0, 0x34, 0x23, 0xb0, 0x00, 0x00, 0x00, 0x10},
  817. };
  818. static const u8 om6802_sensor_init[][8] = {
  819. {0xa0, 0x34, 0xdf, 0x6d, 0x00, 0x00, 0x00, 0x10},
  820. /* factory mode */
  821. {0xa0, 0x34, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10},
  822. /* output raw RGB */
  823. {0xa0, 0x34, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10},
  824. /* {0xa0, 0x34, 0xfb, 0x11, 0x00, 0x00, 0x00, 0x10}, */
  825. {0xa0, 0x34, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x10},
  826. /* auto-exposure speed (0) / white balance mode (auto RGB) */
  827. /* {0xa0, 0x34, 0xf1, 0x02, 0x00, 0x00, 0x00, 0x10},
  828. * set color mode */
  829. /* {0xa0, 0x34, 0xfe, 0x5b, 0x00, 0x00, 0x00, 0x10},
  830. * max AGC value in AE */
  831. /* {0xa0, 0x34, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x10},
  832. * preset AGC */
  833. /* {0xa0, 0x34, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x10},
  834. * preset brightness */
  835. /* {0xa0, 0x34, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x10},
  836. * preset contrast */
  837. /* {0xa0, 0x34, 0xe8, 0x31, 0x00, 0x00, 0x00, 0x10},
  838. * preset gamma */
  839. {0xa0, 0x34, 0xe9, 0x0f, 0x00, 0x00, 0x00, 0x10},
  840. /* luminance mode (0x4f -> AutoExpo on) */
  841. {0xa0, 0x34, 0xe4, 0xff, 0x00, 0x00, 0x00, 0x10},
  842. /* preset shutter */
  843. /* {0xa0, 0x34, 0xef, 0x00, 0x00, 0x00, 0x00, 0x10},
  844. * auto frame rate */
  845. /* {0xa0, 0x34, 0xfb, 0xee, 0x00, 0x00, 0x00, 0x10}, */
  846. {0xa0, 0x34, 0x5d, 0x80, 0x00, 0x00, 0x00, 0x10},
  847. {}
  848. };
  849. static const u8 om6802_sensor_param1[][8] = {
  850. {0xa0, 0x34, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10},
  851. {0xa0, 0x34, 0x72, 0x05, 0x00, 0x00, 0x00, 0x10},
  852. {0xa0, 0x34, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10},
  853. {0xa0, 0x34, 0x69, 0x01, 0x00, 0x00, 0x00, 0x10},
  854. {}
  855. };
  856. static const u8 ov7630_sensor_init[][8] = {
  857. {0xa1, 0x21, 0x76, 0x01, 0x00, 0x00, 0x00, 0x10},
  858. {0xa1, 0x21, 0x12, 0xc8, 0x00, 0x00, 0x00, 0x10},
  859. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 20ms */
  860. {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
  861. {0xa1, 0x21, 0x12, 0xc8, 0x00, 0x00, 0x00, 0x10},
  862. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 20ms */
  863. {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
  864. /* win: i2c_r from 00 to 80 */
  865. {0xd1, 0x21, 0x03, 0x80, 0x10, 0x20, 0x80, 0x10},
  866. {0xb1, 0x21, 0x0c, 0x20, 0x20, 0x00, 0x00, 0x10},
  867. /* HDG: 0x11 was 0x00 change to 0x01 for better exposure (15 fps instead of 30)
  868. 0x13 was 0xc0 change to 0xc3 for auto gain and exposure */
  869. {0xd1, 0x21, 0x11, 0x01, 0x48, 0xc3, 0x00, 0x10},
  870. {0xb1, 0x21, 0x15, 0x80, 0x03, 0x00, 0x00, 0x10},
  871. {0xd1, 0x21, 0x17, 0x1b, 0xbd, 0x05, 0xf6, 0x10},
  872. {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10},
  873. {0xd1, 0x21, 0x1f, 0x00, 0x80, 0x80, 0x80, 0x10},
  874. {0xd1, 0x21, 0x23, 0xde, 0x10, 0x8a, 0xa0, 0x10},
  875. {0xc1, 0x21, 0x27, 0xca, 0xa2, 0x74, 0x00, 0x10},
  876. {0xd1, 0x21, 0x2a, 0x88, 0x00, 0x88, 0x01, 0x10},
  877. {0xc1, 0x21, 0x2e, 0x80, 0x00, 0x18, 0x00, 0x10},
  878. {0xa1, 0x21, 0x21, 0x08, 0x00, 0x00, 0x00, 0x10},
  879. {0xa1, 0x21, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10},
  880. {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10},
  881. {0xb1, 0x21, 0x32, 0xc2, 0x08, 0x00, 0x00, 0x10},
  882. {0xb1, 0x21, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x10},
  883. {0xd1, 0x21, 0x60, 0x05, 0x40, 0x12, 0x57, 0x10},
  884. {0xa1, 0x21, 0x64, 0x73, 0x00, 0x00, 0x00, 0x10},
  885. {0xd1, 0x21, 0x65, 0x00, 0x55, 0x01, 0xac, 0x10},
  886. {0xa1, 0x21, 0x69, 0x38, 0x00, 0x00, 0x00, 0x10},
  887. {0xd1, 0x21, 0x6f, 0x1f, 0x01, 0x00, 0x10, 0x10},
  888. {0xd1, 0x21, 0x73, 0x50, 0x20, 0x02, 0x01, 0x10},
  889. {0xd1, 0x21, 0x77, 0xf3, 0x90, 0x98, 0x98, 0x10},
  890. {0xc1, 0x21, 0x7b, 0x00, 0x4c, 0xf7, 0x00, 0x10},
  891. {0xd1, 0x21, 0x17, 0x1b, 0xbd, 0x05, 0xf6, 0x10},
  892. {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10},
  893. {}
  894. };
  895. static const u8 ov7630_sensor_param1[][8] = {
  896. {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
  897. {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10},
  898. /*fixme: + 0x12, 0x04*/
  899. /* {0xa1, 0x21, 0x75, 0x82, 0x00, 0x00, 0x00, 0x10}, * COMN
  900. * set by setvflip */
  901. {0xa1, 0x21, 0x10, 0x32, 0x00, 0x00, 0x00, 0x10},
  902. {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
  903. {0xb1, 0x21, 0x01, 0x80, 0x80, 0x00, 0x00, 0x10},
  904. /* */
  905. /* {0xa1, 0x21, 0x2a, 0x88, 0x00, 0x00, 0x00, 0x10}, * set by setfreq */
  906. /* {0xa1, 0x21, 0x2b, 0x34, 0x00, 0x00, 0x00, 0x10}, * set by setfreq */
  907. /* */
  908. {0xa1, 0x21, 0x10, 0x83, 0x00, 0x00, 0x00, 0x10},
  909. /* {0xb1, 0x21, 0x01, 0x88, 0x70, 0x00, 0x00, 0x10}, */
  910. {}
  911. };
  912. static const u8 ov7648_sensor_init[][8] = {
  913. {0xa1, 0x21, 0x76, 0x00, 0x00, 0x00, 0x00, 0x10},
  914. {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset */
  915. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 20ms */
  916. {0xa1, 0x21, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
  917. {0xd1, 0x21, 0x03, 0xa4, 0x30, 0x88, 0x00, 0x10},
  918. {0xb1, 0x21, 0x11, 0x80, 0x08, 0x00, 0x00, 0x10},
  919. {0xc1, 0x21, 0x13, 0xa0, 0x04, 0x84, 0x00, 0x10},
  920. {0xd1, 0x21, 0x17, 0x1a, 0x02, 0xba, 0xf4, 0x10},
  921. {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10},
  922. {0xd1, 0x21, 0x1f, 0x41, 0xc0, 0x80, 0x80, 0x10},
  923. {0xd1, 0x21, 0x23, 0xde, 0xa0, 0x80, 0x32, 0x10},
  924. {0xd1, 0x21, 0x27, 0xfe, 0xa0, 0x00, 0x91, 0x10},
  925. {0xd1, 0x21, 0x2b, 0x00, 0x88, 0x85, 0x80, 0x10},
  926. {0xc1, 0x21, 0x2f, 0x9c, 0x00, 0xc4, 0x00, 0x10},
  927. {0xd1, 0x21, 0x60, 0xa6, 0x60, 0x88, 0x12, 0x10},
  928. {0xd1, 0x21, 0x64, 0x88, 0x00, 0x00, 0x94, 0x10},
  929. {0xd1, 0x21, 0x68, 0x7a, 0x0c, 0x00, 0x00, 0x10},
  930. {0xd1, 0x21, 0x6c, 0x11, 0x33, 0x22, 0x00, 0x10},
  931. {0xd1, 0x21, 0x70, 0x11, 0x00, 0x10, 0x50, 0x10},
  932. {0xd1, 0x21, 0x74, 0x20, 0x06, 0x00, 0xb5, 0x10},
  933. {0xd1, 0x21, 0x78, 0x8a, 0x00, 0x00, 0x00, 0x10},
  934. {0xb1, 0x21, 0x7c, 0x00, 0x43, 0x00, 0x00, 0x10},
  935. {0xd1, 0x21, 0x21, 0x86, 0x00, 0xde, 0xa0, 0x10},
  936. /* {0xd1, 0x21, 0x25, 0x80, 0x32, 0xfe, 0xa0, 0x10}, jfm done */
  937. /* {0xd1, 0x21, 0x29, 0x00, 0x91, 0x00, 0x88, 0x10}, jfm done */
  938. /* {0xb1, 0x21, 0x2d, 0x85, 0x00, 0x00, 0x00, 0x10}, set by setfreq */
  939. {}
  940. };
  941. static const u8 ov7648_sensor_param1[][8] = {
  942. /* {0xa1, 0x21, 0x12, 0x08, 0x00, 0x00, 0x00, 0x10}, jfm done */
  943. /* {0xa1, 0x21, 0x75, 0x06, 0x00, 0x00, 0x00, 0x10}, * COMN
  944. * set by setvflip */
  945. {0xa1, 0x21, 0x19, 0x02, 0x00, 0x00, 0x00, 0x10},
  946. {0xa1, 0x21, 0x10, 0x32, 0x00, 0x00, 0x00, 0x10},
  947. /* {0xa1, 0x21, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10}, jfm done */
  948. /* {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}, * GAIN - def */
  949. /* {0xb1, 0x21, 0x01, 0x6c, 0x6c, 0x00, 0x00, 0x10}, * B R - def: 80 */
  950. /*...*/
  951. {0xa1, 0x21, 0x11, 0x81, 0x00, 0x00, 0x00, 0x10}, /* CLKRC */
  952. /* {0xa1, 0x21, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x10}, jfm done */
  953. /* {0xa1, 0x21, 0x16, 0x00, 0x00, 0x00, 0x00, 0x10}, jfm done */
  954. /* {0xa1, 0x21, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x10}, jfm done */
  955. /* {0xa1, 0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10}, jfm done */
  956. /* {0xb1, 0x21, 0x01, 0x64, 0x84, 0x00, 0x00, 0x10}, * B R - def: 80 */
  957. {}
  958. };
  959. static const u8 ov7660_sensor_init[][8] = {
  960. {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */
  961. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 20ms */
  962. {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10},
  963. /* Outformat = rawRGB */
  964. {0xa1, 0x21, 0x13, 0xb8, 0x00, 0x00, 0x00, 0x10}, /* init COM8 */
  965. {0xd1, 0x21, 0x00, 0x01, 0x74, 0x92, 0x00, 0x10},
  966. /* GAIN BLUE RED VREF */
  967. {0xd1, 0x21, 0x04, 0x00, 0x7d, 0x62, 0x00, 0x10},
  968. /* COM 1 BAVE GEAVE AECHH */
  969. {0xb1, 0x21, 0x08, 0x83, 0x01, 0x00, 0x00, 0x10}, /* RAVE COM2 */
  970. {0xd1, 0x21, 0x0c, 0x00, 0x08, 0x04, 0x4f, 0x10}, /* COM 3 4 5 6 */
  971. {0xd1, 0x21, 0x10, 0x7f, 0x40, 0x05, 0xff, 0x10},
  972. /* AECH CLKRC COM7 COM8 */
  973. {0xc1, 0x21, 0x14, 0x2c, 0x00, 0x02, 0x00, 0x10}, /* COM9 COM10 */
  974. {0xd1, 0x21, 0x17, 0x10, 0x60, 0x02, 0x7b, 0x10},
  975. /* HSTART HSTOP VSTRT VSTOP */
  976. {0xa1, 0x21, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x10}, /* PSHFT */
  977. {0xb1, 0x21, 0x1e, 0x01, 0x0e, 0x00, 0x00, 0x10}, /* MVFP LAEC */
  978. {0xd1, 0x21, 0x20, 0x07, 0x07, 0x07, 0x07, 0x10},
  979. /* BOS GBOS GROS ROS (BGGR offset) */
  980. /* {0xd1, 0x21, 0x24, 0x68, 0x58, 0xd4, 0x80, 0x10}, */
  981. {0xd1, 0x21, 0x24, 0x78, 0x68, 0xd4, 0x80, 0x10},
  982. /* AEW AEB VPT BBIAS */
  983. {0xd1, 0x21, 0x28, 0x80, 0x30, 0x00, 0x00, 0x10},
  984. /* GbBIAS RSVD EXHCH EXHCL */
  985. {0xd1, 0x21, 0x2c, 0x80, 0x00, 0x00, 0x62, 0x10},
  986. /* RBIAS ADVFL ASDVFH YAVE */
  987. {0xc1, 0x21, 0x30, 0x08, 0x30, 0xb4, 0x00, 0x10},
  988. /* HSYST HSYEN HREF */
  989. {0xd1, 0x21, 0x33, 0x00, 0x07, 0x84, 0x00, 0x10}, /* reserved */
  990. {0xd1, 0x21, 0x37, 0x0c, 0x02, 0x43, 0x00, 0x10},
  991. /* ADC ACOM OFON TSLB */
  992. {0xd1, 0x21, 0x3b, 0x02, 0x6c, 0x19, 0x0e, 0x10},
  993. /* COM11 COM12 COM13 COM14 */
  994. {0xd1, 0x21, 0x3f, 0x41, 0xc1, 0x22, 0x08, 0x10},
  995. /* EDGE COM15 COM16 COM17 */
  996. {0xd1, 0x21, 0x43, 0xf0, 0x10, 0x78, 0xa8, 0x10}, /* reserved */
  997. {0xd1, 0x21, 0x47, 0x60, 0x80, 0x00, 0x00, 0x10}, /* reserved */
  998. {0xd1, 0x21, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x10}, /* reserved */
  999. {0xd1, 0x21, 0x4f, 0x46, 0x36, 0x0f, 0x17, 0x10}, /* MTX 1 2 3 4 */
  1000. {0xd1, 0x21, 0x53, 0x7f, 0x96, 0x40, 0x40, 0x10}, /* MTX 5 6 7 8 */
  1001. {0xb1, 0x21, 0x57, 0x40, 0x0f, 0x00, 0x00, 0x10}, /* MTX9 MTXS */
  1002. {0xd1, 0x21, 0x59, 0xba, 0x9a, 0x22, 0xb9, 0x10}, /* reserved */
  1003. {0xd1, 0x21, 0x5d, 0x9b, 0x10, 0xf0, 0x05, 0x10}, /* reserved */
  1004. {0xa1, 0x21, 0x61, 0x60, 0x00, 0x00, 0x00, 0x10}, /* reserved */
  1005. {0xd1, 0x21, 0x62, 0x00, 0x00, 0x50, 0x30, 0x10},
  1006. /* LCC1 LCC2 LCC3 LCC4 */
  1007. {0xa1, 0x21, 0x66, 0x00, 0x00, 0x00, 0x00, 0x10}, /* LCC5 */
  1008. {0xd1, 0x21, 0x67, 0x80, 0x7a, 0x90, 0x80, 0x10}, /* MANU */
  1009. {0xa1, 0x21, 0x6b, 0x0a, 0x00, 0x00, 0x00, 0x10},
  1010. /* band gap reference [0:3] DBLV */
  1011. {0xd1, 0x21, 0x6c, 0x30, 0x48, 0x80, 0x74, 0x10}, /* gamma curve */
  1012. {0xd1, 0x21, 0x70, 0x64, 0x60, 0x5c, 0x58, 0x10}, /* gamma curve */
  1013. {0xd1, 0x21, 0x74, 0x54, 0x4c, 0x40, 0x38, 0x10}, /* gamma curve */
  1014. {0xd1, 0x21, 0x78, 0x34, 0x30, 0x2f, 0x2b, 0x10}, /* gamma curve */
  1015. {0xd1, 0x21, 0x7c, 0x03, 0x07, 0x17, 0x34, 0x10}, /* gamma curve */
  1016. {0xd1, 0x21, 0x80, 0x41, 0x4d, 0x58, 0x63, 0x10}, /* gamma curve */
  1017. {0xd1, 0x21, 0x84, 0x6e, 0x77, 0x87, 0x95, 0x10}, /* gamma curve */
  1018. {0xc1, 0x21, 0x88, 0xaf, 0xc7, 0xdf, 0x00, 0x10}, /* gamma curve */
  1019. {0xc1, 0x21, 0x8b, 0x99, 0x99, 0xcf, 0x00, 0x10}, /* reserved */
  1020. {0xb1, 0x21, 0x92, 0x00, 0x00, 0x00, 0x00, 0x10}, /* DM_LNL/H */
  1021. /* not in all ms-win traces*/
  1022. {0xa1, 0x21, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x10},
  1023. {}
  1024. };
  1025. static const u8 ov7660_sensor_param1[][8] = {
  1026. {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10}, /* MVFP */
  1027. /* bits[3..0]reserved */
  1028. {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10},
  1029. {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
  1030. /* VREF vertical frame ctrl */
  1031. {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10},
  1032. {0xa1, 0x21, 0x10, 0x20, 0x00, 0x00, 0x00, 0x10}, /* AECH 0x20 */
  1033. {0xa1, 0x21, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10}, /* ADVFL */
  1034. {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10}, /* ADVFH */
  1035. {0xa1, 0x21, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10}, /* GAIN */
  1036. /* {0xb1, 0x21, 0x01, 0x78, 0x78, 0x00, 0x00, 0x10}, * BLUE */
  1037. /****** (some exchanges in the win trace) ******/
  1038. /*fixme:param2*/
  1039. {0xa1, 0x21, 0x93, 0x00, 0x00, 0x00, 0x00, 0x10},/* dummy line hight */
  1040. {0xa1, 0x21, 0x92, 0x25, 0x00, 0x00, 0x00, 0x10}, /* dummy line low */
  1041. {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, /* EXHCH */
  1042. {0xa1, 0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10}, /* EXHCL */
  1043. /* {0xa1, 0x21, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10}, * RED */
  1044. /****** (some exchanges in the win trace) ******/
  1045. /******!! startsensor KO if changed !!****/
  1046. /*fixme: param3*/
  1047. {0xa1, 0x21, 0x93, 0x01, 0x00, 0x00, 0x00, 0x10},
  1048. {0xa1, 0x21, 0x92, 0xff, 0x00, 0x00, 0x00, 0x10},
  1049. {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10},
  1050. {0xa1, 0x21, 0x2b, 0xc3, 0x00, 0x00, 0x00, 0x10},
  1051. {}
  1052. };
  1053. static const u8 po1030_sensor_init[][8] = {
  1054. /* the sensor registers are described in m5602/m5602_po1030.h */
  1055. {0xa1, 0x6e, 0x3f, 0x20, 0x00, 0x00, 0x00, 0x10}, /* sensor reset */
  1056. {DELAY, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 20ms */
  1057. {0xa1, 0x6e, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x10},
  1058. {0xa1, 0x6e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x10},
  1059. {0xd1, 0x6e, 0x04, 0x02, 0xb1, 0x02, 0x39, 0x10},
  1060. {0xd1, 0x6e, 0x08, 0x00, 0x01, 0x00, 0x00, 0x10},
  1061. {0xd1, 0x6e, 0x0c, 0x02, 0x7f, 0x01, 0xe0, 0x10},
  1062. {0xd1, 0x6e, 0x12, 0x03, 0x02, 0x00, 0x03, 0x10},
  1063. {0xd1, 0x6e, 0x16, 0x85, 0x40, 0x4a, 0x40, 0x10}, /* r/g1/b/g2 gains */
  1064. {0xc1, 0x6e, 0x1a, 0x00, 0x80, 0x00, 0x00, 0x10},
  1065. {0xd1, 0x6e, 0x1d, 0x08, 0x03, 0x00, 0x00, 0x10},
  1066. {0xd1, 0x6e, 0x23, 0x00, 0xb0, 0x00, 0x94, 0x10},
  1067. {0xd1, 0x6e, 0x27, 0x58, 0x00, 0x00, 0x00, 0x10},
  1068. {0xb1, 0x6e, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10},
  1069. {0xd1, 0x6e, 0x2d, 0x14, 0x35, 0x61, 0x84, 0x10}, /* gamma corr */
  1070. {0xd1, 0x6e, 0x31, 0xa2, 0xbd, 0xd8, 0xff, 0x10},
  1071. {0xd1, 0x6e, 0x35, 0x06, 0x1e, 0x12, 0x02, 0x10}, /* color matrix */
  1072. {0xd1, 0x6e, 0x39, 0xaa, 0x53, 0x37, 0xd5, 0x10},
  1073. {0xa1, 0x6e, 0x3d, 0xf2, 0x00, 0x00, 0x00, 0x10},
  1074. {0xd1, 0x6e, 0x3e, 0x00, 0x00, 0x80, 0x03, 0x10},
  1075. {0xd1, 0x6e, 0x42, 0x03, 0x00, 0x00, 0x00, 0x10},
  1076. {0xc1, 0x6e, 0x46, 0x00, 0x80, 0x80, 0x00, 0x10},
  1077. {0xd1, 0x6e, 0x4b, 0x02, 0xef, 0x08, 0xcd, 0x10},
  1078. {0xd1, 0x6e, 0x4f, 0x00, 0xd0, 0x00, 0xa0, 0x10},
  1079. {0xd1, 0x6e, 0x53, 0x01, 0xaa, 0x01, 0x40, 0x10},
  1080. {0xd1, 0x6e, 0x5a, 0x50, 0x04, 0x30, 0x03, 0x10}, /* raw rgb bayer */
  1081. {0xa1, 0x6e, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x10},
  1082. {0xd1, 0x6e, 0x5f, 0x10, 0x40, 0xff, 0x00, 0x10},
  1083. {0xd1, 0x6e, 0x63, 0x40, 0x40, 0x00, 0x00, 0x10},
  1084. {0xd1, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x10},
  1085. {0xd1, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x10},
  1086. {0xd1, 0x6e, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x10},
  1087. {0xc1, 0x6e, 0x73, 0x10, 0x80, 0xeb, 0x00, 0x10},
  1088. {}
  1089. };
  1090. static const u8 po1030_sensor_param1[][8] = {
  1091. /* from ms-win traces - these values change with auto gain/expo/wb.. */
  1092. {0xa1, 0x6e, 0x1e, 0x03, 0x00, 0x00, 0x00, 0x10},
  1093. {0xa1, 0x6e, 0x1e, 0x03, 0x00, 0x00, 0x00, 0x10},
  1094. /* mean values */
  1095. {0xc1, 0x6e, 0x1a, 0x02, 0xd4, 0xa4, 0x00, 0x10}, /* integlines */
  1096. {0xa1, 0x6e, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10}, /* global gain */
  1097. {0xc1, 0x6e, 0x16, 0x40, 0x40, 0x40, 0x00, 0x10}, /* r/g1/b gains */
  1098. {0xa1, 0x6e, 0x1d, 0x08, 0x00, 0x00, 0x00, 0x10}, /* control1 */
  1099. {0xa1, 0x6e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x10}, /* frameheight */
  1100. {0xa1, 0x6e, 0x07, 0xd5, 0x00, 0x00, 0x00, 0x10},
  1101. /* {0xc1, 0x6e, 0x16, 0x49, 0x40, 0x45, 0x00, 0x10}, */
  1102. {}
  1103. };
  1104. static const u8 po2030n_sensor_init[][8] = {
  1105. {0xa1, 0x6e, 0x1e, 0x1a, 0x00, 0x00, 0x00, 0x10},
  1106. {0xa1, 0x6e, 0x1f, 0x99, 0x00, 0x00, 0x00, 0x10},
  1107. {DELAY, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 10ms */
  1108. {0xa1, 0x6e, 0x1e, 0x0a, 0x00, 0x00, 0x00, 0x10},
  1109. {0xa1, 0x6e, 0x1f, 0x19, 0x00, 0x00, 0x00, 0x10},
  1110. {DELAY, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 10ms */
  1111. {0xa1, 0x6e, 0x20, 0x44, 0x00, 0x00, 0x00, 0x10},
  1112. {0xa1, 0x6e, 0x04, 0x03, 0x00, 0x00, 0x00, 0x10},
  1113. {0xa1, 0x6e, 0x05, 0x70, 0x00, 0x00, 0x00, 0x10},
  1114. {0xa1, 0x6e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x10},
  1115. {0xa1, 0x6e, 0x07, 0x25, 0x00, 0x00, 0x00, 0x10},
  1116. {0xd1, 0x6e, 0x08, 0x00, 0xd0, 0x00, 0x08, 0x10},
  1117. {0xd1, 0x6e, 0x0c, 0x03, 0x50, 0x01, 0xe8, 0x10},
  1118. {0xd1, 0x6e, 0x1d, 0x20, 0x0a, 0x19, 0x44, 0x10},
  1119. {0xd1, 0x6e, 0x21, 0x00, 0x00, 0x00, 0x00, 0x10},
  1120. {0xd1, 0x6e, 0x25, 0x00, 0x00, 0x00, 0x00, 0x10},
  1121. {0xd1, 0x6e, 0x29, 0x00, 0x00, 0x00, 0x00, 0x10},
  1122. {0xd1, 0x6e, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1123. {0xd1, 0x6e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x10},
  1124. {0xd1, 0x6e, 0x35, 0x00, 0x00, 0x00, 0x00, 0x10},
  1125. {0xd1, 0x6e, 0x39, 0x00, 0x00, 0x00, 0x00, 0x10},
  1126. {0xd1, 0x6e, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1127. {0xd1, 0x6e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x10},
  1128. {0xd1, 0x6e, 0x45, 0x00, 0x00, 0x00, 0x00, 0x10},
  1129. {0xd1, 0x6e, 0x49, 0x00, 0x00, 0x00, 0x00, 0x10},
  1130. {0xd1, 0x6e, 0x4d, 0x00, 0x00, 0x00, 0xed, 0x10},
  1131. {0xd1, 0x6e, 0x51, 0x17, 0x4a, 0x2f, 0xc0, 0x10},
  1132. {0xd1, 0x6e, 0x55, 0x00, 0x00, 0x00, 0x00, 0x10},
  1133. {0xd1, 0x6e, 0x59, 0x00, 0x00, 0x00, 0x00, 0x10},
  1134. {0xd1, 0x6e, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1135. {0xd1, 0x6e, 0x61, 0x00, 0x00, 0x00, 0x00, 0x10},
  1136. {0xd1, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x10},
  1137. {0xd1, 0x6e, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10},
  1138. {0xd1, 0x6e, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1139. {0xd1, 0x6e, 0x71, 0x00, 0x00, 0x00, 0x00, 0x10},
  1140. {0xd1, 0x6e, 0x75, 0x00, 0x00, 0x00, 0x00, 0x10},
  1141. {0xd1, 0x6e, 0x79, 0x00, 0x00, 0x00, 0x00, 0x10},
  1142. {0xd1, 0x6e, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1143. {0xd1, 0x6e, 0x81, 0x00, 0x00, 0x00, 0x00, 0x10},
  1144. {0xd1, 0x6e, 0x85, 0x00, 0x00, 0x00, 0x08, 0x10},
  1145. {0xd1, 0x6e, 0x89, 0x01, 0xe8, 0x00, 0x01, 0x10},
  1146. {0xa1, 0x6e, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1147. {0xd1, 0x6e, 0x21, 0x00, 0x00, 0x00, 0x00, 0x10},
  1148. {0xd1, 0x6e, 0x25, 0x00, 0x00, 0x00, 0x01, 0x10},
  1149. {0xd1, 0x6e, 0x29, 0xe6, 0x00, 0xbd, 0x03, 0x10},
  1150. {0xd1, 0x6e, 0x2d, 0x41, 0x38, 0x68, 0x40, 0x10},
  1151. {0xd1, 0x6e, 0x31, 0x2b, 0x00, 0x36, 0x00, 0x10},
  1152. {0xd1, 0x6e, 0x35, 0x30, 0x30, 0x08, 0x00, 0x10},
  1153. {0xd1, 0x6e, 0x39, 0x00, 0x00, 0x33, 0x06, 0x10},
  1154. {0xb1, 0x6e, 0x3d, 0x06, 0x02, 0x00, 0x00, 0x10},
  1155. {}
  1156. };
  1157. static const u8 po2030n_sensor_param1[][8] = {
  1158. {0xa1, 0x6e, 0x1a, 0x01, 0x00, 0x00, 0x00, 0x10},
  1159. {DELAY, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 8ms */
  1160. {0xa1, 0x6e, 0x1b, 0xf4, 0x00, 0x00, 0x00, 0x10},
  1161. {0xa1, 0x6e, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10},
  1162. {0xd1, 0x6e, 0x16, 0x50, 0x40, 0x49, 0x40, 0x10},
  1163. /*param2*/
  1164. {0xa1, 0x6e, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1165. {0xa1, 0x6e, 0x04, 0x03, 0x00, 0x00, 0x00, 0x10},
  1166. {0xa1, 0x6e, 0x05, 0x6f, 0x00, 0x00, 0x00, 0x10},
  1167. {0xa1, 0x6e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x10},
  1168. {0xa1, 0x6e, 0x07, 0x25, 0x00, 0x00, 0x00, 0x10},
  1169. {0xa1, 0x6e, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10},
  1170. {0xc1, 0x6e, 0x16, 0x52, 0x40, 0x48, 0x00, 0x10},
  1171. /*after start*/
  1172. {0xa1, 0x6e, 0x15, 0x0f, 0x00, 0x00, 0x00, 0x10},
  1173. {DELAY, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 5ms */
  1174. {0xa1, 0x6e, 0x1a, 0x05, 0x00, 0x00, 0x00, 0x10},
  1175. {DELAY, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 5ms */
  1176. {0xa1, 0x6e, 0x1b, 0x53, 0x00, 0x00, 0x00, 0x10},
  1177. {}
  1178. };
  1179. static const u8 soi768_sensor_init[][8] = {
  1180. {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset */
  1181. {DELAY, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 96ms */
  1182. {0xa1, 0x21, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10},
  1183. {0xa1, 0x21, 0x13, 0x80, 0x00, 0x00, 0x00, 0x10},
  1184. {0xa1, 0x21, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x10},
  1185. {0xa1, 0x21, 0x19, 0x00, 0x00, 0x00, 0x00, 0x10},
  1186. {}
  1187. };
  1188. static const u8 soi768_sensor_param1[][8] = {
  1189. {0xa1, 0x21, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10},
  1190. {0xa1, 0x21, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10},
  1191. {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10},
  1192. {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10},
  1193. {0xb1, 0x21, 0x01, 0x7f, 0x7f, 0x00, 0x00, 0x10},
  1194. /* */
  1195. /* {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10}, */
  1196. /* {0xa1, 0x21, 0x2d, 0x25, 0x00, 0x00, 0x00, 0x10}, */
  1197. {0xa1, 0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10},
  1198. /* {0xb1, 0x21, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x10}, */
  1199. {0xa1, 0x21, 0x02, 0x8d, 0x00, 0x00, 0x00, 0x10},
  1200. /* the next sequence should be used for auto gain */
  1201. {0xa1, 0x21, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10},
  1202. /* global gain ? : 07 - change with 0x15 at the end */
  1203. {0xa1, 0x21, 0x10, 0x3f, 0x00, 0x00, 0x00, 0x10}, /* ???? : 063f */
  1204. {0xa1, 0x21, 0x04, 0x06, 0x00, 0x00, 0x00, 0x10},
  1205. {0xb1, 0x21, 0x2d, 0x00, 0x02, 0x00, 0x00, 0x10},
  1206. /* exposure ? : 0200 - change with 0x1e at the end */
  1207. {}
  1208. };
  1209. static const u8 sp80708_sensor_init[][8] = {
  1210. {0xa1, 0x18, 0x06, 0xf9, 0x00, 0x00, 0x00, 0x10},
  1211. {0xa1, 0x18, 0x09, 0x1f, 0x00, 0x00, 0x00, 0x10},
  1212. {0xa1, 0x18, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10},
  1213. {0xa1, 0x18, 0x0d, 0xc0, 0x00, 0x00, 0x00, 0x10},
  1214. {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10},
  1215. {0xa1, 0x18, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x10},
  1216. {0xa1, 0x18, 0x10, 0x40, 0x00, 0x00, 0x00, 0x10},
  1217. {0xa1, 0x18, 0x11, 0x4e, 0x00, 0x00, 0x00, 0x10},
  1218. {0xa1, 0x18, 0x12, 0x53, 0x00, 0x00, 0x00, 0x10},
  1219. {0xa1, 0x18, 0x15, 0x80, 0x00, 0x00, 0x00, 0x10},
  1220. {0xa1, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10},
  1221. {0xa1, 0x18, 0x19, 0x18, 0x00, 0x00, 0x00, 0x10},
  1222. {0xa1, 0x18, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x10},
  1223. {0xa1, 0x18, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x10},
  1224. {0xa1, 0x18, 0x1c, 0x28, 0x00, 0x00, 0x00, 0x10},
  1225. {0xa1, 0x18, 0x1d, 0x02, 0x00, 0x00, 0x00, 0x10},
  1226. {0xa1, 0x18, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x10},
  1227. {0xa1, 0x18, 0x26, 0x04, 0x00, 0x00, 0x00, 0x10},
  1228. {0xa1, 0x18, 0x27, 0x1e, 0x00, 0x00, 0x00, 0x10},
  1229. {0xa1, 0x18, 0x28, 0x5a, 0x00, 0x00, 0x00, 0x10},
  1230. {0xa1, 0x18, 0x29, 0x28, 0x00, 0x00, 0x00, 0x10},
  1231. {0xa1, 0x18, 0x2a, 0x78, 0x00, 0x00, 0x00, 0x10},
  1232. {0xa1, 0x18, 0x2b, 0x01, 0x00, 0x00, 0x00, 0x10},
  1233. {0xa1, 0x18, 0x2c, 0xf7, 0x00, 0x00, 0x00, 0x10},
  1234. {0xa1, 0x18, 0x2d, 0x2d, 0x00, 0x00, 0x00, 0x10},
  1235. {0xa1, 0x18, 0x2e, 0xd5, 0x00, 0x00, 0x00, 0x10},
  1236. {0xa1, 0x18, 0x39, 0x42, 0x00, 0x00, 0x00, 0x10},
  1237. {0xa1, 0x18, 0x3a, 0x67, 0