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 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 75 | [EM2820_BOARD_TERRATEC_CINERGY_250] = { |
| 76 | .name = "Terratec Cinergy 250 USB", |
| 77 | .vchannels = 3, |
| 78 | .norm = VIDEO_MODE_PAL, |
| 79 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 80 | .tda9887_conf = TDA9887_PRESENT, |
| 81 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 82 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 83 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 84 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 85 | .vmux = 2, |
| 86 | .amux = 0, |
| 87 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 88 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 89 | .vmux = 0, |
| 90 | .amux = 1, |
| 91 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 92 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 93 | .vmux = 9, |
| 94 | .amux = 1, |
| 95 | }}, |
| 96 | }, |
| 97 | [EM2820_BOARD_PINNACLE_USB_2] = { |
| 98 | .name = "Pinnacle PCTV USB 2", |
| 99 | .vchannels = 3, |
| 100 | .norm = VIDEO_MODE_PAL, |
| 101 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 102 | .tda9887_conf = TDA9887_PRESENT, |
| 103 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 104 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 105 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 106 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 107 | .vmux = 2, |
| 108 | .amux = 0, |
| 109 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 110 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 111 | .vmux = 0, |
| 112 | .amux = 1, |
| 113 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 114 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 115 | .vmux = 9, |
| 116 | .amux = 1, |
| 117 | }}, |
| 118 | }, |
| 119 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { |
| 120 | .name = "Hauppauge WinTV USB 2", |
| 121 | .vchannels = 3, |
| 122 | .norm = VIDEO_MODE_NTSC, |
| 123 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
| 124 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 125 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 126 | .decoder = EM28XX_TVP5150, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 127 | .has_msp34xx = 1, |
| 128 | /*FIXME: S-Video not tested */ |
| 129 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 130 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 131 | .vmux = 0, |
Mauro Carvalho Chehab | eac9435 | 2005-11-08 21:38:43 -0800 | [diff] [blame] | 132 | .amux = 6, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 133 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 134 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 135 | .vmux = 2, |
| 136 | .amux = 1, |
| 137 | }}, |
| 138 | }, |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 139 | [EM2880_BOARD_WINTV_HVR_900] = { |
| 140 | .name = "WinTV HVR 900", |
| 141 | .vchannels = 3, |
| 142 | .norm = VIDEO_MODE_PAL, |
| 143 | .has_tuner = 0, |
| 144 | .tda9887_conf = TDA9887_PRESENT, |
| 145 | .has_tuner = 1, |
| 146 | .decoder = EM28XX_TVP5150, |
| 147 | .input = {{ |
| 148 | .type = EM28XX_VMUX_COMPOSITE1, |
| 149 | .vmux = 2, |
| 150 | .amux = 0, |
| 151 | },{ |
| 152 | .type = EM28XX_VMUX_TELEVISION, |
| 153 | .vmux = 0, |
| 154 | .amux = 1, |
| 155 | },{ |
| 156 | .type = EM28XX_VMUX_SVIDEO, |
| 157 | .vmux = 9, |
| 158 | .amux = 1, |
| 159 | }}, |
| 160 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 161 | [EM2820_BOARD_MSI_VOX_USB_2] = { |
| 162 | .name = "MSI VOX USB 2.0", |
| 163 | .vchannels = 3, |
| 164 | .norm = VIDEO_MODE_PAL, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 165 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 166 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 167 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 168 | .decoder = EM28XX_SAA7114, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 169 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 170 | .type = EM28XX_VMUX_TELEVISION, |
Markus Rechberger | 30556b2 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 171 | .vmux = 4, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 172 | .amux = 0, |
| 173 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 174 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 175 | .vmux = 0, |
| 176 | .amux = 1, |
| 177 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 178 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 179 | .vmux = 9, |
| 180 | .amux = 1, |
| 181 | }}, |
| 182 | }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 183 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { |
| 184 | .name = "Terratec Cinergy 200 USB", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 185 | .is_em2800 = 1, |
| 186 | .vchannels = 3, |
| 187 | .norm = VIDEO_MODE_PAL, |
| 188 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 189 | .tda9887_conf = TDA9887_PRESENT, |
| 190 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 191 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 192 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 193 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 194 | .vmux = 2, |
| 195 | .amux = 0, |
| 196 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 197 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 198 | .vmux = 0, |
| 199 | .amux = 1, |
| 200 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 201 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 202 | .vmux = 9, |
| 203 | .amux = 1, |
| 204 | }}, |
| 205 | }, |
| 206 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { |
| 207 | .name = "Leadtek Winfast USB II", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 208 | .is_em2800 = 1, |
| 209 | .vchannels = 3, |
| 210 | .norm = VIDEO_MODE_PAL, |
| 211 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 212 | .tda9887_conf = TDA9887_PRESENT, |
| 213 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 214 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 215 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 216 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 217 | .vmux = 2, |
| 218 | .amux = 0, |
| 219 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 220 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 221 | .vmux = 0, |
| 222 | .amux = 1, |
| 223 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 224 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 225 | .vmux = 9, |
| 226 | .amux = 1, |
| 227 | }}, |
| 228 | }, |
| 229 | [EM2800_BOARD_KWORLD_USB2800] = { |
| 230 | .name = "Kworld USB2800", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 231 | .is_em2800 = 1, |
| 232 | .vchannels = 3, |
| 233 | .norm = VIDEO_MODE_PAL, |
| 234 | .tuner_type = TUNER_PHILIPS_ATSC, |
| 235 | .tda9887_conf = TDA9887_PRESENT, |
| 236 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 237 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 238 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 239 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 240 | .vmux = 2, |
| 241 | .amux = 0, |
| 242 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 243 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 244 | .vmux = 0, |
| 245 | .amux = 1, |
| 246 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 247 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 248 | .vmux = 9, |
| 249 | .amux = 1, |
| 250 | }}, |
| 251 | }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 252 | [EM2820_BOARD_PINNACLE_DVC_90] = { |
| 253 | .name = "Pinnacle Dazzle DVC 90", |
| 254 | .vchannels = 3, |
| 255 | .norm = VIDEO_MODE_PAL, |
| 256 | .has_tuner = 0, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 257 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 258 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 259 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 260 | .vmux = 0, |
| 261 | .amux = 1, |
| 262 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 263 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 264 | .vmux = 9, |
| 265 | .amux = 1, |
| 266 | }}, |
| 267 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 268 | }; |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 269 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 270 | |
| 271 | /* table of devices that work with this driver */ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 272 | struct usb_device_id em28xx_id_table [] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 273 | { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN }, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 274 | { 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] | 275 | { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, |
| 276 | { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, |
| 277 | { 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] | 278 | { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 279 | { USB_DEVICE(0x2040, 0x6500), .driver_info = EM2880_BOARD_WINTV_HVR_900 }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 280 | { }, |
| 281 | }; |
| 282 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 283 | void em28xx_pre_card_setup(struct em28xx *dev) |
| 284 | { |
| 285 | /* request some modules */ |
| 286 | switch(dev->model){ |
| 287 | case EM2880_BOARD_WINTV_HVR_900: |
| 288 | { |
| 289 | em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); // reset through GPIO? |
| 290 | break; |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 295 | void em28xx_card_setup(struct em28xx *dev) |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 296 | { |
| 297 | /* request some modules */ |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 298 | switch(dev->model){ |
| 299 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: |
| 300 | { |
| 301 | struct tveeprom tv; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 302 | #ifdef CONFIG_MODULES |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 303 | request_module("tveeprom"); |
| 304 | request_module("ir-kbd-i2c"); |
| 305 | request_module("msp3400"); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 306 | #endif |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 307 | /* Call first TVeeprom */ |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 308 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 309 | dev->i2c_client.addr = 0xa0 >> 1; |
| 310 | tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 311 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame^] | 312 | dev->tuner_type= tv.tuner_type; |
| 313 | if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { |
| 314 | dev->i2s_speed=2048000; |
| 315 | dev->has_msp34xx=1; |
| 316 | } else |
| 317 | dev->has_msp34xx=0; |
| 318 | break; |
| 319 | } |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 320 | } |
| 321 | } |
| 322 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 323 | EXPORT_SYMBOL(em28xx_boards); |
| 324 | EXPORT_SYMBOL(em28xx_bcount); |
| 325 | EXPORT_SYMBOL(em28xx_id_table); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 326 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 327 | MODULE_DEVICE_TABLE (usb, em28xx_id_table); |