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> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 33 | #include "msp3400.h" |
| 34 | |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 35 | #include "em28xx.h" |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 36 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 37 | struct em28xx_board em28xx_boards[] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 38 | [EM2800_BOARD_UNKNOWN] = { |
| 39 | .name = "Unknown EM2800 video grabber", |
| 40 | .is_em2800 = 1, |
| 41 | .vchannels = 2, |
| 42 | .norm = VIDEO_MODE_PAL, |
| 43 | .tda9887_conf = TDA9887_PRESENT, |
| 44 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 45 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 46 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 47 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 48 | .vmux = 0, |
| 49 | .amux = 1, |
| 50 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 51 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 52 | .vmux = 9, |
| 53 | .amux = 1, |
| 54 | }}, |
| 55 | }, |
| 56 | [EM2820_BOARD_UNKNOWN] = { |
| 57 | .name = "Unknown EM2820/2840 video grabber", |
| 58 | .is_em2800 = 0, |
| 59 | .vchannels = 2, |
| 60 | .norm = VIDEO_MODE_PAL, |
| 61 | .tda9887_conf = TDA9887_PRESENT, |
| 62 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 63 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 64 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 65 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 66 | .vmux = 0, |
| 67 | .amux = 1, |
| 68 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 69 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 70 | .vmux = 9, |
| 71 | .amux = 1, |
| 72 | }}, |
| 73 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 74 | [EM2820_BOARD_TERRATEC_CINERGY_250] = { |
| 75 | .name = "Terratec Cinergy 250 USB", |
| 76 | .vchannels = 3, |
| 77 | .norm = VIDEO_MODE_PAL, |
| 78 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 79 | .tda9887_conf = TDA9887_PRESENT, |
| 80 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 81 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 82 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 83 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 84 | .vmux = 2, |
| 85 | .amux = 0, |
| 86 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 87 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 88 | .vmux = 0, |
| 89 | .amux = 1, |
| 90 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 91 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 92 | .vmux = 9, |
| 93 | .amux = 1, |
| 94 | }}, |
| 95 | }, |
| 96 | [EM2820_BOARD_PINNACLE_USB_2] = { |
| 97 | .name = "Pinnacle PCTV USB 2", |
| 98 | .vchannels = 3, |
| 99 | .norm = VIDEO_MODE_PAL, |
| 100 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 101 | .tda9887_conf = TDA9887_PRESENT, |
| 102 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 103 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 104 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 105 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 106 | .vmux = 2, |
| 107 | .amux = 0, |
| 108 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 109 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 110 | .vmux = 0, |
| 111 | .amux = 1, |
| 112 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 113 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 114 | .vmux = 9, |
| 115 | .amux = 1, |
| 116 | }}, |
| 117 | }, |
| 118 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { |
| 119 | .name = "Hauppauge WinTV USB 2", |
| 120 | .vchannels = 3, |
| 121 | .norm = VIDEO_MODE_NTSC, |
| 122 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
| 123 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 124 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 125 | .decoder = EM28XX_TVP5150, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 126 | .has_msp34xx = 1, |
| 127 | /*FIXME: S-Video not tested */ |
| 128 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 129 | .type = EM28XX_VMUX_TELEVISION, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 130 | .vmux = 0, |
| 131 | .amux = 0, |
| 132 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 133 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 134 | .vmux = 2, |
| 135 | .amux = 1, |
| 136 | }}, |
| 137 | }, |
| 138 | [EM2820_BOARD_MSI_VOX_USB_2] = { |
| 139 | .name = "MSI VOX USB 2.0", |
| 140 | .vchannels = 3, |
| 141 | .norm = VIDEO_MODE_PAL, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 142 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 143 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 144 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 145 | .decoder = EM28XX_SAA7114, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 146 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 147 | .type = EM28XX_VMUX_TELEVISION, |
Markus Rechberger | 30556b2 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 148 | .vmux = 4, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 149 | .amux = 0, |
| 150 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 151 | .type = EM28XX_VMUX_COMPOSITE1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 152 | .vmux = 0, |
| 153 | .amux = 1, |
| 154 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 155 | .type = EM28XX_VMUX_SVIDEO, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 156 | .vmux = 9, |
| 157 | .amux = 1, |
| 158 | }}, |
| 159 | }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 160 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { |
| 161 | .name = "Terratec Cinergy 200 USB", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 162 | .is_em2800 = 1, |
| 163 | .vchannels = 3, |
| 164 | .norm = VIDEO_MODE_PAL, |
| 165 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 166 | .tda9887_conf = TDA9887_PRESENT, |
| 167 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 168 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 169 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 170 | .type = EM28XX_VMUX_TELEVISION, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 171 | .vmux = 2, |
| 172 | .amux = 0, |
| 173 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 174 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -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, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 179 | .vmux = 9, |
| 180 | .amux = 1, |
| 181 | }}, |
| 182 | }, |
| 183 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { |
| 184 | .name = "Leadtek Winfast USB II", |
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_KWORLD_USB2800] = { |
| 207 | .name = "Kworld USB2800", |
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_PHILIPS_ATSC, |
| 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 | }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 229 | [EM2820_BOARD_PINNACLE_DVC_90] = { |
| 230 | .name = "Pinnacle Dazzle DVC 90", |
| 231 | .vchannels = 3, |
| 232 | .norm = VIDEO_MODE_PAL, |
| 233 | .has_tuner = 0, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 234 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 235 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 236 | .type = EM28XX_VMUX_COMPOSITE1, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 237 | .vmux = 0, |
| 238 | .amux = 1, |
| 239 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 240 | .type = EM28XX_VMUX_SVIDEO, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 241 | .vmux = 9, |
| 242 | .amux = 1, |
| 243 | }}, |
| 244 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 245 | }; |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 246 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 247 | |
| 248 | /* table of devices that work with this driver */ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 249 | struct usb_device_id em28xx_id_table [] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 250 | { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN }, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 251 | { 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] | 252 | { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, |
| 253 | { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, |
| 254 | { 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] | 255 | { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 256 | { }, |
| 257 | }; |
| 258 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 259 | void em28xx_card_setup(struct em28xx *dev) |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 260 | { |
| 261 | /* request some modules */ |
| 262 | if (dev->model == EM2820_BOARD_HAUPPAUGE_WINTV_USB_2) { |
| 263 | struct tveeprom tv; |
| 264 | #ifdef CONFIG_MODULES |
| 265 | request_module("tveeprom"); |
Mauro Carvalho Chehab | d5e5265 | 2005-11-08 21:37:32 -0800 | [diff] [blame] | 266 | request_module("ir-kbd-i2c"); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 267 | #endif |
| 268 | /* Call first TVeeprom */ |
| 269 | |
Mauro Carvalho Chehab | f59ab27 | 2005-11-08 21:37:58 -0800 | [diff] [blame] | 270 | dev->i2c_client.addr = 0xa0 >> 1; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 271 | tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata); |
| 272 | |
| 273 | dev->tuner_type= tv.tuner_type; |
| 274 | if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { |
| 275 | dev->has_msp34xx=1; |
| 276 | } else dev->has_msp34xx=0; |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 277 | em28xx_write_regs_req(dev,0x06,0x00,"\x40",1);// Serial Bus Frequency Select Register |
| 278 | em28xx_write_regs_req(dev,0x0f,0x00,"\x87",1);// XCLK Frequency Select Register |
| 279 | em28xx_write_regs_req(dev,0x88,0x0d,"\xd0",1); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 283 | EXPORT_SYMBOL(em28xx_boards); |
| 284 | EXPORT_SYMBOL(em28xx_bcount); |
| 285 | EXPORT_SYMBOL(em28xx_id_table); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 286 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame^] | 287 | MODULE_DEVICE_TABLE (usb, em28xx_id_table); |