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 | 2e7c6dc | 2006-04-03 07:53:40 -0300 | [diff] [blame] | 6 | Mauro Carvalho Chehab <mchehab@infradead.org> |
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> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 26 | #include <linux/delay.h> |
| 27 | #include <linux/i2c.h> |
| 28 | #include <linux/usb.h> |
| 29 | #include <media/tuner.h> |
Hans Verkuil | 2474ed4 | 2006-03-19 12:35:57 -0300 | [diff] [blame] | 30 | #include <media/msp3400.h> |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 31 | #include <media/saa7115.h> |
| 32 | #include <media/tvp5150.h> |
Mauro Carvalho Chehab | 1f6173e | 2005-11-08 21:37:16 -0800 | [diff] [blame] | 33 | #include <media/tveeprom.h> |
Hans Verkuil | 2474ed4 | 2006-03-19 12:35:57 -0300 | [diff] [blame] | 34 | #include <media/audiochip.h> |
Mauro Carvalho Chehab | 9bb13a6 | 2006-01-09 15:25:37 -0200 | [diff] [blame] | 35 | #include <media/v4l2-common.h> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 36 | |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 37 | #include "em28xx.h" |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame^] | 38 | #include "tuner-xc2028.h" |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 39 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 40 | struct em28xx_board em28xx_boards[] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 41 | [EM2800_BOARD_UNKNOWN] = { |
| 42 | .name = "Unknown EM2800 video grabber", |
| 43 | .is_em2800 = 1, |
| 44 | .vchannels = 2, |
| 45 | .norm = VIDEO_MODE_PAL, |
| 46 | .tda9887_conf = TDA9887_PRESENT, |
| 47 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 48 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 49 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 50 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 51 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 52 | .amux = 1, |
| 53 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 54 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 55 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 56 | .amux = 1, |
| 57 | }}, |
| 58 | }, |
| 59 | [EM2820_BOARD_UNKNOWN] = { |
| 60 | .name = "Unknown EM2820/2840 video grabber", |
| 61 | .is_em2800 = 0, |
| 62 | .vchannels = 2, |
| 63 | .norm = VIDEO_MODE_PAL, |
| 64 | .tda9887_conf = TDA9887_PRESENT, |
| 65 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 66 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 67 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 68 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 69 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 70 | .amux = 1, |
| 71 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 72 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 73 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 74 | .amux = 1, |
| 75 | }}, |
| 76 | }, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 77 | [EM2820_BOARD_KWORLD_PVRTV2800RF] = { |
Markus Rechberger | 33ccaa3 | 2006-02-07 06:25:41 -0200 | [diff] [blame] | 78 | .name = "Kworld PVR TV 2800 RF", |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 79 | .is_em2800 = 0, |
| 80 | .vchannels = 2, |
| 81 | .norm = VIDEO_MODE_PAL, |
| 82 | .tda9887_conf = TDA9887_PRESENT, |
| 83 | .has_tuner = 1, |
| 84 | .decoder = EM28XX_SAA7113, |
| 85 | .input = {{ |
| 86 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 87 | .vmux = SAA7115_COMPOSITE0, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 88 | .amux = 1, |
| 89 | },{ |
| 90 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 91 | .vmux = SAA7115_SVIDEO3, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 92 | .amux = 1, |
| 93 | }}, |
| 94 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 95 | [EM2820_BOARD_TERRATEC_CINERGY_250] = { |
| 96 | .name = "Terratec Cinergy 250 USB", |
| 97 | .vchannels = 3, |
| 98 | .norm = VIDEO_MODE_PAL, |
| 99 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 100 | .tda9887_conf = TDA9887_PRESENT, |
| 101 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 102 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 103 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 104 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 105 | .vmux = SAA7115_COMPOSITE2, |
Markus Rechberger | 9475fb1 | 2006-02-27 00:07:34 -0300 | [diff] [blame] | 106 | .amux = 1, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 107 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 108 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 109 | .vmux = SAA7115_COMPOSITE0, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 110 | .amux = 1, |
| 111 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 112 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 113 | .vmux = SAA7115_SVIDEO3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 114 | .amux = 1, |
| 115 | }}, |
| 116 | }, |
| 117 | [EM2820_BOARD_PINNACLE_USB_2] = { |
| 118 | .name = "Pinnacle PCTV USB 2", |
| 119 | .vchannels = 3, |
| 120 | .norm = VIDEO_MODE_PAL, |
| 121 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 122 | .tda9887_conf = TDA9887_PRESENT, |
| 123 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 124 | .decoder = EM28XX_SAA7113, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 125 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 126 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 127 | .vmux = SAA7115_COMPOSITE2, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 128 | .amux = 0, |
| 129 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 130 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 131 | .vmux = SAA7115_COMPOSITE0, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 132 | .amux = 1, |
| 133 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 134 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 135 | .vmux = SAA7115_SVIDEO3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 136 | .amux = 1, |
| 137 | }}, |
| 138 | }, |
| 139 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { |
| 140 | .name = "Hauppauge WinTV USB 2", |
| 141 | .vchannels = 3, |
| 142 | .norm = VIDEO_MODE_NTSC, |
| 143 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
| 144 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 145 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 146 | .decoder = EM28XX_TVP5150, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 147 | .has_msp34xx = 1, |
| 148 | /*FIXME: S-Video not tested */ |
| 149 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 150 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 151 | .vmux = TVP5150_COMPOSITE0, |
Hans Verkuil | 2474ed4 | 2006-03-19 12:35:57 -0300 | [diff] [blame] | 152 | .amux = MSP_INPUT_DEFAULT, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 153 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 154 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 155 | .vmux = TVP5150_SVIDEO, |
Hans Verkuil | 0715172 | 2006-04-01 18:03:23 -0300 | [diff] [blame] | 156 | .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, |
| 157 | MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 158 | }}, |
| 159 | }, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 160 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { |
| 161 | .name = "Hauppauge WinTV HVR 900", |
| 162 | .vchannels = 3, |
| 163 | .norm = VIDEO_MODE_PAL, |
| 164 | .tda9887_conf = TDA9887_PRESENT, |
| 165 | .tuner_type = TUNER_XC2028, |
| 166 | .has_tuner = 1, |
| 167 | .decoder = EM28XX_TVP5150, |
| 168 | .input = {{ |
| 169 | .type = EM28XX_VMUX_COMPOSITE1, |
| 170 | .vmux = TVP5150_COMPOSITE1, |
| 171 | .amux = 1, |
| 172 | },{ |
| 173 | .type = EM28XX_VMUX_TELEVISION, |
| 174 | .vmux = TVP5150_COMPOSITE0, |
| 175 | .amux = 0, |
| 176 | },{ |
| 177 | .type = EM28XX_VMUX_SVIDEO, |
| 178 | .vmux = TVP5150_SVIDEO, |
| 179 | .amux = 1, |
| 180 | }}, |
| 181 | }, |
| 182 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { |
| 183 | .name = "Terratec Hybrid XS", |
| 184 | .vchannels = 3, |
| 185 | .norm = VIDEO_MODE_PAL, |
| 186 | .tda9887_conf = TDA9887_PRESENT, |
| 187 | .has_tuner = 1, |
| 188 | .tuner_type = TUNER_XC2028, |
| 189 | .decoder = EM28XX_TVP5150, |
| 190 | .input = {{ |
| 191 | .type = EM28XX_VMUX_TELEVISION, |
| 192 | .vmux = TVP5150_COMPOSITE0, |
| 193 | .amux = 0, |
| 194 | },{ |
| 195 | .type = EM28XX_VMUX_COMPOSITE1, |
| 196 | .vmux = TVP5150_COMPOSITE1, |
| 197 | .amux = 1, |
| 198 | },{ |
| 199 | .type = EM28XX_VMUX_SVIDEO, |
| 200 | .vmux = TVP5150_SVIDEO, |
| 201 | .amux = 1, |
| 202 | }}, |
| 203 | }, |
| 204 | /* maybe there's a reason behind it why Terratec sells the Hybrid XS as Prodigy XS with a |
| 205 | * different PID, let's keep it separated for now maybe we'll need it lateron */ |
| 206 | [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { |
| 207 | .name = "Terratec Prodigy XS", |
| 208 | .vchannels = 3, |
| 209 | .norm = VIDEO_MODE_PAL, |
| 210 | .tda9887_conf = TDA9887_PRESENT, |
| 211 | .has_tuner = 1, |
| 212 | .tuner_type = TUNER_XC2028, |
| 213 | .decoder = EM28XX_TVP5150, |
| 214 | .input = {{ |
| 215 | .type = EM28XX_VMUX_TELEVISION, |
| 216 | .vmux = TVP5150_COMPOSITE0, |
| 217 | .amux = 0, |
| 218 | },{ |
| 219 | .type = EM28XX_VMUX_COMPOSITE1, |
| 220 | .vmux = TVP5150_COMPOSITE1, |
| 221 | .amux = 1, |
| 222 | },{ |
| 223 | .type = EM28XX_VMUX_SVIDEO, |
| 224 | .vmux = TVP5150_SVIDEO, |
| 225 | .amux = 1, |
| 226 | }}, |
| 227 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 228 | [EM2820_BOARD_MSI_VOX_USB_2] = { |
| 229 | .name = "MSI VOX USB 2.0", |
| 230 | .vchannels = 3, |
| 231 | .norm = VIDEO_MODE_PAL, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 232 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 233 | .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE, |
| 234 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 235 | .decoder = EM28XX_SAA7114, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 236 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 237 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 238 | .vmux = SAA7115_COMPOSITE4, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 239 | .amux = 0, |
| 240 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 241 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 242 | .vmux = SAA7115_COMPOSITE0, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 243 | .amux = 1, |
| 244 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 245 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 246 | .vmux = SAA7115_SVIDEO3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 247 | .amux = 1, |
| 248 | }}, |
| 249 | }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 250 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { |
| 251 | .name = "Terratec Cinergy 200 USB", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 252 | .is_em2800 = 1, |
| 253 | .vchannels = 3, |
| 254 | .norm = VIDEO_MODE_PAL, |
| 255 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 256 | .tda9887_conf = TDA9887_PRESENT, |
| 257 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 258 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 259 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 260 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 261 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 262 | .amux = 0, |
| 263 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 264 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 265 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 266 | .amux = 1, |
| 267 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 268 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 269 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 270 | .amux = 1, |
| 271 | }}, |
| 272 | }, |
| 273 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { |
| 274 | .name = "Leadtek Winfast USB II", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 275 | .is_em2800 = 1, |
| 276 | .vchannels = 3, |
| 277 | .norm = VIDEO_MODE_PAL, |
| 278 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 279 | .tda9887_conf = TDA9887_PRESENT, |
| 280 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 281 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 282 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 283 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 284 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 285 | .amux = 0, |
| 286 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 287 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 288 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 289 | .amux = 1, |
| 290 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 291 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 292 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 293 | .amux = 1, |
| 294 | }}, |
| 295 | }, |
| 296 | [EM2800_BOARD_KWORLD_USB2800] = { |
| 297 | .name = "Kworld USB2800", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 298 | .is_em2800 = 1, |
| 299 | .vchannels = 3, |
| 300 | .norm = VIDEO_MODE_PAL, |
| 301 | .tuner_type = TUNER_PHILIPS_ATSC, |
| 302 | .tda9887_conf = TDA9887_PRESENT, |
| 303 | .has_tuner = 1, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 304 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 305 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 306 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 307 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 308 | .amux = 0, |
| 309 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 310 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 311 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 312 | .amux = 1, |
| 313 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 314 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 315 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 316 | .amux = 1, |
| 317 | }}, |
| 318 | }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 319 | [EM2820_BOARD_PINNACLE_DVC_90] = { |
| 320 | .name = "Pinnacle Dazzle DVC 90", |
| 321 | .vchannels = 3, |
| 322 | .norm = VIDEO_MODE_PAL, |
| 323 | .has_tuner = 0, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 324 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 325 | .input = {{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 326 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 327 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 328 | .amux = 1, |
| 329 | },{ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 330 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 331 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 332 | .amux = 1, |
| 333 | }}, |
| 334 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 335 | }; |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 336 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 337 | |
| 338 | /* table of devices that work with this driver */ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 339 | struct usb_device_id em28xx_id_table [] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 340 | { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN }, |
Markus Rechberger | 08eca13 | 2005-11-08 21:38:05 -0800 | [diff] [blame] | 341 | { 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] | 342 | { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, |
| 343 | { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, |
| 344 | { 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] | 345 | { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 346 | { USB_DEVICE(0x2040, 0x6500), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
| 347 | { USB_DEVICE(0x0ccd, 0x0042), .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, |
| 348 | { USB_DEVICE(0x0ccd, 0x0047), .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 349 | { }, |
| 350 | }; |
| 351 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 352 | void em28xx_pre_card_setup(struct em28xx *dev) |
| 353 | { |
| 354 | /* request some modules */ |
| 355 | switch(dev->model){ |
Markus Rechberger | 282b7cb | 2006-02-07 06:14:16 +0100 | [diff] [blame] | 356 | case EM2880_BOARD_TERRATEC_PRODIGY_XS: |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 357 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
| 358 | case EM2880_BOARD_TERRATEC_HYBRID_XS: |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 359 | { |
| 360 | em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); // reset through GPIO? |
| 361 | break; |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame^] | 366 | static void em28xx_config_tuner (struct em28xx *dev) |
| 367 | { |
| 368 | struct v4l2_priv_tun_config xc2028_cfg; |
| 369 | struct xc2028_ctrl ctl; |
| 370 | |
| 371 | memset (&ctl,0,sizeof(ctl)); |
| 372 | |
| 373 | ctl.fname = XC2028_DEFAULT_FIRMWARE; |
| 374 | |
| 375 | xc2028_cfg.tuner = TUNER_XC2028; |
| 376 | xc2028_cfg.priv = &ctl; |
| 377 | |
| 378 | em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg); |
| 379 | } |
| 380 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 381 | void em28xx_card_setup(struct em28xx *dev) |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 382 | { |
| 383 | /* request some modules */ |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 384 | switch(dev->model){ |
| 385 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: |
| 386 | { |
| 387 | struct tveeprom tv; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 388 | #ifdef CONFIG_MODULES |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 389 | request_module("tveeprom"); |
| 390 | request_module("ir-kbd-i2c"); |
| 391 | request_module("msp3400"); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 392 | #endif |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 393 | /* Call first TVeeprom */ |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 394 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 395 | dev->i2c_client.addr = 0xa0 >> 1; |
| 396 | tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 397 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 398 | dev->tuner_type= tv.tuner_type; |
| 399 | if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { |
| 400 | dev->i2s_speed=2048000; |
| 401 | dev->has_msp34xx=1; |
| 402 | } else |
| 403 | dev->has_msp34xx=0; |
| 404 | break; |
| 405 | } |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 406 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
| 407 | { |
| 408 | em28xx_write_regs_req(dev,0x00,0x08, "\xf9", 1); // GPIO enables sound on KWORLD PVR TV 2800RF |
| 409 | break; |
| 410 | } |
| 411 | |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 412 | } |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame^] | 413 | em28xx_config_tuner (dev); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 414 | } |
| 415 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 416 | MODULE_DEVICE_TABLE (usb, em28xx_id_table); |