diff options
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 1464 |
1 files changed, 935 insertions, 529 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index d65d0572403b..e776699b62f9 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -37,6 +37,8 @@ | |||
37 | 37 | ||
38 | #include "em28xx.h" | 38 | #include "em28xx.h" |
39 | 39 | ||
40 | #define DRIVER_NAME "em28xx" | ||
41 | |||
40 | static int tuner = -1; | 42 | static int tuner = -1; |
41 | module_param(tuner, int, 0444); | 43 | module_param(tuner, int, 0444); |
42 | MODULE_PARM_DESC(tuner, "tuner type"); | 44 | MODULE_PARM_DESC(tuner, "tuner type"); |
@@ -45,122 +47,177 @@ static unsigned int disable_ir; | |||
45 | module_param(disable_ir, int, 0444); | 47 | module_param(disable_ir, int, 0444); |
46 | MODULE_PARM_DESC(disable_ir, "disable infrared remote support"); | 48 | MODULE_PARM_DESC(disable_ir, "disable infrared remote support"); |
47 | 49 | ||
50 | static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET }; | ||
51 | module_param_array(card, int, NULL, 0444); | ||
52 | MODULE_PARM_DESC(card, "card type"); | ||
53 | |||
54 | /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */ | ||
55 | static unsigned long em28xx_devused; | ||
56 | |||
48 | struct em28xx_hash_table { | 57 | struct em28xx_hash_table { |
49 | unsigned long hash; | 58 | unsigned long hash; |
50 | unsigned int model; | 59 | unsigned int model; |
51 | unsigned int tuner; | 60 | unsigned int tuner; |
52 | }; | 61 | }; |
53 | 62 | ||
63 | /* | ||
64 | * Reset sequences for analog/digital modes | ||
65 | */ | ||
66 | |||
67 | /* Reset for the most [analog] boards */ | ||
68 | static struct em28xx_reg_seq default_analog[] = { | ||
69 | {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10}, | ||
70 | { -1, -1, -1, -1}, | ||
71 | }; | ||
72 | |||
73 | /* Reset for the most [digital] boards */ | ||
74 | static struct em28xx_reg_seq default_digital[] = { | ||
75 | {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10}, | ||
76 | { -1, -1, -1, -1}, | ||
77 | }; | ||
78 | |||
79 | /* Board Hauppauge WinTV HVR 900 analog */ | ||
80 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { | ||
81 | {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10}, | ||
82 | {0x05, 0xff, 0x10, 10}, | ||
83 | { -1, -1, -1, -1}, | ||
84 | }; | ||
85 | |||
86 | /* Board Hauppauge WinTV HVR 900 digital */ | ||
87 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { | ||
88 | {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10}, | ||
89 | {EM2880_R04_GPO, 0x04, 0x0f, 10}, | ||
90 | {EM2880_R04_GPO, 0x0c, 0x0f, 10}, | ||
91 | { -1, -1, -1, -1}, | ||
92 | }; | ||
93 | |||
94 | /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ | ||
95 | static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { | ||
96 | {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10}, | ||
97 | { -1, -1, -1, -1}, | ||
98 | }; | ||
99 | |||
100 | /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ | ||
101 | |||
102 | /* Board - EM2870 Kworld 355u | ||
103 | Analog - No input analog */ | ||
104 | |||
105 | /* Callback for the most boards */ | ||
106 | static struct em28xx_reg_seq default_tuner_gpio[] = { | ||
107 | {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, | ||
108 | {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10}, | ||
109 | {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, | ||
110 | { -1, -1, -1, -1}, | ||
111 | }; | ||
112 | |||
113 | /* | ||
114 | * Board definitions | ||
115 | */ | ||
54 | struct em28xx_board em28xx_boards[] = { | 116 | struct em28xx_board em28xx_boards[] = { |
55 | [EM2750_BOARD_UNKNOWN] = { | 117 | [EM2750_BOARD_UNKNOWN] = { |
56 | .name = "Unknown EM2750/EM2751 webcam grabber", | 118 | .name = "Unknown EM2750/EM2751 webcam grabber", |
57 | .vchannels = 1, | 119 | .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, |
120 | .tuner_type = TUNER_ABSENT, /* This is a webcam */ | ||
58 | .input = { { | 121 | .input = { { |
59 | .type = EM28XX_VMUX_COMPOSITE1, | 122 | .type = EM28XX_VMUX_COMPOSITE1, |
60 | .vmux = 0, | 123 | .vmux = 0, |
61 | .amux = 0, | 124 | .amux = EM28XX_AMUX_VIDEO, |
62 | } }, | 125 | } }, |
63 | }, | 126 | }, |
64 | [EM2800_BOARD_UNKNOWN] = { | 127 | [EM2800_BOARD_UNKNOWN] = { |
65 | .name = "Unknown EM2800 video grabber", | 128 | .name = "Unknown EM2800 video grabber", |
66 | .is_em2800 = 1, | 129 | .is_em2800 = 1, |
67 | .vchannels = 2, | ||
68 | .tda9887_conf = TDA9887_PRESENT, | 130 | .tda9887_conf = TDA9887_PRESENT, |
69 | .decoder = EM28XX_SAA7113, | 131 | .decoder = EM28XX_SAA711X, |
70 | .input = { { | 132 | .tuner_type = TUNER_ABSENT, |
133 | .input = { { | ||
71 | .type = EM28XX_VMUX_COMPOSITE1, | 134 | .type = EM28XX_VMUX_COMPOSITE1, |
72 | .vmux = SAA7115_COMPOSITE0, | 135 | .vmux = SAA7115_COMPOSITE0, |
73 | .amux = 1, | 136 | .amux = EM28XX_AMUX_LINE_IN, |
74 | }, { | 137 | }, { |
75 | .type = EM28XX_VMUX_SVIDEO, | 138 | .type = EM28XX_VMUX_SVIDEO, |
76 | .vmux = SAA7115_SVIDEO3, | 139 | .vmux = SAA7115_SVIDEO3, |
77 | .amux = 1, | 140 | .amux = EM28XX_AMUX_LINE_IN, |
78 | } }, | 141 | } }, |
79 | }, | 142 | }, |
80 | [EM2820_BOARD_UNKNOWN] = { | 143 | [EM2820_BOARD_UNKNOWN] = { |
81 | .name = "Unknown EM2750/28xx video grabber", | 144 | .name = "Unknown EM2750/28xx video grabber", |
82 | .is_em2800 = 0, | 145 | .tuner_type = TUNER_ABSENT, |
83 | .tuner_type = TUNER_ABSENT, | ||
84 | }, | 146 | }, |
85 | [EM2750_BOARD_DLCW_130] = { | 147 | [EM2750_BOARD_DLCW_130] = { |
86 | /* Beijing Huaqi Information Digital Technology Co., Ltd */ | 148 | /* Beijing Huaqi Information Digital Technology Co., Ltd */ |
87 | .name = "Huaqi DLCW-130", | 149 | .name = "Huaqi DLCW-130", |
88 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 150 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
89 | .vchannels = 1, | 151 | .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, |
152 | .tuner_type = TUNER_ABSENT, /* This is a webcam */ | ||
90 | .input = { { | 153 | .input = { { |
91 | .type = EM28XX_VMUX_COMPOSITE1, | 154 | .type = EM28XX_VMUX_COMPOSITE1, |
92 | .vmux = 0, | 155 | .vmux = 0, |
93 | .amux = 0, | 156 | .amux = EM28XX_AMUX_VIDEO, |
94 | } }, | 157 | } }, |
95 | }, | 158 | }, |
96 | [EM2820_BOARD_KWORLD_PVRTV2800RF] = { | 159 | [EM2820_BOARD_KWORLD_PVRTV2800RF] = { |
97 | .name = "Kworld PVR TV 2800 RF", | 160 | .name = "Kworld PVR TV 2800 RF", |
98 | .is_em2800 = 0, | ||
99 | .vchannels = 2, | ||
100 | .tuner_type = TUNER_TEMIC_PAL, | 161 | .tuner_type = TUNER_TEMIC_PAL, |
101 | .tda9887_conf = TDA9887_PRESENT, | 162 | .tda9887_conf = TDA9887_PRESENT, |
102 | .decoder = EM28XX_SAA7113, | 163 | .decoder = EM28XX_SAA711X, |
103 | .input = { { | 164 | .input = { { |
104 | .type = EM28XX_VMUX_COMPOSITE1, | 165 | .type = EM28XX_VMUX_COMPOSITE1, |
105 | .vmux = SAA7115_COMPOSITE0, | 166 | .vmux = SAA7115_COMPOSITE0, |
106 | .amux = 1, | 167 | .amux = EM28XX_AMUX_LINE_IN, |
107 | }, { | 168 | }, { |
108 | .type = EM28XX_VMUX_SVIDEO, | 169 | .type = EM28XX_VMUX_SVIDEO, |
109 | .vmux = SAA7115_SVIDEO3, | 170 | .vmux = SAA7115_SVIDEO3, |
110 | .amux = 1, | 171 | .amux = EM28XX_AMUX_LINE_IN, |
111 | } }, | 172 | } }, |
112 | }, | 173 | }, |
113 | [EM2820_BOARD_TERRATEC_CINERGY_250] = { | 174 | [EM2820_BOARD_TERRATEC_CINERGY_250] = { |
114 | .name = "Terratec Cinergy 250 USB", | 175 | .name = "Terratec Cinergy 250 USB", |
115 | .vchannels = 3, | ||
116 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 176 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
117 | .tda9887_conf = TDA9887_PRESENT, | 177 | .tda9887_conf = TDA9887_PRESENT, |
118 | .decoder = EM28XX_SAA7113, | 178 | .decoder = EM28XX_SAA711X, |
119 | .input = { { | 179 | .input = { { |
120 | .type = EM28XX_VMUX_TELEVISION, | 180 | .type = EM28XX_VMUX_TELEVISION, |
121 | .vmux = SAA7115_COMPOSITE2, | 181 | .vmux = SAA7115_COMPOSITE2, |
122 | .amux = 1, | 182 | .amux = EM28XX_AMUX_LINE_IN, |
123 | }, { | 183 | }, { |
124 | .type = EM28XX_VMUX_COMPOSITE1, | 184 | .type = EM28XX_VMUX_COMPOSITE1, |
125 | .vmux = SAA7115_COMPOSITE0, | 185 | .vmux = SAA7115_COMPOSITE0, |
126 | .amux = 1, | 186 | .amux = EM28XX_AMUX_LINE_IN, |
127 | }, { | 187 | }, { |
128 | .type = EM28XX_VMUX_SVIDEO, | 188 | .type = EM28XX_VMUX_SVIDEO, |
129 | .vmux = SAA7115_SVIDEO3, | 189 | .vmux = SAA7115_SVIDEO3, |
130 | .amux = 1, | 190 | .amux = EM28XX_AMUX_LINE_IN, |
131 | } }, | 191 | } }, |
132 | }, | 192 | }, |
133 | [EM2820_BOARD_PINNACLE_USB_2] = { | 193 | [EM2820_BOARD_PINNACLE_USB_2] = { |
134 | .name = "Pinnacle PCTV USB 2", | 194 | .name = "Pinnacle PCTV USB 2", |
135 | .vchannels = 3, | ||
136 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 195 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
137 | .tda9887_conf = TDA9887_PRESENT, | 196 | .tda9887_conf = TDA9887_PRESENT, |
138 | .decoder = EM28XX_SAA7113, | 197 | .decoder = EM28XX_SAA711X, |
139 | .input = { { | 198 | .input = { { |
140 | .type = EM28XX_VMUX_TELEVISION, | 199 | .type = EM28XX_VMUX_TELEVISION, |
141 | .vmux = SAA7115_COMPOSITE2, | 200 | .vmux = SAA7115_COMPOSITE2, |
142 | .amux = 0, | 201 | .amux = EM28XX_AMUX_VIDEO, |
143 | }, { | 202 | }, { |
144 | .type = EM28XX_VMUX_COMPOSITE1, | 203 | .type = EM28XX_VMUX_COMPOSITE1, |
145 | .vmux = SAA7115_COMPOSITE0, | 204 | .vmux = SAA7115_COMPOSITE0, |
146 | .amux = 1, | 205 | .amux = EM28XX_AMUX_LINE_IN, |
147 | }, { | 206 | }, { |
148 | .type = EM28XX_VMUX_SVIDEO, | 207 | .type = EM28XX_VMUX_SVIDEO, |
149 | .vmux = SAA7115_SVIDEO3, | 208 | .vmux = SAA7115_SVIDEO3, |
150 | .amux = 1, | 209 | .amux = EM28XX_AMUX_LINE_IN, |
151 | } }, | 210 | } }, |
152 | }, | 211 | }, |
153 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { | 212 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { |
154 | .name = "Hauppauge WinTV USB 2", | 213 | .name = "Hauppauge WinTV USB 2", |
155 | .vchannels = 3, | ||
156 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, | 214 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
157 | .tda9887_conf = TDA9887_PRESENT | | 215 | .tda9887_conf = TDA9887_PRESENT | |
158 | TDA9887_PORT1_ACTIVE| | 216 | TDA9887_PORT1_ACTIVE| |
159 | TDA9887_PORT2_ACTIVE, | 217 | TDA9887_PORT2_ACTIVE, |
160 | .decoder = EM28XX_TVP5150, | 218 | .decoder = EM28XX_TVP5150, |
161 | .has_msp34xx = 1, | 219 | .has_msp34xx = 1, |
162 | /*FIXME: S-Video not tested */ | 220 | .input = { { |
163 | .input = { { | ||
164 | .type = EM28XX_VMUX_TELEVISION, | 221 | .type = EM28XX_VMUX_TELEVISION, |
165 | .vmux = TVP5150_COMPOSITE0, | 222 | .vmux = TVP5150_COMPOSITE0, |
166 | .amux = MSP_INPUT_DEFAULT, | 223 | .amux = MSP_INPUT_DEFAULT, |
@@ -174,327 +231,305 @@ struct em28xx_board em28xx_boards[] = { | |||
174 | [EM2820_BOARD_DLINK_USB_TV] = { | 231 | [EM2820_BOARD_DLINK_USB_TV] = { |
175 | .name = "D-Link DUB-T210 TV Tuner", | 232 | .name = "D-Link DUB-T210 TV Tuner", |
176 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 233 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
177 | .vchannels = 3, | ||
178 | .is_em2800 = 0, | ||
179 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 234 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
180 | .tda9887_conf = TDA9887_PRESENT, | 235 | .tda9887_conf = TDA9887_PRESENT, |
181 | .decoder = EM28XX_SAA7113, | 236 | .decoder = EM28XX_SAA711X, |
182 | .input = { { | 237 | .input = { { |
183 | .type = EM28XX_VMUX_TELEVISION, | 238 | .type = EM28XX_VMUX_TELEVISION, |
184 | .vmux = SAA7115_COMPOSITE2, | 239 | .vmux = SAA7115_COMPOSITE2, |
185 | .amux = 1, | 240 | .amux = EM28XX_AMUX_LINE_IN, |
186 | }, { | 241 | }, { |
187 | .type = EM28XX_VMUX_COMPOSITE1, | 242 | .type = EM28XX_VMUX_COMPOSITE1, |
188 | .vmux = SAA7115_COMPOSITE0, | 243 | .vmux = SAA7115_COMPOSITE0, |
189 | .amux = 1, | 244 | .amux = EM28XX_AMUX_LINE_IN, |
190 | }, { | 245 | }, { |
191 | .type = EM28XX_VMUX_SVIDEO, | 246 | .type = EM28XX_VMUX_SVIDEO, |
192 | .vmux = SAA7115_SVIDEO3, | 247 | .vmux = SAA7115_SVIDEO3, |
193 | .amux = 1, | 248 | .amux = EM28XX_AMUX_LINE_IN, |
194 | } }, | 249 | } }, |
195 | }, | 250 | }, |
196 | [EM2820_BOARD_HERCULES_SMART_TV_USB2] = { | 251 | [EM2820_BOARD_HERCULES_SMART_TV_USB2] = { |
197 | .name = "Hercules Smart TV USB 2.0", | 252 | .name = "Hercules Smart TV USB 2.0", |
198 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 253 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
199 | .vchannels = 3, | ||
200 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 254 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
201 | .tda9887_conf = TDA9887_PRESENT, | 255 | .tda9887_conf = TDA9887_PRESENT, |
202 | .decoder = EM28XX_SAA7113, | 256 | .decoder = EM28XX_SAA711X, |
203 | .input = { { | 257 | .input = { { |
204 | .type = EM28XX_VMUX_TELEVISION, | 258 | .type = EM28XX_VMUX_TELEVISION, |
205 | .vmux = SAA7115_COMPOSITE2, | 259 | .vmux = SAA7115_COMPOSITE2, |
206 | .amux = 1, | 260 | .amux = EM28XX_AMUX_LINE_IN, |
207 | }, { | 261 | }, { |
208 | .type = EM28XX_VMUX_COMPOSITE1, | 262 | .type = EM28XX_VMUX_COMPOSITE1, |
209 | .vmux = SAA7115_COMPOSITE0, | 263 | .vmux = SAA7115_COMPOSITE0, |
210 | .amux = 1, | 264 | .amux = EM28XX_AMUX_LINE_IN, |
211 | }, { | 265 | }, { |
212 | .type = EM28XX_VMUX_SVIDEO, | 266 | .type = EM28XX_VMUX_SVIDEO, |
213 | .vmux = SAA7115_SVIDEO3, | 267 | .vmux = SAA7115_SVIDEO3, |
214 | .amux = 1, | 268 | .amux = EM28XX_AMUX_LINE_IN, |
215 | } }, | 269 | } }, |
216 | }, | 270 | }, |
217 | [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = { | 271 | [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = { |
218 | .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)", | 272 | .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)", |
219 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 273 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
220 | .vchannels = 3, | ||
221 | .is_em2800 = 0, | ||
222 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, | 274 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
223 | .tda9887_conf = TDA9887_PRESENT, | 275 | .tda9887_conf = TDA9887_PRESENT, |
224 | .decoder = EM28XX_SAA7113, | 276 | .decoder = EM28XX_SAA711X, |
225 | .input = { { | 277 | .input = { { |
226 | .type = EM28XX_VMUX_TELEVISION, | 278 | .type = EM28XX_VMUX_TELEVISION, |
227 | .vmux = SAA7115_COMPOSITE2, | 279 | .vmux = SAA7115_COMPOSITE2, |
228 | .amux = 0, | 280 | .amux = EM28XX_AMUX_VIDEO, |
229 | }, { | 281 | }, { |
230 | .type = EM28XX_VMUX_COMPOSITE1, | 282 | .type = EM28XX_VMUX_COMPOSITE1, |
231 | .vmux = SAA7115_COMPOSITE0, | 283 | .vmux = SAA7115_COMPOSITE0, |
232 | .amux = 1, | 284 | .amux = EM28XX_AMUX_LINE_IN, |
233 | }, { | 285 | }, { |
234 | .type = EM28XX_VMUX_SVIDEO, | 286 | .type = EM28XX_VMUX_SVIDEO, |
235 | .vmux = SAA7115_SVIDEO3, | 287 | .vmux = SAA7115_SVIDEO3, |
236 | .amux = 1, | 288 | .amux = EM28XX_AMUX_LINE_IN, |
237 | } }, | 289 | } }, |
238 | }, | 290 | }, |
239 | [EM2820_BOARD_GADMEI_UTV310] = { | 291 | [EM2820_BOARD_GADMEI_UTV310] = { |
240 | .name = "Gadmei UTV310", | 292 | .name = "Gadmei UTV310", |
241 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 293 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
242 | .vchannels = 3, | ||
243 | .tuner_type = TUNER_TNF_5335MF, | 294 | .tuner_type = TUNER_TNF_5335MF, |
244 | .tda9887_conf = TDA9887_PRESENT, | 295 | .tda9887_conf = TDA9887_PRESENT, |
245 | .decoder = EM28XX_SAA7113, | 296 | .decoder = EM28XX_SAA711X, |
246 | .input = { { | 297 | .input = { { |
247 | .type = EM28XX_VMUX_TELEVISION, | 298 | .type = EM28XX_VMUX_TELEVISION, |
248 | .vmux = SAA7115_COMPOSITE1, | 299 | .vmux = SAA7115_COMPOSITE1, |
249 | .amux = 1, | 300 | .amux = EM28XX_AMUX_LINE_IN, |
250 | }, { | 301 | }, { |
251 | .type = EM28XX_VMUX_COMPOSITE1, | 302 | .type = EM28XX_VMUX_COMPOSITE1, |
252 | .vmux = SAA7115_COMPOSITE0, | 303 | .vmux = SAA7115_COMPOSITE0, |
253 | .amux = 1, | 304 | .amux = EM28XX_AMUX_LINE_IN, |
254 | }, { | 305 | }, { |
255 | .type = EM28XX_VMUX_SVIDEO, | 306 | .type = EM28XX_VMUX_SVIDEO, |
256 | .vmux = SAA7115_SVIDEO3, | 307 | .vmux = SAA7115_SVIDEO3, |
257 | .amux = 1, | 308 | .amux = EM28XX_AMUX_LINE_IN, |
258 | } }, | 309 | } }, |
259 | }, | 310 | }, |
260 | [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = { | 311 | [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = { |
261 | .name = "Leadtek Winfast USB II Deluxe", | 312 | .name = "Leadtek Winfast USB II Deluxe", |
262 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 313 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
263 | .vchannels = 3, | ||
264 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, | 314 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
265 | .tda9887_conf = TDA9887_PRESENT, | 315 | .tda9887_conf = TDA9887_PRESENT, |
266 | .decoder = EM28XX_SAA7114, | 316 | .decoder = EM28XX_SAA711X, |
267 | .input = { { | 317 | .input = { { |
268 | .type = EM28XX_VMUX_TELEVISION, | 318 | .type = EM28XX_VMUX_TELEVISION, |
269 | .vmux = 2, | 319 | .vmux = SAA7115_COMPOSITE2, |
270 | .amux = 0, | 320 | .amux = EM28XX_AMUX_VIDEO, |
271 | }, { | 321 | }, { |
272 | .type = EM28XX_VMUX_COMPOSITE1, | 322 | .type = EM28XX_VMUX_COMPOSITE1, |
273 | .vmux = 0, | ||
274 | .amux = 1, | ||
275 | }, { | ||
276 | .type = EM28XX_VMUX_SVIDEO, | ||
277 | .vmux = 9, | ||
278 | .amux = 1, | ||
279 | } }, | ||
280 | }, | ||
281 | [EM2820_BOARD_PINNACLE_DVC_100] = { | ||
282 | .name = "Pinnacle Dazzle DVC 100", | ||
283 | .valid = EM28XX_BOARD_NOT_VALIDATED, | ||
284 | .vchannels = 3, | ||
285 | .decoder = EM28XX_SAA7113, | ||
286 | .input = { { | ||
287 | .type = EM28XX_VMUX_COMPOSITE1, | ||
288 | .vmux = SAA7115_COMPOSITE0, | 323 | .vmux = SAA7115_COMPOSITE0, |
289 | .amux = 1, | 324 | .amux = EM28XX_AMUX_LINE_IN, |
290 | }, { | 325 | }, { |
291 | .type = EM28XX_VMUX_SVIDEO, | 326 | .type = EM28XX_VMUX_SVIDEO, |
292 | .vmux = SAA7115_SVIDEO3, | 327 | .vmux = SAA7115_COMPOSITE0, |
293 | .amux = 1, | 328 | .amux = EM28XX_AMUX_LINE_IN, |
294 | } }, | 329 | } }, |
295 | }, | 330 | }, |
296 | [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { | 331 | [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { |
297 | .name = "Videology 20K14XUSB USB2.0", | 332 | .name = "Videology 20K14XUSB USB2.0", |
298 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 333 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
299 | .vchannels = 1, | 334 | .tuner_type = TUNER_ABSENT, /* This is a webcam */ |
300 | .input = { { | 335 | .input = { { |
301 | .type = EM28XX_VMUX_COMPOSITE1, | 336 | .type = EM28XX_VMUX_COMPOSITE1, |
302 | .vmux = 0, | 337 | .vmux = 0, |
303 | .amux = 0, | 338 | .amux = EM28XX_AMUX_VIDEO, |
304 | } }, | 339 | } }, |
305 | }, | 340 | }, |
306 | [EM2821_BOARD_PROLINK_PLAYTV_USB2] = { | 341 | [EM2821_BOARD_PROLINK_PLAYTV_USB2] = { |
307 | .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0", | 342 | .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0", |
308 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 343 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
309 | .vchannels = 3, | ||
310 | .is_em2800 = 0, | ||
311 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */ | 344 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */ |
312 | .tda9887_conf = TDA9887_PRESENT, /* unknown? */ | 345 | .tda9887_conf = TDA9887_PRESENT, /* unknown? */ |
313 | .decoder = EM28XX_SAA7113, | 346 | .decoder = EM28XX_SAA711X, |
314 | .input = { { | 347 | .input = { { |
315 | .type = EM28XX_VMUX_TELEVISION, | 348 | .type = EM28XX_VMUX_TELEVISION, |
316 | .vmux = SAA7115_COMPOSITE2, | 349 | .vmux = SAA7115_COMPOSITE2, |
317 | .amux = 1, | 350 | .amux = EM28XX_AMUX_LINE_IN, |
318 | }, { | 351 | }, { |
319 | .type = EM28XX_VMUX_COMPOSITE1, | 352 | .type = EM28XX_VMUX_COMPOSITE1, |
320 | .vmux = SAA7115_COMPOSITE0, | 353 | .vmux = SAA7115_COMPOSITE0, |
321 | .amux = 1, | 354 | .amux = EM28XX_AMUX_LINE_IN, |
322 | }, { | 355 | }, { |
323 | .type = EM28XX_VMUX_SVIDEO, | 356 | .type = EM28XX_VMUX_SVIDEO, |
324 | .vmux = SAA7115_SVIDEO3, | 357 | .vmux = SAA7115_SVIDEO3, |
325 | .amux = 1, | 358 | .amux = EM28XX_AMUX_LINE_IN, |
326 | } }, | 359 | } }, |
327 | }, | 360 | }, |
328 | [EM2821_BOARD_SUPERCOMP_USB_2] = { | 361 | [EM2821_BOARD_SUPERCOMP_USB_2] = { |
329 | .name = "Supercomp USB 2.0 TV", | 362 | .name = "Supercomp USB 2.0 TV", |
330 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 363 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
331 | .vchannels = 3, | ||
332 | .is_em2800 = 0, | ||
333 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, | 364 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
334 | .tda9887_conf = TDA9887_PRESENT | | 365 | .tda9887_conf = TDA9887_PRESENT | |
335 | TDA9887_PORT1_ACTIVE | | 366 | TDA9887_PORT1_ACTIVE | |
336 | TDA9887_PORT2_ACTIVE, | 367 | TDA9887_PORT2_ACTIVE, |
337 | .decoder = EM28XX_SAA7113, | 368 | .decoder = EM28XX_SAA711X, |
338 | .input = { { | 369 | .input = { { |
339 | .type = EM28XX_VMUX_TELEVISION, | 370 | .type = EM28XX_VMUX_TELEVISION, |
340 | .vmux = SAA7115_COMPOSITE2, | 371 | .vmux = SAA7115_COMPOSITE2, |
341 | .amux = 1, | 372 | .amux = EM28XX_AMUX_LINE_IN, |
342 | }, { | 373 | }, { |
343 | .type = EM28XX_VMUX_COMPOSITE1, | 374 | .type = EM28XX_VMUX_COMPOSITE1, |
344 | .vmux = SAA7115_COMPOSITE0, | 375 | .vmux = SAA7115_COMPOSITE0, |
345 | .amux = 0, | 376 | .amux = EM28XX_AMUX_VIDEO, |
346 | }, { | 377 | }, { |
347 | .type = EM28XX_VMUX_SVIDEO, | 378 | .type = EM28XX_VMUX_SVIDEO, |
348 | .vmux = SAA7115_SVIDEO3, | 379 | .vmux = SAA7115_SVIDEO3, |
349 | .amux = 1, | 380 | .amux = EM28XX_AMUX_LINE_IN, |
350 | } }, | 381 | } }, |
351 | }, | 382 | }, |
352 | [EM2821_BOARD_USBGEAR_VD204] = { | 383 | [EM2821_BOARD_USBGEAR_VD204] = { |
353 | .name = "Usbgear VD204v9", | 384 | .name = "Usbgear VD204v9", |
354 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 385 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
355 | .vchannels = 2, | 386 | .tuner_type = TUNER_ABSENT, /* Capture only device */ |
356 | .decoder = EM28XX_SAA7113, | 387 | .decoder = EM28XX_SAA711X, |
357 | .input = { { | 388 | .input = { { |
358 | .type = EM28XX_VMUX_COMPOSITE1, | 389 | .type = EM28XX_VMUX_COMPOSITE1, |
359 | .vmux = SAA7115_COMPOSITE0, | 390 | .vmux = SAA7115_COMPOSITE0, |
360 | .amux = 1, | 391 | .amux = EM28XX_AMUX_LINE_IN, |
361 | }, { | 392 | }, { |
362 | .type = EM28XX_VMUX_SVIDEO, | 393 | .type = EM28XX_VMUX_SVIDEO, |
363 | .vmux = SAA7115_SVIDEO3, | 394 | .vmux = SAA7115_SVIDEO3, |
364 | .amux = 1, | 395 | .amux = EM28XX_AMUX_LINE_IN, |
365 | } }, | 396 | } }, |
366 | }, | 397 | }, |
367 | [EM2860_BOARD_NETGMBH_CAM] = { | 398 | [EM2860_BOARD_NETGMBH_CAM] = { |
368 | /* Beijing Huaqi Information Digital Technology Co., Ltd */ | 399 | /* Beijing Huaqi Information Digital Technology Co., Ltd */ |
369 | .name = "NetGMBH Cam", | 400 | .name = "NetGMBH Cam", |
370 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 401 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
371 | .vchannels = 1, | 402 | .tuner_type = TUNER_ABSENT, /* This is a webcam */ |
372 | .input = { { | 403 | .input = { { |
373 | .type = EM28XX_VMUX_COMPOSITE1, | 404 | .type = EM28XX_VMUX_COMPOSITE1, |
374 | .vmux = 0, | 405 | .vmux = 0, |
375 | .amux = 0, | 406 | .amux = EM28XX_AMUX_VIDEO, |
376 | } }, | 407 | } }, |
377 | }, | 408 | }, |
378 | [EM2860_BOARD_TYPHOON_DVD_MAKER] = { | 409 | [EM2860_BOARD_TYPHOON_DVD_MAKER] = { |
379 | .name = "Typhoon DVD Maker", | 410 | .name = "Typhoon DVD Maker", |
380 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 411 | .decoder = EM28XX_SAA711X, |
381 | .vchannels = 2, | 412 | .tuner_type = TUNER_ABSENT, /* Capture only device */ |
382 | .decoder = EM28XX_SAA7113, | 413 | .input = { { |
383 | .input = { { | ||
384 | .type = EM28XX_VMUX_COMPOSITE1, | 414 | .type = EM28XX_VMUX_COMPOSITE1, |
385 | .vmux = SAA7115_COMPOSITE0, | 415 | .vmux = SAA7115_COMPOSITE0, |
386 | .amux = 1, | 416 | .amux = EM28XX_AMUX_LINE_IN, |
387 | }, { | 417 | }, { |
388 | .type = EM28XX_VMUX_SVIDEO, | 418 | .type = EM28XX_VMUX_SVIDEO, |
389 | .vmux = SAA7115_SVIDEO3, | 419 | .vmux = SAA7115_SVIDEO3, |
390 | .amux = 1, | 420 | .amux = EM28XX_AMUX_LINE_IN, |
391 | } }, | 421 | } }, |
392 | }, | 422 | }, |
393 | [EM2860_BOARD_GADMEI_UTV330] = { | 423 | [EM2860_BOARD_GADMEI_UTV330] = { |
394 | .name = "Gadmei UTV330", | 424 | .name = "Gadmei UTV330", |
395 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 425 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
396 | .vchannels = 3, | ||
397 | .tuner_type = TUNER_TNF_5335MF, | 426 | .tuner_type = TUNER_TNF_5335MF, |
398 | .tda9887_conf = TDA9887_PRESENT, | 427 | .tda9887_conf = TDA9887_PRESENT, |
399 | .decoder = EM28XX_SAA7113, | 428 | .decoder = EM28XX_SAA711X, |
400 | .input = { { | 429 | .input = { { |
401 | .type = EM28XX_VMUX_TELEVISION, | 430 | .type = EM28XX_VMUX_TELEVISION, |
402 | .vmux = SAA7115_COMPOSITE2, | 431 | .vmux = SAA7115_COMPOSITE2, |
403 | .amux = 0, | 432 | .amux = EM28XX_AMUX_VIDEO, |
404 | }, { | 433 | }, { |
405 | .type = EM28XX_VMUX_COMPOSITE1, | 434 | .type = EM28XX_VMUX_COMPOSITE1, |
406 | .vmux = SAA7115_COMPOSITE0, | 435 | .vmux = SAA7115_COMPOSITE0, |
407 | .amux = 1, | 436 | .amux = EM28XX_AMUX_LINE_IN, |
408 | }, { | 437 | }, { |
409 | .type = EM28XX_VMUX_SVIDEO, | 438 | .type = EM28XX_VMUX_SVIDEO, |
410 | .vmux = SAA7115_SVIDEO3, | 439 | .vmux = SAA7115_SVIDEO3, |
411 | .amux = 1, | 440 | .amux = EM28XX_AMUX_LINE_IN, |
412 | } }, | 441 | } }, |
413 | }, | 442 | }, |
414 | [EM2860_BOARD_TERRATEC_HYBRID_XS] = { | 443 | [EM2860_BOARD_TERRATEC_HYBRID_XS] = { |
415 | .name = "Terratec Cinergy A Hybrid XS", | 444 | .name = "Terratec Cinergy A Hybrid XS", |
416 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 445 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
417 | .vchannels = 3, | ||
418 | .tuner_type = TUNER_XC2028, | 446 | .tuner_type = TUNER_XC2028, |
447 | .tuner_gpio = default_tuner_gpio, | ||
419 | .decoder = EM28XX_TVP5150, | 448 | .decoder = EM28XX_TVP5150, |
420 | .input = { { | 449 | |
450 | .input = { { | ||
421 | .type = EM28XX_VMUX_TELEVISION, | 451 | .type = EM28XX_VMUX_TELEVISION, |
422 | .vmux = TVP5150_COMPOSITE0, | 452 | .vmux = TVP5150_COMPOSITE0, |
423 | .amux = 0, | 453 | .amux = EM28XX_AMUX_VIDEO, |
454 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
424 | }, { | 455 | }, { |
425 | .type = EM28XX_VMUX_COMPOSITE1, | 456 | .type = EM28XX_VMUX_COMPOSITE1, |
426 | .vmux = TVP5150_COMPOSITE1, | 457 | .vmux = TVP5150_COMPOSITE1, |
427 | .amux = 1, | 458 | .amux = EM28XX_AMUX_LINE_IN, |
459 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
428 | }, { | 460 | }, { |
429 | .type = EM28XX_VMUX_SVIDEO, | 461 | .type = EM28XX_VMUX_SVIDEO, |
430 | .vmux = TVP5150_SVIDEO, | 462 | .vmux = TVP5150_SVIDEO, |
431 | .amux = 1, | 463 | .amux = EM28XX_AMUX_LINE_IN, |
464 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
432 | } }, | 465 | } }, |
433 | }, | 466 | }, |
434 | [EM2861_BOARD_KWORLD_PVRTV_300U] = { | 467 | [EM2861_BOARD_KWORLD_PVRTV_300U] = { |
435 | .name = "KWorld PVRTV 300U", | 468 | .name = "KWorld PVRTV 300U", |
436 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 469 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
437 | .vchannels = 3, | ||
438 | .tuner_type = TUNER_XC2028, | 470 | .tuner_type = TUNER_XC2028, |
471 | .tuner_gpio = default_tuner_gpio, | ||
439 | .decoder = EM28XX_TVP5150, | 472 | .decoder = EM28XX_TVP5150, |
440 | .input = { { | 473 | .input = { { |
441 | .type = EM28XX_VMUX_TELEVISION, | 474 | .type = EM28XX_VMUX_TELEVISION, |
442 | .vmux = TVP5150_COMPOSITE0, | 475 | .vmux = TVP5150_COMPOSITE0, |
443 | .amux = 0, | 476 | .amux = EM28XX_AMUX_VIDEO, |
444 | }, { | 477 | }, { |
445 | .type = EM28XX_VMUX_COMPOSITE1, | 478 | .type = EM28XX_VMUX_COMPOSITE1, |
446 | .vmux = TVP5150_COMPOSITE1, | 479 | .vmux = TVP5150_COMPOSITE1, |
447 | .amux = 1, | 480 | .amux = EM28XX_AMUX_LINE_IN, |
448 | }, { | 481 | }, { |
449 | .type = EM28XX_VMUX_SVIDEO, | 482 | .type = EM28XX_VMUX_SVIDEO, |
450 | .vmux = TVP5150_SVIDEO, | 483 | .vmux = TVP5150_SVIDEO, |
451 | .amux = 1, | 484 | .amux = EM28XX_AMUX_LINE_IN, |
452 | } }, | 485 | } }, |
453 | }, | 486 | }, |
454 | [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = { | 487 | [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = { |
455 | .name = "Yakumo MovieMixer", | 488 | .name = "Yakumo MovieMixer", |
456 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 489 | .tuner_type = TUNER_ABSENT, /* Capture only device */ |
457 | .vchannels = 1, | ||
458 | .decoder = EM28XX_TVP5150, | 490 | .decoder = EM28XX_TVP5150, |
459 | .input = { { | 491 | .input = { { |
460 | .type = EM28XX_VMUX_TELEVISION, | 492 | .type = EM28XX_VMUX_TELEVISION, |
461 | .vmux = TVP5150_COMPOSITE0, | 493 | .vmux = TVP5150_COMPOSITE0, |
462 | .amux = 0, | 494 | .amux = EM28XX_AMUX_VIDEO, |
463 | }, { | 495 | }, { |
464 | .type = EM28XX_VMUX_COMPOSITE1, | 496 | .type = EM28XX_VMUX_COMPOSITE1, |
465 | .vmux = TVP5150_COMPOSITE1, | 497 | .vmux = TVP5150_COMPOSITE1, |
466 | .amux = 1, | 498 | .amux = EM28XX_AMUX_LINE_IN, |
467 | }, { | 499 | }, { |
468 | .type = EM28XX_VMUX_SVIDEO, | 500 | .type = EM28XX_VMUX_SVIDEO, |
469 | .vmux = TVP5150_SVIDEO, | 501 | .vmux = TVP5150_SVIDEO, |
470 | .amux = 1, | 502 | .amux = EM28XX_AMUX_LINE_IN, |
471 | } }, | 503 | } }, |
472 | }, | 504 | }, |
473 | [EM2861_BOARD_PLEXTOR_PX_TV100U] = { | 505 | [EM2861_BOARD_PLEXTOR_PX_TV100U] = { |
474 | .name = "Plextor ConvertX PX-TV100U", | 506 | .name = "Plextor ConvertX PX-TV100U", |
475 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 507 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
476 | .vchannels = 3, | ||
477 | .tuner_type = TUNER_TNF_5335MF, | 508 | .tuner_type = TUNER_TNF_5335MF, |
478 | .tda9887_conf = TDA9887_PRESENT, | 509 | .tda9887_conf = TDA9887_PRESENT, |
479 | .decoder = EM28XX_TVP5150, | 510 | .decoder = EM28XX_TVP5150, |
480 | .input = { { | 511 | .input = { { |
481 | .type = EM28XX_VMUX_TELEVISION, | 512 | .type = EM28XX_VMUX_TELEVISION, |
482 | .vmux = TVP5150_COMPOSITE0, | 513 | .vmux = TVP5150_COMPOSITE0, |
483 | .amux = 1, | 514 | .amux = EM28XX_AMUX_LINE_IN, |
484 | }, { | 515 | }, { |
485 | .type = EM28XX_VMUX_COMPOSITE1, | 516 | .type = EM28XX_VMUX_COMPOSITE1, |
486 | .vmux = TVP5150_COMPOSITE1, | 517 | .vmux = TVP5150_COMPOSITE1, |
487 | .amux = 1, | 518 | .amux = EM28XX_AMUX_LINE_IN, |
488 | }, { | 519 | }, { |
489 | .type = EM28XX_VMUX_SVIDEO, | 520 | .type = EM28XX_VMUX_SVIDEO, |
490 | .vmux = TVP5150_SVIDEO, | 521 | .vmux = TVP5150_SVIDEO, |
491 | .amux = 1, | 522 | .amux = EM28XX_AMUX_LINE_IN, |
492 | } }, | 523 | } }, |
493 | }, | 524 | }, |
525 | |||
526 | /* Those boards with em2870 are DVB Only*/ | ||
527 | |||
494 | [EM2870_BOARD_TERRATEC_XS] = { | 528 | [EM2870_BOARD_TERRATEC_XS] = { |
495 | .name = "Terratec Cinergy T XS", | 529 | .name = "Terratec Cinergy T XS", |
496 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 530 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
497 | .tuner_type = TUNER_XC2028, | 531 | .tuner_type = TUNER_XC2028, |
532 | .tuner_gpio = default_tuner_gpio, | ||
498 | }, | 533 | }, |
499 | [EM2870_BOARD_TERRATEC_XS_MT2060] = { | 534 | [EM2870_BOARD_TERRATEC_XS_MT2060] = { |
500 | .name = "Terratec Cinergy T XS (MT2060)", | 535 | .name = "Terratec Cinergy T XS (MT2060)", |
@@ -505,6 +540,7 @@ struct em28xx_board em28xx_boards[] = { | |||
505 | .name = "Kworld 350 U DVB-T", | 540 | .name = "Kworld 350 U DVB-T", |
506 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 541 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
507 | .tuner_type = TUNER_XC2028, | 542 | .tuner_type = TUNER_XC2028, |
543 | .tuner_gpio = default_tuner_gpio, | ||
508 | }, | 544 | }, |
509 | [EM2870_BOARD_KWORLD_355U] = { | 545 | [EM2870_BOARD_KWORLD_355U] = { |
510 | .name = "Kworld 355 U DVB-T", | 546 | .name = "Kworld 355 U DVB-T", |
@@ -514,164 +550,216 @@ struct em28xx_board em28xx_boards[] = { | |||
514 | .name = "Pinnacle PCTV DVB-T", | 550 | .name = "Pinnacle PCTV DVB-T", |
515 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 551 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
516 | .tuner_type = TUNER_ABSENT, /* MT2060 */ | 552 | .tuner_type = TUNER_ABSENT, /* MT2060 */ |
553 | /* djh - I have serious doubts this is right... */ | ||
554 | .xclk = EM28XX_XCLK_IR_RC5_MODE | | ||
555 | EM28XX_XCLK_FREQUENCY_10MHZ, | ||
517 | }, | 556 | }, |
518 | [EM2870_BOARD_COMPRO_VIDEOMATE] = { | 557 | [EM2870_BOARD_COMPRO_VIDEOMATE] = { |
519 | .name = "Compro, VideoMate U3", | 558 | .name = "Compro, VideoMate U3", |
520 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 559 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
521 | .tuner_type = TUNER_ABSENT, /* MT2060 */ | 560 | .tuner_type = TUNER_ABSENT, /* MT2060 */ |
522 | }, | 561 | }, |
562 | |||
523 | [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = { | 563 | [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = { |
524 | .name = "Terratec Hybrid XS Secam", | 564 | .name = "Terratec Hybrid XS Secam", |
525 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 565 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
526 | .vchannels = 3, | ||
527 | .has_msp34xx = 1, | 566 | .has_msp34xx = 1, |
528 | .tuner_type = TUNER_XC2028, | 567 | .tuner_type = TUNER_XC2028, |
568 | .tuner_gpio = default_tuner_gpio, | ||
529 | .decoder = EM28XX_TVP5150, | 569 | .decoder = EM28XX_TVP5150, |
530 | .input = { { | 570 | .input = { { |
531 | .type = EM28XX_VMUX_TELEVISION, | 571 | .type = EM28XX_VMUX_TELEVISION, |
532 | .vmux = TVP5150_COMPOSITE0, | 572 | .vmux = TVP5150_COMPOSITE0, |
533 | .amux = 0, | 573 | .amux = EM28XX_AMUX_VIDEO, |
574 | .gpio = default_analog, | ||
534 | }, { | 575 | }, { |
535 | .type = EM28XX_VMUX_COMPOSITE1, | 576 | .type = EM28XX_VMUX_COMPOSITE1, |
536 | .vmux = TVP5150_COMPOSITE1, | 577 | .vmux = TVP5150_COMPOSITE1, |
537 | .amux = 1, | 578 | .amux = EM28XX_AMUX_LINE_IN, |
579 | .gpio = default_analog, | ||
538 | }, { | 580 | }, { |
539 | .type = EM28XX_VMUX_SVIDEO, | 581 | .type = EM28XX_VMUX_SVIDEO, |
540 | .vmux = TVP5150_SVIDEO, | 582 | .vmux = TVP5150_SVIDEO, |
541 | .amux = 1, | 583 | .amux = EM28XX_AMUX_LINE_IN, |
584 | .gpio = default_analog, | ||
542 | } }, | 585 | } }, |
543 | }, | 586 | }, |
544 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { | 587 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { |
545 | .name = "Hauppauge WinTV HVR 900", | 588 | .name = "Hauppauge WinTV HVR 900", |
546 | .vchannels = 3, | ||
547 | .tda9887_conf = TDA9887_PRESENT, | 589 | .tda9887_conf = TDA9887_PRESENT, |
548 | .tuner_type = TUNER_XC2028, | 590 | .tuner_type = TUNER_XC2028, |
591 | .tuner_gpio = default_tuner_gpio, | ||
549 | .mts_firmware = 1, | 592 | .mts_firmware = 1, |
550 | .has_dvb = 1, | 593 | .has_dvb = 1, |
594 | .dvb_gpio = hauppauge_wintv_hvr_900_digital, | ||
551 | .decoder = EM28XX_TVP5150, | 595 | .decoder = EM28XX_TVP5150, |
552 | .input = { { | 596 | .input = { { |
553 | .type = EM28XX_VMUX_TELEVISION, | 597 | .type = EM28XX_VMUX_TELEVISION, |
554 | .vmux = TVP5150_COMPOSITE0, | 598 | .vmux = TVP5150_COMPOSITE0, |
555 | .amux = 0, | 599 | .amux = EM28XX_AMUX_VIDEO, |
600 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
556 | }, { | 601 | }, { |
557 | .type = EM28XX_VMUX_COMPOSITE1, | 602 | .type = EM28XX_VMUX_COMPOSITE1, |
558 | .vmux = TVP5150_COMPOSITE1, | 603 | .vmux = TVP5150_COMPOSITE1, |
559 | .amux = 1, | 604 | .amux = EM28XX_AMUX_LINE_IN, |
605 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
560 | }, { | 606 | }, { |
561 | .type = EM28XX_VMUX_SVIDEO, | 607 | .type = EM28XX_VMUX_SVIDEO, |
562 | .vmux = TVP5150_SVIDEO, | 608 | .vmux = TVP5150_SVIDEO, |
563 | .amux = 1, | 609 | .amux = EM28XX_AMUX_LINE_IN, |
610 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
564 | } }, | 611 | } }, |
565 | }, | 612 | }, |
566 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = { | 613 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = { |
567 | .name = "Hauppauge WinTV HVR 900 (R2)", | 614 | .name = "Hauppauge WinTV HVR 900 (R2)", |
568 | .vchannels = 3, | ||
569 | .tda9887_conf = TDA9887_PRESENT, | 615 | .tda9887_conf = TDA9887_PRESENT, |
570 | .tuner_type = TUNER_XC2028, | 616 | .tuner_type = TUNER_XC2028, |
617 | .tuner_gpio = default_tuner_gpio, | ||
571 | .mts_firmware = 1, | 618 | .mts_firmware = 1, |
572 | .decoder = EM28XX_TVP5150, | 619 | .decoder = EM28XX_TVP5150, |
620 | .input = { { | ||
621 | .type = EM28XX_VMUX_TELEVISION, | ||
622 | .vmux = TVP5150_COMPOSITE0, | ||
623 | .amux = EM28XX_AMUX_VIDEO, | ||
624 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
625 | }, { | ||
626 | .type = EM28XX_VMUX_COMPOSITE1, | ||
627 | .vmux = TVP5150_COMPOSITE1, | ||
628 | .amux = EM28XX_AMUX_LINE_IN, | ||
629 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
630 | }, { | ||
631 | .type = EM28XX_VMUX_SVIDEO, | ||
632 | .vmux = TVP5150_SVIDEO, | ||
633 | .amux = EM28XX_AMUX_LINE_IN, | ||
634 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
635 | } }, | ||
636 | }, | ||
637 | [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = { | ||
638 | .name = "Hauppauge WinTV HVR 850", | ||
639 | .tuner_type = TUNER_XC2028, | ||
640 | .tuner_gpio = default_tuner_gpio, | ||
641 | .mts_firmware = 1, | ||
642 | .has_dvb = 1, | ||
643 | .dvb_gpio = hauppauge_wintv_hvr_900_digital, | ||
644 | .ir_codes = ir_codes_hauppauge_new, | ||
645 | .decoder = EM28XX_TVP5150, | ||
573 | .input = { { | 646 | .input = { { |
574 | .type = EM28XX_VMUX_TELEVISION, | 647 | .type = EM28XX_VMUX_TELEVISION, |
575 | .vmux = TVP5150_COMPOSITE0, | 648 | .vmux = TVP5150_COMPOSITE0, |
576 | .amux = 0, | 649 | .amux = EM28XX_AMUX_VIDEO, |
650 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
577 | }, { | 651 | }, { |
578 | .type = EM28XX_VMUX_COMPOSITE1, | 652 | .type = EM28XX_VMUX_COMPOSITE1, |
579 | .vmux = TVP5150_COMPOSITE1, | 653 | .vmux = TVP5150_COMPOSITE1, |
580 | .amux = 3, | 654 | .amux = EM28XX_AMUX_LINE_IN, |
655 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
581 | }, { | 656 | }, { |
582 | .type = EM28XX_VMUX_SVIDEO, | 657 | .type = EM28XX_VMUX_SVIDEO, |
583 | .vmux = TVP5150_SVIDEO, | 658 | .vmux = TVP5150_SVIDEO, |
584 | .amux = 1, | 659 | .amux = EM28XX_AMUX_LINE_IN, |
660 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
585 | } }, | 661 | } }, |
586 | }, | 662 | }, |
587 | [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = { | 663 | [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = { |
588 | .name = "Hauppauge WinTV HVR 950", | 664 | .name = "Hauppauge WinTV HVR 950", |
589 | .vchannels = 3, | ||
590 | .tda9887_conf = TDA9887_PRESENT, | ||
591 | .tuner_type = TUNER_XC2028, | 665 | .tuner_type = TUNER_XC2028, |
666 | .tuner_gpio = default_tuner_gpio, | ||
592 | .mts_firmware = 1, | 667 | .mts_firmware = 1, |
593 | .has_12mhz_i2s = 1, | ||
594 | .has_dvb = 1, | 668 | .has_dvb = 1, |
669 | .dvb_gpio = hauppauge_wintv_hvr_900_digital, | ||
670 | .ir_codes = ir_codes_hauppauge_new, | ||
595 | .decoder = EM28XX_TVP5150, | 671 | .decoder = EM28XX_TVP5150, |
596 | .input = { { | 672 | .input = { { |
597 | .type = EM28XX_VMUX_TELEVISION, | 673 | .type = EM28XX_VMUX_TELEVISION, |
598 | .vmux = TVP5150_COMPOSITE0, | 674 | .vmux = TVP5150_COMPOSITE0, |
599 | .amux = 0, | 675 | .amux = EM28XX_AMUX_VIDEO, |
676 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
600 | }, { | 677 | }, { |
601 | .type = EM28XX_VMUX_COMPOSITE1, | 678 | .type = EM28XX_VMUX_COMPOSITE1, |
602 | .vmux = TVP5150_COMPOSITE1, | 679 | .vmux = TVP5150_COMPOSITE1, |
603 | .amux = 1, | 680 | .amux = EM28XX_AMUX_LINE_IN, |
681 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
604 | }, { | 682 | }, { |
605 | .type = EM28XX_VMUX_SVIDEO, | 683 | .type = EM28XX_VMUX_SVIDEO, |
606 | .vmux = TVP5150_SVIDEO, | 684 | .vmux = TVP5150_SVIDEO, |
607 | .amux = 1, | 685 | .amux = EM28XX_AMUX_LINE_IN, |
686 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
608 | } }, | 687 | } }, |
609 | }, | 688 | }, |
610 | [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = { | 689 | [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = { |
611 | .name = "Pinnacle PCTV HD Pro Stick", | 690 | .name = "Pinnacle PCTV HD Pro Stick", |
612 | .vchannels = 3, | ||
613 | .tda9887_conf = TDA9887_PRESENT, | ||
614 | .tuner_type = TUNER_XC2028, | 691 | .tuner_type = TUNER_XC2028, |
692 | .tuner_gpio = default_tuner_gpio, | ||
615 | .mts_firmware = 1, | 693 | .mts_firmware = 1, |
616 | .has_12mhz_i2s = 1, | ||
617 | .has_dvb = 1, | 694 | .has_dvb = 1, |
695 | .dvb_gpio = hauppauge_wintv_hvr_900_digital, | ||
696 | .ir_codes = ir_codes_pinnacle_pctv_hd, | ||
618 | .decoder = EM28XX_TVP5150, | 697 | .decoder = EM28XX_TVP5150, |
619 | .input = { { | 698 | .input = { { |
620 | .type = EM28XX_VMUX_TELEVISION, | 699 | .type = EM28XX_VMUX_TELEVISION, |
621 | .vmux = TVP5150_COMPOSITE0, | 700 | .vmux = TVP5150_COMPOSITE0, |
622 | .amux = 0, | 701 | .amux = EM28XX_AMUX_VIDEO, |
702 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
623 | }, { | 703 | }, { |
624 | .type = EM28XX_VMUX_COMPOSITE1, | 704 | .type = EM28XX_VMUX_COMPOSITE1, |
625 | .vmux = TVP5150_COMPOSITE1, | 705 | .vmux = TVP5150_COMPOSITE1, |
626 | .amux = 1, | 706 | .amux = EM28XX_AMUX_LINE_IN, |
707 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
627 | }, { | 708 | }, { |
628 | .type = EM28XX_VMUX_SVIDEO, | 709 | .type = EM28XX_VMUX_SVIDEO, |
629 | .vmux = TVP5150_SVIDEO, | 710 | .vmux = TVP5150_SVIDEO, |
630 | .amux = 1, | 711 | .amux = EM28XX_AMUX_LINE_IN, |
712 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
631 | } }, | 713 | } }, |
632 | }, | 714 | }, |
633 | [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = { | 715 | [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = { |
634 | .name = "AMD ATI TV Wonder HD 600", | 716 | .name = "AMD ATI TV Wonder HD 600", |
635 | .vchannels = 3, | ||
636 | .tda9887_conf = TDA9887_PRESENT, | ||
637 | .tuner_type = TUNER_XC2028, | 717 | .tuner_type = TUNER_XC2028, |
718 | .tuner_gpio = default_tuner_gpio, | ||
638 | .mts_firmware = 1, | 719 | .mts_firmware = 1, |
639 | .has_12mhz_i2s = 1, | ||
640 | .has_dvb = 1, | 720 | .has_dvb = 1, |
721 | .dvb_gpio = hauppauge_wintv_hvr_900_digital, | ||
722 | .ir_codes = ir_codes_ati_tv_wonder_hd_600, | ||
641 | .decoder = EM28XX_TVP5150, | 723 | .decoder = EM28XX_TVP5150, |
642 | .input = { { | 724 | .input = { { |
643 | .type = EM28XX_VMUX_TELEVISION, | 725 | .type = EM28XX_VMUX_TELEVISION, |
644 | .vmux = TVP5150_COMPOSITE0, | 726 | .vmux = TVP5150_COMPOSITE0, |
645 | .amux = 0, | 727 | .amux = EM28XX_AMUX_VIDEO, |
728 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
646 | }, { | 729 | }, { |
647 | .type = EM28XX_VMUX_COMPOSITE1, | 730 | .type = EM28XX_VMUX_COMPOSITE1, |
648 | .vmux = TVP5150_COMPOSITE1, | 731 | .vmux = TVP5150_COMPOSITE1, |
649 | .amux = 1, | 732 | .amux = EM28XX_AMUX_LINE_IN, |
733 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
650 | }, { | 734 | }, { |
651 | .type = EM28XX_VMUX_SVIDEO, | 735 | .type = EM28XX_VMUX_SVIDEO, |
652 | .vmux = TVP5150_SVIDEO, | 736 | .vmux = TVP5150_SVIDEO, |
653 | .amux = 1, | 737 | .amux = EM28XX_AMUX_LINE_IN, |
738 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
654 | } }, | 739 | } }, |
655 | }, | 740 | }, |
656 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { | 741 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { |
657 | .name = "Terratec Hybrid XS", | 742 | .name = "Terratec Hybrid XS", |
658 | .vchannels = 3, | 743 | .tuner_type = TUNER_XC2028, |
659 | .tda9887_conf = TDA9887_PRESENT, | 744 | .tuner_gpio = default_tuner_gpio, |
660 | .tuner_type = TUNER_XC2028, | 745 | .decoder = EM28XX_TVP5150, |
661 | .decoder = EM28XX_TVP5150, | ||
662 | .has_dvb = 1, | 746 | .has_dvb = 1, |
747 | .dvb_gpio = default_analog, | ||
663 | .input = { { | 748 | .input = { { |
664 | .type = EM28XX_VMUX_TELEVISION, | 749 | .type = EM28XX_VMUX_TELEVISION, |
665 | .vmux = TVP5150_COMPOSITE0, | 750 | .vmux = TVP5150_COMPOSITE0, |
666 | .amux = 0, | 751 | .amux = EM28XX_AMUX_VIDEO, |
752 | .gpio = default_analog, | ||
667 | }, { | 753 | }, { |
668 | .type = EM28XX_VMUX_COMPOSITE1, | 754 | .type = EM28XX_VMUX_COMPOSITE1, |
669 | .vmux = TVP5150_COMPOSITE1, | 755 | .vmux = TVP5150_COMPOSITE1, |
670 | .amux = 1, | 756 | .amux = EM28XX_AMUX_LINE_IN, |
757 | .gpio = default_analog, | ||
671 | }, { | 758 | }, { |
672 | .type = EM28XX_VMUX_SVIDEO, | 759 | .type = EM28XX_VMUX_SVIDEO, |
673 | .vmux = TVP5150_SVIDEO, | 760 | .vmux = TVP5150_SVIDEO, |
674 | .amux = 1, | 761 | .amux = EM28XX_AMUX_LINE_IN, |
762 | .gpio = default_analog, | ||
675 | } }, | 763 | } }, |
676 | }, | 764 | }, |
677 | /* maybe there's a reason behind it why Terratec sells the Hybrid XS | 765 | /* maybe there's a reason behind it why Terratec sells the Hybrid XS |
@@ -679,172 +767,190 @@ struct em28xx_board em28xx_boards[] = { | |||
679 | maybe we'll need it lateron */ | 767 | maybe we'll need it lateron */ |
680 | [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { | 768 | [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { |
681 | .name = "Terratec Prodigy XS", | 769 | .name = "Terratec Prodigy XS", |
682 | .vchannels = 3, | ||
683 | .tda9887_conf = TDA9887_PRESENT, | ||
684 | .tuner_type = TUNER_XC2028, | 770 | .tuner_type = TUNER_XC2028, |
771 | .tuner_gpio = default_tuner_gpio, | ||
685 | .decoder = EM28XX_TVP5150, | 772 | .decoder = EM28XX_TVP5150, |
686 | .input = { { | 773 | .input = { { |
687 | .type = EM28XX_VMUX_TELEVISION, | 774 | .type = EM28XX_VMUX_TELEVISION, |
688 | .vmux = TVP5150_COMPOSITE0, | 775 | .vmux = TVP5150_COMPOSITE0, |
689 | .amux = 0, | 776 | .amux = EM28XX_AMUX_VIDEO, |
777 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
690 | }, { | 778 | }, { |
691 | .type = EM28XX_VMUX_COMPOSITE1, | 779 | .type = EM28XX_VMUX_COMPOSITE1, |
692 | .vmux = TVP5150_COMPOSITE1, | 780 | .vmux = TVP5150_COMPOSITE1, |
693 | .amux = 1, | 781 | .amux = EM28XX_AMUX_LINE_IN, |
782 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
694 | }, { | 783 | }, { |
695 | .type = EM28XX_VMUX_SVIDEO, | 784 | .type = EM28XX_VMUX_SVIDEO, |
696 | .vmux = TVP5150_SVIDEO, | 785 | .vmux = TVP5150_SVIDEO, |
697 | .amux = 1, | 786 | .amux = EM28XX_AMUX_LINE_IN, |
787 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
698 | } }, | 788 | } }, |
699 | }, | 789 | }, |
700 | [EM2820_BOARD_MSI_VOX_USB_2] = { | 790 | [EM2820_BOARD_MSI_VOX_USB_2] = { |
701 | .name = "MSI VOX USB 2.0", | 791 | .name = "MSI VOX USB 2.0", |
702 | .vchannels = 3, | ||
703 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 792 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
704 | .tda9887_conf = TDA9887_PRESENT | | 793 | .tda9887_conf = TDA9887_PRESENT | |
705 | TDA9887_PORT1_ACTIVE | | 794 | TDA9887_PORT1_ACTIVE | |
706 | TDA9887_PORT2_ACTIVE, | 795 | TDA9887_PORT2_ACTIVE, |
707 | .max_range_640_480 = 1, | 796 | .max_range_640_480 = 1, |
708 | 797 | .decoder = EM28XX_SAA711X, | |
709 | .decoder = EM28XX_SAA7114, | ||
710 | .input = { { | 798 | .input = { { |
711 | .type = EM28XX_VMUX_TELEVISION, | 799 | .type = EM28XX_VMUX_TELEVISION, |
712 | .vmux = SAA7115_COMPOSITE4, | 800 | .vmux = SAA7115_COMPOSITE4, |
713 | .amux = 0, | 801 | .amux = EM28XX_AMUX_VIDEO, |
714 | }, { | 802 | }, { |
715 | .type = EM28XX_VMUX_COMPOSITE1, | 803 | .type = EM28XX_VMUX_COMPOSITE1, |
716 | .vmux = SAA7115_COMPOSITE0, | 804 | .vmux = SAA7115_COMPOSITE0, |
717 | .amux = 1, | 805 | .amux = EM28XX_AMUX_LINE_IN, |
718 | }, { | 806 | }, { |
719 | .type = EM28XX_VMUX_SVIDEO, | 807 | .type = EM28XX_VMUX_SVIDEO, |
720 | .vmux = SAA7115_SVIDEO3, | 808 | .vmux = SAA7115_SVIDEO3, |
721 | .amux = 1, | 809 | .amux = EM28XX_AMUX_LINE_IN, |
722 | } }, | 810 | } }, |
723 | }, | 811 | }, |
724 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { | 812 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { |
725 | .name = "Terratec Cinergy 200 USB", | 813 | .name = "Terratec Cinergy 200 USB", |
726 | .is_em2800 = 1, | 814 | .is_em2800 = 1, |
727 | .vchannels = 3, | ||
728 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 815 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
729 | .tda9887_conf = TDA9887_PRESENT, | 816 | .tda9887_conf = TDA9887_PRESENT, |
730 | .decoder = EM28XX_SAA7113, | 817 | .decoder = EM28XX_SAA711X, |
731 | .input = { { | 818 | .input = { { |
732 | .type = EM28XX_VMUX_TELEVISION, | 819 | .type = EM28XX_VMUX_TELEVISION, |
733 | .vmux = SAA7115_COMPOSITE2, | 820 | .vmux = SAA7115_COMPOSITE2, |
734 | .amux = 0, | 821 | .amux = EM28XX_AMUX_VIDEO, |
735 | }, { | 822 | }, { |
736 | .type = EM28XX_VMUX_COMPOSITE1, | 823 | .type = EM28XX_VMUX_COMPOSITE1, |
737 | .vmux = SAA7115_COMPOSITE0, | 824 | .vmux = SAA7115_COMPOSITE0, |
738 | .amux = 1, | 825 | .amux = EM28XX_AMUX_LINE_IN, |
739 | }, { | 826 | }, { |
740 | .type = EM28XX_VMUX_SVIDEO, | 827 | .type = EM28XX_VMUX_SVIDEO, |
741 | .vmux = SAA7115_SVIDEO3, | 828 | .vmux = SAA7115_SVIDEO3, |
742 | .amux = 1, | 829 | .amux = EM28XX_AMUX_LINE_IN, |
743 | } }, | 830 | } }, |
744 | }, | 831 | }, |
745 | [EM2800_BOARD_GRABBEEX_USB2800] = { | 832 | [EM2800_BOARD_GRABBEEX_USB2800] = { |
746 | .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder", | 833 | .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder", |
747 | .is_em2800 = 1, | 834 | .is_em2800 = 1, |
748 | .vchannels = 2, | 835 | .decoder = EM28XX_SAA711X, |
749 | .decoder = EM28XX_SAA7113, | 836 | .tuner_type = TUNER_ABSENT, /* capture only board */ |
750 | .input = { { | 837 | .input = { { |
751 | .type = EM28XX_VMUX_COMPOSITE1, | 838 | .type = EM28XX_VMUX_COMPOSITE1, |
752 | .vmux = SAA7115_COMPOSITE0, | 839 | .vmux = SAA7115_COMPOSITE0, |
753 | .amux = 1, | 840 | .amux = EM28XX_AMUX_LINE_IN, |
754 | }, { | 841 | }, { |
755 | .type = EM28XX_VMUX_SVIDEO, | 842 | .type = EM28XX_VMUX_SVIDEO, |
756 | .vmux = SAA7115_SVIDEO3, | 843 | .vmux = SAA7115_SVIDEO3, |
757 | .amux = 1, | 844 | .amux = EM28XX_AMUX_LINE_IN, |
758 | } }, | 845 | } }, |
759 | }, | 846 | }, |
760 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { | 847 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { |
761 | .name = "Leadtek Winfast USB II", | 848 | .name = "Leadtek Winfast USB II", |
762 | .is_em2800 = 1, | 849 | .is_em2800 = 1, |
763 | .vchannels = 3, | ||
764 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 850 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
765 | .tda9887_conf = TDA9887_PRESENT, | 851 | .tda9887_conf = TDA9887_PRESENT, |
766 | .decoder = EM28XX_SAA7113, | 852 | .decoder = EM28XX_SAA711X, |
767 | .input = { { | 853 | .input = { { |
768 | .type = EM28XX_VMUX_TELEVISION, | 854 | .type = EM28XX_VMUX_TELEVISION, |
769 | .vmux = SAA7115_COMPOSITE2, | 855 | .vmux = SAA7115_COMPOSITE2, |
770 | .amux = 0, | 856 | .amux = EM28XX_AMUX_VIDEO, |
771 | }, { | 857 | }, { |
772 | .type = EM28XX_VMUX_COMPOSITE1, | 858 | .type = EM28XX_VMUX_COMPOSITE1, |
773 | .vmux = SAA7115_COMPOSITE0, | 859 | .vmux = SAA7115_COMPOSITE0, |
774 | .amux = 1, | 860 | .amux = EM28XX_AMUX_LINE_IN, |
775 | }, { | 861 | }, { |
776 | .type = EM28XX_VMUX_SVIDEO, | 862 | .type = EM28XX_VMUX_SVIDEO, |
777 | .vmux = SAA7115_SVIDEO3, | 863 | .vmux = SAA7115_SVIDEO3, |
778 | .amux = 1, | 864 | .amux = EM28XX_AMUX_LINE_IN, |
779 | } }, | 865 | } }, |
780 | }, | 866 | }, |
781 | [EM2800_BOARD_KWORLD_USB2800] = { | 867 | [EM2800_BOARD_KWORLD_USB2800] = { |
782 | .name = "Kworld USB2800", | 868 | .name = "Kworld USB2800", |
783 | .is_em2800 = 1, | 869 | .is_em2800 = 1, |
784 | .vchannels = 3, | ||
785 | .tuner_type = TUNER_PHILIPS_FCV1236D, | 870 | .tuner_type = TUNER_PHILIPS_FCV1236D, |
786 | .tda9887_conf = TDA9887_PRESENT, | 871 | .tda9887_conf = TDA9887_PRESENT, |
787 | .decoder = EM28XX_SAA7113, | 872 | .decoder = EM28XX_SAA711X, |
788 | .input = { { | 873 | .input = { { |
789 | .type = EM28XX_VMUX_TELEVISION, | 874 | .type = EM28XX_VMUX_TELEVISION, |
790 | .vmux = SAA7115_COMPOSITE2, | 875 | .vmux = SAA7115_COMPOSITE2, |
791 | .amux = 0, | 876 | .amux = EM28XX_AMUX_VIDEO, |
792 | }, { | 877 | }, { |
793 | .type = EM28XX_VMUX_COMPOSITE1, | 878 | .type = EM28XX_VMUX_COMPOSITE1, |
794 | .vmux = SAA7115_COMPOSITE0, | 879 | .vmux = SAA7115_COMPOSITE0, |
795 | .amux = 1, | 880 | .amux = EM28XX_AMUX_LINE_IN, |
796 | }, { | 881 | }, { |
797 | .type = EM28XX_VMUX_SVIDEO, | 882 | .type = EM28XX_VMUX_SVIDEO, |
798 | .vmux = SAA7115_SVIDEO3, | 883 | .vmux = SAA7115_SVIDEO3, |
799 | .amux = 1, | 884 | .amux = EM28XX_AMUX_LINE_IN, |
800 | } }, | 885 | } }, |
801 | }, | 886 | }, |
802 | [EM2820_BOARD_PINNACLE_DVC_90] = { | 887 | [EM2820_BOARD_PINNACLE_DVC_90] = { |
803 | .name = "Pinnacle Dazzle DVC 90/DVC 100", | 888 | .name = "Pinnacle Dazzle DVC 90/DVC 100", |
804 | .vchannels = 3, | 889 | .tuner_type = TUNER_ABSENT, /* capture only board */ |
805 | .tuner_type = TUNER_ABSENT, | 890 | .decoder = EM28XX_SAA711X, |
806 | .decoder = EM28XX_SAA7113, | 891 | .input = { { |
807 | .input = { { | ||
808 | .type = EM28XX_VMUX_COMPOSITE1, | 892 | .type = EM28XX_VMUX_COMPOSITE1, |
809 | .vmux = SAA7115_COMPOSITE0, | 893 | .vmux = SAA7115_COMPOSITE0, |
810 | .amux = 1, | 894 | .amux = EM28XX_AMUX_LINE_IN, |
811 | }, { | 895 | }, { |
812 | .type = EM28XX_VMUX_SVIDEO, | 896 | .type = EM28XX_VMUX_SVIDEO, |
813 | .vmux = SAA7115_SVIDEO3, | 897 | .vmux = SAA7115_SVIDEO3, |
814 | .amux = 1, | 898 | .amux = EM28XX_AMUX_LINE_IN, |
815 | } }, | 899 | } }, |
816 | }, | 900 | }, |
817 | [EM2800_BOARD_VGEAR_POCKETTV] = { | 901 | [EM2800_BOARD_VGEAR_POCKETTV] = { |
818 | .name = "V-Gear PocketTV", | 902 | .name = "V-Gear PocketTV", |
819 | .is_em2800 = 1, | 903 | .is_em2800 = 1, |
820 | .vchannels = 3, | ||
821 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 904 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
822 | .tda9887_conf = TDA9887_PRESENT, | 905 | .tda9887_conf = TDA9887_PRESENT, |
823 | .decoder = EM28XX_SAA7113, | 906 | .decoder = EM28XX_SAA711X, |
824 | .input = { { | 907 | .input = { { |
825 | .type = EM28XX_VMUX_TELEVISION, | 908 | .type = EM28XX_VMUX_TELEVISION, |
826 | .vmux = SAA7115_COMPOSITE2, | 909 | .vmux = SAA7115_COMPOSITE2, |
827 | .amux = 0, | 910 | .amux = EM28XX_AMUX_VIDEO, |
828 | }, { | 911 | }, { |
829 | .type = EM28XX_VMUX_COMPOSITE1, | 912 | .type = EM28XX_VMUX_COMPOSITE1, |
830 | .vmux = SAA7115_COMPOSITE0, | 913 | .vmux = SAA7115_COMPOSITE0, |
831 | .amux = 1, | 914 | .amux = EM28XX_AMUX_LINE_IN, |
915 | }, { | ||
916 | .type = EM28XX_VMUX_SVIDEO, | ||
917 | .vmux = SAA7115_SVIDEO3, | ||
918 | .amux = EM28XX_AMUX_LINE_IN, | ||
919 | } }, | ||
920 | }, | ||
921 | [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = { | ||
922 | .name = "Pixelview PlayTV Box 4 USB 2.0", | ||
923 | .tda9887_conf = TDA9887_PRESENT, | ||
924 | .tuner_type = TUNER_YMEC_TVF_5533MF, | ||
925 | .decoder = EM28XX_SAA711X, | ||
926 | .input = { { | ||
927 | .type = EM28XX_VMUX_TELEVISION, | ||
928 | .vmux = SAA7115_COMPOSITE2, | ||
929 | .amux = EM28XX_AMUX_VIDEO, | ||
930 | .aout = EM28XX_AOUT_MONO | /* I2S */ | ||
931 | EM28XX_AOUT_MASTER, /* Line out pin */ | ||
932 | }, { | ||
933 | .type = EM28XX_VMUX_COMPOSITE1, | ||
934 | .vmux = SAA7115_COMPOSITE0, | ||
935 | .amux = EM28XX_AMUX_LINE_IN, | ||
832 | }, { | 936 | }, { |
833 | .type = EM28XX_VMUX_SVIDEO, | 937 | .type = EM28XX_VMUX_SVIDEO, |
834 | .vmux = SAA7115_SVIDEO3, | 938 | .vmux = SAA7115_SVIDEO3, |
835 | .amux = 1, | 939 | .amux = EM28XX_AMUX_LINE_IN, |
836 | } }, | 940 | } }, |
837 | }, | 941 | }, |
838 | [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { | 942 | [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { |
839 | .name = "Pixelview Prolink PlayTV USB 2.0", | 943 | .name = "Pixelview Prolink PlayTV USB 2.0", |
840 | .vchannels = 3, | 944 | .has_snapshot_button = 1, |
841 | .tda9887_conf = TDA9887_PRESENT, | 945 | .tda9887_conf = TDA9887_PRESENT, |
842 | .tuner_type = TUNER_YMEC_TVF_5533MF, | 946 | .tuner_type = TUNER_YMEC_TVF_5533MF, |
843 | .decoder = EM28XX_SAA7113, | 947 | .decoder = EM28XX_SAA711X, |
844 | .input = { { | 948 | .input = { { |
845 | .type = EM28XX_VMUX_TELEVISION, | 949 | .type = EM28XX_VMUX_TELEVISION, |
846 | .vmux = SAA7115_COMPOSITE2, | 950 | .vmux = SAA7115_COMPOSITE2, |
847 | .amux = EM28XX_AMUX_LINE_IN, | 951 | .amux = EM28XX_AMUX_VIDEO, |
952 | .aout = EM28XX_AOUT_MONO | /* I2S */ | ||
953 | EM28XX_AOUT_MASTER, /* Line out pin */ | ||
848 | }, { | 954 | }, { |
849 | .type = EM28XX_VMUX_COMPOSITE1, | 955 | .type = EM28XX_VMUX_COMPOSITE1, |
850 | .vmux = SAA7115_COMPOSITE0, | 956 | .vmux = SAA7115_COMPOSITE0, |
@@ -856,228 +962,252 @@ struct em28xx_board em28xx_boards[] = { | |||
856 | } }, | 962 | } }, |
857 | }, | 963 | }, |
858 | [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = { | 964 | [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = { |
859 | .name = "PointNix Intra-Oral Camera", | 965 | .name = "PointNix Intra-Oral Camera", |
860 | .has_snapshot_button = 1, | 966 | .has_snapshot_button = 1, |
861 | .vchannels = 1, | 967 | .tda9887_conf = TDA9887_PRESENT, |
862 | .tda9887_conf = TDA9887_PRESENT, | 968 | .tuner_type = TUNER_ABSENT, |
863 | .tuner_type = TUNER_ABSENT, | 969 | .decoder = EM28XX_SAA711X, |
864 | .decoder = EM28XX_SAA7113, | 970 | .input = { { |
865 | .input = { { | ||
866 | .type = EM28XX_VMUX_SVIDEO, | 971 | .type = EM28XX_VMUX_SVIDEO, |
867 | .vmux = SAA7115_SVIDEO3, | 972 | .vmux = SAA7115_SVIDEO3, |
868 | .amux = 0, | 973 | .amux = EM28XX_AMUX_VIDEO, |
869 | } }, | 974 | } }, |
870 | }, | 975 | }, |
871 | [EM2880_BOARD_MSI_DIGIVOX_AD] = { | 976 | [EM2880_BOARD_MSI_DIGIVOX_AD] = { |
872 | .name = "MSI DigiVox A/D", | 977 | .name = "MSI DigiVox A/D", |
873 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 978 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
874 | .vchannels = 3, | ||
875 | .tuner_type = TUNER_XC2028, | 979 | .tuner_type = TUNER_XC2028, |
980 | .tuner_gpio = default_tuner_gpio, | ||
876 | .decoder = EM28XX_TVP5150, | 981 | .decoder = EM28XX_TVP5150, |
877 | .input = { { | 982 | .input = { { |
878 | .type = EM28XX_VMUX_TELEVISION, | 983 | .type = EM28XX_VMUX_TELEVISION, |
879 | .vmux = TVP5150_COMPOSITE0, | 984 | .vmux = TVP5150_COMPOSITE0, |
880 | .amux = 0, | 985 | .amux = EM28XX_AMUX_VIDEO, |
986 | .gpio = em2880_msi_digivox_ad_analog, | ||
881 | }, { | 987 | }, { |
882 | .type = EM28XX_VMUX_COMPOSITE1, | 988 | .type = EM28XX_VMUX_COMPOSITE1, |
883 | .vmux = TVP5150_COMPOSITE1, | 989 | .vmux = TVP5150_COMPOSITE1, |
884 | .amux = 1, | 990 | .amux = EM28XX_AMUX_LINE_IN, |
991 | .gpio = em2880_msi_digivox_ad_analog, | ||
885 | }, { | 992 | }, { |
886 | .type = EM28XX_VMUX_SVIDEO, | 993 | .type = EM28XX_VMUX_SVIDEO, |
887 | .vmux = TVP5150_SVIDEO, | 994 | .vmux = TVP5150_SVIDEO, |
888 | .amux = 1, | 995 | .amux = EM28XX_AMUX_LINE_IN, |
996 | .gpio = em2880_msi_digivox_ad_analog, | ||
889 | } }, | 997 | } }, |
890 | }, | 998 | }, |
891 | [EM2880_BOARD_MSI_DIGIVOX_AD_II] = { | 999 | [EM2880_BOARD_MSI_DIGIVOX_AD_II] = { |
892 | .name = "MSI DigiVox A/D II", | 1000 | .name = "MSI DigiVox A/D II", |
893 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1001 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
894 | .vchannels = 3, | ||
895 | .tuner_type = TUNER_XC2028, | 1002 | .tuner_type = TUNER_XC2028, |
1003 | .tuner_gpio = default_tuner_gpio, | ||
896 | .decoder = EM28XX_TVP5150, | 1004 | .decoder = EM28XX_TVP5150, |
897 | .input = { { | 1005 | .input = { { |
898 | .type = EM28XX_VMUX_TELEVISION, | 1006 | .type = EM28XX_VMUX_TELEVISION, |
899 | .vmux = TVP5150_COMPOSITE0, | 1007 | .vmux = TVP5150_COMPOSITE0, |
900 | .amux = 0, | 1008 | .amux = EM28XX_AMUX_VIDEO, |
1009 | .gpio = em2880_msi_digivox_ad_analog, | ||
901 | }, { | 1010 | }, { |
902 | .type = EM28XX_VMUX_COMPOSITE1, | 1011 | .type = EM28XX_VMUX_COMPOSITE1, |
903 | .vmux = TVP5150_COMPOSITE1, | 1012 | .vmux = TVP5150_COMPOSITE1, |
904 | .amux = 1, | 1013 | .amux = EM28XX_AMUX_LINE_IN, |
1014 | .gpio = em2880_msi_digivox_ad_analog, | ||
905 | }, { | 1015 | }, { |
906 | .type = EM28XX_VMUX_SVIDEO, | 1016 | .type = EM28XX_VMUX_SVIDEO, |
907 | .vmux = TVP5150_SVIDEO, | 1017 | .vmux = TVP5150_SVIDEO, |
908 | .amux = 1, | 1018 | .amux = EM28XX_AMUX_LINE_IN, |
1019 | .gpio = em2880_msi_digivox_ad_analog, | ||
909 | } }, | 1020 | } }, |
910 | }, | 1021 | }, |
911 | [EM2880_BOARD_KWORLD_DVB_305U] = { | 1022 | [EM2880_BOARD_KWORLD_DVB_305U] = { |
912 | .name = "KWorld DVB-T 305U", | 1023 | .name = "KWorld DVB-T 305U", |
913 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1024 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
914 | .vchannels = 3, | ||
915 | .tuner_type = TUNER_XC2028, | 1025 | .tuner_type = TUNER_XC2028, |
1026 | .tuner_gpio = default_tuner_gpio, | ||
916 | .decoder = EM28XX_TVP5150, | 1027 | .decoder = EM28XX_TVP5150, |
917 | .input = { { | 1028 | .input = { { |
918 | .type = EM28XX_VMUX_TELEVISION, | 1029 | .type = EM28XX_VMUX_TELEVISION, |
919 | .vmux = TVP5150_COMPOSITE0, | 1030 | .vmux = TVP5150_COMPOSITE0, |
920 | .amux = 0, | 1031 | .amux = EM28XX_AMUX_VIDEO, |
921 | }, { | 1032 | }, { |
922 | .type = EM28XX_VMUX_COMPOSITE1, | 1033 | .type = EM28XX_VMUX_COMPOSITE1, |
923 | .vmux = TVP5150_COMPOSITE1, | 1034 | .vmux = TVP5150_COMPOSITE1, |
924 | .amux = 1, | 1035 | .amux = EM28XX_AMUX_LINE_IN, |
925 | }, { | 1036 | }, { |
926 | .type = EM28XX_VMUX_SVIDEO, | 1037 | .type = EM28XX_VMUX_SVIDEO, |
927 | .vmux = TVP5150_SVIDEO, | 1038 | .vmux = TVP5150_SVIDEO, |
928 | .amux = 1, | 1039 | .amux = EM28XX_AMUX_LINE_IN, |
929 | } }, | 1040 | } }, |
930 | }, | 1041 | }, |
931 | [EM2880_BOARD_KWORLD_DVB_310U] = { | 1042 | [EM2880_BOARD_KWORLD_DVB_310U] = { |
932 | .name = "KWorld DVB-T 310U", | 1043 | .name = "KWorld DVB-T 310U", |
933 | .vchannels = 3, | ||
934 | .tuner_type = TUNER_XC2028, | 1044 | .tuner_type = TUNER_XC2028, |
1045 | .tuner_gpio = default_tuner_gpio, | ||
935 | .has_dvb = 1, | 1046 | .has_dvb = 1, |
1047 | .dvb_gpio = default_digital, | ||
936 | .mts_firmware = 1, | 1048 | .mts_firmware = 1, |
937 | .decoder = EM28XX_TVP5150, | 1049 | .decoder = EM28XX_TVP5150, |
938 | .input = { { | 1050 | .input = { { |
939 | .type = EM28XX_VMUX_TELEVISION, | 1051 | .type = EM28XX_VMUX_TELEVISION, |
940 | .vmux = TVP5150_COMPOSITE0, | 1052 | .vmux = TVP5150_COMPOSITE0, |
941 | .amux = EM28XX_AMUX_VIDEO, | 1053 | .amux = EM28XX_AMUX_VIDEO, |
1054 | .gpio = default_analog, | ||
942 | }, { | 1055 | }, { |
943 | .type = EM28XX_VMUX_COMPOSITE1, | 1056 | .type = EM28XX_VMUX_COMPOSITE1, |
944 | .vmux = TVP5150_COMPOSITE1, | 1057 | .vmux = TVP5150_COMPOSITE1, |
945 | .amux = EM28XX_AMUX_AC97_LINE_IN, | 1058 | .amux = EM28XX_AMUX_LINE_IN, |
1059 | .gpio = default_analog, | ||
946 | }, { /* S-video has not been tested yet */ | 1060 | }, { /* S-video has not been tested yet */ |
947 | .type = EM28XX_VMUX_SVIDEO, | 1061 | .type = EM28XX_VMUX_SVIDEO, |
948 | .vmux = TVP5150_SVIDEO, | 1062 | .vmux = TVP5150_SVIDEO, |
949 | .amux = EM28XX_AMUX_AC97_LINE_IN, | 1063 | .amux = EM28XX_AMUX_LINE_IN, |
1064 | .gpio = default_analog, | ||
950 | } }, | 1065 | } }, |
951 | }, | 1066 | }, |
952 | [EM2881_BOARD_DNT_DA2_HYBRID] = { | 1067 | [EM2881_BOARD_DNT_DA2_HYBRID] = { |
953 | .name = "DNT DA2 Hybrid", | 1068 | .name = "DNT DA2 Hybrid", |
954 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1069 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
955 | .vchannels = 3, | ||
956 | .tuner_type = TUNER_XC2028, | 1070 | .tuner_type = TUNER_XC2028, |
1071 | .tuner_gpio = default_tuner_gpio, | ||
957 | .decoder = EM28XX_TVP5150, | 1072 | .decoder = EM28XX_TVP5150, |
958 | .input = { { | 1073 | .input = { { |
959 | .type = EM28XX_VMUX_TELEVISION, | 1074 | .type = EM28XX_VMUX_TELEVISION, |
960 | .vmux = TVP5150_COMPOSITE0, | 1075 | .vmux = TVP5150_COMPOSITE0, |
961 | .amux = 0, | 1076 | .amux = EM28XX_AMUX_VIDEO, |
1077 | .gpio = default_analog, | ||
962 | }, { | 1078 | }, { |
963 | .type = EM28XX_VMUX_COMPOSITE1, | 1079 | .type = EM28XX_VMUX_COMPOSITE1, |
964 | .vmux = TVP5150_COMPOSITE1, | 1080 | .vmux = TVP5150_COMPOSITE1, |
965 | .amux = 1, | 1081 | .amux = EM28XX_AMUX_LINE_IN, |
1082 | .gpio = default_analog, | ||
966 | }, { | 1083 | }, { |
967 | .type = EM28XX_VMUX_SVIDEO, | 1084 | .type = EM28XX_VMUX_SVIDEO, |
968 | .vmux = TVP5150_SVIDEO, | 1085 | .vmux = TVP5150_SVIDEO, |
969 | .amux = 1, | 1086 | .amux = EM28XX_AMUX_LINE_IN, |
1087 | .gpio = default_analog, | ||
970 | } }, | 1088 | } }, |
971 | }, | 1089 | }, |
972 | [EM2881_BOARD_PINNACLE_HYBRID_PRO] = { | 1090 | [EM2881_BOARD_PINNACLE_HYBRID_PRO] = { |
973 | .name = "Pinnacle Hybrid Pro", | 1091 | .name = "Pinnacle Hybrid Pro", |
974 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1092 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
975 | .vchannels = 3, | ||
976 | .tuner_type = TUNER_XC2028, | 1093 | .tuner_type = TUNER_XC2028, |
1094 | .tuner_gpio = default_tuner_gpio, | ||
977 | .decoder = EM28XX_TVP5150, | 1095 | .decoder = EM28XX_TVP5150, |
978 | .input = { { | 1096 | .input = { { |
979 | .type = EM28XX_VMUX_TELEVISION, | 1097 | .type = EM28XX_VMUX_TELEVISION, |
980 | .vmux = TVP5150_COMPOSITE0, | 1098 | .vmux = TVP5150_COMPOSITE0, |
981 | .amux = 0, | 1099 | .amux = EM28XX_AMUX_VIDEO, |
1100 | .gpio = default_analog, | ||
982 | }, { | 1101 | }, { |
983 | .type = EM28XX_VMUX_COMPOSITE1, | 1102 | .type = EM28XX_VMUX_COMPOSITE1, |
984 | .vmux = TVP5150_COMPOSITE1, | 1103 | .vmux = TVP5150_COMPOSITE1, |
985 | .amux = 1, | 1104 | .amux = EM28XX_AMUX_LINE_IN, |
1105 | .gpio = default_analog, | ||
986 | }, { | 1106 | }, { |
987 | .type = EM28XX_VMUX_SVIDEO, | 1107 | .type = EM28XX_VMUX_SVIDEO, |
988 | .vmux = TVP5150_SVIDEO, | 1108 | .vmux = TVP5150_SVIDEO, |
989 | .amux = 1, | 1109 | .amux = EM28XX_AMUX_LINE_IN, |
1110 | .gpio = default_analog, | ||
990 | } }, | 1111 | } }, |
991 | }, | 1112 | }, |
992 | [EM2882_BOARD_PINNACLE_HYBRID_PRO] = { | 1113 | [EM2882_BOARD_PINNACLE_HYBRID_PRO] = { |
993 | .name = "Pinnacle Hybrid Pro (2)", | 1114 | .name = "Pinnacle Hybrid Pro (2)", |
994 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1115 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
995 | .vchannels = 3, | ||
996 | .tuner_type = TUNER_XC2028, | 1116 | .tuner_type = TUNER_XC2028, |
1117 | .tuner_gpio = default_tuner_gpio, | ||
997 | .mts_firmware = 1, | 1118 | .mts_firmware = 1, |
998 | .decoder = EM28XX_TVP5150, | 1119 | .decoder = EM28XX_TVP5150, |
999 | .input = { { | 1120 | .input = { { |
1000 | .type = EM28XX_VMUX_TELEVISION, | 1121 | .type = EM28XX_VMUX_TELEVISION, |
1001 | .vmux = TVP5150_COMPOSITE0, | 1122 | .vmux = TVP5150_COMPOSITE0, |
1002 | .amux = 0, | 1123 | .amux = EM28XX_AMUX_VIDEO, |
1124 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1003 | }, { | 1125 | }, { |
1004 | .type = EM28XX_VMUX_COMPOSITE1, | 1126 | .type = EM28XX_VMUX_COMPOSITE1, |
1005 | .vmux = TVP5150_COMPOSITE1, | 1127 | .vmux = TVP5150_COMPOSITE1, |
1006 | .amux = 1, | 1128 | .amux = EM28XX_AMUX_LINE_IN, |
1129 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1007 | }, { | 1130 | }, { |
1008 | .type = EM28XX_VMUX_SVIDEO, | 1131 | .type = EM28XX_VMUX_SVIDEO, |
1009 | .vmux = TVP5150_SVIDEO, | 1132 | .vmux = TVP5150_SVIDEO, |
1010 | .amux = 1, | 1133 | .amux = EM28XX_AMUX_LINE_IN, |
1134 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1011 | } }, | 1135 | } }, |
1012 | }, | 1136 | }, |
1013 | [EM2882_BOARD_KWORLD_VS_DVBT] = { | 1137 | [EM2882_BOARD_KWORLD_VS_DVBT] = { |
1014 | .name = "Kworld VS-DVB-T 323UR", | 1138 | .name = "Kworld VS-DVB-T 323UR", |
1015 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1139 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
1016 | .vchannels = 3, | ||
1017 | .tuner_type = TUNER_XC2028, | 1140 | .tuner_type = TUNER_XC2028, |
1141 | .tuner_gpio = default_tuner_gpio, | ||
1018 | .decoder = EM28XX_TVP5150, | 1142 | .decoder = EM28XX_TVP5150, |
1019 | .input = { { | 1143 | .input = { { |
1020 | .type = EM28XX_VMUX_TELEVISION, | 1144 | .type = EM28XX_VMUX_TELEVISION, |
1021 | .vmux = TVP5150_COMPOSITE0, | 1145 | .vmux = TVP5150_COMPOSITE0, |
1022 | .amux = 0, | 1146 | .amux = EM28XX_AMUX_VIDEO, |
1023 | }, { | 1147 | }, { |
1024 | .type = EM28XX_VMUX_COMPOSITE1, | 1148 | .type = EM28XX_VMUX_COMPOSITE1, |
1025 | .vmux = TVP5150_COMPOSITE1, | 1149 | .vmux = TVP5150_COMPOSITE1, |
1026 | .amux = 1, | 1150 | .amux = EM28XX_AMUX_LINE_IN, |
1027 | }, { | 1151 | }, { |
1028 | .type = EM28XX_VMUX_SVIDEO, | 1152 | .type = EM28XX_VMUX_SVIDEO, |
1029 | .vmux = TVP5150_SVIDEO, | 1153 | .vmux = TVP5150_SVIDEO, |
1030 | .amux = 1, | 1154 | .amux = EM28XX_AMUX_LINE_IN, |
1031 | } }, | 1155 | } }, |
1032 | }, | 1156 | }, |
1033 | [EM2882_BOARD_TERRATEC_HYBRID_XS] = { | 1157 | [EM2882_BOARD_TERRATEC_HYBRID_XS] = { |
1034 | .name = "Terratec Hybrid XS (em2882)", | 1158 | .name = "Terratec Hybrid XS (em2882)", |
1035 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1159 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
1036 | .vchannels = 3, | ||
1037 | .tuner_type = TUNER_XC2028, | 1160 | .tuner_type = TUNER_XC2028, |
1161 | .tuner_gpio = default_tuner_gpio, | ||
1038 | .decoder = EM28XX_TVP5150, | 1162 | .decoder = EM28XX_TVP5150, |
1039 | .input = { { | 1163 | .input = { { |
1040 | .type = EM28XX_VMUX_TELEVISION, | 1164 | .type = EM28XX_VMUX_TELEVISION, |
1041 | .vmux = TVP5150_COMPOSITE0, | 1165 | .vmux = TVP5150_COMPOSITE0, |
1042 | .amux = 0, | 1166 | .amux = EM28XX_AMUX_VIDEO, |
1167 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1043 | }, { | 1168 | }, { |
1044 | .type = EM28XX_VMUX_COMPOSITE1, | 1169 | .type = EM28XX_VMUX_COMPOSITE1, |
1045 | .vmux = TVP5150_COMPOSITE1, | 1170 | .vmux = TVP5150_COMPOSITE1, |
1046 | .amux = 1, | 1171 | .amux = EM28XX_AMUX_LINE_IN, |
1172 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1047 | }, { | 1173 | }, { |
1048 | .type = EM28XX_VMUX_SVIDEO, | 1174 | .type = EM28XX_VMUX_SVIDEO, |
1049 | .vmux = TVP5150_SVIDEO, | 1175 | .vmux = TVP5150_SVIDEO, |
1050 | .amux = 1, | 1176 | .amux = EM28XX_AMUX_LINE_IN, |
1177 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1051 | } }, | 1178 | } }, |
1052 | }, | 1179 | }, |
1053 | [EM2883_BOARD_KWORLD_HYBRID_A316] = { | 1180 | [EM2883_BOARD_KWORLD_HYBRID_A316] = { |
1054 | .name = "Kworld PlusTV HD Hybrid 330", | 1181 | .name = "Kworld PlusTV HD Hybrid 330", |
1055 | .valid = EM28XX_BOARD_NOT_VALIDATED, | ||
1056 | .vchannels = 3, | ||
1057 | .is_em2800 = 0, | ||
1058 | .tuner_type = TUNER_XC2028, | 1182 | .tuner_type = TUNER_XC2028, |
1183 | .tuner_gpio = default_tuner_gpio, | ||
1059 | .decoder = EM28XX_TVP5150, | 1184 | .decoder = EM28XX_TVP5150, |
1060 | .input = { { | 1185 | .mts_firmware = 1, |
1186 | .has_dvb = 1, | ||
1187 | .dvb_gpio = default_digital, | ||
1188 | .input = { { | ||
1061 | .type = EM28XX_VMUX_TELEVISION, | 1189 | .type = EM28XX_VMUX_TELEVISION, |
1062 | .vmux = TVP5150_COMPOSITE0, | 1190 | .vmux = TVP5150_COMPOSITE0, |
1063 | .amux = 0, | 1191 | .amux = EM28XX_AMUX_VIDEO, |
1192 | .gpio = default_analog, | ||
1064 | }, { | 1193 | }, { |
1065 | .type = EM28XX_VMUX_COMPOSITE1, | 1194 | .type = EM28XX_VMUX_COMPOSITE1, |
1066 | .vmux = TVP5150_COMPOSITE1, | 1195 | .vmux = TVP5150_COMPOSITE1, |
1067 | .amux = 1, | 1196 | .amux = EM28XX_AMUX_LINE_IN, |
1197 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1068 | }, { | 1198 | }, { |
1069 | .type = EM28XX_VMUX_SVIDEO, | 1199 | .type = EM28XX_VMUX_SVIDEO, |
1070 | .vmux = TVP5150_SVIDEO, | 1200 | .vmux = TVP5150_SVIDEO, |
1071 | .amux = 1, | 1201 | .amux = EM28XX_AMUX_LINE_IN, |
1202 | .gpio = hauppauge_wintv_hvr_900_analog, | ||
1072 | } }, | 1203 | } }, |
1073 | }, | 1204 | }, |
1074 | [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = { | 1205 | [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = { |
1075 | .name = "Compro VideoMate ForYou/Stereo", | 1206 | .name = "Compro VideoMate ForYou/Stereo", |
1076 | .vchannels = 2, | ||
1077 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | 1207 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
1078 | .tda9887_conf = TDA9887_PRESENT, | 1208 | .tda9887_conf = TDA9887_PRESENT, |
1079 | .decoder = EM28XX_TVP5150, | 1209 | .decoder = EM28XX_TVP5150, |
1080 | .input = { { | 1210 | .input = { { |
1081 | .type = EM28XX_VMUX_TELEVISION, | 1211 | .type = EM28XX_VMUX_TELEVISION, |
1082 | .vmux = TVP5150_COMPOSITE0, | 1212 | .vmux = TVP5150_COMPOSITE0, |
1083 | .amux = EM28XX_AMUX_LINE_IN, | 1213 | .amux = EM28XX_AMUX_LINE_IN, |
@@ -1101,7 +1231,7 @@ struct usb_device_id em28xx_id_table [] = { | |||
1101 | { USB_DEVICE(0xeb1a, 0x2820), | 1231 | { USB_DEVICE(0xeb1a, 0x2820), |
1102 | .driver_info = EM2820_BOARD_UNKNOWN }, | 1232 | .driver_info = EM2820_BOARD_UNKNOWN }, |
1103 | { USB_DEVICE(0xeb1a, 0x2821), | 1233 | { USB_DEVICE(0xeb1a, 0x2821), |
1104 | .driver_info = EM2820_BOARD_PROLINK_PLAYTV_USB2 }, | 1234 | .driver_info = EM2820_BOARD_UNKNOWN }, |
1105 | { USB_DEVICE(0xeb1a, 0x2860), | 1235 | { USB_DEVICE(0xeb1a, 0x2860), |
1106 | .driver_info = EM2820_BOARD_UNKNOWN }, | 1236 | .driver_info = EM2820_BOARD_UNKNOWN }, |
1107 | { USB_DEVICE(0xeb1a, 0x2861), | 1237 | { USB_DEVICE(0xeb1a, 0x2861), |
@@ -1164,8 +1294,8 @@ struct usb_device_id em28xx_id_table [] = { | |||
1164 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | 1294 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
1165 | { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */ | 1295 | { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */ |
1166 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | 1296 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
1167 | { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */ | 1297 | { USB_DEVICE(0x2040, 0x651f), |
1168 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | 1298 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 }, |
1169 | { USB_DEVICE(0x0438, 0xb002), | 1299 | { USB_DEVICE(0x0438, 0xb002), |
1170 | .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 }, | 1300 | .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 }, |
1171 | { USB_DEVICE(0x2001, 0xf112), | 1301 | { USB_DEVICE(0x2001, 0xf112), |
@@ -1189,78 +1319,12 @@ struct usb_device_id em28xx_id_table [] = { | |||
1189 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); | 1319 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); |
1190 | 1320 | ||
1191 | /* | 1321 | /* |
1192 | * Reset sequences for analog/digital modes | ||
1193 | */ | ||
1194 | |||
1195 | /* Reset for the most [analog] boards */ | ||
1196 | static struct em28xx_reg_seq default_analog[] = { | ||
1197 | {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10}, | ||
1198 | { -1, -1, -1, -1}, | ||
1199 | }; | ||
1200 | |||
1201 | /* Reset for the most [digital] boards */ | ||
1202 | static struct em28xx_reg_seq default_digital[] = { | ||
1203 | {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10}, | ||
1204 | { -1, -1, -1, -1}, | ||
1205 | }; | ||
1206 | |||
1207 | /* Board Hauppauge WinTV HVR 900 analog */ | ||
1208 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { | ||
1209 | {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10}, | ||
1210 | {0x05, 0xff, 0x10, 10}, | ||
1211 | { -1, -1, -1, -1}, | ||
1212 | }; | ||
1213 | |||
1214 | /* Board Hauppauge WinTV HVR 900 digital */ | ||
1215 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { | ||
1216 | {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10}, | ||
1217 | {EM2880_R04_GPO, 0x04, 0x0f, 10}, | ||
1218 | {EM2880_R04_GPO, 0x0c, 0x0f, 10}, | ||
1219 | { -1, -1, -1, -1}, | ||
1220 | }; | ||
1221 | |||
1222 | /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ | ||
1223 | static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { | ||
1224 | {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10}, | ||
1225 | { -1, -1, -1, -1}, | ||
1226 | }; | ||
1227 | |||
1228 | /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ | ||
1229 | static struct em28xx_reg_seq em2880_msi_digivox_ad_digital[] = { | ||
1230 | {EM28XX_R08_GPIO, 0x6a, ~EM_GPIO_4, 10}, | ||
1231 | { -1, -1, -1, -1}, | ||
1232 | }; | ||
1233 | |||
1234 | /* Board - EM2870 Kworld 355u | ||
1235 | Analog - No input analog */ | ||
1236 | static struct em28xx_reg_seq em2870_kworld_355u_digital[] = { | ||
1237 | {EM2880_R04_GPO, 0x01, 0xff, 10}, | ||
1238 | { -1, -1, -1, -1}, | ||
1239 | }; | ||
1240 | |||
1241 | /* Callback for the most boards */ | ||
1242 | static struct em28xx_reg_seq default_callback[] = { | ||
1243 | {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, | ||
1244 | {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10}, | ||
1245 | {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, | ||
1246 | { -1, -1, -1, -1}, | ||
1247 | }; | ||
1248 | |||
1249 | /* Callback for EM2882 TERRATEC HYBRID XS */ | ||
1250 | static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = { | ||
1251 | {EM28XX_R08_GPIO, 0x2e, 0xff, 6}, | ||
1252 | {EM28XX_R08_GPIO, 0x3e, ~EM_GPIO_4, 6}, | ||
1253 | {EM2880_R04_GPO, 0x04, 0xff, 10}, | ||
1254 | {EM2880_R04_GPO, 0x0c, 0xff, 10}, | ||
1255 | { -1, -1, -1, -1}, | ||
1256 | }; | ||
1257 | |||
1258 | /* | ||
1259 | * EEPROM hash table for devices with generic USB IDs | 1322 | * EEPROM hash table for devices with generic USB IDs |
1260 | */ | 1323 | */ |
1261 | static struct em28xx_hash_table em28xx_eeprom_hash [] = { | 1324 | static struct em28xx_hash_table em28xx_eeprom_hash [] = { |
1262 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ | 1325 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ |
1263 | {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, | 1326 | {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, |
1327 | {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF}, | ||
1264 | {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028}, | 1328 | {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028}, |
1265 | }; | 1329 | }; |
1266 | 1330 | ||
@@ -1282,27 +1346,26 @@ int em28xx_tuner_callback(void *ptr, int component, int command, int arg) | |||
1282 | if (command != XC2028_TUNER_RESET) | 1346 | if (command != XC2028_TUNER_RESET) |
1283 | return 0; | 1347 | return 0; |
1284 | 1348 | ||
1285 | if (dev->mode == EM28XX_ANALOG_MODE) | 1349 | rc = em28xx_gpio_set(dev, dev->board.tuner_gpio); |
1286 | rc = em28xx_gpio_set(dev, dev->tun_analog_gpio); | ||
1287 | else | ||
1288 | rc = em28xx_gpio_set(dev, dev->tun_digital_gpio); | ||
1289 | 1350 | ||
1290 | return rc; | 1351 | return rc; |
1291 | } | 1352 | } |
1292 | EXPORT_SYMBOL_GPL(em28xx_tuner_callback); | 1353 | EXPORT_SYMBOL_GPL(em28xx_tuner_callback); |
1293 | 1354 | ||
1294 | static void em28xx_set_model(struct em28xx *dev) | 1355 | static void inline em28xx_set_model(struct em28xx *dev) |
1295 | { | 1356 | { |
1296 | dev->is_em2800 = em28xx_boards[dev->model].is_em2800; | 1357 | memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board)); |
1297 | dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx; | 1358 | |
1298 | dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; | 1359 | /* Those are the default values for the majority of boards |
1299 | dev->decoder = em28xx_boards[dev->model].decoder; | 1360 | Use those values if not specified otherwise at boards entry |
1300 | dev->video_inputs = em28xx_boards[dev->model].vchannels; | 1361 | */ |
1301 | dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s; | 1362 | if (!dev->board.xclk) |
1302 | dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480; | 1363 | dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE | |
1303 | dev->has_dvb = em28xx_boards[dev->model].has_dvb; | 1364 | EM28XX_XCLK_FREQUENCY_12MHZ; |
1304 | dev->has_snapshot_button = em28xx_boards[dev->model].has_snapshot_button; | 1365 | |
1305 | dev->valid = em28xx_boards[dev->model].valid; | 1366 | if (!dev->board.i2c_speed) |
1367 | dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | | ||
1368 | EM28XX_I2C_FREQ_100_KHZ; | ||
1306 | } | 1369 | } |
1307 | 1370 | ||
1308 | /* Since em28xx_pre_card_setup() requires a proper dev->model, | 1371 | /* Since em28xx_pre_card_setup() requires a proper dev->model, |
@@ -1312,205 +1375,126 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1312 | { | 1375 | { |
1313 | int rc; | 1376 | int rc; |
1314 | 1377 | ||
1315 | rc = em28xx_read_reg(dev, EM2880_R04_GPO); | 1378 | em28xx_set_model(dev); |
1316 | if (rc >= 0) | 1379 | |
1317 | dev->reg_gpo = rc; | 1380 | em28xx_info("Identified as %s (card=%d)\n", |
1381 | dev->board.name, dev->model); | ||
1382 | |||
1383 | /* Set the default GPO/GPIO for legacy devices */ | ||
1384 | dev->reg_gpo_num = EM2880_R04_GPO; | ||
1385 | dev->reg_gpio_num = EM28XX_R08_GPIO; | ||
1318 | 1386 | ||
1319 | dev->wait_after_write = 5; | 1387 | dev->wait_after_write = 5; |
1388 | |||
1389 | /* Based on the Chip ID, set the device configuration */ | ||
1320 | rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID); | 1390 | rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID); |
1321 | if (rc > 0) { | 1391 | if (rc > 0) { |
1322 | switch (rc) { | 1392 | dev->chip_id = rc; |
1393 | |||
1394 | switch (dev->chip_id) { | ||
1395 | case CHIP_ID_EM2750: | ||
1396 | em28xx_info("chip ID is em2750\n"); | ||
1397 | break; | ||
1398 | case CHIP_ID_EM2820: | ||
1399 | em28xx_info("chip ID is em2820\n"); | ||
1400 | break; | ||
1401 | case CHIP_ID_EM2840: | ||
1402 | em28xx_info("chip ID is em2840\n"); | ||
1403 | break; | ||
1323 | case CHIP_ID_EM2860: | 1404 | case CHIP_ID_EM2860: |
1324 | em28xx_info("chip ID is em2860\n"); | 1405 | em28xx_info("chip ID is em2860\n"); |
1325 | break; | 1406 | break; |
1407 | case CHIP_ID_EM2870: | ||
1408 | em28xx_info("chip ID is em2870\n"); | ||
1409 | dev->wait_after_write = 0; | ||
1410 | break; | ||
1411 | case CHIP_ID_EM2874: | ||
1412 | em28xx_info("chip ID is em2874\n"); | ||
1413 | dev->reg_gpio_num = EM2874_R80_GPIO; | ||
1414 | dev->wait_after_write = 0; | ||
1415 | break; | ||
1326 | case CHIP_ID_EM2883: | 1416 | case CHIP_ID_EM2883: |
1327 | em28xx_info("chip ID is em2882/em2883\n"); | 1417 | em28xx_info("chip ID is em2882/em2883\n"); |
1328 | dev->wait_after_write = 0; | 1418 | dev->wait_after_write = 0; |
1329 | break; | 1419 | break; |
1330 | default: | 1420 | default: |
1331 | em28xx_info("em28xx chip ID = %d\n", rc); | 1421 | em28xx_info("em28xx chip ID = %d\n", dev->chip_id); |
1332 | } | 1422 | } |
1333 | } | 1423 | } |
1334 | em28xx_set_model(dev); | ||
1335 | |||
1336 | /* request some modules */ | ||
1337 | switch (dev->model) { | ||
1338 | case EM2880_BOARD_TERRATEC_PRODIGY_XS: | ||
1339 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: | ||
1340 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: | ||
1341 | case EM2860_BOARD_TERRATEC_HYBRID_XS: | ||
1342 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: | ||
1343 | case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: | ||
1344 | case EM2882_BOARD_PINNACLE_HYBRID_PRO: | ||
1345 | case EM2883_BOARD_KWORLD_HYBRID_A316: | ||
1346 | case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600: | ||
1347 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1348 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1349 | msleep(50); | ||
1350 | |||
1351 | /* Sets GPO/GPIO sequences for this device */ | ||
1352 | dev->analog_gpio = hauppauge_wintv_hvr_900_analog; | ||
1353 | dev->digital_gpio = hauppauge_wintv_hvr_900_digital; | ||
1354 | dev->tun_analog_gpio = default_callback; | ||
1355 | dev->tun_digital_gpio = default_callback; | ||
1356 | break; | ||
1357 | |||
1358 | case EM2882_BOARD_TERRATEC_HYBRID_XS: | ||
1359 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1360 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1361 | msleep(50); | ||
1362 | |||
1363 | /* should be added ir_codes here */ | ||
1364 | |||
1365 | /* Sets GPO/GPIO sequences for this device */ | ||
1366 | dev->analog_gpio = hauppauge_wintv_hvr_900_analog; | ||
1367 | dev->digital_gpio = hauppauge_wintv_hvr_900_digital; | ||
1368 | dev->tun_analog_gpio = default_callback; | ||
1369 | dev->tun_digital_gpio = em2882_terratec_hybrid_xs_digital; | ||
1370 | break; | ||
1371 | |||
1372 | case EM2880_BOARD_TERRATEC_HYBRID_XS_FR: | ||
1373 | case EM2880_BOARD_TERRATEC_HYBRID_XS: | ||
1374 | case EM2870_BOARD_TERRATEC_XS: | ||
1375 | case EM2881_BOARD_PINNACLE_HYBRID_PRO: | ||
1376 | case EM2880_BOARD_KWORLD_DVB_310U: | ||
1377 | case EM2870_BOARD_KWORLD_350U: | ||
1378 | case EM2881_BOARD_DNT_DA2_HYBRID: | ||
1379 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1380 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1381 | msleep(50); | ||
1382 | |||
1383 | /* NOTE: EM2881_DNT_DA2_HYBRID spend 140 msleep for digital | ||
1384 | and analog commands. If this commands doesn't work, | ||
1385 | add this timer. */ | ||
1386 | |||
1387 | /* Sets GPO/GPIO sequences for this device */ | ||
1388 | dev->analog_gpio = default_analog; | ||
1389 | dev->digital_gpio = default_digital; | ||
1390 | dev->tun_analog_gpio = default_callback; | ||
1391 | dev->tun_digital_gpio = default_callback; | ||
1392 | break; | ||
1393 | 1424 | ||
1394 | case EM2880_BOARD_MSI_DIGIVOX_AD: | 1425 | /* Prepopulate cached GPO register content */ |
1395 | case EM2880_BOARD_MSI_DIGIVOX_AD_II: | 1426 | rc = em28xx_read_reg(dev, dev->reg_gpo_num); |
1396 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | 1427 | if (rc >= 0) |
1397 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | 1428 | dev->reg_gpo = rc; |
1398 | msleep(50); | ||
1399 | |||
1400 | /* Sets GPO/GPIO sequences for this device */ | ||
1401 | dev->analog_gpio = em2880_msi_digivox_ad_analog; | ||
1402 | dev->digital_gpio = em2880_msi_digivox_ad_digital; | ||
1403 | dev->tun_analog_gpio = default_callback; | ||
1404 | dev->tun_digital_gpio = default_callback; | ||
1405 | break; | ||
1406 | 1429 | ||
1407 | case EM2750_BOARD_UNKNOWN: | 1430 | /* Set the initial XCLK and I2C clock values based on the board |
1408 | case EM2750_BOARD_DLCW_130: | 1431 | definition */ |
1409 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x0a", 1); | 1432 | em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f); |
1410 | break; | 1433 | em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); |
1434 | msleep(50); | ||
1411 | 1435 | ||
1436 | /* request some modules */ | ||
1437 | switch (dev->model) { | ||
1412 | case EM2861_BOARD_PLEXTOR_PX_TV100U: | 1438 | case EM2861_BOARD_PLEXTOR_PX_TV100U: |
1413 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1414 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1415 | /* FIXME guess */ | 1439 | /* FIXME guess */ |
1416 | /* Turn on analog audio output */ | 1440 | /* Turn on analog audio output */ |
1417 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); | 1441 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1418 | break; | 1442 | break; |
1419 | |||
1420 | case EM2861_BOARD_KWORLD_PVRTV_300U: | 1443 | case EM2861_BOARD_KWORLD_PVRTV_300U: |
1421 | case EM2880_BOARD_KWORLD_DVB_305U: | 1444 | case EM2880_BOARD_KWORLD_DVB_305U: |
1422 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | 1445 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d); |
1423 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x4c", 1); | ||
1424 | msleep(10); | ||
1425 | em28xx_write_regs(dev, 0x08, "\x6d", 1); | ||
1426 | msleep(10); | 1446 | msleep(10); |
1427 | em28xx_write_regs(dev, 0x08, "\x7d", 1); | 1447 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); |
1428 | msleep(10); | 1448 | msleep(10); |
1429 | break; | 1449 | break; |
1430 | |||
1431 | case EM2870_BOARD_KWORLD_355U: | ||
1432 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1433 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1434 | msleep(50); | ||
1435 | |||
1436 | /* Sets GPO/GPIO sequences for this device */ | ||
1437 | dev->digital_gpio = em2870_kworld_355u_digital; | ||
1438 | break; | ||
1439 | |||
1440 | case EM2870_BOARD_COMPRO_VIDEOMATE: | 1450 | case EM2870_BOARD_COMPRO_VIDEOMATE: |
1441 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1442 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1443 | /* TODO: someone can do some cleanup here... | 1451 | /* TODO: someone can do some cleanup here... |
1444 | not everything's needed */ | 1452 | not everything's needed */ |
1445 | em28xx_write_regs(dev, 0x04, "\x00", 1); | 1453 | em28xx_write_reg(dev, EM2880_R04_GPO, 0x00); |
1446 | msleep(10); | 1454 | msleep(10); |
1447 | em28xx_write_regs(dev, 0x04, "\x01", 1); | 1455 | em28xx_write_reg(dev, EM2880_R04_GPO, 0x01); |
1448 | msleep(10); | 1456 | msleep(10); |
1449 | em28xx_write_regs(dev, 0x08, "\xfd", 1); | 1457 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1450 | mdelay(70); | 1458 | mdelay(70); |
1451 | em28xx_write_regs(dev, 0x08, "\xfc", 1); | 1459 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc); |
1452 | mdelay(70); | 1460 | mdelay(70); |
1453 | em28xx_write_regs(dev, 0x08, "\xdc", 1); | 1461 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc); |
1454 | mdelay(70); | 1462 | mdelay(70); |
1455 | em28xx_write_regs(dev, 0x08, "\xfc", 1); | 1463 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc); |
1456 | mdelay(70); | 1464 | mdelay(70); |
1457 | break; | 1465 | break; |
1458 | |||
1459 | case EM2870_BOARD_TERRATEC_XS_MT2060: | 1466 | case EM2870_BOARD_TERRATEC_XS_MT2060: |
1460 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1461 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1462 | /* this device needs some gpio writes to get the DVB-T | 1467 | /* this device needs some gpio writes to get the DVB-T |
1463 | demod work */ | 1468 | demod work */ |
1464 | em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1469 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1465 | mdelay(70); | 1470 | mdelay(70); |
1466 | em28xx_write_regs(dev, 0x08, "\xde", 1); | 1471 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde); |
1467 | mdelay(70); | 1472 | mdelay(70); |
1468 | dev->em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1473 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1469 | mdelay(70); | 1474 | mdelay(70); |
1470 | break; | 1475 | break; |
1471 | |||
1472 | case EM2870_BOARD_PINNACLE_PCTV_DVB: | 1476 | case EM2870_BOARD_PINNACLE_PCTV_DVB: |
1473 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1474 | /* this device needs some gpio writes to get the | 1477 | /* this device needs some gpio writes to get the |
1475 | DVB-T demod work */ | 1478 | DVB-T demod work */ |
1476 | em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1479 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1477 | mdelay(70); | 1480 | mdelay(70); |
1478 | em28xx_write_regs(dev, 0x08, "\xde", 1); | 1481 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde); |
1479 | mdelay(70); | 1482 | mdelay(70); |
1480 | em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1483 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1481 | mdelay(70); | 1484 | mdelay(70); |
1482 | /* switch em2880 rc protocol */ | ||
1483 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x22", 1); | ||
1484 | /* should be added ir_codes here */ | ||
1485 | break; | 1485 | break; |
1486 | |||
1487 | case EM2820_BOARD_GADMEI_UTV310: | 1486 | case EM2820_BOARD_GADMEI_UTV310: |
1488 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | ||
1489 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1490 | /* Turn on analog audio output */ | ||
1491 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); | ||
1492 | break; | ||
1493 | |||
1494 | case EM2860_BOARD_GADMEI_UTV330: | ||
1495 | /* Turn on IR */ | ||
1496 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1); | ||
1497 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | ||
1498 | /* should be added ir_codes here */ | ||
1499 | break; | ||
1500 | |||
1501 | case EM2820_BOARD_MSI_VOX_USB_2: | 1487 | case EM2820_BOARD_MSI_VOX_USB_2: |
1502 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); | 1488 | /* enables audio for that devices */ |
1503 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); | 1489 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1504 | /* enables audio for that device */ | ||
1505 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); | ||
1506 | break; | 1490 | break; |
1507 | } | 1491 | } |
1508 | 1492 | ||
1509 | em28xx_gpio_set(dev, dev->tun_analog_gpio); | 1493 | em28xx_gpio_set(dev, dev->board.tuner_gpio); |
1510 | em28xx_set_mode(dev, EM28XX_ANALOG_MODE); | 1494 | em28xx_set_mode(dev, EM28XX_ANALOG_MODE); |
1511 | 1495 | ||
1512 | /* Unlock device */ | 1496 | /* Unlock device */ |
1513 | em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED); | 1497 | em28xx_set_mode(dev, EM28XX_SUSPEND); |
1514 | } | 1498 | } |
1515 | 1499 | ||
1516 | static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) | 1500 | static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) |
@@ -1536,6 +1520,7 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) | |||
1536 | ctl->demod = XC3028_FE_DEFAULT; | 1520 | ctl->demod = XC3028_FE_DEFAULT; |
1537 | ctl->fname = XC3028L_DEFAULT_FIRMWARE; | 1521 | ctl->fname = XC3028L_DEFAULT_FIRMWARE; |
1538 | break; | 1522 | break; |
1523 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: | ||
1539 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: | 1524 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: |
1540 | case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: | 1525 | case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: |
1541 | /* FIXME: Better to specify the needed IF */ | 1526 | /* FIXME: Better to specify the needed IF */ |
@@ -1712,12 +1697,15 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1712 | em28xx_set_model(dev); | 1697 | em28xx_set_model(dev); |
1713 | 1698 | ||
1714 | dev->tuner_type = em28xx_boards[dev->model].tuner_type; | 1699 | dev->tuner_type = em28xx_boards[dev->model].tuner_type; |
1700 | if (em28xx_boards[dev->model].tuner_addr) | ||
1701 | dev->tuner_addr = em28xx_boards[dev->model].tuner_addr; | ||
1715 | 1702 | ||
1716 | /* request some modules */ | 1703 | /* request some modules */ |
1717 | switch (dev->model) { | 1704 | switch (dev->model) { |
1718 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: | 1705 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: |
1719 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: | 1706 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
1720 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: | 1707 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: |
1708 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: | ||
1721 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: | 1709 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: |
1722 | { | 1710 | { |
1723 | struct tveeprom tv; | 1711 | struct tveeprom tv; |
@@ -1733,7 +1721,7 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1733 | 1721 | ||
1734 | if (tv.audio_processor == V4L2_IDENT_MSPX4XX) { | 1722 | if (tv.audio_processor == V4L2_IDENT_MSPX4XX) { |
1735 | dev->i2s_speed = 2048000; | 1723 | dev->i2s_speed = 2048000; |
1736 | dev->has_msp34xx = 1; | 1724 | dev->board.has_msp34xx = 1; |
1737 | } | 1725 | } |
1738 | #ifdef CONFIG_MODULES | 1726 | #ifdef CONFIG_MODULES |
1739 | if (tv.has_ir) | 1727 | if (tv.has_ir) |
@@ -1743,7 +1731,7 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1743 | } | 1731 | } |
1744 | case EM2820_BOARD_KWORLD_PVRTV2800RF: | 1732 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
1745 | /* GPIO enables sound on KWORLD PVR TV 2800RF */ | 1733 | /* GPIO enables sound on KWORLD PVR TV 2800RF */ |
1746 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xf9", 1); | 1734 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9); |
1747 | break; | 1735 | break; |
1748 | case EM2820_BOARD_UNKNOWN: | 1736 | case EM2820_BOARD_UNKNOWN: |
1749 | case EM2800_BOARD_UNKNOWN: | 1737 | case EM2800_BOARD_UNKNOWN: |
@@ -1766,10 +1754,10 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1766 | break; | 1754 | break; |
1767 | } | 1755 | } |
1768 | 1756 | ||
1769 | if (dev->has_snapshot_button) | 1757 | if (dev->board.has_snapshot_button) |
1770 | em28xx_register_snapshot_button(dev); | 1758 | em28xx_register_snapshot_button(dev); |
1771 | 1759 | ||
1772 | if (dev->valid == EM28XX_BOARD_NOT_VALIDATED) { | 1760 | if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { |
1773 | em28xx_errdev("\n\n"); | 1761 | em28xx_errdev("\n\n"); |
1774 | em28xx_errdev("The support for this board weren't " | 1762 | em28xx_errdev("The support for this board weren't " |
1775 | "valid yet.\n"); | 1763 | "valid yet.\n"); |
@@ -1784,15 +1772,433 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1784 | 1772 | ||
1785 | #ifdef CONFIG_MODULES | 1773 | #ifdef CONFIG_MODULES |
1786 | /* request some modules */ | 1774 | /* request some modules */ |
1787 | if (dev->has_msp34xx) | 1775 | if (dev->board.has_msp34xx) |
1788 | request_module("msp3400"); | 1776 | request_module("msp3400"); |
1789 | if (dev->decoder == EM28XX_SAA7113 || dev->decoder == EM28XX_SAA7114) | 1777 | if (dev->board.decoder == EM28XX_SAA711X) |
1790 | request_module("saa7115"); | 1778 | request_module("saa7115"); |
1791 | if (dev->decoder == EM28XX_TVP5150) | 1779 | if (dev->board.decoder == EM28XX_TVP5150) |
1792 | request_module("tvp5150"); | 1780 | request_module("tvp5150"); |
1793 | if (dev->tuner_type != TUNER_ABSENT) | 1781 | if (dev->board.tuner_type != TUNER_ABSENT) |
1794 | request_module("tuner"); | 1782 | request_module("tuner"); |
1795 | #endif | 1783 | #endif |
1796 | 1784 | ||
1797 | em28xx_config_tuner(dev); | 1785 | em28xx_config_tuner(dev); |
1786 | |||
1787 | em28xx_ir_init(dev); | ||
1788 | } | ||
1789 | |||
1790 | |||
1791 | #if defined(CONFIG_MODULES) && defined(MODULE) | ||
1792 | static void request_module_async(struct work_struct *work) | ||
1793 | { | ||
1794 | struct em28xx *dev = container_of(work, | ||
1795 | struct em28xx, request_module_wk); | ||
1796 | |||
1797 | if (dev->has_audio_class) | ||
1798 | request_module("snd-usb-audio"); | ||
1799 | else if (dev->has_alsa_audio) | ||
1800 | request_module("em28xx-alsa"); | ||
1801 | |||
1802 | if (dev->board.has_dvb) | ||
1803 | request_module("em28xx-dvb"); | ||
1804 | } | ||
1805 | |||
1806 | static void request_modules(struct em28xx *dev) | ||
1807 | { | ||
1808 | INIT_WORK(&dev->request_module_wk, request_module_async); | ||
1809 | schedule_work(&dev->request_module_wk); | ||
1810 | } | ||
1811 | #else | ||
1812 | #define request_modules(dev) | ||
1813 | #endif /* CONFIG_MODULES */ | ||
1814 | |||
1815 | /* | ||
1816 | * em28xx_realease_resources() | ||
1817 | * unregisters the v4l2,i2c and usb devices | ||
1818 | * called when the device gets disconected or at module unload | ||
1819 | */ | ||
1820 | void em28xx_release_resources(struct em28xx *dev) | ||
1821 | { | ||
1822 | if (dev->sbutton_input_dev) | ||
1823 | em28xx_deregister_snapshot_button(dev); | ||
1824 | |||
1825 | if (dev->ir) | ||
1826 | em28xx_ir_fini(dev); | ||
1827 | |||
1828 | /*FIXME: I2C IR should be disconnected */ | ||
1829 | |||
1830 | em28xx_release_analog_resources(dev); | ||
1831 | |||
1832 | em28xx_remove_from_devlist(dev); | ||
1833 | |||
1834 | em28xx_i2c_unregister(dev); | ||
1835 | usb_put_dev(dev->udev); | ||
1836 | |||
1837 | /* Mark device as unused */ | ||
1838 | em28xx_devused &= ~(1 << dev->devno); | ||
1839 | }; | ||
1840 | |||
1841 | /* | ||
1842 | * em28xx_init_dev() | ||
1843 | * allocates and inits the device structs, registers i2c bus and v4l device | ||
1844 | */ | ||
1845 | int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | ||
1846 | int minor) | ||
1847 | { | ||
1848 | struct em28xx *dev = *devhandle; | ||
1849 | int retval = -ENOMEM; | ||
1850 | int errCode; | ||
1851 | |||
1852 | dev->udev = udev; | ||
1853 | mutex_init(&dev->ctrl_urb_lock); | ||
1854 | spin_lock_init(&dev->slock); | ||
1855 | init_waitqueue_head(&dev->open); | ||
1856 | init_waitqueue_head(&dev->wait_frame); | ||
1857 | init_waitqueue_head(&dev->wait_stream); | ||
1858 | |||
1859 | dev->em28xx_write_regs = em28xx_write_regs; | ||
1860 | dev->em28xx_read_reg = em28xx_read_reg; | ||
1861 | dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len; | ||
1862 | dev->em28xx_write_regs_req = em28xx_write_regs_req; | ||
1863 | dev->em28xx_read_reg_req = em28xx_read_reg_req; | ||
1864 | dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800; | ||
1865 | |||
1866 | em28xx_pre_card_setup(dev); | ||
1867 | |||
1868 | if (!dev->board.is_em2800) { | ||
1869 | /* Sets I2C speed to 100 KHz */ | ||
1870 | retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40); | ||
1871 | if (retval < 0) { | ||
1872 | em28xx_errdev("%s: em28xx_write_regs_req failed!" | ||
1873 | " retval [%d]\n", | ||
1874 | __func__, retval); | ||
1875 | return retval; | ||
1876 | } | ||
1877 | } | ||
1878 | |||
1879 | /* register i2c bus */ | ||
1880 | errCode = em28xx_i2c_register(dev); | ||
1881 | if (errCode < 0) { | ||
1882 | em28xx_errdev("%s: em28xx_i2c_register - errCode [%d]!\n", | ||
1883 | __func__, errCode); | ||
1884 | return errCode; | ||
1885 | } | ||
1886 | |||
1887 | /* Do board specific init and eeprom reading */ | ||
1888 | em28xx_card_setup(dev); | ||
1889 | |||
1890 | /* Configure audio */ | ||
1891 | errCode = em28xx_audio_setup(dev); | ||
1892 | if (errCode < 0) { | ||
1893 | em28xx_errdev("%s: Error while setting audio - errCode [%d]!\n", | ||
1894 | __func__, errCode); | ||
1895 | } | ||
1896 | |||
1897 | /* wake i2c devices */ | ||
1898 | em28xx_wake_i2c(dev); | ||
1899 | |||
1900 | /* init video dma queues */ | ||
1901 | INIT_LIST_HEAD(&dev->vidq.active); | ||
1902 | INIT_LIST_HEAD(&dev->vidq.queued); | ||
1903 | |||
1904 | |||
1905 | if (dev->board.has_msp34xx) { | ||
1906 | /* Send a reset to other chips via gpio */ | ||
1907 | errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7); | ||
1908 | if (errCode < 0) { | ||
1909 | em28xx_errdev("%s: em28xx_write_regs_req - " | ||
1910 | "msp34xx(1) failed! errCode [%d]\n", | ||
1911 | __func__, errCode); | ||
1912 | return errCode; | ||
1913 | } | ||
1914 | msleep(3); | ||
1915 | |||
1916 | errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff); | ||
1917 | if (errCode < 0) { | ||
1918 | em28xx_errdev("%s: em28xx_write_regs_req - " | ||
1919 | "msp34xx(2) failed! errCode [%d]\n", | ||
1920 | __func__, errCode); | ||
1921 | return errCode; | ||
1922 | } | ||
1923 | msleep(3); | ||
1924 | } | ||
1925 | |||
1926 | em28xx_add_into_devlist(dev); | ||
1927 | |||
1928 | retval = em28xx_register_analog_devices(dev); | ||
1929 | if (retval < 0) { | ||
1930 | em28xx_release_resources(dev); | ||
1931 | goto fail_reg_devices; | ||
1932 | } | ||
1933 | |||
1934 | em28xx_init_extension(dev); | ||
1935 | |||
1936 | /* Save some power by putting tuner to sleep */ | ||
1937 | em28xx_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL); | ||
1938 | |||
1939 | return 0; | ||
1940 | |||
1941 | fail_reg_devices: | ||
1942 | return retval; | ||
1943 | } | ||
1944 | |||
1945 | /* | ||
1946 | * em28xx_usb_probe() | ||
1947 | * checks for supported devices | ||
1948 | */ | ||
1949 | static int em28xx_usb_probe(struct usb_interface *interface, | ||
1950 | const struct usb_device_id *id) | ||
1951 | { | ||
1952 | const struct usb_endpoint_descriptor *endpoint; | ||
1953 | struct usb_device *udev; | ||
1954 | struct usb_interface *uif; | ||
1955 | struct em28xx *dev = NULL; | ||
1956 | int retval = -ENODEV; | ||
1957 | int i, nr, ifnum, isoc_pipe; | ||
1958 | char *speed; | ||
1959 | char descr[255] = ""; | ||
1960 | |||
1961 | udev = usb_get_dev(interface_to_usbdev(interface)); | ||
1962 | ifnum = interface->altsetting[0].desc.bInterfaceNumber; | ||
1963 | |||
1964 | /* Check to see next free device and mark as used */ | ||
1965 | nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS); | ||
1966 | em28xx_devused |= 1<<nr; | ||
1967 | |||
1968 | /* Don't register audio interfaces */ | ||
1969 | if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { | ||
1970 | em28xx_err(DRIVER_NAME " audio device (%04x:%04x): " | ||
1971 | "interface %i, class %i\n", | ||
1972 | le16_to_cpu(udev->descriptor.idVendor), | ||
1973 | le16_to_cpu(udev->descriptor.idProduct), | ||
1974 | ifnum, | ||
1975 | interface->altsetting[0].desc.bInterfaceClass); | ||
1976 | |||
1977 | em28xx_devused &= ~(1<<nr); | ||
1978 | return -ENODEV; | ||
1979 | } | ||
1980 | |||
1981 | endpoint = &interface->cur_altsetting->endpoint[0].desc; | ||
1982 | |||
1983 | /* check if the device has the iso in endpoint at the correct place */ | ||
1984 | if (usb_endpoint_xfer_isoc(endpoint) | ||
1985 | && | ||
1986 | (interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940)) { | ||
1987 | /* It's a newer em2874/em2875 device */ | ||
1988 | isoc_pipe = 0; | ||
1989 | } else { | ||
1990 | int check_interface = 1; | ||
1991 | isoc_pipe = 1; | ||
1992 | endpoint = &interface->cur_altsetting->endpoint[1].desc; | ||
1993 | if (usb_endpoint_type(endpoint) != | ||
1994 | USB_ENDPOINT_XFER_ISOC) | ||
1995 | check_interface = 0; | ||
1996 | |||
1997 | if (usb_endpoint_dir_out(endpoint)) | ||
1998 | check_interface = 0; | ||
1999 | |||
2000 | if (!check_interface) { | ||
2001 | em28xx_err(DRIVER_NAME " video device (%04x:%04x): " | ||
2002 | "interface %i, class %i found.\n", | ||
2003 | le16_to_cpu(udev->descriptor.idVendor), | ||
2004 | le16_to_cpu(udev->descriptor.idProduct), | ||
2005 | ifnum, | ||
2006 | interface->altsetting[0].desc.bInterfaceClass); | ||
2007 | |||
2008 | em28xx_err(DRIVER_NAME " This is an anciliary " | ||
2009 | "interface not used by the driver\n"); | ||
2010 | |||
2011 | em28xx_devused &= ~(1<<nr); | ||
2012 | return -ENODEV; | ||
2013 | } | ||
2014 | } | ||
2015 | |||
2016 | switch (udev->speed) { | ||
2017 | case USB_SPEED_LOW: | ||
2018 | speed = "1.5"; | ||
2019 | break; | ||
2020 | case USB_SPEED_UNKNOWN: | ||
2021 | case USB_SPEED_FULL: | ||
2022 | speed = "12"; | ||
2023 | break; | ||
2024 | case USB_SPEED_HIGH: | ||
2025 | speed = "480"; | ||
2026 | break; | ||
2027 | default: | ||
2028 | speed = "unknown"; | ||
2029 | } | ||
2030 | |||
2031 | if (udev->manufacturer) | ||
2032 | strlcpy(descr, udev->manufacturer, sizeof(descr)); | ||
2033 | |||
2034 | if (udev->product) { | ||
2035 | if (*descr) | ||
2036 | strlcat(descr, " ", sizeof(descr)); | ||
2037 | strlcat(descr, udev->product, sizeof(descr)); | ||
2038 | } | ||
2039 | if (*descr) | ||
2040 | strlcat(descr, " ", sizeof(descr)); | ||
2041 | |||
2042 | printk(DRIVER_NAME ": New device %s@ %s Mbps " | ||
2043 | "(%04x:%04x, interface %d, class %d)\n", | ||
2044 | descr, | ||
2045 | speed, | ||
2046 | le16_to_cpu(udev->descriptor.idVendor), | ||
2047 | le16_to_cpu(udev->descriptor.idProduct), | ||
2048 | ifnum, | ||
2049 | interface->altsetting->desc.bInterfaceNumber); | ||
2050 | |||
2051 | if (nr >= EM28XX_MAXBOARDS) { | ||
2052 | printk(DRIVER_NAME ": Supports only %i em28xx boards.\n", | ||
2053 | EM28XX_MAXBOARDS); | ||
2054 | em28xx_devused &= ~(1<<nr); | ||
2055 | return -ENOMEM; | ||
2056 | } | ||
2057 | |||
2058 | /* allocate memory for our device state and initialize it */ | ||
2059 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | ||
2060 | if (dev == NULL) { | ||
2061 | em28xx_err(DRIVER_NAME ": out of memory!\n"); | ||
2062 | em28xx_devused &= ~(1<<nr); | ||
2063 | return -ENOMEM; | ||
2064 | } | ||
2065 | |||
2066 | snprintf(dev->name, 29, "em28xx #%d", nr); | ||
2067 | dev->devno = nr; | ||
2068 | dev->model = id->driver_info; | ||
2069 | dev->alt = -1; | ||
2070 | |||
2071 | /* Checks if audio is provided by some interface */ | ||
2072 | for (i = 0; i < udev->config->desc.bNumInterfaces; i++) { | ||
2073 | uif = udev->config->interface[i]; | ||
2074 | if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { | ||
2075 | dev->has_audio_class = 1; | ||
2076 | break; | ||
2077 | } | ||
2078 | } | ||
2079 | |||
2080 | /* compute alternate max packet sizes */ | ||
2081 | uif = udev->actconfig->interface[0]; | ||
2082 | |||
2083 | dev->num_alt = uif->num_altsetting; | ||
2084 | dev->alt_max_pkt_size = kmalloc(32 * dev->num_alt, GFP_KERNEL); | ||
2085 | |||
2086 | if (dev->alt_max_pkt_size == NULL) { | ||
2087 | em28xx_errdev("out of memory!\n"); | ||
2088 | em28xx_devused &= ~(1<<nr); | ||
2089 | kfree(dev); | ||
2090 | return -ENOMEM; | ||
2091 | } | ||
2092 | |||
2093 | for (i = 0; i < dev->num_alt ; i++) { | ||
2094 | u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize); | ||
2095 | dev->alt_max_pkt_size[i] = | ||
2096 | (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); | ||
2097 | } | ||
2098 | |||
2099 | if ((card[nr] >= 0) && (card[nr] < em28xx_bcount)) | ||
2100 | dev->model = card[nr]; | ||
2101 | |||
2102 | /* allocate device struct */ | ||
2103 | mutex_init(&dev->lock); | ||
2104 | mutex_lock(&dev->lock); | ||
2105 | retval = em28xx_init_dev(&dev, udev, nr); | ||
2106 | if (retval) { | ||
2107 | em28xx_devused &= ~(1<<dev->devno); | ||
2108 | kfree(dev); | ||
2109 | |||
2110 | return retval; | ||
2111 | } | ||
2112 | |||
2113 | /* save our data pointer in this interface device */ | ||
2114 | usb_set_intfdata(interface, dev); | ||
2115 | |||
2116 | request_modules(dev); | ||
2117 | |||
2118 | /* Should be the last thing to do, to avoid newer udev's to | ||
2119 | open the device before fully initializing it | ||
2120 | */ | ||
2121 | mutex_unlock(&dev->lock); | ||
2122 | |||
2123 | return 0; | ||
2124 | } | ||
2125 | |||
2126 | /* | ||
2127 | * em28xx_usb_disconnect() | ||
2128 | * called when the device gets diconencted | ||
2129 | * video device will be unregistered on v4l2_close in case it is still open | ||
2130 | */ | ||
2131 | static void em28xx_usb_disconnect(struct usb_interface *interface) | ||
2132 | { | ||
2133 | struct em28xx *dev; | ||
2134 | |||
2135 | dev = usb_get_intfdata(interface); | ||
2136 | usb_set_intfdata(interface, NULL); | ||
2137 | |||
2138 | if (!dev) | ||
2139 | return; | ||
2140 | |||
2141 | em28xx_info("disconnecting %s\n", dev->vdev->name); | ||
2142 | |||
2143 | /* wait until all current v4l2 io is finished then deallocate | ||
2144 | resources */ | ||
2145 | mutex_lock(&dev->lock); | ||
2146 | |||
2147 | wake_up_interruptible_all(&dev->open); | ||
2148 | |||
2149 | if (dev->users) { | ||
2150 | em28xx_warn | ||
2151 | ("device /dev/video%d is open! Deregistration and memory " | ||
2152 | "deallocation are deferred on close.\n", | ||
2153 | dev->vdev->num); | ||
2154 | |||
2155 | dev->state |= DEV_MISCONFIGURED; | ||
2156 | em28xx_uninit_isoc(dev); | ||
2157 | dev->state |= DEV_DISCONNECTED; | ||
2158 | wake_up_interruptible(&dev->wait_frame); | ||
2159 | wake_up_interruptible(&dev->wait_stream); | ||
2160 | } else { | ||
2161 | dev->state |= DEV_DISCONNECTED; | ||
2162 | em28xx_release_resources(dev); | ||
2163 | } | ||
2164 | |||
2165 | em28xx_close_extension(dev); | ||
2166 | |||
2167 | mutex_unlock(&dev->lock); | ||
2168 | |||
2169 | if (!dev->users) { | ||
2170 | kfree(dev->alt_max_pkt_size); | ||
2171 | kfree(dev); | ||
2172 | } | ||
1798 | } | 2173 | } |
2174 | |||
2175 | static struct usb_driver em28xx_usb_driver = { | ||
2176 | .name = "em28xx", | ||
2177 | .probe = em28xx_usb_probe, | ||
2178 | .disconnect = em28xx_usb_disconnect, | ||
2179 | .id_table = em28xx_id_table, | ||
2180 | }; | ||
2181 | |||
2182 | static int __init em28xx_module_init(void) | ||
2183 | { | ||
2184 | int result; | ||
2185 | |||
2186 | /* register this driver with the USB subsystem */ | ||
2187 | result = usb_register(&em28xx_usb_driver); | ||
2188 | if (result) | ||
2189 | em28xx_err(DRIVER_NAME | ||
2190 | " usb_register failed. Error number %d.\n", result); | ||
2191 | |||
2192 | printk(KERN_INFO DRIVER_NAME " driver loaded\n"); | ||
2193 | |||
2194 | return result; | ||
2195 | } | ||
2196 | |||
2197 | static void __exit em28xx_module_exit(void) | ||
2198 | { | ||
2199 | /* deregister this driver with the USB subsystem */ | ||
2200 | usb_deregister(&em28xx_usb_driver); | ||
2201 | } | ||
2202 | |||
2203 | module_init(em28xx_module_init); | ||
2204 | module_exit(em28xx_module_exit); | ||