akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 1 | /* |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 2 | em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 3 | |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 4 | Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 5 | Markus Rechberger <mrechberger@gmail.com> |
Mauro Carvalho Chehab | 4ac9791 | 2005-11-08 21:37:43 -0800 | [diff] [blame] | 6 | Mauro Carvalho Chehab <mchehab@brturbo.com.br> |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 7 | Sascha Sommer <saschasommer@freenet.de> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 8 | |
| 9 | This program is free software; you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by |
| 11 | the Free Software Foundation; either version 2 of the License, or |
| 12 | (at your option) any later version. |
| 13 | |
| 14 | This program is distributed in the hope that it will be useful, |
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | GNU General Public License for more details. |
| 18 | |
| 19 | You should have received a copy of the GNU General Public License |
| 20 | along with this program; if not, write to the Free Software |
| 21 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ |
| 23 | |
| 24 | #include <linux/init.h> |
| 25 | #include <linux/module.h> |
| 26 | #include <linux/pci.h> |
| 27 | #include <linux/delay.h> |
| 28 | #include <linux/i2c.h> |
| 29 | #include <linux/usb.h> |
| 30 | #include <media/tuner.h> |
Mauro Carvalho Chehab | 1f6173e | 2005-11-08 21:37:16 -0800 | [diff] [blame] | 31 | #include <media/audiochip.h> |
| 32 | #include <media/tveeprom.h> |
Mauro Carvalho Chehab | 9bb13a6 | 2006-01-09 15:25:37 -0200 | [diff] [blame] | 33 | #include <media/v4l2-common.h> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 34 | #include "msp3400.h" |
| 35 | |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 36 | #include "em28xx.h" |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 37 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 38 | struct em28xx_board em28xx_boards[] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 39 | [EM2800_BOARD_UNKNOWN] = { |
| 40 | .name = "Unknown EM2800 video grabber", |
| 41 | .is_em2800 = 1, |
| 42 | .vchannels = 2, |
| 43 | .norm = VIDEO_MODE_PAL, |
| 44 | .tda9887_conf = TDA9887_PRESENT, |
| 45 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 46 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 47 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 48 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 49 | .vmux = 0, |
| 50 | .amux = 1, |
| 51 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 52 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 53 | .vmux = 9, |
| 54 | .amux = 1, |
| 55 | }}, |
| 56 | }, |
| 57 | [EM2820_BOARD_UNKNOWN] = { |
| 58 | .name = "Unknown EM2820/2840 video grabber", |
| 59 | .is_em2800 = 0, |
| 60 | .vchannels = 2, |
| 61 | .norm = VIDEO_MODE_PAL, |
| 62 | .tda9887_conf = TDA9887_PRESENT, |
| 63 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 64 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 65 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 66 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 67 | .vmux = 0, |
| 68 | .amux = 1, |
| 69 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 70 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 71 | .vmux = 9, |
| 72 | .amux = 1, |
| 73 | }}, |
| 74 | }, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 75 | [EM2820_BOARD_KWORLD_PVRTV2800RF] = { |
Markus Rechberger | 33ccaa3 | 2006-02-07 06:25:41 -0200 | [diff] [blame^] | 76 | .name = "Kworld PVR TV 2800 RF", |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 77 | .is_em2800 = 0, |
| 78 | .vchannels = 2, |
| 79 | .norm = VIDEO_MODE_PAL, |
| 80 | .tda9887_conf = TDA9887_PRESENT, |
| 81 | .has_tuner = 1, |
| 82 | .decoder = EM28XX_SAA7113, |
| 83 | .input = {{ |
| 84 | .type = EM28XX_VMUX_COMPOSITE1, |
| 85 | .vmux = 0, |
| 86 | .amux = 1, |
| 87 | },{ |
| 88 | .type = EM28XX_VMUX_SVIDEO, |
| 89 | .vmux = 9, |
| 90 | .amux = 1, |
| 91 | }}, |
| 92 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 93 | [EM2820_BOARD_TERRATEC_CINERGY_250] = { |
| 94 | .name = "Terratec Cinergy 250 USB", |
| 95 | .vchannels = 3, |
| 96 | .norm = VIDEO_MODE_PAL, |
| 97 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 98 | .tda9887_conf = TDA9887_PRESENT, |
| 99 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 100 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 101 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 102 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 103 | .vmux = 2, |
| 104 | .amux = 0, |
| 105 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 106 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 107 | .vmux = 0, |
| 108 | .amux = 1, |
| 109 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 110 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 111 | .vmux = 9, |
| 112 | .amux = 1, |
| 113 | }}, |
| 114 | }, |
| 115 | [EM2820_BOARD_PINNACLE_USB_2] = { |
| 116 | .name = "Pinnacle PCTV USB 2", |
| 117 | .vchannels = 3, |
| 118 | .norm = VIDEO_MODE_PAL, |
| 119 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 120 | .tda9887_conf = TDA9887_PRESENT, |
| 121 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 122 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 123 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 124 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 125 | .vmux = 2, |
| 126 | .amux = 0, |
| 127 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 128 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 129 | .vmux = 0, |
| 130 | .amux = 1, |
| 131 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 132 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 133 | .vmux = 9, |
| 134 | .amux = 1, |
| 135 | }}, |
| 136 | }, |
| 137 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { |
| 138 | .name = "Hauppauge WinTV USB 2", |
| 139 | .vchannels = 3, |
| 140 | .norm = VIDEO_MODE_NTSC, |
| 141 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
| 142 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 143 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 144 | .decoder = EM28XX_TVP5150, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 145 | .has_msp34xx = 1, |
| 146 | /*FIXME: S-Video not tested */ |
| 147 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 148 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 149 | .vmux = 0, |
Mauro Carvalho Chehab | eac9435 | 2005-11-08 21:38:43 -0800 | [diff] [blame] | 150 | .amux = 6, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 151 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 152 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 153 | .vmux = 2, |
| 154 | .amux = 1, |
| 155 | }}, |
| 156 | }, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 157 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { |
| 158 | .name = "Hauppauge WinTV HVR 900", |
| 159 | .vchannels = 3, |
| 160 | .norm = VIDEO_MODE_PAL, |
| 161 | .has_tuner = 0, |
| 162 | .tda9887_conf = TDA9887_PRESENT, |
| 163 | .has_tuner = 1, |
| 164 | .decoder = EM28XX_TVP5150, |
| 165 | .input = {{ |
| 166 | .type = EM28XX_VMUX_COMPOSITE1, |
| 167 | .vmux = 2, |
| 168 | .amux = 0, |
| 169 | },{ |
| 170 | .type = EM28XX_VMUX_TELEVISION, |
| 171 | .vmux = 0, |
| 172 | .amux = 1, |
| 173 | },{ |
| 174 | .type = EM28XX_VMUX_SVIDEO, |
| 175 | .vmux = 9, |
| 176 | .amux = 1, |
| 177 | }}, |
| 178 | }, |
| 179 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { |
| 180 | .name = "Terratec Hybrid XS", |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 181 | .vchannels = 3, |
| 182 | .norm = VIDEO_MODE_PAL, |
| 183 | .has_tuner = 0, |
| 184 | .tda9887_conf = TDA9887_PRESENT, |
| 185 | .has_tuner = 1, |
| 186 | .decoder = EM28XX_TVP5150, |
| 187 | .input = {{ |
| 188 | .type = EM28XX_VMUX_COMPOSITE1, |
| 189 | .vmux = 2, |
| 190 | .amux = 0, |
| 191 | },{ |
| 192 | .type = EM28XX_VMUX_TELEVISION, |
| 193 | .vmux = 0, |
| 194 | .amux = 1, |
| 195 | },{ |
| 196 | .type = EM28XX_VMUX_SVIDEO, |
| 197 | .vmux = 9, |
| 198 | .amux = 1, |
| 199 | }}, |
| 200 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 201 | [EM2820_BOARD_MSI_VOX_USB_2] = { |
| 202 | .name = "MSI VOX USB 2.0", |
| 203 | .vchannels = 3, |
| 204 | .norm = VIDEO_MODE_PAL, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 205 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 206 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 207 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 208 | .decoder = EM28XX_SAA7114, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 209 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 210 | .type = EM28XX_VMUX_TELEVISION, |
Markus Rechberger | 30556b2 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 211 | .vmux = 4, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 212 | .amux = 0, |
| 213 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 214 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 215 | .vmux = 0, |
| 216 | .amux = 1, |
| 217 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 218 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 219 | .vmux = 9, |
| 220 | .amux = 1, |
| 221 | }}, |
| 222 | }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 223 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { |
| 224 | .name = "Terratec Cinergy 200 USB", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 225 | .is_em2800 = 1, |
| 226 | .vchannels = 3, |
| 227 | .norm = VIDEO_MODE_PAL, |
| 228 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 229 | .tda9887_conf = TDA9887_PRESENT, |
| 230 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 231 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 232 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 233 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 234 | .vmux = 2, |
| 235 | .amux = 0, |
| 236 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 237 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 238 | .vmux = 0, |
| 239 | .amux = 1, |
| 240 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 241 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 242 | .vmux = 9, |
| 243 | .amux = 1, |
| 244 | }}, |
| 245 | }, |
| 246 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { |
| 247 | .name = "Leadtek Winfast USB II", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 248 | .is_em2800 = 1, |
| 249 | .vchannels = 3, |
| 250 | .norm = VIDEO_MODE_PAL, |
| 251 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 252 | .tda9887_conf = TDA9887_PRESENT, |
| 253 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 254 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 255 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 256 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 257 | .vmux = 2, |
| 258 | .amux = 0, |
| 259 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 260 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 261 | .vmux = 0, |
| 262 | .amux = 1, |
| 263 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 264 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 265 | .vmux = 9, |
| 266 | .amux = 1, |
| 267 | }}, |
| 268 | }, |
| 269 | [EM2800_BOARD_KWORLD_USB2800] = { |
| 270 | .name = "Kworld USB2800", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 271 | .is_em2800 = 1, |
| 272 | .vchannels = 3, |
| 273 | .norm = VIDEO_MODE_PAL, |
| 274 | .tuner_type = TUNER_PHILIPS_ATSC, |
| 275 | .tda9887_conf = TDA9887_PRESENT, |
| 276 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 277 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 278 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 279 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 280 | .vmux = 2, |
| 281 | .amux = 0, |
| 282 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 283 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 284 | .vmux = 0, |
| 285 | .amux = 1, |
| 286 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 287 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 288 | .vmux = 9, |
| 289 | .amux = 1, |
| 290 | }}, |
| 291 | }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 292 | [EM2820_BOARD_PINNACLE_DVC_90] = { |
| 293 | .name = "Pinnacle Dazzle DVC 90", |
| 294 | .vchannels = 3, |
| 295 | .norm = VIDEO_MODE_PAL, |
| 296 | .has_tuner = 0, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 297 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 298 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 299 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 300 | .vmux = 0, |
| 301 | .amux = 1, |
| 302 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 303 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 304 | .vmux = 9, |
| 305 | .amux = 1, |
| 306 | }}, |
| 307 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 308 | }; |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 309 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 310 | |
| 311 | /* table of devices that work with this driver */ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 312 | struct usb_device_id em28xx_id_table [] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 313 | { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN }, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 314 | { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 315 | { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, |
| 316 | { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, |
| 317 | { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 318 | { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 319 | { USB_DEVICE(0x2040, 0x6500), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
| 320 | { USB_DEVICE(0x0ccd, 0x0042), .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 321 | { }, |
| 322 | }; |
| 323 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 324 | void em28xx_pre_card_setup(struct em28xx *dev) |
| 325 | { |
| 326 | /* request some modules */ |
| 327 | switch(dev->model){ |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 328 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
| 329 | case EM2880_BOARD_TERRATEC_HYBRID_XS: |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 330 | { |
| 331 | em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); // reset through GPIO? |
| 332 | break; |
| 333 | } |
| 334 | } |
| 335 | } |
| 336 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 337 | void em28xx_card_setup(struct em28xx *dev) |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 338 | { |
| 339 | /* request some modules */ |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 340 | switch(dev->model){ |
| 341 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: |
| 342 | { |
| 343 | struct tveeprom tv; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 344 | #ifdef CONFIG_MODULES |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 345 | request_module("tveeprom"); |
| 346 | request_module("ir-kbd-i2c"); |
| 347 | request_module("msp3400"); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 348 | #endif |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 349 | /* Call first TVeeprom */ |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 350 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 351 | dev->i2c_client.addr = 0xa0 >> 1; |
| 352 | tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 353 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 354 | dev->tuner_type= tv.tuner_type; |
| 355 | if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { |
| 356 | dev->i2s_speed=2048000; |
| 357 | dev->has_msp34xx=1; |
| 358 | } else |
| 359 | dev->has_msp34xx=0; |
| 360 | break; |
| 361 | } |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 362 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
| 363 | { |
| 364 | em28xx_write_regs_req(dev,0x00,0x08, "\xf9", 1); // GPIO enables sound on KWORLD PVR TV 2800RF |
| 365 | break; |
| 366 | } |
| 367 | |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 368 | } |
| 369 | } |
| 370 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 371 | EXPORT_SYMBOL(em28xx_boards); |
| 372 | EXPORT_SYMBOL(em28xx_bcount); |
| 373 | EXPORT_SYMBOL(em28xx_id_table); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 374 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 375 | MODULE_DEVICE_TABLE (usb, em28xx_id_table); |