aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-12-08 04:41:04 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:59 -0500
commit7320d6bf300262b05116309ecf0c6655c818a5da (patch)
tree9f62fe60a8df09cdf5ce8b9275d742025cac2293 /drivers/media/video
parentf4f4ef7618c0839326aa6f462a7c95ed76fb26b6 (diff)
V4L/DVB (9869): gspca - zc3xx: Change the USB exchanges for the sensor pas202b.
This sensor was declared as hdcs2020. The new exchanges have been extracted from the ms-win file usbvm31b.inf. The light frequency control has been added. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/zc3xx.c723
1 files changed, 348 insertions, 375 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 4f95ab8f375..a62c8ac7b4a 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -51,16 +51,16 @@ struct sd {
51#define SENSOR_CS2102 0 51#define SENSOR_CS2102 0
52#define SENSOR_CS2102K 1 52#define SENSOR_CS2102K 1
53#define SENSOR_GC0305 2 53#define SENSOR_GC0305 2
54#define SENSOR_HDCS2020 3 54#define SENSOR_HDCS2020b 3
55#define SENSOR_HDCS2020b 4 55#define SENSOR_HV7131B 4
56#define SENSOR_HV7131B 5 56#define SENSOR_HV7131C 5
57#define SENSOR_HV7131C 6 57#define SENSOR_ICM105A 6
58#define SENSOR_ICM105A 7 58#define SENSOR_MC501CB 7
59#define SENSOR_MC501CB 8 59#define SENSOR_OV7620 8
60#define SENSOR_OV7620 9 60/*#define SENSOR_OV7648 8 - same values */
61/*#define SENSOR_OV7648 9 - same values */ 61#define SENSOR_OV7630C 9
62#define SENSOR_OV7630C 10 62#define SENSOR_PAS106 10
63#define SENSOR_PAS106 11 63#define SENSOR_PAS202B 11
64#define SENSOR_PB0330 12 64#define SENSOR_PB0330 12
65#define SENSOR_PO2030 13 65#define SENSOR_PO2030 13
66#define SENSOR_TAS5130CK 14 66#define SENSOR_TAS5130CK 14
@@ -1653,295 +1653,6 @@ static const struct usb_action gc0305_NoFliker[] = {
1653 {} 1653 {}
1654}; 1654};
1655 1655
1656/* play poker with registers at your own risk !! */
1657static const struct usb_action hdcs2020xx_Initial[] = {
1658 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1659 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1660 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},
1661 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
1662 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1663 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1664 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1665 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW},
1666 /* D0 ?? E0 did not start */
1667 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1668 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1669 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1670 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
1671 {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW},
1672 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
1673 {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW},
1674 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
1675 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1676 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
1677 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1678 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
1679 {0xaa, 0x02, 0x0002},
1680 {0xaa, 0x07, 0x0006},
1681 {0xaa, 0x08, 0x0002},
1682 {0xaa, 0x09, 0x0006},
1683 {0xaa, 0x0a, 0x0001},
1684 {0xaa, 0x0b, 0x0001},
1685 {0xaa, 0x0c, 0x0008},
1686 {0xaa, 0x0d, 0x0000},
1687 {0xaa, 0x10, 0x0000},
1688 {0xaa, 0x12, 0x0005},
1689 {0xaa, 0x13, 0x0063},
1690 {0xaa, 0x15, 0x0070},
1691 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
1692 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1693 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1694 {0xa0, 0x00, 0x01ad},
1695 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1696 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1697 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1698 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1699 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1700 {0xa1, 0x01, 0x0002},
1701 {0xa1, 0x01, 0x0008},
1702 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1703 {0xa0, 0x04, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
1704 {0xa1, 0x01, 0x01c8},
1705 {0xa1, 0x01, 0x01c9},
1706 {0xa1, 0x01, 0x01ca},
1707 {0xa0, 0x07, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1708 {0xa0, 0x11, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
1709 {0xa0, 0x37, ZC3XX_R121_GAMMA01},
1710 {0xa0, 0x58, ZC3XX_R122_GAMMA02},
1711 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1712 {0xa0, 0x91, ZC3XX_R124_GAMMA04},
1713 {0xa0, 0xa6, ZC3XX_R125_GAMMA05},
1714 {0xa0, 0xb8, ZC3XX_R126_GAMMA06},
1715 {0xa0, 0xc7, ZC3XX_R127_GAMMA07},
1716 {0xa0, 0xd3, ZC3XX_R128_GAMMA08},
1717 {0xa0, 0xde, ZC3XX_R129_GAMMA09},
1718 {0xa0, 0xe6, ZC3XX_R12A_GAMMA0A},
1719 {0xa0, 0xed, ZC3XX_R12B_GAMMA0B},
1720 {0xa0, 0xf3, ZC3XX_R12C_GAMMA0C},
1721 {0xa0, 0xf8, ZC3XX_R12D_GAMMA0D},
1722 {0xa0, 0xfb, ZC3XX_R12E_GAMMA0E},
1723 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1724 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1725 {0xa0, 0x23, ZC3XX_R131_GAMMA11},
1726 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1727 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1728 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1729 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1730 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1731 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1732 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1733 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1734 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1735 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1736 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1737 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1738 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1739 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1740
1741 {0xa0, 0x4c, ZC3XX_R10A_RGB00}, /* matrix */
1742 {0xa0, 0xf5, ZC3XX_R10B_RGB01},
1743 {0xa0, 0xff, ZC3XX_R10C_RGB02},
1744 {0xa0, 0xf9, ZC3XX_R10D_RGB10},
1745 {0xa0, 0x51, ZC3XX_R10E_RGB11},
1746 {0xa0, 0xf5, ZC3XX_R10F_RGB12},
1747 {0xa0, 0xfb, ZC3XX_R110_RGB20},
1748 {0xa0, 0xed, ZC3XX_R111_RGB21},
1749 {0xa0, 0x5f, ZC3XX_R112_RGB22},
1750
1751 {0xa1, 0x01, 0x0180},
1752 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1753 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1754 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1755 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1756 {0xaa, 0x20, 0x0004},
1757 {0xaa, 0x21, 0x003d},
1758 {0xaa, 0x03, 0x0041},
1759 {0xaa, 0x04, 0x0010},
1760 {0xaa, 0x05, 0x003d},
1761 {0xaa, 0x0e, 0x0001},
1762 {0xaa, 0x0f, 0x0000},
1763 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
1764 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
1765 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1766 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
1767 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
1768 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1769 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1770 {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW},
1771 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1772 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1773 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0},
1774 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},
1775 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},
1776 {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
1777 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},
1778 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},
1779 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
1780 {0xa1, 0x01, 0x0195},
1781 {0xa1, 0x01, 0x0196},
1782 {0xa1, 0x01, 0x0197},
1783 {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
1784 {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
1785 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1786 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1787 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1788 {0xa0, 0x85, ZC3XX_R118_BGAIN},
1789 {0xa1, 0x01, 0x0116},
1790 {0xa1, 0x01, 0x0118},
1791 {0xa1, 0x01, 0x0180},
1792 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1793 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1794 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1795 {0xa0, 0x85, ZC3XX_R118_BGAIN},
1796 {0xa1, 0x01, 0x0116},
1797 {0xa1, 0x01, 0x0118},
1798/* {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
1799 {0xa0, 0x00, 0x0007},
1800 {}
1801};
1802
1803static const struct usb_action hdcs2020xx_InitialScale[] = {
1804 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1805 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
1806 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT},
1807 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1808 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
1809 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
1810 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
1811 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
1812 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
1813 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
1814 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
1815 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
1816 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
1817 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
1818 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
1819 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
1820 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
1821 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
1822 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
1823 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
1824 {0xaa, 0x02, 0x0002},
1825 {0xaa, 0x07, 0x0006},
1826 {0xaa, 0x08, 0x0002},
1827 {0xaa, 0x09, 0x0006},
1828 {0xaa, 0x0a, 0x0001},
1829 {0xaa, 0x0b, 0x0001},
1830 {0xaa, 0x0c, 0x0008},
1831 {0xaa, 0x0d, 0x0000},
1832 {0xaa, 0x10, 0x0000},
1833 {0xaa, 0x12, 0x0005},
1834 {0xaa, 0x13, 0x0063},
1835 {0xaa, 0x15, 0x0070},
1836 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
1837 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
1838 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
1839 {0xa0, 0x00, 0x01ad},
1840 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
1841 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
1842 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
1843 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
1844 {0xa0, 0x70, ZC3XX_R18D_YTARGET},
1845 {0xa1, 0x01, 0x0002},
1846 {0xa1, 0x01, 0x0008},
1847 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
1848 {0xa0, 0x04, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
1849 {0xa1, 0x01, 0x01c8},
1850 {0xa1, 0x01, 0x01c9},
1851 {0xa1, 0x01, 0x01ca},
1852 {0xa0, 0x07, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
1853 {0xa0, 0x11, ZC3XX_R120_GAMMA00}, /* gamma ~4*/
1854 {0xa0, 0x37, ZC3XX_R121_GAMMA01},
1855 {0xa0, 0x58, ZC3XX_R122_GAMMA02},
1856 {0xa0, 0x79, ZC3XX_R123_GAMMA03},
1857 {0xa0, 0x91, ZC3XX_R124_GAMMA04},
1858 {0xa0, 0xa6, ZC3XX_R125_GAMMA05},
1859 {0xa0, 0xb8, ZC3XX_R126_GAMMA06},
1860 {0xa0, 0xc7, ZC3XX_R127_GAMMA07},
1861 {0xa0, 0xd3, ZC3XX_R128_GAMMA08},
1862 {0xa0, 0xde, ZC3XX_R129_GAMMA09},
1863 {0xa0, 0xe6, ZC3XX_R12A_GAMMA0A},
1864 {0xa0, 0xed, ZC3XX_R12B_GAMMA0B},
1865 {0xa0, 0xf3, ZC3XX_R12C_GAMMA0C},
1866 {0xa0, 0xf8, ZC3XX_R12D_GAMMA0D},
1867 {0xa0, 0xfb, ZC3XX_R12E_GAMMA0E},
1868 {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
1869 {0xa0, 0x26, ZC3XX_R130_GAMMA10},
1870 {0xa0, 0x23, ZC3XX_R131_GAMMA11},
1871 {0xa0, 0x20, ZC3XX_R132_GAMMA12},
1872 {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
1873 {0xa0, 0x16, ZC3XX_R134_GAMMA14},
1874 {0xa0, 0x13, ZC3XX_R135_GAMMA15},
1875 {0xa0, 0x10, ZC3XX_R136_GAMMA16},
1876 {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
1877 {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
1878 {0xa0, 0x09, ZC3XX_R139_GAMMA19},
1879 {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
1880 {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
1881 {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
1882 {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
1883 {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
1884 {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
1885 {0xa0, 0x60, ZC3XX_R10A_RGB00}, /* matrix */
1886 {0xa0, 0xff, ZC3XX_R10B_RGB01},
1887 {0xa0, 0xff, ZC3XX_R10C_RGB02},
1888 {0xa0, 0xff, ZC3XX_R10D_RGB10},
1889 {0xa0, 0x60, ZC3XX_R10E_RGB11},
1890 {0xa0, 0xff, ZC3XX_R10F_RGB12},
1891 {0xa0, 0xff, ZC3XX_R110_RGB20},
1892 {0xa0, 0xff, ZC3XX_R111_RGB21},
1893 {0xa0, 0x60, ZC3XX_R112_RGB22},
1894
1895 {0xa1, 0x01, 0x0180},
1896 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
1897 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
1898 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
1899 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
1900 {0xaa, 0x20, 0x0002},
1901 {0xaa, 0x21, 0x001b},
1902 {0xaa, 0x03, 0x0044},
1903 {0xaa, 0x04, 0x0008},
1904 {0xaa, 0x05, 0x001b},
1905 {0xaa, 0x0e, 0x0001},
1906 {0xaa, 0x0f, 0x0000},
1907 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
1908 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
1909 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1910 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1911 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
1912 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
1913 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
1914 {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW},
1915 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
1916 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
1917 {0xa0, 0x44, ZC3XX_R01D_HSYNC_0},
1918 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1},
1919 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2},
1920 {0xa0, 0xeb, ZC3XX_R020_HSYNC_3},
1921 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID},
1922 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW},
1923 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
1924 {0xa1, 0x01, 0x0195},
1925 {0xa1, 0x01, 0x0196},
1926 {0xa1, 0x01, 0x0197},
1927 {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
1928 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
1929 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
1930 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1931 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1932 {0xa0, 0x99, ZC3XX_R118_BGAIN},
1933 {0xa1, 0x01, 0x0116},
1934 {0xa1, 0x01, 0x0118},
1935 {0xa1, 0x01, 0x0180},
1936 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
1937 {0xa0, 0x1d, ZC3XX_R116_RGAIN},
1938 {0xa0, 0x40, ZC3XX_R117_GGAIN},
1939 {0xa0, 0x99, ZC3XX_R118_BGAIN},
1940/* {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, */
1941 {0xa0, 0x00, 0x0007},
1942/* {0xa0, 0x18, 0x00fe}, */
1943 {}
1944};
1945static const struct usb_action hdcs2020xb_Initial[] = { 1656static const struct usb_action hdcs2020xb_Initial[] = {
1946 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, 1657 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1947 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT}, 1658 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
@@ -4419,6 +4130,270 @@ static const struct usb_action pas106b_NoFliker[] = {
4419 {} 4130 {}
4420}; 4131};
4421 4132
4133/* from usbvm31b.inf */
4134static const struct usb_action pas202b_Initial[] = { /* 640x480 */
4135 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4136 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
4137 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
4138 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
4139 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4140 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4141 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4142 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
4143 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4144 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4145 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4146 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
4147 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
4148 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,03,cc */
4149 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
4150 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,03,cc */
4151 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
4152 {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
4153 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
4154 {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
4155 {0xaa, 0x02, 0x0002}, /* 00,02,04,aa --> 02 */
4156 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
4157 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
4158 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
4159 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
4160 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
4161 {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
4162 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
4163 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
4164 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
4165 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
4166 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
4167 {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
4168 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4169 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4170 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4171 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4172 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4173 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4174 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4175 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
4176 {}
4177};
4178static const struct usb_action pas202b_InitialScale[] = { /* 320x240 */
4179 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
4180 {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
4181 {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
4182 {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
4183 {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
4184 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
4185 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
4186 {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
4187 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
4188 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
4189 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
4190 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
4191 {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,08,cc */
4192 {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,02,cc */
4193 {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,08,cc */
4194 {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,02,cc */
4195 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
4196 {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
4197 {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
4198 {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
4199 {0xaa, 0x02, 0x0002}, /* 00,02,02,aa */
4200 {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
4201 {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
4202 {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
4203 {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
4204 {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
4205 {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
4206 {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
4207 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
4208 {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
4209 {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
4210 {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
4211 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
4212 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
4213 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
4214 {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
4215 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
4216 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
4217 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
4218 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
4219 {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
4220 {}
4221};
4222static const struct usb_action pas202b_50HZ[] = {
4223 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4224 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4225 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4226 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4227 {0xaa, 0x21, 0x0068}, /* 00,21,68,aa */
4228 {0xaa, 0x03, 0x0044}, /* 00,03,44,aa */
4229 {0xaa, 0x04, 0x0009}, /* 00,04,09,aa */
4230 {0xaa, 0x05, 0x0028}, /* 00,05,28,aa */
4231 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4232 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4233 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,14,cc */
4234 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4235 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4236 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4237 {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,d2,cc */
4238 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4239 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4240 {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4d,cc */
4241 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4242 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4243 {0xa0, 0x44, ZC3XX_R01D_HSYNC_0}, /* 00,1d,44,cc */
4244 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4245 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4246 {0xa0, 0xeb, ZC3XX_R020_HSYNC_3}, /* 00,20,eb,cc */
4247 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4248 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4249 {}
4250};
4251static const struct usb_action pas202b_50HZScale[] = {
4252 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4253 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4254 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4255 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4256 {0xaa, 0x21, 0x006c}, /* 00,21,6c,aa */
4257 {0xaa, 0x03, 0x0041}, /* 00,03,41,aa */
4258 {0xaa, 0x04, 0x0009}, /* 00,04,09,aa */
4259 {0xaa, 0x05, 0x002c}, /* 00,05,2c,aa */
4260 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4261 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4262 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,14,cc */
4263 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4264 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4265 {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0f,cc */
4266 {0xa0, 0xbe, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,be,cc */
4267 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4268 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4269 {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,9b,cc */
4270 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4271 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4272 {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
4273 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4274 {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
4275 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4276 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4277 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4278 {}
4279};
4280static const struct usb_action pas202b_60HZ[] = {
4281 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4282 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4283 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4284 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4285 {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
4286 {0xaa, 0x03, 0x0045}, /* 00,03,45,aa */
4287 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4288 {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
4289 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4290 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4291 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,14,cc */
4292 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4293 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4294 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4295 {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,c0,cc */
4296 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4297 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4298 {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,40,cc */
4299 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4300 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4301 {0xa0, 0x45, ZC3XX_R01D_HSYNC_0}, /* 00,1d,45,cc */
4302 {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1}, /* 00,1e,8e,cc */
4303 {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c1,cc */
4304 {0xa0, 0xf5, ZC3XX_R020_HSYNC_3}, /* 00,20,f5,cc */
4305 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4306 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4307 {}
4308};
4309static const struct usb_action pas202b_60HZScale[] = {
4310 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4311 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4312 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4313 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4314 {0xaa, 0x21, 0x0004}, /* 00,21,04,aa */
4315 {0xaa, 0x03, 0x0042}, /* 00,03,42,aa */
4316 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4317 {0xaa, 0x05, 0x0004}, /* 00,05,04,aa */
4318 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4319 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4320 {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,14,cc */
4321 {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
4322 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4323 {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0f,cc */
4324 {0xa0, 0x9f, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,9f,cc */
4325 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4326 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4327 {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
4328 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4329 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4330 {0xa0, 0x42, ZC3XX_R01D_HSYNC_0}, /* 00,1d,42,cc */
4331 {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
4332 {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2}, /* 00,1f,af,cc */
4333 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4334 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4335 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4336 {}
4337};
4338static const struct usb_action pas202b_NoFliker[] = {
4339 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4340 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4341 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4342 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4343 {0xaa, 0x21, 0x0020}, /* 00,21,20,aa */
4344 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
4345 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4346 {0xaa, 0x05, 0x0020}, /* 00,05,20,aa */
4347 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4348 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4349 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4350 {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,07,cc */
4351 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
4352 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4353 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4354 {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,02,cc */
4355 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4356 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4357 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4358 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
4359 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4360 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4361 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4362 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4363 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4364 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4365 {}
4366};
4367static const struct usb_action pas202b_NoFlikerScale[] = {
4368 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
4369 {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
4370 {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
4371 {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
4372 {0xaa, 0x21, 0x0010}, /* 00,21,10,aa */
4373 {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
4374 {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
4375 {0xaa, 0x05, 0x0010}, /* 00,05,10,aa */
4376 {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
4377 {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
4378 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
4379 {0xa0, 0x0f, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0f,cc */
4380 {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,f0,cc */
4381 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
4382 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
4383 {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,02,cc */
4384 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
4385 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
4386 {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
4387 {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
4388 {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
4389 {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
4390 {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
4391 {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
4392 {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
4393 {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
4394 {}
4395};
4396
4422static const struct usb_action pb03303x_Initial[] = { 4397static const struct usb_action pb03303x_Initial[] = {
4423 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, 4398 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
4424 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, 4399 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
@@ -6333,7 +6308,7 @@ static __u8 i2c_write(struct gspca_dev *gspca_dev,
6333 reg_w_i(gspca_dev->dev, valL, 0x93); 6308 reg_w_i(gspca_dev->dev, valL, 0x93);
6334 reg_w_i(gspca_dev->dev, valH, 0x94); 6309 reg_w_i(gspca_dev->dev, valH, 0x94);
6335 reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */ 6310 reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */
6336 msleep(5); 6311 msleep(15);
6337 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ 6312 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
6338 PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)", 6313 PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
6339 reg, valH, valL, retbyte); 6314 reg, valH, valL, retbyte);
@@ -6376,31 +6351,35 @@ static void setmatrix(struct gspca_dev *gspca_dev)
6376 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; 6351 {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
6377 static const __u8 ov7620_matrix[9] = 6352 static const __u8 ov7620_matrix[9] =
6378 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58}; 6353 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6354 static const __u8 pas202b_matrix[9] =
6355 {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
6379 static const __u8 po2030_matrix[9] = 6356 static const __u8 po2030_matrix[9] =
6380 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60}; 6357 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6381 static const __u8 vf0250_matrix[9] = 6358 static const __u8 vf0250_matrix[9] =
6382 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; 6359 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
6360 static const __u8 *matrix_tb[SENSOR_MAX] = {
6361 NULL, /* SENSOR_CS2102 0 */
6362 NULL, /* SENSOR_CS2102K 1 */
6363 gc0305_matrix, /* SENSOR_GC0305 2 */
6364 NULL, /* SENSOR_HDCS2020b 3 */
6365 NULL, /* SENSOR_HV7131B 4 */
6366 NULL, /* SENSOR_HV7131C 5 */
6367 NULL, /* SENSOR_ICM105A 6 */
6368 NULL, /* SENSOR_MC501CB 7 */
6369 ov7620_matrix, /* SENSOR_OV7620 8 */
6370 NULL, /* SENSOR_OV7630C 9 */
6371 NULL, /* SENSOR_PAS106 10 */
6372 pas202b_matrix, /* SENSOR_PAS202B 11 */
6373 NULL, /* SENSOR_PB0330 12 */
6374 po2030_matrix, /* SENSOR_PO2030 13 */
6375 NULL, /* SENSOR_TAS5130CK 14 */
6376 NULL, /* SENSOR_TAS5130CXX 15 */
6377 vf0250_matrix, /* SENSOR_TAS5130C_VF0250 16 */
6378 };
6383 6379
6384 switch (sd->sensor) { 6380 matrix = matrix_tb[sd->sensor];
6385 case SENSOR_GC0305: 6381 if (matrix == NULL)
6386 case SENSOR_HV7131B: 6382 return; /* matrix already loaded */
6387 matrix = gc0305_matrix;
6388 break;
6389 case SENSOR_MC501CB:
6390 return; /* no matrix? */
6391 case SENSOR_OV7620:
6392/* case SENSOR_OV7648: */
6393 matrix = ov7620_matrix;
6394 break;
6395 case SENSOR_PO2030:
6396 matrix = po2030_matrix;
6397 break;
6398 case SENSOR_TAS5130C_VF0250:
6399 matrix = vf0250_matrix;
6400 break;
6401 default: /* matrix already loaded */
6402 return;
6403 }
6404 for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++) 6383 for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
6405 reg_w(gspca_dev->dev, matrix[i], 0x010a + i); 6384 reg_w(gspca_dev->dev, matrix[i], 0x010a + i);
6406} 6385}
@@ -6616,42 +6595,42 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
6616 {gc0305_NoFliker, gc0305_NoFliker, 6595 {gc0305_NoFliker, gc0305_NoFliker,
6617 gc0305_50HZ, gc0305_50HZ, 6596 gc0305_50HZ, gc0305_50HZ,
6618 gc0305_60HZ, gc0305_60HZ}, 6597 gc0305_60HZ, gc0305_60HZ},
6619/* SENSOR_HDCS2020 3 */ 6598/* SENSOR_HDCS2020b 3 */
6620 {NULL, NULL,
6621 NULL, NULL,
6622 NULL, NULL},
6623/* SENSOR_HDCS2020b 4 */
6624 {hdcs2020b_NoFliker, hdcs2020b_NoFliker, 6599 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6625 hdcs2020b_50HZ, hdcs2020b_50HZ, 6600 hdcs2020b_50HZ, hdcs2020b_50HZ,
6626 hdcs2020b_60HZ, hdcs2020b_60HZ}, 6601 hdcs2020b_60HZ, hdcs2020b_60HZ},
6627/* SENSOR_HV7131B 5 */ 6602/* SENSOR_HV7131B 4 */
6628 {hv7131b_NoFlikerScale, hv7131b_NoFliker, 6603 {hv7131b_NoFlikerScale, hv7131b_NoFliker,
6629 hv7131b_50HZScale, hv7131b_50HZ, 6604 hv7131b_50HZScale, hv7131b_50HZ,
6630 hv7131b_60HZScale, hv7131b_60HZ}, 6605 hv7131b_60HZScale, hv7131b_60HZ},
6631/* SENSOR_HV7131C 6 */ 6606/* SENSOR_HV7131C 5 */
6632 {NULL, NULL, 6607 {NULL, NULL,
6633 NULL, NULL, 6608 NULL, NULL,
6634 NULL, NULL}, 6609 NULL, NULL},
6635/* SENSOR_ICM105A 7 */ 6610/* SENSOR_ICM105A 6 */
6636 {icm105a_NoFliker, icm105a_NoFlikerScale, 6611 {icm105a_NoFliker, icm105a_NoFlikerScale,
6637 icm105a_50HZ, icm105a_50HZScale, 6612 icm105a_50HZ, icm105a_50HZScale,
6638 icm105a_60HZ, icm105a_60HZScale}, 6613 icm105a_60HZ, icm105a_60HZScale},
6639/* SENSOR_MC501CB 8 */ 6614/* SENSOR_MC501CB 7 */
6640 {MC501CB_NoFliker, MC501CB_NoFlikerScale, 6615 {MC501CB_NoFliker, MC501CB_NoFlikerScale,
6641 MC501CB_50HZ, MC501CB_50HZScale, 6616 MC501CB_50HZ, MC501CB_50HZScale,
6642 MC501CB_60HZ, MC501CB_60HZScale}, 6617 MC501CB_60HZ, MC501CB_60HZScale},
6643/* SENSOR_OV7620 9 */ 6618/* SENSOR_OV7620 8 */
6644 {OV7620_NoFliker, OV7620_NoFliker, 6619 {OV7620_NoFliker, OV7620_NoFliker,
6645 OV7620_50HZ, OV7620_50HZ, 6620 OV7620_50HZ, OV7620_50HZ,
6646 OV7620_60HZ, OV7620_60HZ}, 6621 OV7620_60HZ, OV7620_60HZ},
6647/* SENSOR_OV7630C 10 */ 6622/* SENSOR_OV7630C 9 */
6648 {NULL, NULL, 6623 {NULL, NULL,
6649 NULL, NULL, 6624 NULL, NULL,
6650 NULL, NULL}, 6625 NULL, NULL},
6651/* SENSOR_PAS106 11 */ 6626/* SENSOR_PAS106 10 */
6652 {pas106b_NoFliker, pas106b_NoFliker, 6627 {pas106b_NoFliker, pas106b_NoFliker,
6653 pas106b_50HZ, pas106b_50HZ, 6628 pas106b_50HZ, pas106b_50HZ,
6654 pas106b_60HZ, pas106b_60HZ}, 6629 pas106b_60HZ, pas106b_60HZ},
6630/* SENSOR_PAS202B 11 */
6631 {pas202b_NoFlikerScale, pas202b_NoFliker,
6632 pas202b_50HZScale, pas202b_50HZ,
6633 pas202b_60HZScale, pas202b_60HZ},
6655/* SENSOR_PB0330 12 */ 6634/* SENSOR_PB0330 12 */
6656 {pb0330_NoFliker, pb0330_NoFlikerScale, 6635 {pb0330_NoFliker, pb0330_NoFlikerScale,
6657 pb0330_50HZ, pb0330_50HZScale, 6636 pb0330_50HZ, pb0330_50HZScale,
@@ -7033,15 +7012,15 @@ static int sd_config(struct gspca_dev *gspca_dev,
7033 5, /* SENSOR_CS2102 0 */ 7012 5, /* SENSOR_CS2102 0 */
7034 5, /* SENSOR_CS2102K 1 */ 7013 5, /* SENSOR_CS2102K 1 */
7035 4, /* SENSOR_GC0305 2 */ 7014 4, /* SENSOR_GC0305 2 */
7036 4, /* SENSOR_HDCS2020 3 */ 7015 4, /* SENSOR_HDCS2020b 3 */
7037 4, /* SENSOR_HDCS2020b 4 */ 7016 4, /* SENSOR_HV7131B 4 */
7038 4, /* SENSOR_HV7131B 5 */ 7017 4, /* SENSOR_HV7131C 5 */
7039 4, /* SENSOR_HV7131C 6 */ 7018 4, /* SENSOR_ICM105A 6 */
7040 4, /* SENSOR_ICM105A 7 */ 7019 4, /* SENSOR_MC501CB 7 */
7041 4, /* SENSOR_MC501CB 8 */ 7020 3, /* SENSOR_OV7620 8 */
7042 3, /* SENSOR_OV7620 9 */ 7021 4, /* SENSOR_OV7630C 9 */
7043 4, /* SENSOR_OV7630C 10 */ 7022 4, /* SENSOR_PAS106 10 */
7044 4, /* SENSOR_PAS106 11 */ 7023 4, /* SENSOR_PAS202B 11 */
7045 4, /* SENSOR_PB0330 12 */ 7024 4, /* SENSOR_PB0330 12 */
7046 4, /* SENSOR_PO2030 13 */ 7025 4, /* SENSOR_PO2030 13 */
7047 4, /* SENSOR_TAS5130CK 14 */ 7026 4, /* SENSOR_TAS5130CK 14 */
@@ -7097,8 +7076,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
7097 sd->sensor = SENSOR_ICM105A; 7076 sd->sensor = SENSOR_ICM105A;
7098 break; 7077 break;
7099 case 0x0e: 7078 case 0x0e:
7100 PDEBUG(D_PROBE, "Find Sensor HDCS2020"); 7079 PDEBUG(D_PROBE, "Find Sensor PAS202B");
7101 sd->sensor = SENSOR_HDCS2020; 7080 sd->sensor = SENSOR_PAS202B;
7102 sd->sharpness = 1; 7081 sd->sharpness = 1;
7103 break; 7082 break;
7104 case 0x0f: 7083 case 0x0f:
@@ -7191,7 +7170,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
7191 case SENSOR_PO2030: 7170 case SENSOR_PO2030:
7192 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX); 7171 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX);
7193 break; 7172 break;
7194 case SENSOR_HDCS2020:
7195 case SENSOR_HV7131B: 7173 case SENSOR_HV7131B:
7196 case SENSOR_HV7131C: 7174 case SENSOR_HV7131C:
7197 case SENSOR_OV7630C: 7175 case SENSOR_OV7630C:
@@ -7221,15 +7199,15 @@ static int sd_start(struct gspca_dev *gspca_dev)
7221 {cs2102_InitialScale, cs2102_Initial}, /* 0 */ 7199 {cs2102_InitialScale, cs2102_Initial}, /* 0 */
7222 {cs2102K_InitialScale, cs2102K_Initial}, /* 1 */ 7200 {cs2102K_InitialScale, cs2102K_Initial}, /* 1 */
7223 {gc0305_Initial, gc0305_InitialScale}, /* 2 */ 7201 {gc0305_Initial, gc0305_InitialScale}, /* 2 */
7224 {hdcs2020xx_InitialScale, hdcs2020xx_Initial}, /* 3 */ 7202 {hdcs2020xb_InitialScale, hdcs2020xb_Initial}, /* 3 */
7225 {hdcs2020xb_InitialScale, hdcs2020xb_Initial}, /* 4 */ 7203 {hv7131bxx_InitialScale, hv7131bxx_Initial}, /* 4 */
7226 {hv7131bxx_InitialScale, hv7131bxx_Initial}, /* 5 */ 7204 {hv7131cxx_InitialScale, hv7131cxx_Initial}, /* 5 */
7227 {hv7131cxx_InitialScale, hv7131cxx_Initial}, /* 6 */ 7205 {icm105axx_InitialScale, icm105axx_Initial}, /* 6 */
7228 {icm105axx_InitialScale, icm105axx_Initial}, /* 7 */ 7206 {MC501CB_InitialScale, MC501CB_Initial}, /* 7 */
7229 {MC501CB_InitialScale, MC501CB_Initial}, /* 9 */ 7207 {OV7620_mode0, OV7620_mode1}, /* 8 */
7230 {OV7620_mode0, OV7620_mode1}, /* 9 */ 7208 {ov7630c_InitialScale, ov7630c_Initial}, /* 9 */
7231 {ov7630c_InitialScale, ov7630c_Initial}, /* 10 */ 7209 {pas106b_InitialScale, pas106b_Initial}, /* 10 */
7232 {pas106b_InitialScale, pas106b_Initial}, /* 11 */ 7210 {pas202b_Initial, pas202b_InitialScale}, /* 11 */
7233 {pb0330xx_InitialScale, pb0330xx_Initial}, /* 12 */ 7211 {pb0330xx_InitialScale, pb0330xx_Initial}, /* 12 */
7234/* or {pb03303x_InitialScale, pb03303x_Initial}, */ 7212/* or {pb03303x_InitialScale, pb03303x_Initial}, */
7235 {PO2030_mode0, PO2030_mode1}, /* 13 */ 7213 {PO2030_mode0, PO2030_mode1}, /* 13 */
@@ -7286,6 +7264,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
7286 reg_r(gspca_dev, 0x0008); 7264 reg_r(gspca_dev, 0x0008);
7287 reg_w(dev, 0x00, 0x0008); 7265 reg_w(dev, 0x00, 0x0008);
7288 break; 7266 break;
7267 case SENSOR_PAS202B:
7289 case SENSOR_GC0305: 7268 case SENSOR_GC0305:
7290 reg_r(gspca_dev, 0x0008); 7269 reg_r(gspca_dev, 0x0008);
7291 /* fall thru */ 7270 /* fall thru */
@@ -7299,7 +7278,6 @@ static int sd_start(struct gspca_dev *gspca_dev)
7299 switch (sd->sensor) { 7278 switch (sd->sensor) {
7300 case SENSOR_CS2102: /* gamma set in xxx_Initial */ 7279 case SENSOR_CS2102: /* gamma set in xxx_Initial */
7301 case SENSOR_CS2102K: 7280 case SENSOR_CS2102K:
7302 case SENSOR_HDCS2020:
7303 case SENSOR_HDCS2020b: 7281 case SENSOR_HDCS2020b:
7304 case SENSOR_PB0330: /* pb with chip_revision - see above */ 7282 case SENSOR_PB0330: /* pb with chip_revision - see above */
7305 case SENSOR_OV7630C: 7283 case SENSOR_OV7630C:
@@ -7312,6 +7290,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
7312 setmatrix(gspca_dev); /* one more time? */ 7290 setmatrix(gspca_dev); /* one more time? */
7313 switch (sd->sensor) { 7291 switch (sd->sensor) {
7314 case SENSOR_OV7620: 7292 case SENSOR_OV7620:
7293 case SENSOR_PAS202B:
7315 reg_r(gspca_dev, 0x0180); /* from win */ 7294 reg_r(gspca_dev, 0x0180); /* from win */
7316 reg_w(dev, 0x00, 0x0180); 7295 reg_w(dev, 0x00, 0x0180);
7317 break; 7296 break;
@@ -7323,37 +7302,29 @@ static int sd_start(struct gspca_dev *gspca_dev)
7323 7302
7324 switch (sd->sensor) { 7303 switch (sd->sensor) {
7325 case SENSOR_GC0305: 7304 case SENSOR_GC0305:
7326 case SENSOR_OV7620:
7327 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ 7305 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
7328 reg_w(dev, 0x15, 0x01ae); 7306 reg_w(dev, 0x15, 0x01ae);
7329 sd->autogain = 0; 7307 /* fall thru */
7330 break; 7308 case SENSOR_PAS202B:
7331 case SENSOR_PO2030: 7309 case SENSOR_PO2030:
7332 reg_w(dev, 0x40, 0x0117); /* (from win traces) */ 7310/* reg_w(dev, 0x40, ZC3XX_R117_GGAIN); * (from win traces) */
7333 reg_r(gspca_dev, 0x0180);
7334 break;
7335 }
7336
7337 setautogain(gspca_dev);
7338 switch (sd->sensor) {
7339 case SENSOR_GC0305:
7340/* setlightfreq(gspca_dev); ?? (end: 80 -> [18d]) */
7341 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
7342 reg_w(dev, 0x15, 0x01ae);
7343 reg_w(dev, 0x40, 0x0180);
7344 reg_w(dev, 0x40, 0x0117);
7345 reg_r(gspca_dev, 0x0180); 7311 reg_r(gspca_dev, 0x0180);
7346 sd->autogain = 1;
7347 setautogain(gspca_dev);
7348 break; 7312 break;
7349 case SENSOR_OV7620: 7313 case SENSOR_OV7620:
7314 reg_w(dev, 0x09, 0x01ad);
7315 reg_w(dev, 0x15, 0x01ae);
7350 i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */ 7316 i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */
7351 i2c_write(gspca_dev, 0x13, 0xa3, 0x00); 7317 i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
7352 /*fixme: returned value to send? */ 7318 /*fixme: returned value to send? */
7353 reg_w(dev, 0x40, 0x0117); /* (from win traces) */ 7319 reg_w(dev, 0x40, 0x0117);
7354 reg_r(gspca_dev, 0x0180); 7320 reg_r(gspca_dev, 0x0180);
7355 setautogain(gspca_dev); 7321 break;
7356 msleep(500); 7322 }
7323
7324 setautogain(gspca_dev);
7325 switch (sd->sensor) {
7326 case SENSOR_PAS202B:
7327 reg_w(dev, 0x00, 0x0007); /* (from win traces) */
7357 break; 7328 break;
7358 case SENSOR_PO2030: 7329 case SENSOR_PO2030:
7359 msleep(500); 7330 msleep(500);
@@ -7363,6 +7334,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
7363 reg_w(dev, 0x02, 0x0008); 7334 reg_w(dev, 0x02, 0x0008);
7364 break; 7335 break;
7365 } 7336 }
7337 if (sd->sensor == SENSOR_PAS202B)
7338 reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING);
7366 return 0; 7339 return 0;
7367} 7340}
7368 7341