diff options
author | Jean-François Moine <moinejf@free.fr> | 2011-03-22 04:58:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 15:38:22 -0400 |
commit | ee32ffbf8e446e9b8c247ae9c9ba032979c3eafc (patch) | |
tree | 7da1d0d116e22308a17547714ed95ade1e4d6bb3 /drivers/media | |
parent | f12b44ff2d5ba8eb41210438589a64490ddfedec (diff) |
[media] gspca - nw80x: Check the bridge from the webcam type
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/nw80x.c | 146 |
1 files changed, 78 insertions, 68 deletions
diff --git a/drivers/media/video/gspca/nw80x.c b/drivers/media/video/gspca/nw80x.c index d2d356e87539..f2adf6f0426f 100644 --- a/drivers/media/video/gspca/nw80x.c +++ b/drivers/media/video/gspca/nw80x.c | |||
@@ -79,75 +79,80 @@ enum webcams { | |||
79 | NWEBCAMS /* number of webcams */ | 79 | NWEBCAMS /* number of webcams */ |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static const u8 webcam_chip[NWEBCAMS] = { | ||
83 | [Generic800] = BRIDGE_NW800, /* 06a5:0000 | ||
84 | * Typhoon Webcam 100 USB */ | ||
85 | |||
86 | [SpaceCam] = BRIDGE_NW800, /* 06a5:d800 | ||
87 | * Trust SpaceCam120 or SpaceCam100 PORTABLE */ | ||
88 | |||
89 | [SpaceCam2] = BRIDGE_NW800, /* 06a5:d800 - pas106 | ||
90 | * other Trust SpaceCam120 or SpaceCam100 PORTABLE */ | ||
91 | |||
92 | [Cvideopro] = BRIDGE_NW802, /* 06a5:d001 | ||
93 | * Conceptronic Video Pro 'CVIDEOPRO USB Webcam CCD' */ | ||
94 | |||
95 | [Dlink350c] = BRIDGE_NW802, /* 06a5:d001 | ||
96 | * D-Link NetQam Pro 250plus */ | ||
97 | |||
98 | [DS3303u] = BRIDGE_NW801, /* 06a5:d001 | ||
99 | * Plustek Opticam 500U or ProLink DS3303u */ | ||
100 | |||
101 | [Kr651us] = BRIDGE_NW802, /* 06a5:d001 | ||
102 | * Panasonic GP-KR651US */ | ||
103 | |||
104 | [Kritter] = BRIDGE_NW802, /* 06a5:d001 | ||
105 | * iRez Kritter cam */ | ||
106 | |||
107 | [Mustek300] = BRIDGE_NW802, /* 055f:d001 | ||
108 | * Mustek Wcam 300 mini */ | ||
109 | |||
110 | [Proscope] = BRIDGE_NW802, /* 06a5:d001 | ||
111 | * Scalar USB Microscope (ProScope) */ | ||
112 | |||
113 | [Twinkle] = BRIDGE_NW800, /* 06a5:d800 - hv7121b? (seems pas106) | ||
114 | * Divio Chicony TwinkleCam | ||
115 | * DSB-C110 */ | ||
116 | |||
117 | [DvcV6] = BRIDGE_NW802, /* 0502:d001 | ||
118 | * DVC V6 */ | ||
119 | |||
120 | [P35u] = BRIDGE_NW801, /* 052b:d001, 06a5:d001 and 06be:d001 | ||
121 | * EZCam Pro p35u */ | ||
122 | |||
123 | [Generic802] = BRIDGE_NW802, | ||
124 | }; | ||
125 | /* | ||
126 | * other webcams: | ||
127 | * - nw801 046d:d001 | ||
128 | * Logitech QuickCam Pro (dark focus ring) | ||
129 | * - nw801 0728:d001 | ||
130 | * AVerMedia Camguard | ||
131 | * - nw??? 06a5:d001 | ||
132 | * D-Link NetQam Pro 250plus | ||
133 | * - nw800 065a:d800 | ||
134 | * Showcam NGS webcam | ||
135 | * - nw??? ????:???? | ||
136 | * Sceptre svc300 | ||
137 | */ | ||
138 | |||
82 | /* | 139 | /* |
83 | - webcams: | 140 | * registers |
84 | - Typhoon Webcam 100 USB (06a5:0000) | 141 | * nw800/et31x110 nw801 nw802 |
85 | nw800 | 142 | * 0000..009e 0000..00a1 0000..009e |
86 | - Trust SpaceCam120 or SpaceCam100 PORTABLE (06a5:d800) | 143 | * 0200..0211 id id |
87 | nw801 SpaceCam.init | 144 | * 0300..0302 id id |
88 | or trust_space.init if no LED (?) | 145 | * 0400..0406 (inex) 0400..0406 |
89 | - Divio Chicony TwinkleCam (06a5:d800) ? | 146 | * 0500..0505 0500..0506 (inex) |
90 | nw800 Twinkle.init | 147 | * 0600..061a 0600..0601 0600..0601 |
91 | - Plustek Opticam 500U or ProLink DS3303u | 148 | * 0800..0814 id id |
92 | nw801 DS3303u.init | 149 | * 1000..109c 1000..10a1 1000..109a |
93 | - Logitech QuickCam Pro (dark focus ring) (046d:d001) | 150 | */ |
94 | nw801 | ||
95 | - EZCam Pro p35u (052b:d001, 06a5:d001 and 06be:d001) | ||
96 | nw801 - sensor Sharp IR3Y38M | ||
97 | - AVerMedia Camguard (0728:d001) | ||
98 | nw801 | ||
99 | - Panasonic GP-KR651US (06a5:d001) | ||
100 | nw802 kr651us.init | ||
101 | - iRez Kritter cam | ||
102 | nw802 kritter.init | ||
103 | - D-link dru-350c cam | ||
104 | nw802 d-link-350c.init | ||
105 | - The Scope USB Microscope M2 (ProScope) | ||
106 | = Divio ProLink DS3303u WebCam (06a5:d001) | ||
107 | = Scalar USB Microscope M2 (Proscope) | ||
108 | nw802 proscope.init | ||
109 | - Conceptronic Video Pro 'CVIDEOPRO USB Webcam CCD' (06a5:d001) | ||
110 | nw802 cvideopro.init | ||
111 | - Mustek Wcam 300 mini | ||
112 | nw802 mustek_300_mini.init | ||
113 | - D-Link NetQam Pro 250plus (06a5:d001) | ||
114 | - Showcam NGS webcam (065a:d800) | ||
115 | - sceptre svc300 | ||
116 | - DSB-C110 (06a5:d800) | ||
117 | et31x110 | ||
118 | - DVC V6 (0502:d001) | ||
119 | nw802 | ||
120 | - registers | ||
121 | nw800/et31x110 nw801 nw802 | ||
122 | 0000..009e 0000..00a1 0000..009e | ||
123 | 0200..0211 id id | ||
124 | 0300..0302 id id | ||
125 | 0400..0406 (inex) 0400..0406 | ||
126 | 0500..0505 0500..0506 (inex) | ||
127 | 0600..061a 0600..0601 0600..0601 | ||
128 | 0800..0814 id id | ||
129 | 1000..109c 1000..10a1 1000..109a | ||
130 | |||
131 | 080c: luma (nw800/nw802) | ||
132 | 080d: luma (nw801) | ||
133 | 1004: LUT (?) | ||
134 | 100b: R gain (0..63) | ||
135 | 100c: B gain | ||
136 | 100d: G gain | ||
137 | 100e: Y gain | ||
138 | 100f: U gain | ||
139 | 1010: V gain | ||
140 | 1019: clock (nw801 - bit 0x08: indoor/outdoor) | ||
141 | 101b: shutter 1 (0..255) | ||
142 | 101c: shutter 2 | ||
143 | 1026: BP = gain (nw801) | ||
144 | 1041, 1052, 1063, 1074: LUT base (nw802) | ||
145 | 1048, 1059, 106a, 107b: LUT base (nw801) | ||
146 | - resolutions | ||
147 | nw800 352x288 | ||
148 | nw801/nw802 320x240 - 640x480 | ||
149 | */ | ||
150 | 151 | ||
152 | /* resolutions | ||
153 | * nw800: 320x240, 352x288 | ||
154 | * nw801/802: 320x240, 640x480 | ||
155 | */ | ||
151 | static const struct v4l2_pix_format cif_mode[] = { | 156 | static const struct v4l2_pix_format cif_mode[] = { |
152 | {352, 288, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE, | 157 | {352, 288, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE, |
153 | .bytesperline = 352, | 158 | .bytesperline = 352, |
@@ -1769,7 +1774,12 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1769 | if (sd->webcam == Generic800) | 1774 | if (sd->webcam == Generic800) |
1770 | sd->webcam = P35u; | 1775 | sd->webcam = P35u; |
1771 | } | 1776 | } |
1772 | PDEBUG(D_PROBE, "Bridge nw80%d", sd->bridge); | 1777 | if (webcam_chip[sd->webcam] != sd->bridge) { |
1778 | err("Bad webcam type %d for NW80%d", sd->webcam, sd->bridge); | ||
1779 | gspca_dev->usb_err = -ENODEV; | ||
1780 | return gspca_dev->usb_err; | ||
1781 | } | ||
1782 | PDEBUG(D_PROBE, "Bridge nw80%d - type: %d", sd->bridge, sd->webcam); | ||
1773 | 1783 | ||
1774 | if (sd->bridge == BRIDGE_NW800) { | 1784 | if (sd->bridge == BRIDGE_NW800) { |
1775 | gspca_dev->cam.cam_mode = cif_mode; | 1785 | gspca_dev->cam.cam_mode = cif_mode; |