18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * SPCA508 chip based cameras subdriver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2009 Jean-Francois Moine <http://moinejf.free.fr> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#define MODULE_NAME "spca508" 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include "gspca.h" 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ciMODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); 158c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver"); 168c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL"); 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* specific webcam descriptor */ 198c2ecf20Sopenharmony_cistruct sd { 208c2ecf20Sopenharmony_ci struct gspca_dev gspca_dev; /* !! must be the first item */ 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci u8 subtype; 238c2ecf20Sopenharmony_ci#define CreativeVista 0 248c2ecf20Sopenharmony_ci#define HamaUSBSightcam 1 258c2ecf20Sopenharmony_ci#define HamaUSBSightcam2 2 268c2ecf20Sopenharmony_ci#define IntelEasyPCCamera 3 278c2ecf20Sopenharmony_ci#define MicroInnovationIC200 4 288c2ecf20Sopenharmony_ci#define ViewQuestVQ110 5 298c2ecf20Sopenharmony_ci}; 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_cistatic const struct v4l2_pix_format sif_mode[] = { 328c2ecf20Sopenharmony_ci {160, 120, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE, 338c2ecf20Sopenharmony_ci .bytesperline = 160, 348c2ecf20Sopenharmony_ci .sizeimage = 160 * 120 * 3 / 2, 358c2ecf20Sopenharmony_ci .colorspace = V4L2_COLORSPACE_SRGB, 368c2ecf20Sopenharmony_ci .priv = 3}, 378c2ecf20Sopenharmony_ci {176, 144, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE, 388c2ecf20Sopenharmony_ci .bytesperline = 176, 398c2ecf20Sopenharmony_ci .sizeimage = 176 * 144 * 3 / 2, 408c2ecf20Sopenharmony_ci .colorspace = V4L2_COLORSPACE_SRGB, 418c2ecf20Sopenharmony_ci .priv = 2}, 428c2ecf20Sopenharmony_ci {320, 240, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE, 438c2ecf20Sopenharmony_ci .bytesperline = 320, 448c2ecf20Sopenharmony_ci .sizeimage = 320 * 240 * 3 / 2, 458c2ecf20Sopenharmony_ci .colorspace = V4L2_COLORSPACE_SRGB, 468c2ecf20Sopenharmony_ci .priv = 1}, 478c2ecf20Sopenharmony_ci {352, 288, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE, 488c2ecf20Sopenharmony_ci .bytesperline = 352, 498c2ecf20Sopenharmony_ci .sizeimage = 352 * 288 * 3 / 2, 508c2ecf20Sopenharmony_ci .colorspace = V4L2_COLORSPACE_SRGB, 518c2ecf20Sopenharmony_ci .priv = 0}, 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci/* Frame packet header offsets for the spca508 */ 558c2ecf20Sopenharmony_ci#define SPCA508_OFFSET_DATA 37 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci/* 588c2ecf20Sopenharmony_ci * Initialization data: this is the first set-up data written to the 598c2ecf20Sopenharmony_ci * device (before the open data). 608c2ecf20Sopenharmony_ci */ 618c2ecf20Sopenharmony_cistatic const u16 spca508_init_data[][2] = { 628c2ecf20Sopenharmony_ci {0x0000, 0x870b}, 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci {0x0020, 0x8112}, /* Video drop enable, ISO streaming disable */ 658c2ecf20Sopenharmony_ci {0x0003, 0x8111}, /* Reset compression & memory */ 668c2ecf20Sopenharmony_ci {0x0000, 0x8110}, /* Disable all outputs */ 678c2ecf20Sopenharmony_ci /* READ {0x0000, 0x8114} -> 0000: 00 */ 688c2ecf20Sopenharmony_ci {0x0000, 0x8114}, /* SW GPIO data */ 698c2ecf20Sopenharmony_ci {0x0008, 0x8110}, /* Enable charge pump output */ 708c2ecf20Sopenharmony_ci {0x0002, 0x8116}, /* 200 kHz pump clock */ 718c2ecf20Sopenharmony_ci /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE:) */ 728c2ecf20Sopenharmony_ci {0x0003, 0x8111}, /* Reset compression & memory */ 738c2ecf20Sopenharmony_ci {0x0000, 0x8111}, /* Normal mode (not reset) */ 748c2ecf20Sopenharmony_ci {0x0098, 0x8110}, 758c2ecf20Sopenharmony_ci /* Enable charge pump output, sync.serial,external 2x clock */ 768c2ecf20Sopenharmony_ci {0x000d, 0x8114}, /* SW GPIO data */ 778c2ecf20Sopenharmony_ci {0x0002, 0x8116}, /* 200 kHz pump clock */ 788c2ecf20Sopenharmony_ci {0x0020, 0x8112}, /* Video drop enable, ISO streaming disable */ 798c2ecf20Sopenharmony_ci/* --------------------------------------- */ 808c2ecf20Sopenharmony_ci {0x000f, 0x8402}, /* memory bank */ 818c2ecf20Sopenharmony_ci {0x0000, 0x8403}, /* ... address */ 828c2ecf20Sopenharmony_ci/* --------------------------------------- */ 838c2ecf20Sopenharmony_ci/* 0x88__ is Synchronous Serial Interface. */ 848c2ecf20Sopenharmony_ci/* TBD: This table could be expressed more compactly */ 858c2ecf20Sopenharmony_ci/* using spca508_write_i2c_vector(). */ 868c2ecf20Sopenharmony_ci/* TBD: Should see if the values in spca50x_i2c_data */ 878c2ecf20Sopenharmony_ci/* would work with the VQ110 instead of the values */ 888c2ecf20Sopenharmony_ci/* below. */ 898c2ecf20Sopenharmony_ci {0x00c0, 0x8804}, /* SSI slave addr */ 908c2ecf20Sopenharmony_ci {0x0008, 0x8802}, /* 375 Khz SSI clock */ 918c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 928c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 938c2ecf20Sopenharmony_ci {0x0008, 0x8802}, /* 375 Khz SSI clock */ 948c2ecf20Sopenharmony_ci {0x0012, 0x8801}, /* SSI reg addr */ 958c2ecf20Sopenharmony_ci {0x0080, 0x8800}, /* SSI data to write */ 968c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 978c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 988c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 998c2ecf20Sopenharmony_ci {0x0008, 0x8802}, /* 375 Khz SSI clock */ 1008c2ecf20Sopenharmony_ci {0x0012, 0x8801}, /* SSI reg addr */ 1018c2ecf20Sopenharmony_ci {0x0000, 0x8800}, /* SSI data to write */ 1028c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1038c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1048c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1058c2ecf20Sopenharmony_ci {0x0008, 0x8802}, /* 375 Khz SSI clock */ 1068c2ecf20Sopenharmony_ci {0x0011, 0x8801}, /* SSI reg addr */ 1078c2ecf20Sopenharmony_ci {0x0040, 0x8800}, /* SSI data to write */ 1088c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1098c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1108c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1118c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1128c2ecf20Sopenharmony_ci {0x0013, 0x8801}, 1138c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 1148c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1158c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1168c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1178c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1188c2ecf20Sopenharmony_ci {0x0014, 0x8801}, 1198c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 1208c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1218c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1228c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1238c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1248c2ecf20Sopenharmony_ci {0x0015, 0x8801}, 1258c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 1268c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1278c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1288c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1298c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1308c2ecf20Sopenharmony_ci {0x0016, 0x8801}, 1318c2ecf20Sopenharmony_ci {0x0003, 0x8800}, 1328c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1338c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1348c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1358c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1368c2ecf20Sopenharmony_ci {0x0017, 0x8801}, 1378c2ecf20Sopenharmony_ci {0x0036, 0x8800}, 1388c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1398c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1408c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1418c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1428c2ecf20Sopenharmony_ci {0x0018, 0x8801}, 1438c2ecf20Sopenharmony_ci {0x00ec, 0x8800}, 1448c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1458c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1468c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1478c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1488c2ecf20Sopenharmony_ci {0x001a, 0x8801}, 1498c2ecf20Sopenharmony_ci {0x0094, 0x8800}, 1508c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1518c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1528c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1538c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1548c2ecf20Sopenharmony_ci {0x001b, 0x8801}, 1558c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 1568c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1578c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1588c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1598c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1608c2ecf20Sopenharmony_ci {0x0027, 0x8801}, 1618c2ecf20Sopenharmony_ci {0x00a2, 0x8800}, 1628c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1638c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1648c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1658c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1668c2ecf20Sopenharmony_ci {0x0028, 0x8801}, 1678c2ecf20Sopenharmony_ci {0x0040, 0x8800}, 1688c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1698c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1708c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1718c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1728c2ecf20Sopenharmony_ci {0x002a, 0x8801}, 1738c2ecf20Sopenharmony_ci {0x0084, 0x8800}, 1748c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1758c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1768c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1778c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1788c2ecf20Sopenharmony_ci {0x002b, 0x8801}, 1798c2ecf20Sopenharmony_ci {0x00a8, 0x8800}, 1808c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1818c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1828c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1838c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1848c2ecf20Sopenharmony_ci {0x002c, 0x8801}, 1858c2ecf20Sopenharmony_ci {0x00fe, 0x8800}, 1868c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1878c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1888c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1898c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1908c2ecf20Sopenharmony_ci {0x002d, 0x8801}, 1918c2ecf20Sopenharmony_ci {0x0003, 0x8800}, 1928c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1938c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1948c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 1958c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 1968c2ecf20Sopenharmony_ci {0x0038, 0x8801}, 1978c2ecf20Sopenharmony_ci {0x0083, 0x8800}, 1988c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 1998c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2008c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2018c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2028c2ecf20Sopenharmony_ci {0x0033, 0x8801}, 2038c2ecf20Sopenharmony_ci {0x0081, 0x8800}, 2048c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2058c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2068c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2078c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2088c2ecf20Sopenharmony_ci {0x0034, 0x8801}, 2098c2ecf20Sopenharmony_ci {0x004a, 0x8800}, 2108c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2118c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2128c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2138c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2148c2ecf20Sopenharmony_ci {0x0039, 0x8801}, 2158c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 2168c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2178c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2188c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2198c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2208c2ecf20Sopenharmony_ci {0x0010, 0x8801}, 2218c2ecf20Sopenharmony_ci {0x00a8, 0x8800}, 2228c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2238c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2248c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2258c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2268c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 2278c2ecf20Sopenharmony_ci {0x0058, 0x8800}, 2288c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2298c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2308c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2318c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2328c2ecf20Sopenharmony_ci {0x0000, 0x8801}, 2338c2ecf20Sopenharmony_ci {0x0004, 0x8800}, 2348c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2358c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2368c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2378c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2388c2ecf20Sopenharmony_ci {0x0040, 0x8801}, 2398c2ecf20Sopenharmony_ci {0x0080, 0x8800}, 2408c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2418c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2428c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2438c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2448c2ecf20Sopenharmony_ci {0x0041, 0x8801}, 2458c2ecf20Sopenharmony_ci {0x000c, 0x8800}, 2468c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2478c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2488c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2498c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2508c2ecf20Sopenharmony_ci {0x0042, 0x8801}, 2518c2ecf20Sopenharmony_ci {0x000c, 0x8800}, 2528c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2538c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2548c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2558c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2568c2ecf20Sopenharmony_ci {0x0043, 0x8801}, 2578c2ecf20Sopenharmony_ci {0x0028, 0x8800}, 2588c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2598c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2608c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2618c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2628c2ecf20Sopenharmony_ci {0x0044, 0x8801}, 2638c2ecf20Sopenharmony_ci {0x0080, 0x8800}, 2648c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2658c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2668c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2678c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2688c2ecf20Sopenharmony_ci {0x0045, 0x8801}, 2698c2ecf20Sopenharmony_ci {0x0020, 0x8800}, 2708c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2718c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2728c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2738c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2748c2ecf20Sopenharmony_ci {0x0046, 0x8801}, 2758c2ecf20Sopenharmony_ci {0x0020, 0x8800}, 2768c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2778c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2788c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2798c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2808c2ecf20Sopenharmony_ci {0x0047, 0x8801}, 2818c2ecf20Sopenharmony_ci {0x0080, 0x8800}, 2828c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2838c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2848c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2858c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2868c2ecf20Sopenharmony_ci {0x0048, 0x8801}, 2878c2ecf20Sopenharmony_ci {0x004c, 0x8800}, 2888c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2898c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2908c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2918c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2928c2ecf20Sopenharmony_ci {0x0049, 0x8801}, 2938c2ecf20Sopenharmony_ci {0x0084, 0x8800}, 2948c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2958c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 2968c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 2978c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 2988c2ecf20Sopenharmony_ci {0x004a, 0x8801}, 2998c2ecf20Sopenharmony_ci {0x0084, 0x8800}, 3008c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3018c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3028c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 3038c2ecf20Sopenharmony_ci {0x0008, 0x8802}, 3048c2ecf20Sopenharmony_ci {0x004b, 0x8801}, 3058c2ecf20Sopenharmony_ci {0x0084, 0x8800}, 3068c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3078c2ecf20Sopenharmony_ci /* --------------------------------------- */ 3088c2ecf20Sopenharmony_ci {0x0012, 0x8700}, /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */ 3098c2ecf20Sopenharmony_ci {0x0000, 0x8701}, /* CKx1 clock delay adj */ 3108c2ecf20Sopenharmony_ci {0x0000, 0x8701}, /* CKx1 clock delay adj */ 3118c2ecf20Sopenharmony_ci {0x0001, 0x870c}, /* CKOx2 output */ 3128c2ecf20Sopenharmony_ci /* --------------------------------------- */ 3138c2ecf20Sopenharmony_ci {0x0080, 0x8600}, /* Line memory read counter (L) */ 3148c2ecf20Sopenharmony_ci {0x0001, 0x8606}, /* reserved */ 3158c2ecf20Sopenharmony_ci {0x0064, 0x8607}, /* Line memory read counter (H) 0x6480=25,728 */ 3168c2ecf20Sopenharmony_ci {0x002a, 0x8601}, /* CDSP sharp interpolation mode, 3178c2ecf20Sopenharmony_ci * line sel for color sep, edge enhance enab */ 3188c2ecf20Sopenharmony_ci {0x0000, 0x8602}, /* optical black level for user settng = 0 */ 3198c2ecf20Sopenharmony_ci {0x0080, 0x8600}, /* Line memory read counter (L) */ 3208c2ecf20Sopenharmony_ci {0x000a, 0x8603}, /* optical black level calc mode: 3218c2ecf20Sopenharmony_ci * auto; optical black offset = 10 */ 3228c2ecf20Sopenharmony_ci {0x00df, 0x865b}, /* Horiz offset for valid pixels (L)=0xdf */ 3238c2ecf20Sopenharmony_ci {0x0012, 0x865c}, /* Vert offset for valid lines (L)=0x12 */ 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ci/* The following two lines seem to be the "wrong" resolution. */ 3268c2ecf20Sopenharmony_ci/* But perhaps these indicate the actual size of the sensor */ 3278c2ecf20Sopenharmony_ci/* rather than the size of the current video mode. */ 3288c2ecf20Sopenharmony_ci {0x0058, 0x865d}, /* Horiz valid pixels (*4) (L) = 352 */ 3298c2ecf20Sopenharmony_ci {0x0048, 0x865e}, /* Vert valid lines (*4) (L) = 288 */ 3308c2ecf20Sopenharmony_ci 3318c2ecf20Sopenharmony_ci {0x0015, 0x8608}, /* A11 Coef ... */ 3328c2ecf20Sopenharmony_ci {0x0030, 0x8609}, 3338c2ecf20Sopenharmony_ci {0x00fb, 0x860a}, 3348c2ecf20Sopenharmony_ci {0x003e, 0x860b}, 3358c2ecf20Sopenharmony_ci {0x00ce, 0x860c}, 3368c2ecf20Sopenharmony_ci {0x00f4, 0x860d}, 3378c2ecf20Sopenharmony_ci {0x00eb, 0x860e}, 3388c2ecf20Sopenharmony_ci {0x00dc, 0x860f}, 3398c2ecf20Sopenharmony_ci {0x0039, 0x8610}, 3408c2ecf20Sopenharmony_ci {0x0001, 0x8611}, /* R offset for white balance ... */ 3418c2ecf20Sopenharmony_ci {0x0000, 0x8612}, 3428c2ecf20Sopenharmony_ci {0x0001, 0x8613}, 3438c2ecf20Sopenharmony_ci {0x0000, 0x8614}, 3448c2ecf20Sopenharmony_ci {0x005b, 0x8651}, /* R gain for white balance ... */ 3458c2ecf20Sopenharmony_ci {0x0040, 0x8652}, 3468c2ecf20Sopenharmony_ci {0x0060, 0x8653}, 3478c2ecf20Sopenharmony_ci {0x0040, 0x8654}, 3488c2ecf20Sopenharmony_ci {0x0000, 0x8655}, 3498c2ecf20Sopenharmony_ci {0x0001, 0x863f}, /* Fixed gamma correction enable, USB control, 3508c2ecf20Sopenharmony_ci * lum filter disable, lum noise clip disable */ 3518c2ecf20Sopenharmony_ci {0x00a1, 0x8656}, /* Window1 size 256x256, Windows2 size 64x64, 3528c2ecf20Sopenharmony_ci * gamma look-up disable, 3538c2ecf20Sopenharmony_ci * new edge enhancement enable */ 3548c2ecf20Sopenharmony_ci {0x0018, 0x8657}, /* Edge gain high thresh */ 3558c2ecf20Sopenharmony_ci {0x0020, 0x8658}, /* Edge gain low thresh */ 3568c2ecf20Sopenharmony_ci {0x000a, 0x8659}, /* Edge bandwidth high threshold */ 3578c2ecf20Sopenharmony_ci {0x0005, 0x865a}, /* Edge bandwidth low threshold */ 3588c2ecf20Sopenharmony_ci /* -------------------------------- */ 3598c2ecf20Sopenharmony_ci {0x0030, 0x8112}, /* Video drop enable, ISO streaming enable */ 3608c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3618c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 3628c2ecf20Sopenharmony_ci {0xa908, 0x8802}, 3638c2ecf20Sopenharmony_ci {0x0034, 0x8801}, /* SSI reg addr */ 3648c2ecf20Sopenharmony_ci {0x00ca, 0x8800}, 3658c2ecf20Sopenharmony_ci /* SSI data to write */ 3668c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3678c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3688c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 3698c2ecf20Sopenharmony_ci {0x1f08, 0x8802}, 3708c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 3718c2ecf20Sopenharmony_ci {0x0080, 0x8800}, 3728c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_ci/* ----- Read back coefs we wrote earlier. */ 3758c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8608 } -> 0000: 15 */ 3768c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8609 } -> 0000: 30 */ 3778c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x860a } -> 0000: fb */ 3788c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x860b } -> 0000: 3e */ 3798c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x860c } -> 0000: ce */ 3808c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x860d } -> 0000: f4 */ 3818c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x860e } -> 0000: eb */ 3828c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x860f } -> 0000: dc */ 3838c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8610 } -> 0000: 39 */ 3848c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3858c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 08 */ 3868c2ecf20Sopenharmony_ci {0xb008, 0x8802}, 3878c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 3888c2ecf20Sopenharmony_ci {0x007d, 0x8800}, 3898c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 3908c2ecf20Sopenharmony_ci 3918c2ecf20Sopenharmony_ci 3928c2ecf20Sopenharmony_ci /* This chunk is seemingly redundant with */ 3938c2ecf20Sopenharmony_ci /* earlier commands (A11 Coef...), but if I disable it, */ 3948c2ecf20Sopenharmony_ci /* the image appears too dark. Maybe there was some kind of */ 3958c2ecf20Sopenharmony_ci /* reset since the earlier commands, so this is necessary again. */ 3968c2ecf20Sopenharmony_ci {0x0015, 0x8608}, 3978c2ecf20Sopenharmony_ci {0x0030, 0x8609}, 3988c2ecf20Sopenharmony_ci {0xfffb, 0x860a}, 3998c2ecf20Sopenharmony_ci {0x003e, 0x860b}, 4008c2ecf20Sopenharmony_ci {0xffce, 0x860c}, 4018c2ecf20Sopenharmony_ci {0xfff4, 0x860d}, 4028c2ecf20Sopenharmony_ci {0xffeb, 0x860e}, 4038c2ecf20Sopenharmony_ci {0xffdc, 0x860f}, 4048c2ecf20Sopenharmony_ci {0x0039, 0x8610}, 4058c2ecf20Sopenharmony_ci {0x0018, 0x8657}, 4068c2ecf20Sopenharmony_ci 4078c2ecf20Sopenharmony_ci {0x0000, 0x8508}, /* Disable compression. */ 4088c2ecf20Sopenharmony_ci /* Previous line was: 4098c2ecf20Sopenharmony_ci {0x0021, 0x8508}, * Enable compression. */ 4108c2ecf20Sopenharmony_ci {0x0032, 0x850b}, /* compression stuff */ 4118c2ecf20Sopenharmony_ci {0x0003, 0x8509}, /* compression stuff */ 4128c2ecf20Sopenharmony_ci {0x0011, 0x850a}, /* compression stuff */ 4138c2ecf20Sopenharmony_ci {0x0021, 0x850d}, /* compression stuff */ 4148c2ecf20Sopenharmony_ci {0x0010, 0x850c}, /* compression stuff */ 4158c2ecf20Sopenharmony_ci {0x0003, 0x8500}, /* *** Video mode: 160x120 */ 4168c2ecf20Sopenharmony_ci {0x0001, 0x8501}, /* Hardware-dominated snap control */ 4178c2ecf20Sopenharmony_ci {0x0061, 0x8656}, /* Window1 size 128x128, Windows2 size 128x128, 4188c2ecf20Sopenharmony_ci * gamma look-up disable, 4198c2ecf20Sopenharmony_ci * new edge enhancement enable */ 4208c2ecf20Sopenharmony_ci {0x0018, 0x8617}, /* Window1 start X (*2) */ 4218c2ecf20Sopenharmony_ci {0x0008, 0x8618}, /* Window1 start Y (*2) */ 4228c2ecf20Sopenharmony_ci {0x0061, 0x8656}, /* Window1 size 128x128, Windows2 size 128x128, 4238c2ecf20Sopenharmony_ci * gamma look-up disable, 4248c2ecf20Sopenharmony_ci * new edge enhancement enable */ 4258c2ecf20Sopenharmony_ci {0x0058, 0x8619}, /* Window2 start X (*2) */ 4268c2ecf20Sopenharmony_ci {0x0008, 0x861a}, /* Window2 start Y (*2) */ 4278c2ecf20Sopenharmony_ci {0x00ff, 0x8615}, /* High lum thresh for white balance */ 4288c2ecf20Sopenharmony_ci {0x0000, 0x8616}, /* Low lum thresh for white balance */ 4298c2ecf20Sopenharmony_ci {0x0012, 0x8700}, /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */ 4308c2ecf20Sopenharmony_ci {0x0012, 0x8700}, /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */ 4318c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8656 } -> 0000: 61 */ 4328c2ecf20Sopenharmony_ci {0x0028, 0x8802}, /* 375 Khz SSI clock, SSI r/w sync with VSYNC */ 4338c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 4348c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 28 */ 4358c2ecf20Sopenharmony_ci {0x1f28, 0x8802}, /* 375 Khz SSI clock, SSI r/w sync with VSYNC */ 4368c2ecf20Sopenharmony_ci {0x0010, 0x8801}, /* SSI reg addr */ 4378c2ecf20Sopenharmony_ci {0x003e, 0x8800}, /* SSI data to write */ 4388c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 4398c2ecf20Sopenharmony_ci {0x0028, 0x8802}, 4408c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 4418c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 28 */ 4428c2ecf20Sopenharmony_ci {0x1f28, 0x8802}, 4438c2ecf20Sopenharmony_ci {0x0000, 0x8801}, 4448c2ecf20Sopenharmony_ci {0x001f, 0x8800}, 4458c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 4468c2ecf20Sopenharmony_ci {0x0001, 0x8602}, /* optical black level for user settning = 1 */ 4478c2ecf20Sopenharmony_ci 4488c2ecf20Sopenharmony_ci /* Original: */ 4498c2ecf20Sopenharmony_ci {0x0023, 0x8700}, /* Clock speed 48Mhz/(3+2)/4= 2.4 Mhz */ 4508c2ecf20Sopenharmony_ci {0x000f, 0x8602}, /* optical black level for user settning = 15 */ 4518c2ecf20Sopenharmony_ci 4528c2ecf20Sopenharmony_ci {0x0028, 0x8802}, 4538c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 4548c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 28 */ 4558c2ecf20Sopenharmony_ci {0x1f28, 0x8802}, 4568c2ecf20Sopenharmony_ci {0x0010, 0x8801}, 4578c2ecf20Sopenharmony_ci {0x007b, 0x8800}, 4588c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 4598c2ecf20Sopenharmony_ci {0x002f, 0x8651}, /* R gain for white balance ... */ 4608c2ecf20Sopenharmony_ci {0x0080, 0x8653}, 4618c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8655 } -> 0000: 00 */ 4628c2ecf20Sopenharmony_ci {0x0000, 0x8655}, 4638c2ecf20Sopenharmony_ci 4648c2ecf20Sopenharmony_ci {0x0030, 0x8112}, /* Video drop enable, ISO streaming enable */ 4658c2ecf20Sopenharmony_ci {0x0020, 0x8112}, /* Video drop enable, ISO streaming disable */ 4668c2ecf20Sopenharmony_ci /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE: (ALT=0) ) */ 4678c2ecf20Sopenharmony_ci {} 4688c2ecf20Sopenharmony_ci}; 4698c2ecf20Sopenharmony_ci 4708c2ecf20Sopenharmony_ci/* 4718c2ecf20Sopenharmony_ci * Initialization data for Intel EasyPC Camera CS110 4728c2ecf20Sopenharmony_ci */ 4738c2ecf20Sopenharmony_cistatic const u16 spca508cs110_init_data[][2] = { 4748c2ecf20Sopenharmony_ci {0x0000, 0x870b}, /* Reset CTL3 */ 4758c2ecf20Sopenharmony_ci {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */ 4768c2ecf20Sopenharmony_ci {0x0000, 0x8111}, /* Normal operation on reset */ 4778c2ecf20Sopenharmony_ci {0x0090, 0x8110}, 4788c2ecf20Sopenharmony_ci /* External Clock 2x & Synchronous Serial Interface Output */ 4798c2ecf20Sopenharmony_ci {0x0020, 0x8112}, /* Video Drop packet enable */ 4808c2ecf20Sopenharmony_ci {0x0000, 0x8114}, /* Software GPIO output data */ 4818c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 4828c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 4838c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 4848c2ecf20Sopenharmony_ci {0x0003, 0x8114}, 4858c2ecf20Sopenharmony_ci 4868c2ecf20Sopenharmony_ci /* Initial sequence Synchronous Serial Interface */ 4878c2ecf20Sopenharmony_ci {0x000f, 0x8402}, /* Memory bank Address */ 4888c2ecf20Sopenharmony_ci {0x0000, 0x8403}, /* Memory bank Address */ 4898c2ecf20Sopenharmony_ci {0x00ba, 0x8804}, /* SSI Slave address */ 4908c2ecf20Sopenharmony_ci {0x0010, 0x8802}, /* 93.75kHz SSI Clock Two DataByte */ 4918c2ecf20Sopenharmony_ci {0x0010, 0x8802}, /* 93.75kHz SSI Clock two DataByte */ 4928c2ecf20Sopenharmony_ci 4938c2ecf20Sopenharmony_ci {0x0001, 0x8801}, 4948c2ecf20Sopenharmony_ci {0x000a, 0x8805}, /* a - NWG: Dunno what this is about */ 4958c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 4968c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 4978c2ecf20Sopenharmony_ci 4988c2ecf20Sopenharmony_ci {0x0002, 0x8801}, 4998c2ecf20Sopenharmony_ci {0x0000, 0x8805}, 5008c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 5018c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 5028c2ecf20Sopenharmony_ci 5038c2ecf20Sopenharmony_ci {0x0003, 0x8801}, 5048c2ecf20Sopenharmony_ci {0x0027, 0x8805}, 5058c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 5068c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 5078c2ecf20Sopenharmony_ci 5088c2ecf20Sopenharmony_ci {0x0004, 0x8801}, 5098c2ecf20Sopenharmony_ci {0x0065, 0x8805}, 5108c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 5118c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 5128c2ecf20Sopenharmony_ci 5138c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 5148c2ecf20Sopenharmony_ci {0x0003, 0x8805}, 5158c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 5168c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 5178c2ecf20Sopenharmony_ci 5188c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 5198c2ecf20Sopenharmony_ci {0x001c, 0x8805}, 5208c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 5218c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 5228c2ecf20Sopenharmony_ci 5238c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 5248c2ecf20Sopenharmony_ci {0x002a, 0x8805}, 5258c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 5268c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 5278c2ecf20Sopenharmony_ci 5288c2ecf20Sopenharmony_ci {0x0002, 0x8704}, /* External input CKIx1 */ 5298c2ecf20Sopenharmony_ci {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */ 5308c2ecf20Sopenharmony_ci {0x009a, 0x8600}, /* Line memory Read Counter (L) */ 5318c2ecf20Sopenharmony_ci {0x0001, 0x865b}, /* 1 Horizontal Offset for Valid Pixel(L) */ 5328c2ecf20Sopenharmony_ci {0x0003, 0x865c}, /* 3 Vertical Offset for Valid Lines(L) */ 5338c2ecf20Sopenharmony_ci {0x0058, 0x865d}, /* 58 Horizontal Valid Pixel Window(L) */ 5348c2ecf20Sopenharmony_ci 5358c2ecf20Sopenharmony_ci {0x0006, 0x8660}, /* Nibble data + input order */ 5368c2ecf20Sopenharmony_ci 5378c2ecf20Sopenharmony_ci {0x000a, 0x8602}, /* Optical black level set to 0x0a */ 5388c2ecf20Sopenharmony_ci {0x0000, 0x8603}, /* Optical black level Offset */ 5398c2ecf20Sopenharmony_ci 5408c2ecf20Sopenharmony_ci/* {0x0000, 0x8611}, * 0 R Offset for white Balance */ 5418c2ecf20Sopenharmony_ci/* {0x0000, 0x8612}, * 1 Gr Offset for white Balance */ 5428c2ecf20Sopenharmony_ci/* {0x0000, 0x8613}, * 1f B Offset for white Balance */ 5438c2ecf20Sopenharmony_ci/* {0x0000, 0x8614}, * f0 Gb Offset for white Balance */ 5448c2ecf20Sopenharmony_ci 5458c2ecf20Sopenharmony_ci {0x0040, 0x8651}, /* 2b BLUE gain for white balance good at all 60 */ 5468c2ecf20Sopenharmony_ci {0x0030, 0x8652}, /* 41 Gr Gain for white Balance (L) */ 5478c2ecf20Sopenharmony_ci {0x0035, 0x8653}, /* 26 RED gain for white balance */ 5488c2ecf20Sopenharmony_ci {0x0035, 0x8654}, /* 40Gb Gain for white Balance (L) */ 5498c2ecf20Sopenharmony_ci {0x0041, 0x863f}, 5508c2ecf20Sopenharmony_ci /* Fixed Gamma correction enabled (makes colours look better) */ 5518c2ecf20Sopenharmony_ci 5528c2ecf20Sopenharmony_ci {0x0000, 0x8655}, 5538c2ecf20Sopenharmony_ci /* High bits for white balance*****brightness control*** */ 5548c2ecf20Sopenharmony_ci {} 5558c2ecf20Sopenharmony_ci}; 5568c2ecf20Sopenharmony_ci 5578c2ecf20Sopenharmony_cistatic const u16 spca508_sightcam_init_data[][2] = { 5588c2ecf20Sopenharmony_ci/* This line seems to setup the frame/canvas */ 5598c2ecf20Sopenharmony_ci {0x000f, 0x8402}, 5608c2ecf20Sopenharmony_ci 5618c2ecf20Sopenharmony_ci/* These 6 lines are needed to startup the webcam */ 5628c2ecf20Sopenharmony_ci {0x0090, 0x8110}, 5638c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 5648c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 5658c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 5668c2ecf20Sopenharmony_ci {0x0003, 0x8114}, 5678c2ecf20Sopenharmony_ci {0x0080, 0x8804}, 5688c2ecf20Sopenharmony_ci 5698c2ecf20Sopenharmony_ci/* This part seems to make the pictures darker? (autobrightness?) */ 5708c2ecf20Sopenharmony_ci {0x0001, 0x8801}, 5718c2ecf20Sopenharmony_ci {0x0004, 0x8800}, 5728c2ecf20Sopenharmony_ci {0x0003, 0x8801}, 5738c2ecf20Sopenharmony_ci {0x00e0, 0x8800}, 5748c2ecf20Sopenharmony_ci {0x0004, 0x8801}, 5758c2ecf20Sopenharmony_ci {0x00b4, 0x8800}, 5768c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 5778c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 5788c2ecf20Sopenharmony_ci 5798c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 5808c2ecf20Sopenharmony_ci {0x00e0, 0x8800}, 5818c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 5828c2ecf20Sopenharmony_ci {0x000c, 0x8800}, 5838c2ecf20Sopenharmony_ci 5848c2ecf20Sopenharmony_ci/* This section is just needed, it probably 5858c2ecf20Sopenharmony_ci * does something like the previous section, 5868c2ecf20Sopenharmony_ci * but the cam won't start if it's not included. 5878c2ecf20Sopenharmony_ci */ 5888c2ecf20Sopenharmony_ci {0x0014, 0x8801}, 5898c2ecf20Sopenharmony_ci {0x0008, 0x8800}, 5908c2ecf20Sopenharmony_ci {0x0015, 0x8801}, 5918c2ecf20Sopenharmony_ci {0x0067, 0x8800}, 5928c2ecf20Sopenharmony_ci {0x0016, 0x8801}, 5938c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 5948c2ecf20Sopenharmony_ci {0x0017, 0x8801}, 5958c2ecf20Sopenharmony_ci {0x0020, 0x8800}, 5968c2ecf20Sopenharmony_ci {0x0018, 0x8801}, 5978c2ecf20Sopenharmony_ci {0x0044, 0x8800}, 5988c2ecf20Sopenharmony_ci 5998c2ecf20Sopenharmony_ci/* Makes the picture darker - and the 6008c2ecf20Sopenharmony_ci * cam won't start if not included 6018c2ecf20Sopenharmony_ci */ 6028c2ecf20Sopenharmony_ci {0x001e, 0x8801}, 6038c2ecf20Sopenharmony_ci {0x00ea, 0x8800}, 6048c2ecf20Sopenharmony_ci {0x001f, 0x8801}, 6058c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 6068c2ecf20Sopenharmony_ci {0x0003, 0x8801}, 6078c2ecf20Sopenharmony_ci {0x00e0, 0x8800}, 6088c2ecf20Sopenharmony_ci 6098c2ecf20Sopenharmony_ci/* seems to place the colors ontop of each other #1 */ 6108c2ecf20Sopenharmony_ci {0x0006, 0x8704}, 6118c2ecf20Sopenharmony_ci {0x0001, 0x870c}, 6128c2ecf20Sopenharmony_ci {0x0016, 0x8600}, 6138c2ecf20Sopenharmony_ci {0x0002, 0x8606}, 6148c2ecf20Sopenharmony_ci 6158c2ecf20Sopenharmony_ci/* if not included the pictures becomes _very_ dark */ 6168c2ecf20Sopenharmony_ci {0x0064, 0x8607}, 6178c2ecf20Sopenharmony_ci {0x003a, 0x8601}, 6188c2ecf20Sopenharmony_ci {0x0000, 0x8602}, 6198c2ecf20Sopenharmony_ci 6208c2ecf20Sopenharmony_ci/* seems to place the colors ontop of each other #2 */ 6218c2ecf20Sopenharmony_ci {0x0016, 0x8600}, 6228c2ecf20Sopenharmony_ci {0x0018, 0x8617}, 6238c2ecf20Sopenharmony_ci {0x0008, 0x8618}, 6248c2ecf20Sopenharmony_ci {0x00a1, 0x8656}, 6258c2ecf20Sopenharmony_ci 6268c2ecf20Sopenharmony_ci/* webcam won't start if not included */ 6278c2ecf20Sopenharmony_ci {0x0007, 0x865b}, 6288c2ecf20Sopenharmony_ci {0x0001, 0x865c}, 6298c2ecf20Sopenharmony_ci {0x0058, 0x865d}, 6308c2ecf20Sopenharmony_ci {0x0048, 0x865e}, 6318c2ecf20Sopenharmony_ci 6328c2ecf20Sopenharmony_ci/* adjusts the colors */ 6338c2ecf20Sopenharmony_ci {0x0049, 0x8651}, 6348c2ecf20Sopenharmony_ci {0x0040, 0x8652}, 6358c2ecf20Sopenharmony_ci {0x004c, 0x8653}, 6368c2ecf20Sopenharmony_ci {0x0040, 0x8654}, 6378c2ecf20Sopenharmony_ci {} 6388c2ecf20Sopenharmony_ci}; 6398c2ecf20Sopenharmony_ci 6408c2ecf20Sopenharmony_cistatic const u16 spca508_sightcam2_init_data[][2] = { 6418c2ecf20Sopenharmony_ci {0x0020, 0x8112}, 6428c2ecf20Sopenharmony_ci 6438c2ecf20Sopenharmony_ci {0x000f, 0x8402}, 6448c2ecf20Sopenharmony_ci {0x0000, 0x8403}, 6458c2ecf20Sopenharmony_ci 6468c2ecf20Sopenharmony_ci {0x0008, 0x8201}, 6478c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6488c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6498c2ecf20Sopenharmony_ci {0x0009, 0x8201}, 6508c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6518c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6528c2ecf20Sopenharmony_ci {0x000a, 0x8201}, 6538c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6548c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6558c2ecf20Sopenharmony_ci {0x000b, 0x8201}, 6568c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6578c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6588c2ecf20Sopenharmony_ci {0x000c, 0x8201}, 6598c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6608c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6618c2ecf20Sopenharmony_ci {0x000d, 0x8201}, 6628c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6638c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6648c2ecf20Sopenharmony_ci {0x000e, 0x8201}, 6658c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6668c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6678c2ecf20Sopenharmony_ci {0x0007, 0x8201}, 6688c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6698c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6708c2ecf20Sopenharmony_ci {0x000f, 0x8201}, 6718c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6728c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6738c2ecf20Sopenharmony_ci 6748c2ecf20Sopenharmony_ci {0x0018, 0x8660}, 6758c2ecf20Sopenharmony_ci {0x0010, 0x8201}, 6768c2ecf20Sopenharmony_ci 6778c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6788c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6798c2ecf20Sopenharmony_ci {0x0011, 0x8201}, 6808c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6818c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6828c2ecf20Sopenharmony_ci 6838c2ecf20Sopenharmony_ci {0x0000, 0x86b0}, 6848c2ecf20Sopenharmony_ci {0x0034, 0x86b1}, 6858c2ecf20Sopenharmony_ci {0x0000, 0x86b2}, 6868c2ecf20Sopenharmony_ci {0x0049, 0x86b3}, 6878c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 6888c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 6898c2ecf20Sopenharmony_ci 6908c2ecf20Sopenharmony_ci {0x0012, 0x8201}, 6918c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6928c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6938c2ecf20Sopenharmony_ci {0x0013, 0x8201}, 6948c2ecf20Sopenharmony_ci {0x0008, 0x8200}, 6958c2ecf20Sopenharmony_ci {0x0001, 0x8200}, 6968c2ecf20Sopenharmony_ci 6978c2ecf20Sopenharmony_ci {0x0001, 0x86b0}, 6988c2ecf20Sopenharmony_ci {0x00aa, 0x86b1}, 6998c2ecf20Sopenharmony_ci {0x0000, 0x86b2}, 7008c2ecf20Sopenharmony_ci {0x00e4, 0x86b3}, 7018c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 7028c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 7038c2ecf20Sopenharmony_ci 7048c2ecf20Sopenharmony_ci {0x0018, 0x8660}, 7058c2ecf20Sopenharmony_ci 7068c2ecf20Sopenharmony_ci {0x0090, 0x8110}, 7078c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 7088c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 7098c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 7108c2ecf20Sopenharmony_ci {0x0003, 0x8114}, 7118c2ecf20Sopenharmony_ci 7128c2ecf20Sopenharmony_ci {0x0080, 0x8804}, 7138c2ecf20Sopenharmony_ci {0x0003, 0x8801}, 7148c2ecf20Sopenharmony_ci {0x0012, 0x8800}, 7158c2ecf20Sopenharmony_ci {0x0004, 0x8801}, 7168c2ecf20Sopenharmony_ci {0x0005, 0x8800}, 7178c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 7188c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7198c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 7208c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7218c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 7228c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7238c2ecf20Sopenharmony_ci {0x0008, 0x8801}, 7248c2ecf20Sopenharmony_ci {0x0005, 0x8800}, 7258c2ecf20Sopenharmony_ci {0x000a, 0x8700}, 7268c2ecf20Sopenharmony_ci {0x000e, 0x8801}, 7278c2ecf20Sopenharmony_ci {0x0004, 0x8800}, 7288c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 7298c2ecf20Sopenharmony_ci {0x0047, 0x8800}, 7308c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 7318c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7328c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 7338c2ecf20Sopenharmony_ci {0x00c0, 0x8800}, 7348c2ecf20Sopenharmony_ci {0x0008, 0x8801}, 7358c2ecf20Sopenharmony_ci {0x0003, 0x8800}, 7368c2ecf20Sopenharmony_ci {0x0013, 0x8801}, 7378c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 7388c2ecf20Sopenharmony_ci {0x0009, 0x8801}, 7398c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7408c2ecf20Sopenharmony_ci {0x000a, 0x8801}, 7418c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7428c2ecf20Sopenharmony_ci {0x000b, 0x8801}, 7438c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7448c2ecf20Sopenharmony_ci {0x000c, 0x8801}, 7458c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7468c2ecf20Sopenharmony_ci {0x000e, 0x8801}, 7478c2ecf20Sopenharmony_ci {0x0004, 0x8800}, 7488c2ecf20Sopenharmony_ci {0x000f, 0x8801}, 7498c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7508c2ecf20Sopenharmony_ci {0x0010, 0x8801}, 7518c2ecf20Sopenharmony_ci {0x0006, 0x8800}, 7528c2ecf20Sopenharmony_ci {0x0011, 0x8801}, 7538c2ecf20Sopenharmony_ci {0x0006, 0x8800}, 7548c2ecf20Sopenharmony_ci {0x0012, 0x8801}, 7558c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 7568c2ecf20Sopenharmony_ci {0x0013, 0x8801}, 7578c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 7588c2ecf20Sopenharmony_ci 7598c2ecf20Sopenharmony_ci {0x000a, 0x8700}, 7608c2ecf20Sopenharmony_ci {0x0000, 0x8702}, 7618c2ecf20Sopenharmony_ci {0x0000, 0x8703}, 7628c2ecf20Sopenharmony_ci {0x00c2, 0x8704}, 7638c2ecf20Sopenharmony_ci {0x0001, 0x870c}, 7648c2ecf20Sopenharmony_ci 7658c2ecf20Sopenharmony_ci {0x0044, 0x8600}, 7668c2ecf20Sopenharmony_ci {0x0002, 0x8606}, 7678c2ecf20Sopenharmony_ci {0x0064, 0x8607}, 7688c2ecf20Sopenharmony_ci {0x003a, 0x8601}, 7698c2ecf20Sopenharmony_ci {0x0008, 0x8602}, 7708c2ecf20Sopenharmony_ci {0x0044, 0x8600}, 7718c2ecf20Sopenharmony_ci {0x0018, 0x8617}, 7728c2ecf20Sopenharmony_ci {0x0008, 0x8618}, 7738c2ecf20Sopenharmony_ci {0x00a1, 0x8656}, 7748c2ecf20Sopenharmony_ci {0x0004, 0x865b}, 7758c2ecf20Sopenharmony_ci {0x0002, 0x865c}, 7768c2ecf20Sopenharmony_ci {0x0058, 0x865d}, 7778c2ecf20Sopenharmony_ci {0x0048, 0x865e}, 7788c2ecf20Sopenharmony_ci {0x0012, 0x8608}, 7798c2ecf20Sopenharmony_ci {0x002c, 0x8609}, 7808c2ecf20Sopenharmony_ci {0x0002, 0x860a}, 7818c2ecf20Sopenharmony_ci {0x002c, 0x860b}, 7828c2ecf20Sopenharmony_ci {0x00db, 0x860c}, 7838c2ecf20Sopenharmony_ci {0x00f9, 0x860d}, 7848c2ecf20Sopenharmony_ci {0x00f1, 0x860e}, 7858c2ecf20Sopenharmony_ci {0x00e3, 0x860f}, 7868c2ecf20Sopenharmony_ci {0x002c, 0x8610}, 7878c2ecf20Sopenharmony_ci {0x006c, 0x8651}, 7888c2ecf20Sopenharmony_ci {0x0041, 0x8652}, 7898c2ecf20Sopenharmony_ci {0x0059, 0x8653}, 7908c2ecf20Sopenharmony_ci {0x0040, 0x8654}, 7918c2ecf20Sopenharmony_ci {0x00fa, 0x8611}, 7928c2ecf20Sopenharmony_ci {0x00ff, 0x8612}, 7938c2ecf20Sopenharmony_ci {0x00f8, 0x8613}, 7948c2ecf20Sopenharmony_ci {0x0000, 0x8614}, 7958c2ecf20Sopenharmony_ci {0x0001, 0x863f}, 7968c2ecf20Sopenharmony_ci {0x0000, 0x8640}, 7978c2ecf20Sopenharmony_ci {0x0026, 0x8641}, 7988c2ecf20Sopenharmony_ci {0x0045, 0x8642}, 7998c2ecf20Sopenharmony_ci {0x0060, 0x8643}, 8008c2ecf20Sopenharmony_ci {0x0075, 0x8644}, 8018c2ecf20Sopenharmony_ci {0x0088, 0x8645}, 8028c2ecf20Sopenharmony_ci {0x009b, 0x8646}, 8038c2ecf20Sopenharmony_ci {0x00b0, 0x8647}, 8048c2ecf20Sopenharmony_ci {0x00c5, 0x8648}, 8058c2ecf20Sopenharmony_ci {0x00d2, 0x8649}, 8068c2ecf20Sopenharmony_ci {0x00dc, 0x864a}, 8078c2ecf20Sopenharmony_ci {0x00e5, 0x864b}, 8088c2ecf20Sopenharmony_ci {0x00eb, 0x864c}, 8098c2ecf20Sopenharmony_ci {0x00f0, 0x864d}, 8108c2ecf20Sopenharmony_ci {0x00f6, 0x864e}, 8118c2ecf20Sopenharmony_ci {0x00fa, 0x864f}, 8128c2ecf20Sopenharmony_ci {0x00ff, 0x8650}, 8138c2ecf20Sopenharmony_ci {0x0060, 0x8657}, 8148c2ecf20Sopenharmony_ci {0x0010, 0x8658}, 8158c2ecf20Sopenharmony_ci {0x0018, 0x8659}, 8168c2ecf20Sopenharmony_ci {0x0005, 0x865a}, 8178c2ecf20Sopenharmony_ci {0x0018, 0x8660}, 8188c2ecf20Sopenharmony_ci {0x0003, 0x8509}, 8198c2ecf20Sopenharmony_ci {0x0011, 0x850a}, 8208c2ecf20Sopenharmony_ci {0x0032, 0x850b}, 8218c2ecf20Sopenharmony_ci {0x0010, 0x850c}, 8228c2ecf20Sopenharmony_ci {0x0021, 0x850d}, 8238c2ecf20Sopenharmony_ci {0x0001, 0x8500}, 8248c2ecf20Sopenharmony_ci {0x0000, 0x8508}, 8258c2ecf20Sopenharmony_ci {0x0012, 0x8608}, 8268c2ecf20Sopenharmony_ci {0x002c, 0x8609}, 8278c2ecf20Sopenharmony_ci {0x0002, 0x860a}, 8288c2ecf20Sopenharmony_ci {0x0039, 0x860b}, 8298c2ecf20Sopenharmony_ci {0x00d0, 0x860c}, 8308c2ecf20Sopenharmony_ci {0x00f7, 0x860d}, 8318c2ecf20Sopenharmony_ci {0x00ed, 0x860e}, 8328c2ecf20Sopenharmony_ci {0x00db, 0x860f}, 8338c2ecf20Sopenharmony_ci {0x0039, 0x8610}, 8348c2ecf20Sopenharmony_ci {0x0012, 0x8657}, 8358c2ecf20Sopenharmony_ci {0x000c, 0x8619}, 8368c2ecf20Sopenharmony_ci {0x0004, 0x861a}, 8378c2ecf20Sopenharmony_ci {0x00a1, 0x8656}, 8388c2ecf20Sopenharmony_ci {0x00c8, 0x8615}, 8398c2ecf20Sopenharmony_ci {0x0032, 0x8616}, 8408c2ecf20Sopenharmony_ci 8418c2ecf20Sopenharmony_ci {0x0030, 0x8112}, 8428c2ecf20Sopenharmony_ci {0x0020, 0x8112}, 8438c2ecf20Sopenharmony_ci {0x0020, 0x8112}, 8448c2ecf20Sopenharmony_ci {0x000f, 0x8402}, 8458c2ecf20Sopenharmony_ci {0x0000, 0x8403}, 8468c2ecf20Sopenharmony_ci 8478c2ecf20Sopenharmony_ci {0x0090, 0x8110}, 8488c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 8498c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 8508c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 8518c2ecf20Sopenharmony_ci {0x0003, 0x8114}, 8528c2ecf20Sopenharmony_ci {0x0080, 0x8804}, 8538c2ecf20Sopenharmony_ci 8548c2ecf20Sopenharmony_ci {0x0003, 0x8801}, 8558c2ecf20Sopenharmony_ci {0x0012, 0x8800}, 8568c2ecf20Sopenharmony_ci {0x0004, 0x8801}, 8578c2ecf20Sopenharmony_ci {0x0005, 0x8800}, 8588c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 8598c2ecf20Sopenharmony_ci {0x0047, 0x8800}, 8608c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 8618c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8628c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 8638c2ecf20Sopenharmony_ci {0x00c0, 0x8800}, 8648c2ecf20Sopenharmony_ci {0x0008, 0x8801}, 8658c2ecf20Sopenharmony_ci {0x0003, 0x8800}, 8668c2ecf20Sopenharmony_ci {0x000a, 0x8700}, 8678c2ecf20Sopenharmony_ci {0x000e, 0x8801}, 8688c2ecf20Sopenharmony_ci {0x0004, 0x8800}, 8698c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 8708c2ecf20Sopenharmony_ci {0x0047, 0x8800}, 8718c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 8728c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8738c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 8748c2ecf20Sopenharmony_ci {0x00c0, 0x8800}, 8758c2ecf20Sopenharmony_ci {0x0008, 0x8801}, 8768c2ecf20Sopenharmony_ci {0x0003, 0x8800}, 8778c2ecf20Sopenharmony_ci {0x0013, 0x8801}, 8788c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 8798c2ecf20Sopenharmony_ci {0x0009, 0x8801}, 8808c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8818c2ecf20Sopenharmony_ci {0x000a, 0x8801}, 8828c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8838c2ecf20Sopenharmony_ci {0x000b, 0x8801}, 8848c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8858c2ecf20Sopenharmony_ci {0x000c, 0x8801}, 8868c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8878c2ecf20Sopenharmony_ci {0x000e, 0x8801}, 8888c2ecf20Sopenharmony_ci {0x0004, 0x8800}, 8898c2ecf20Sopenharmony_ci {0x000f, 0x8801}, 8908c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8918c2ecf20Sopenharmony_ci {0x0010, 0x8801}, 8928c2ecf20Sopenharmony_ci {0x0006, 0x8800}, 8938c2ecf20Sopenharmony_ci {0x0011, 0x8801}, 8948c2ecf20Sopenharmony_ci {0x0006, 0x8800}, 8958c2ecf20Sopenharmony_ci {0x0012, 0x8801}, 8968c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 8978c2ecf20Sopenharmony_ci {0x0013, 0x8801}, 8988c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 8998c2ecf20Sopenharmony_ci {0x000a, 0x8700}, 9008c2ecf20Sopenharmony_ci {0x0000, 0x8702}, 9018c2ecf20Sopenharmony_ci {0x0000, 0x8703}, 9028c2ecf20Sopenharmony_ci {0x00c2, 0x8704}, 9038c2ecf20Sopenharmony_ci {0x0001, 0x870c}, 9048c2ecf20Sopenharmony_ci {0x0044, 0x8600}, 9058c2ecf20Sopenharmony_ci {0x0002, 0x8606}, 9068c2ecf20Sopenharmony_ci {0x0064, 0x8607}, 9078c2ecf20Sopenharmony_ci {0x003a, 0x8601}, 9088c2ecf20Sopenharmony_ci {0x0008, 0x8602}, 9098c2ecf20Sopenharmony_ci {0x0044, 0x8600}, 9108c2ecf20Sopenharmony_ci {0x0018, 0x8617}, 9118c2ecf20Sopenharmony_ci {0x0008, 0x8618}, 9128c2ecf20Sopenharmony_ci {0x00a1, 0x8656}, 9138c2ecf20Sopenharmony_ci {0x0004, 0x865b}, 9148c2ecf20Sopenharmony_ci {0x0002, 0x865c}, 9158c2ecf20Sopenharmony_ci {0x0058, 0x865d}, 9168c2ecf20Sopenharmony_ci {0x0048, 0x865e}, 9178c2ecf20Sopenharmony_ci {0x0012, 0x8608}, 9188c2ecf20Sopenharmony_ci {0x002c, 0x8609}, 9198c2ecf20Sopenharmony_ci {0x0002, 0x860a}, 9208c2ecf20Sopenharmony_ci {0x002c, 0x860b}, 9218c2ecf20Sopenharmony_ci {0x00db, 0x860c}, 9228c2ecf20Sopenharmony_ci {0x00f9, 0x860d}, 9238c2ecf20Sopenharmony_ci {0x00f1, 0x860e}, 9248c2ecf20Sopenharmony_ci {0x00e3, 0x860f}, 9258c2ecf20Sopenharmony_ci {0x002c, 0x8610}, 9268c2ecf20Sopenharmony_ci {0x006c, 0x8651}, 9278c2ecf20Sopenharmony_ci {0x0041, 0x8652}, 9288c2ecf20Sopenharmony_ci {0x0059, 0x8653}, 9298c2ecf20Sopenharmony_ci {0x0040, 0x8654}, 9308c2ecf20Sopenharmony_ci {0x00fa, 0x8611}, 9318c2ecf20Sopenharmony_ci {0x00ff, 0x8612}, 9328c2ecf20Sopenharmony_ci {0x00f8, 0x8613}, 9338c2ecf20Sopenharmony_ci {0x0000, 0x8614}, 9348c2ecf20Sopenharmony_ci {0x0001, 0x863f}, 9358c2ecf20Sopenharmony_ci {0x0000, 0x8640}, 9368c2ecf20Sopenharmony_ci {0x0026, 0x8641}, 9378c2ecf20Sopenharmony_ci {0x0045, 0x8642}, 9388c2ecf20Sopenharmony_ci {0x0060, 0x8643}, 9398c2ecf20Sopenharmony_ci {0x0075, 0x8644}, 9408c2ecf20Sopenharmony_ci {0x0088, 0x8645}, 9418c2ecf20Sopenharmony_ci {0x009b, 0x8646}, 9428c2ecf20Sopenharmony_ci {0x00b0, 0x8647}, 9438c2ecf20Sopenharmony_ci {0x00c5, 0x8648}, 9448c2ecf20Sopenharmony_ci {0x00d2, 0x8649}, 9458c2ecf20Sopenharmony_ci {0x00dc, 0x864a}, 9468c2ecf20Sopenharmony_ci {0x00e5, 0x864b}, 9478c2ecf20Sopenharmony_ci {0x00eb, 0x864c}, 9488c2ecf20Sopenharmony_ci {0x00f0, 0x864d}, 9498c2ecf20Sopenharmony_ci {0x00f6, 0x864e}, 9508c2ecf20Sopenharmony_ci {0x00fa, 0x864f}, 9518c2ecf20Sopenharmony_ci {0x00ff, 0x8650}, 9528c2ecf20Sopenharmony_ci {0x0060, 0x8657}, 9538c2ecf20Sopenharmony_ci {0x0010, 0x8658}, 9548c2ecf20Sopenharmony_ci {0x0018, 0x8659}, 9558c2ecf20Sopenharmony_ci {0x0005, 0x865a}, 9568c2ecf20Sopenharmony_ci {0x0018, 0x8660}, 9578c2ecf20Sopenharmony_ci {0x0003, 0x8509}, 9588c2ecf20Sopenharmony_ci {0x0011, 0x850a}, 9598c2ecf20Sopenharmony_ci {0x0032, 0x850b}, 9608c2ecf20Sopenharmony_ci {0x0010, 0x850c}, 9618c2ecf20Sopenharmony_ci {0x0021, 0x850d}, 9628c2ecf20Sopenharmony_ci {0x0001, 0x8500}, 9638c2ecf20Sopenharmony_ci {0x0000, 0x8508}, 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_ci {0x0012, 0x8608}, 9668c2ecf20Sopenharmony_ci {0x002c, 0x8609}, 9678c2ecf20Sopenharmony_ci {0x0002, 0x860a}, 9688c2ecf20Sopenharmony_ci {0x0039, 0x860b}, 9698c2ecf20Sopenharmony_ci {0x00d0, 0x860c}, 9708c2ecf20Sopenharmony_ci {0x00f7, 0x860d}, 9718c2ecf20Sopenharmony_ci {0x00ed, 0x860e}, 9728c2ecf20Sopenharmony_ci {0x00db, 0x860f}, 9738c2ecf20Sopenharmony_ci {0x0039, 0x8610}, 9748c2ecf20Sopenharmony_ci {0x0012, 0x8657}, 9758c2ecf20Sopenharmony_ci {0x0064, 0x8619}, 9768c2ecf20Sopenharmony_ci 9778c2ecf20Sopenharmony_ci/* This line starts it all, it is not needed here */ 9788c2ecf20Sopenharmony_ci/* since it has been build into the driver */ 9798c2ecf20Sopenharmony_ci/* jfm: don't start now */ 9808c2ecf20Sopenharmony_ci/* {0x0030, 0x8112}, */ 9818c2ecf20Sopenharmony_ci {} 9828c2ecf20Sopenharmony_ci}; 9838c2ecf20Sopenharmony_ci 9848c2ecf20Sopenharmony_ci/* 9858c2ecf20Sopenharmony_ci * Initialization data for Creative Webcam Vista 9868c2ecf20Sopenharmony_ci */ 9878c2ecf20Sopenharmony_cistatic const u16 spca508_vista_init_data[][2] = { 9888c2ecf20Sopenharmony_ci {0x0008, 0x8200}, /* Clear register */ 9898c2ecf20Sopenharmony_ci {0x0000, 0x870b}, /* Reset CTL3 */ 9908c2ecf20Sopenharmony_ci {0x0020, 0x8112}, /* Video Drop packet enable */ 9918c2ecf20Sopenharmony_ci {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */ 9928c2ecf20Sopenharmony_ci {0x0000, 0x8110}, /* Disable everything */ 9938c2ecf20Sopenharmony_ci {0x0000, 0x8114}, /* Software GPIO output data */ 9948c2ecf20Sopenharmony_ci {0x0000, 0x8114}, 9958c2ecf20Sopenharmony_ci 9968c2ecf20Sopenharmony_ci {0x0003, 0x8111}, 9978c2ecf20Sopenharmony_ci {0x0000, 0x8111}, 9988c2ecf20Sopenharmony_ci {0x0090, 0x8110}, /* Enable: SSI output, External 2X clock output */ 9998c2ecf20Sopenharmony_ci {0x0020, 0x8112}, 10008c2ecf20Sopenharmony_ci {0x0000, 0x8114}, 10018c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 10028c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 10038c2ecf20Sopenharmony_ci {0x0001, 0x8114}, 10048c2ecf20Sopenharmony_ci {0x0003, 0x8114}, 10058c2ecf20Sopenharmony_ci 10068c2ecf20Sopenharmony_ci {0x000f, 0x8402}, /* Memory bank Address */ 10078c2ecf20Sopenharmony_ci {0x0000, 0x8403}, /* Memory bank Address */ 10088c2ecf20Sopenharmony_ci {0x00ba, 0x8804}, /* SSI Slave address */ 10098c2ecf20Sopenharmony_ci {0x0010, 0x8802}, /* 93.75kHz SSI Clock Two DataByte */ 10108c2ecf20Sopenharmony_ci 10118c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10128c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10138c2ecf20Sopenharmony_ci {0x0010, 0x8802}, /* Will write 2 bytes (DATA1+DATA2) */ 10148c2ecf20Sopenharmony_ci {0x0020, 0x8801}, /* Register address for SSI read/write */ 10158c2ecf20Sopenharmony_ci {0x0044, 0x8805}, /* DATA2 */ 10168c2ecf20Sopenharmony_ci {0x0004, 0x8800}, /* DATA1 -> write triggered */ 10178c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10188c2ecf20Sopenharmony_ci 10198c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10208c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10218c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10228c2ecf20Sopenharmony_ci {0x0009, 0x8801}, 10238c2ecf20Sopenharmony_ci {0x0042, 0x8805}, 10248c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 10258c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10268c2ecf20Sopenharmony_ci 10278c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10288c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10298c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10308c2ecf20Sopenharmony_ci {0x003c, 0x8801}, 10318c2ecf20Sopenharmony_ci {0x0001, 0x8805}, 10328c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10338c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10348c2ecf20Sopenharmony_ci 10358c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10368c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10378c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10388c2ecf20Sopenharmony_ci {0x0001, 0x8801}, 10398c2ecf20Sopenharmony_ci {0x000a, 0x8805}, 10408c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10418c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10428c2ecf20Sopenharmony_ci 10438c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10448c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10458c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10468c2ecf20Sopenharmony_ci {0x0002, 0x8801}, 10478c2ecf20Sopenharmony_ci {0x0000, 0x8805}, 10488c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10498c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10508c2ecf20Sopenharmony_ci 10518c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10528c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10538c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10548c2ecf20Sopenharmony_ci {0x0003, 0x8801}, 10558c2ecf20Sopenharmony_ci {0x0027, 0x8805}, 10568c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 10578c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10588c2ecf20Sopenharmony_ci 10598c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10608c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10618c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10628c2ecf20Sopenharmony_ci {0x0004, 0x8801}, 10638c2ecf20Sopenharmony_ci {0x0065, 0x8805}, 10648c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 10658c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10668c2ecf20Sopenharmony_ci 10678c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10688c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10698c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10708c2ecf20Sopenharmony_ci {0x0005, 0x8801}, 10718c2ecf20Sopenharmony_ci {0x0003, 0x8805}, 10728c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10738c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10748c2ecf20Sopenharmony_ci 10758c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10768c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10778c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10788c2ecf20Sopenharmony_ci {0x0006, 0x8801}, 10798c2ecf20Sopenharmony_ci {0x001c, 0x8805}, 10808c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10818c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10828c2ecf20Sopenharmony_ci 10838c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10848c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10858c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10868c2ecf20Sopenharmony_ci {0x0007, 0x8801}, 10878c2ecf20Sopenharmony_ci {0x002a, 0x8805}, 10888c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10898c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10908c2ecf20Sopenharmony_ci 10918c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10928c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 10938c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 10948c2ecf20Sopenharmony_ci {0x000e, 0x8801}, 10958c2ecf20Sopenharmony_ci {0x0000, 0x8805}, 10968c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 10978c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 10988c2ecf20Sopenharmony_ci 10998c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11008c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 11018c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 11028c2ecf20Sopenharmony_ci {0x0028, 0x8801}, 11038c2ecf20Sopenharmony_ci {0x002e, 0x8805}, 11048c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 11058c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11068c2ecf20Sopenharmony_ci 11078c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11088c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 11098c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 11108c2ecf20Sopenharmony_ci {0x0039, 0x8801}, 11118c2ecf20Sopenharmony_ci {0x0013, 0x8805}, 11128c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 11138c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11148c2ecf20Sopenharmony_ci 11158c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11168c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 11178c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 11188c2ecf20Sopenharmony_ci {0x003b, 0x8801}, 11198c2ecf20Sopenharmony_ci {0x000c, 0x8805}, 11208c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 11218c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11228c2ecf20Sopenharmony_ci 11238c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11248c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 11258c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 11268c2ecf20Sopenharmony_ci {0x0035, 0x8801}, 11278c2ecf20Sopenharmony_ci {0x0028, 0x8805}, 11288c2ecf20Sopenharmony_ci {0x0000, 0x8800}, 11298c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11308c2ecf20Sopenharmony_ci 11318c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11328c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8802 } -> 0000: 10 */ 11338c2ecf20Sopenharmony_ci {0x0010, 0x8802}, 11348c2ecf20Sopenharmony_ci {0x0009, 0x8801}, 11358c2ecf20Sopenharmony_ci {0x0042, 0x8805}, 11368c2ecf20Sopenharmony_ci {0x0001, 0x8800}, 11378c2ecf20Sopenharmony_ci /* READ { 0x0001, 0x8803 } -> 0000: 00 */ 11388c2ecf20Sopenharmony_ci 11398c2ecf20Sopenharmony_ci {0x0050, 0x8703}, 11408c2ecf20Sopenharmony_ci {0x0002, 0x8704}, /* External input CKIx1 */ 11418c2ecf20Sopenharmony_ci {0x0001, 0x870c}, /* Select CKOx2 output */ 11428c2ecf20Sopenharmony_ci {0x009a, 0x8600}, /* Line memory Read Counter (L) */ 11438c2ecf20Sopenharmony_ci {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */ 11448c2ecf20Sopenharmony_ci {0x0023, 0x8601}, 11458c2ecf20Sopenharmony_ci {0x0010, 0x8602}, 11468c2ecf20Sopenharmony_ci {0x000a, 0x8603}, 11478c2ecf20Sopenharmony_ci {0x009a, 0x8600}, 11488c2ecf20Sopenharmony_ci {0x0001, 0x865b}, /* 1 Horizontal Offset for Valid Pixel(L) */ 11498c2ecf20Sopenharmony_ci {0x0003, 0x865c}, /* Vertical offset for valid lines (L) */ 11508c2ecf20Sopenharmony_ci {0x0058, 0x865d}, /* Horizontal valid pixels window (L) */ 11518c2ecf20Sopenharmony_ci {0x0048, 0x865e}, /* Vertical valid lines window (L) */ 11528c2ecf20Sopenharmony_ci {0x0000, 0x865f}, 11538c2ecf20Sopenharmony_ci 11548c2ecf20Sopenharmony_ci {0x0006, 0x8660}, 11558c2ecf20Sopenharmony_ci /* Enable nibble data input, select nibble input order */ 11568c2ecf20Sopenharmony_ci 11578c2ecf20Sopenharmony_ci {0x0013, 0x8608}, /* A11 Coeficients for color correction */ 11588c2ecf20Sopenharmony_ci {0x0028, 0x8609}, 11598c2ecf20Sopenharmony_ci /* Note: these values are confirmed at the end of array */ 11608c2ecf20Sopenharmony_ci {0x0005, 0x860a}, /* ... */ 11618c2ecf20Sopenharmony_ci {0x0025, 0x860b}, 11628c2ecf20Sopenharmony_ci {0x00e1, 0x860c}, 11638c2ecf20Sopenharmony_ci {0x00fa, 0x860d}, 11648c2ecf20Sopenharmony_ci {0x00f4, 0x860e}, 11658c2ecf20Sopenharmony_ci {0x00e8, 0x860f}, 11668c2ecf20Sopenharmony_ci {0x0025, 0x8610}, /* A33 Coef. */ 11678c2ecf20Sopenharmony_ci {0x00fc, 0x8611}, /* White balance offset: R */ 11688c2ecf20Sopenharmony_ci {0x0001, 0x8612}, /* White balance offset: Gr */ 11698c2ecf20Sopenharmony_ci {0x00fe, 0x8613}, /* White balance offset: B */ 11708c2ecf20Sopenharmony_ci {0x0000, 0x8614}, /* White balance offset: Gb */ 11718c2ecf20Sopenharmony_ci 11728c2ecf20Sopenharmony_ci {0x0064, 0x8651}, /* R gain for white balance (L) */ 11738c2ecf20Sopenharmony_ci {0x0040, 0x8652}, /* Gr gain for white balance (L) */ 11748c2ecf20Sopenharmony_ci {0x0066, 0x8653}, /* B gain for white balance (L) */ 11758c2ecf20Sopenharmony_ci {0x0040, 0x8654}, /* Gb gain for white balance (L) */ 11768c2ecf20Sopenharmony_ci {0x0001, 0x863f}, /* Enable fixed gamma correction */ 11778c2ecf20Sopenharmony_ci 11788c2ecf20Sopenharmony_ci {0x00a1, 0x8656}, /* Size - Window1: 256x256, Window2: 128x128, 11798c2ecf20Sopenharmony_ci * UV division: UV no change, 11808c2ecf20Sopenharmony_ci * Enable New edge enhancement */ 11818c2ecf20Sopenharmony_ci {0x0018, 0x8657}, /* Edge gain high threshold */ 11828c2ecf20Sopenharmony_ci {0x0020, 0x8658}, /* Edge gain low threshold */ 11838c2ecf20Sopenharmony_ci {0x000a, 0x8659}, /* Edge bandwidth high threshold */ 11848c2ecf20Sopenharmony_ci {0x0005, 0x865a}, /* Edge bandwidth low threshold */ 11858c2ecf20Sopenharmony_ci {0x0064, 0x8607}, /* UV filter enable */ 11868c2ecf20Sopenharmony_ci 11878c2ecf20Sopenharmony_ci {0x0016, 0x8660}, 11888c2ecf20Sopenharmony_ci {0x0000, 0x86b0}, /* Bad pixels compensation address */ 11898c2ecf20Sopenharmony_ci {0x00dc, 0x86b1}, /* X coord for bad pixels compensation (L) */ 11908c2ecf20Sopenharmony_ci {0x0000, 0x86b2}, 11918c2ecf20Sopenharmony_ci {0x0009, 0x86b3}, /* Y coord for bad pixels compensation (L) */ 11928c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 11938c2ecf20Sopenharmony_ci 11948c2ecf20Sopenharmony_ci {0x0001, 0x86b0}, 11958c2ecf20Sopenharmony_ci {0x00f5, 0x86b1}, 11968c2ecf20Sopenharmony_ci {0x0000, 0x86b2}, 11978c2ecf20Sopenharmony_ci {0x00c6, 0x86b3}, 11988c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 11998c2ecf20Sopenharmony_ci 12008c2ecf20Sopenharmony_ci {0x0002, 0x86b0}, 12018c2ecf20Sopenharmony_ci {0x001c, 0x86b1}, 12028c2ecf20Sopenharmony_ci {0x0001, 0x86b2}, 12038c2ecf20Sopenharmony_ci {0x00d7, 0x86b3}, 12048c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 12058c2ecf20Sopenharmony_ci 12068c2ecf20Sopenharmony_ci {0x0003, 0x86b0}, 12078c2ecf20Sopenharmony_ci {0x001c, 0x86b1}, 12088c2ecf20Sopenharmony_ci {0x0001, 0x86b2}, 12098c2ecf20Sopenharmony_ci {0x00d8, 0x86b3}, 12108c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 12118c2ecf20Sopenharmony_ci 12128c2ecf20Sopenharmony_ci {0x0004, 0x86b0}, 12138c2ecf20Sopenharmony_ci {0x001d, 0x86b1}, 12148c2ecf20Sopenharmony_ci {0x0001, 0x86b2}, 12158c2ecf20Sopenharmony_ci {0x00d8, 0x86b3}, 12168c2ecf20Sopenharmony_ci {0x0000, 0x86b4}, 12178c2ecf20Sopenharmony_ci {0x001e, 0x8660}, 12188c2ecf20Sopenharmony_ci 12198c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8608 } -> 0000: 13 */ 12208c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8609 } -> 0000: 28 */ 12218c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8610 } -> 0000: 05 */ 12228c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8611 } -> 0000: 25 */ 12238c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8612 } -> 0000: e1 */ 12248c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8613 } -> 0000: fa */ 12258c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8614 } -> 0000: f4 */ 12268c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8615 } -> 0000: e8 */ 12278c2ecf20Sopenharmony_ci /* READ { 0x0000, 0x8616 } -> 0000: 25 */ 12288c2ecf20Sopenharmony_ci {} 12298c2ecf20Sopenharmony_ci}; 12308c2ecf20Sopenharmony_ci 12318c2ecf20Sopenharmony_cistatic int reg_write(struct gspca_dev *gspca_dev, u16 index, u16 value) 12328c2ecf20Sopenharmony_ci{ 12338c2ecf20Sopenharmony_ci int ret; 12348c2ecf20Sopenharmony_ci struct usb_device *dev = gspca_dev->dev; 12358c2ecf20Sopenharmony_ci 12368c2ecf20Sopenharmony_ci ret = usb_control_msg(dev, 12378c2ecf20Sopenharmony_ci usb_sndctrlpipe(dev, 0), 12388c2ecf20Sopenharmony_ci 0, /* request */ 12398c2ecf20Sopenharmony_ci USB_TYPE_VENDOR | USB_RECIP_DEVICE, 12408c2ecf20Sopenharmony_ci value, index, NULL, 0, 500); 12418c2ecf20Sopenharmony_ci gspca_dbg(gspca_dev, D_USBO, "reg write i:0x%04x = 0x%02x\n", 12428c2ecf20Sopenharmony_ci index, value); 12438c2ecf20Sopenharmony_ci if (ret < 0) 12448c2ecf20Sopenharmony_ci pr_err("reg write: error %d\n", ret); 12458c2ecf20Sopenharmony_ci return ret; 12468c2ecf20Sopenharmony_ci} 12478c2ecf20Sopenharmony_ci 12488c2ecf20Sopenharmony_ci/* read 1 byte */ 12498c2ecf20Sopenharmony_ci/* returns: negative is error, pos or zero is data */ 12508c2ecf20Sopenharmony_cistatic int reg_read(struct gspca_dev *gspca_dev, 12518c2ecf20Sopenharmony_ci u16 index) /* wIndex */ 12528c2ecf20Sopenharmony_ci{ 12538c2ecf20Sopenharmony_ci int ret; 12548c2ecf20Sopenharmony_ci 12558c2ecf20Sopenharmony_ci ret = usb_control_msg(gspca_dev->dev, 12568c2ecf20Sopenharmony_ci usb_rcvctrlpipe(gspca_dev->dev, 0), 12578c2ecf20Sopenharmony_ci 0, /* register */ 12588c2ecf20Sopenharmony_ci USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 12598c2ecf20Sopenharmony_ci 0, /* value */ 12608c2ecf20Sopenharmony_ci index, 12618c2ecf20Sopenharmony_ci gspca_dev->usb_buf, 1, 12628c2ecf20Sopenharmony_ci 500); /* timeout */ 12638c2ecf20Sopenharmony_ci gspca_dbg(gspca_dev, D_USBI, "reg read i:%04x --> %02x\n", 12648c2ecf20Sopenharmony_ci index, gspca_dev->usb_buf[0]); 12658c2ecf20Sopenharmony_ci if (ret < 0) { 12668c2ecf20Sopenharmony_ci pr_err("reg_read err %d\n", ret); 12678c2ecf20Sopenharmony_ci return ret; 12688c2ecf20Sopenharmony_ci } 12698c2ecf20Sopenharmony_ci return gspca_dev->usb_buf[0]; 12708c2ecf20Sopenharmony_ci} 12718c2ecf20Sopenharmony_ci 12728c2ecf20Sopenharmony_ci/* send 1 or 2 bytes to the sensor via the Synchronous Serial Interface */ 12738c2ecf20Sopenharmony_cistatic int ssi_w(struct gspca_dev *gspca_dev, 12748c2ecf20Sopenharmony_ci u16 reg, u16 val) 12758c2ecf20Sopenharmony_ci{ 12768c2ecf20Sopenharmony_ci int ret, retry; 12778c2ecf20Sopenharmony_ci 12788c2ecf20Sopenharmony_ci ret = reg_write(gspca_dev, 0x8802, reg >> 8); 12798c2ecf20Sopenharmony_ci if (ret < 0) 12808c2ecf20Sopenharmony_ci goto out; 12818c2ecf20Sopenharmony_ci ret = reg_write(gspca_dev, 0x8801, reg & 0x00ff); 12828c2ecf20Sopenharmony_ci if (ret < 0) 12838c2ecf20Sopenharmony_ci goto out; 12848c2ecf20Sopenharmony_ci if ((reg & 0xff00) == 0x1000) { /* if 2 bytes */ 12858c2ecf20Sopenharmony_ci ret = reg_write(gspca_dev, 0x8805, val & 0x00ff); 12868c2ecf20Sopenharmony_ci if (ret < 0) 12878c2ecf20Sopenharmony_ci goto out; 12888c2ecf20Sopenharmony_ci val >>= 8; 12898c2ecf20Sopenharmony_ci } 12908c2ecf20Sopenharmony_ci ret = reg_write(gspca_dev, 0x8800, val); 12918c2ecf20Sopenharmony_ci if (ret < 0) 12928c2ecf20Sopenharmony_ci goto out; 12938c2ecf20Sopenharmony_ci 12948c2ecf20Sopenharmony_ci /* poll until not busy */ 12958c2ecf20Sopenharmony_ci retry = 10; 12968c2ecf20Sopenharmony_ci for (;;) { 12978c2ecf20Sopenharmony_ci ret = reg_read(gspca_dev, 0x8803); 12988c2ecf20Sopenharmony_ci if (ret < 0) 12998c2ecf20Sopenharmony_ci break; 13008c2ecf20Sopenharmony_ci if (gspca_dev->usb_buf[0] == 0) 13018c2ecf20Sopenharmony_ci break; 13028c2ecf20Sopenharmony_ci if (--retry <= 0) { 13038c2ecf20Sopenharmony_ci gspca_err(gspca_dev, "ssi_w busy %02x\n", 13048c2ecf20Sopenharmony_ci gspca_dev->usb_buf[0]); 13058c2ecf20Sopenharmony_ci ret = -1; 13068c2ecf20Sopenharmony_ci break; 13078c2ecf20Sopenharmony_ci } 13088c2ecf20Sopenharmony_ci msleep(8); 13098c2ecf20Sopenharmony_ci } 13108c2ecf20Sopenharmony_ci 13118c2ecf20Sopenharmony_ciout: 13128c2ecf20Sopenharmony_ci return ret; 13138c2ecf20Sopenharmony_ci} 13148c2ecf20Sopenharmony_ci 13158c2ecf20Sopenharmony_cistatic int write_vector(struct gspca_dev *gspca_dev, 13168c2ecf20Sopenharmony_ci const u16 (*data)[2]) 13178c2ecf20Sopenharmony_ci{ 13188c2ecf20Sopenharmony_ci int ret = 0; 13198c2ecf20Sopenharmony_ci 13208c2ecf20Sopenharmony_ci while ((*data)[1] != 0) { 13218c2ecf20Sopenharmony_ci if ((*data)[1] & 0x8000) { 13228c2ecf20Sopenharmony_ci if ((*data)[1] == 0xdd00) /* delay */ 13238c2ecf20Sopenharmony_ci msleep((*data)[0]); 13248c2ecf20Sopenharmony_ci else 13258c2ecf20Sopenharmony_ci ret = reg_write(gspca_dev, (*data)[1], 13268c2ecf20Sopenharmony_ci (*data)[0]); 13278c2ecf20Sopenharmony_ci } else { 13288c2ecf20Sopenharmony_ci ret = ssi_w(gspca_dev, (*data)[1], (*data)[0]); 13298c2ecf20Sopenharmony_ci } 13308c2ecf20Sopenharmony_ci if (ret < 0) 13318c2ecf20Sopenharmony_ci break; 13328c2ecf20Sopenharmony_ci data++; 13338c2ecf20Sopenharmony_ci } 13348c2ecf20Sopenharmony_ci return ret; 13358c2ecf20Sopenharmony_ci} 13368c2ecf20Sopenharmony_ci 13378c2ecf20Sopenharmony_ci/* this function is called at probe time */ 13388c2ecf20Sopenharmony_cistatic int sd_config(struct gspca_dev *gspca_dev, 13398c2ecf20Sopenharmony_ci const struct usb_device_id *id) 13408c2ecf20Sopenharmony_ci{ 13418c2ecf20Sopenharmony_ci struct sd *sd = (struct sd *) gspca_dev; 13428c2ecf20Sopenharmony_ci struct cam *cam; 13438c2ecf20Sopenharmony_ci const u16 (*init_data)[2]; 13448c2ecf20Sopenharmony_ci static const u16 (*(init_data_tb[]))[2] = { 13458c2ecf20Sopenharmony_ci spca508_vista_init_data, /* CreativeVista 0 */ 13468c2ecf20Sopenharmony_ci spca508_sightcam_init_data, /* HamaUSBSightcam 1 */ 13478c2ecf20Sopenharmony_ci spca508_sightcam2_init_data, /* HamaUSBSightcam2 2 */ 13488c2ecf20Sopenharmony_ci spca508cs110_init_data, /* IntelEasyPCCamera 3 */ 13498c2ecf20Sopenharmony_ci spca508cs110_init_data, /* MicroInnovationIC200 4 */ 13508c2ecf20Sopenharmony_ci spca508_init_data, /* ViewQuestVQ110 5 */ 13518c2ecf20Sopenharmony_ci }; 13528c2ecf20Sopenharmony_ci int data1, data2; 13538c2ecf20Sopenharmony_ci 13548c2ecf20Sopenharmony_ci /* Read from global register the USB product and vendor IDs, just to 13558c2ecf20Sopenharmony_ci * prove that we can communicate with the device. This works, which 13568c2ecf20Sopenharmony_ci * confirms at we are communicating properly and that the device 13578c2ecf20Sopenharmony_ci * is a 508. */ 13588c2ecf20Sopenharmony_ci data1 = reg_read(gspca_dev, 0x8104); 13598c2ecf20Sopenharmony_ci data2 = reg_read(gspca_dev, 0x8105); 13608c2ecf20Sopenharmony_ci gspca_dbg(gspca_dev, D_PROBE, "Webcam Vendor ID: 0x%02x%02x\n", 13618c2ecf20Sopenharmony_ci data2, data1); 13628c2ecf20Sopenharmony_ci 13638c2ecf20Sopenharmony_ci data1 = reg_read(gspca_dev, 0x8106); 13648c2ecf20Sopenharmony_ci data2 = reg_read(gspca_dev, 0x8107); 13658c2ecf20Sopenharmony_ci gspca_dbg(gspca_dev, D_PROBE, "Webcam Product ID: 0x%02x%02x\n", 13668c2ecf20Sopenharmony_ci data2, data1); 13678c2ecf20Sopenharmony_ci 13688c2ecf20Sopenharmony_ci data1 = reg_read(gspca_dev, 0x8621); 13698c2ecf20Sopenharmony_ci gspca_dbg(gspca_dev, D_PROBE, "Window 1 average luminance: %d\n", 13708c2ecf20Sopenharmony_ci data1); 13718c2ecf20Sopenharmony_ci 13728c2ecf20Sopenharmony_ci cam = &gspca_dev->cam; 13738c2ecf20Sopenharmony_ci cam->cam_mode = sif_mode; 13748c2ecf20Sopenharmony_ci cam->nmodes = ARRAY_SIZE(sif_mode); 13758c2ecf20Sopenharmony_ci 13768c2ecf20Sopenharmony_ci sd->subtype = id->driver_info; 13778c2ecf20Sopenharmony_ci 13788c2ecf20Sopenharmony_ci init_data = init_data_tb[sd->subtype]; 13798c2ecf20Sopenharmony_ci return write_vector(gspca_dev, init_data); 13808c2ecf20Sopenharmony_ci} 13818c2ecf20Sopenharmony_ci 13828c2ecf20Sopenharmony_ci/* this function is called at probe and resume time */ 13838c2ecf20Sopenharmony_cistatic int sd_init(struct gspca_dev *gspca_dev) 13848c2ecf20Sopenharmony_ci{ 13858c2ecf20Sopenharmony_ci return 0; 13868c2ecf20Sopenharmony_ci} 13878c2ecf20Sopenharmony_ci 13888c2ecf20Sopenharmony_cistatic int sd_start(struct gspca_dev *gspca_dev) 13898c2ecf20Sopenharmony_ci{ 13908c2ecf20Sopenharmony_ci int mode; 13918c2ecf20Sopenharmony_ci 13928c2ecf20Sopenharmony_ci mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv; 13938c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8500, mode); 13948c2ecf20Sopenharmony_ci switch (mode) { 13958c2ecf20Sopenharmony_ci case 0: 13968c2ecf20Sopenharmony_ci case 1: 13978c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8700, 0x28); /* clock */ 13988c2ecf20Sopenharmony_ci break; 13998c2ecf20Sopenharmony_ci default: 14008c2ecf20Sopenharmony_ci/* case 2: */ 14018c2ecf20Sopenharmony_ci/* case 3: */ 14028c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8700, 0x23); /* clock */ 14038c2ecf20Sopenharmony_ci break; 14048c2ecf20Sopenharmony_ci } 14058c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8112, 0x10 | 0x20); 14068c2ecf20Sopenharmony_ci return 0; 14078c2ecf20Sopenharmony_ci} 14088c2ecf20Sopenharmony_ci 14098c2ecf20Sopenharmony_cistatic void sd_stopN(struct gspca_dev *gspca_dev) 14108c2ecf20Sopenharmony_ci{ 14118c2ecf20Sopenharmony_ci /* Video ISO disable, Video Drop Packet enable: */ 14128c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8112, 0x20); 14138c2ecf20Sopenharmony_ci} 14148c2ecf20Sopenharmony_ci 14158c2ecf20Sopenharmony_cistatic void sd_pkt_scan(struct gspca_dev *gspca_dev, 14168c2ecf20Sopenharmony_ci u8 *data, /* isoc packet */ 14178c2ecf20Sopenharmony_ci int len) /* iso packet length */ 14188c2ecf20Sopenharmony_ci{ 14198c2ecf20Sopenharmony_ci switch (data[0]) { 14208c2ecf20Sopenharmony_ci case 0: /* start of frame */ 14218c2ecf20Sopenharmony_ci gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0); 14228c2ecf20Sopenharmony_ci data += SPCA508_OFFSET_DATA; 14238c2ecf20Sopenharmony_ci len -= SPCA508_OFFSET_DATA; 14248c2ecf20Sopenharmony_ci gspca_frame_add(gspca_dev, FIRST_PACKET, data, len); 14258c2ecf20Sopenharmony_ci break; 14268c2ecf20Sopenharmony_ci case 0xff: /* drop */ 14278c2ecf20Sopenharmony_ci break; 14288c2ecf20Sopenharmony_ci default: 14298c2ecf20Sopenharmony_ci data += 1; 14308c2ecf20Sopenharmony_ci len -= 1; 14318c2ecf20Sopenharmony_ci gspca_frame_add(gspca_dev, INTER_PACKET, data, len); 14328c2ecf20Sopenharmony_ci break; 14338c2ecf20Sopenharmony_ci } 14348c2ecf20Sopenharmony_ci} 14358c2ecf20Sopenharmony_ci 14368c2ecf20Sopenharmony_cistatic void setbrightness(struct gspca_dev *gspca_dev, s32 brightness) 14378c2ecf20Sopenharmony_ci{ 14388c2ecf20Sopenharmony_ci /* MX seem contrast */ 14398c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8651, brightness); 14408c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8652, brightness); 14418c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8653, brightness); 14428c2ecf20Sopenharmony_ci reg_write(gspca_dev, 0x8654, brightness); 14438c2ecf20Sopenharmony_ci} 14448c2ecf20Sopenharmony_ci 14458c2ecf20Sopenharmony_cistatic int sd_s_ctrl(struct v4l2_ctrl *ctrl) 14468c2ecf20Sopenharmony_ci{ 14478c2ecf20Sopenharmony_ci struct gspca_dev *gspca_dev = 14488c2ecf20Sopenharmony_ci container_of(ctrl->handler, struct gspca_dev, ctrl_handler); 14498c2ecf20Sopenharmony_ci 14508c2ecf20Sopenharmony_ci gspca_dev->usb_err = 0; 14518c2ecf20Sopenharmony_ci 14528c2ecf20Sopenharmony_ci if (!gspca_dev->streaming) 14538c2ecf20Sopenharmony_ci return 0; 14548c2ecf20Sopenharmony_ci 14558c2ecf20Sopenharmony_ci switch (ctrl->id) { 14568c2ecf20Sopenharmony_ci case V4L2_CID_BRIGHTNESS: 14578c2ecf20Sopenharmony_ci setbrightness(gspca_dev, ctrl->val); 14588c2ecf20Sopenharmony_ci break; 14598c2ecf20Sopenharmony_ci } 14608c2ecf20Sopenharmony_ci return gspca_dev->usb_err; 14618c2ecf20Sopenharmony_ci} 14628c2ecf20Sopenharmony_ci 14638c2ecf20Sopenharmony_cistatic const struct v4l2_ctrl_ops sd_ctrl_ops = { 14648c2ecf20Sopenharmony_ci .s_ctrl = sd_s_ctrl, 14658c2ecf20Sopenharmony_ci}; 14668c2ecf20Sopenharmony_ci 14678c2ecf20Sopenharmony_cistatic int sd_init_controls(struct gspca_dev *gspca_dev) 14688c2ecf20Sopenharmony_ci{ 14698c2ecf20Sopenharmony_ci struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; 14708c2ecf20Sopenharmony_ci 14718c2ecf20Sopenharmony_ci gspca_dev->vdev.ctrl_handler = hdl; 14728c2ecf20Sopenharmony_ci v4l2_ctrl_handler_init(hdl, 5); 14738c2ecf20Sopenharmony_ci v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 14748c2ecf20Sopenharmony_ci V4L2_CID_BRIGHTNESS, 0, 255, 1, 128); 14758c2ecf20Sopenharmony_ci 14768c2ecf20Sopenharmony_ci if (hdl->error) { 14778c2ecf20Sopenharmony_ci pr_err("Could not initialize controls\n"); 14788c2ecf20Sopenharmony_ci return hdl->error; 14798c2ecf20Sopenharmony_ci } 14808c2ecf20Sopenharmony_ci return 0; 14818c2ecf20Sopenharmony_ci} 14828c2ecf20Sopenharmony_ci 14838c2ecf20Sopenharmony_ci/* sub-driver description */ 14848c2ecf20Sopenharmony_cistatic const struct sd_desc sd_desc = { 14858c2ecf20Sopenharmony_ci .name = MODULE_NAME, 14868c2ecf20Sopenharmony_ci .config = sd_config, 14878c2ecf20Sopenharmony_ci .init = sd_init, 14888c2ecf20Sopenharmony_ci .init_controls = sd_init_controls, 14898c2ecf20Sopenharmony_ci .start = sd_start, 14908c2ecf20Sopenharmony_ci .stopN = sd_stopN, 14918c2ecf20Sopenharmony_ci .pkt_scan = sd_pkt_scan, 14928c2ecf20Sopenharmony_ci}; 14938c2ecf20Sopenharmony_ci 14948c2ecf20Sopenharmony_ci/* -- module initialisation -- */ 14958c2ecf20Sopenharmony_cistatic const struct usb_device_id device_table[] = { 14968c2ecf20Sopenharmony_ci {USB_DEVICE(0x0130, 0x0130), .driver_info = HamaUSBSightcam}, 14978c2ecf20Sopenharmony_ci {USB_DEVICE(0x041e, 0x4018), .driver_info = CreativeVista}, 14988c2ecf20Sopenharmony_ci {USB_DEVICE(0x0733, 0x0110), .driver_info = ViewQuestVQ110}, 14998c2ecf20Sopenharmony_ci {USB_DEVICE(0x0af9, 0x0010), .driver_info = HamaUSBSightcam}, 15008c2ecf20Sopenharmony_ci {USB_DEVICE(0x0af9, 0x0011), .driver_info = HamaUSBSightcam2}, 15018c2ecf20Sopenharmony_ci {USB_DEVICE(0x8086, 0x0110), .driver_info = IntelEasyPCCamera}, 15028c2ecf20Sopenharmony_ci {} 15038c2ecf20Sopenharmony_ci}; 15048c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(usb, device_table); 15058c2ecf20Sopenharmony_ci 15068c2ecf20Sopenharmony_ci/* -- device connect -- */ 15078c2ecf20Sopenharmony_cistatic int sd_probe(struct usb_interface *intf, 15088c2ecf20Sopenharmony_ci const struct usb_device_id *id) 15098c2ecf20Sopenharmony_ci{ 15108c2ecf20Sopenharmony_ci return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), 15118c2ecf20Sopenharmony_ci THIS_MODULE); 15128c2ecf20Sopenharmony_ci} 15138c2ecf20Sopenharmony_ci 15148c2ecf20Sopenharmony_cistatic struct usb_driver sd_driver = { 15158c2ecf20Sopenharmony_ci .name = MODULE_NAME, 15168c2ecf20Sopenharmony_ci .id_table = device_table, 15178c2ecf20Sopenharmony_ci .probe = sd_probe, 15188c2ecf20Sopenharmony_ci .disconnect = gspca_disconnect, 15198c2ecf20Sopenharmony_ci#ifdef CONFIG_PM 15208c2ecf20Sopenharmony_ci .suspend = gspca_suspend, 15218c2ecf20Sopenharmony_ci .resume = gspca_resume, 15228c2ecf20Sopenharmony_ci .reset_resume = gspca_resume, 15238c2ecf20Sopenharmony_ci#endif 15248c2ecf20Sopenharmony_ci}; 15258c2ecf20Sopenharmony_ci 15268c2ecf20Sopenharmony_cimodule_usb_driver(sd_driver); 1527