akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 1 | /* |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 2 | em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB |
| 3 | video capture devices |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 4 | |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 5 | Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | Markus Rechberger <mrechberger@gmail.com> |
Mauro Carvalho Chehab | 2e7c6dc | 2006-04-03 07:53:40 -0300 | [diff] [blame] | 7 | Mauro Carvalho Chehab <mchehab@infradead.org> |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 8 | Sascha Sommer <saschasommer@freenet.de> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 9 | |
| 10 | This program is free software; you can redistribute it and/or modify |
| 11 | it under the terms of the GNU General Public License as published by |
| 12 | the Free Software Foundation; either version 2 of the License, or |
| 13 | (at your option) any later version. |
| 14 | |
| 15 | This program is distributed in the hope that it will be useful, |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | GNU General Public License for more details. |
| 19 | |
| 20 | You should have received a copy of the GNU General Public License |
| 21 | along with this program; if not, write to the Free Software |
| 22 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 23 | */ |
| 24 | |
| 25 | #include <linux/init.h> |
| 26 | #include <linux/module.h> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 27 | #include <linux/delay.h> |
| 28 | #include <linux/i2c.h> |
| 29 | #include <linux/usb.h> |
| 30 | #include <media/tuner.h> |
Hans Verkuil | 2474ed4 | 2006-03-19 12:35:57 -0300 | [diff] [blame] | 31 | #include <media/msp3400.h> |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 32 | #include <media/saa7115.h> |
| 33 | #include <media/tvp5150.h> |
Mauro Carvalho Chehab | 1f6173e | 2005-11-08 21:37:16 -0800 | [diff] [blame] | 34 | #include <media/tveeprom.h> |
Hans Verkuil | 2474ed4 | 2006-03-19 12:35:57 -0300 | [diff] [blame] | 35 | #include <media/audiochip.h> |
Mauro Carvalho Chehab | 9bb13a6 | 2006-01-09 15:25:37 -0200 | [diff] [blame] | 36 | #include <media/v4l2-common.h> |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 37 | |
Mauro Carvalho Chehab | f7abcd3 | 2005-11-08 21:38:25 -0800 | [diff] [blame] | 38 | #include "em28xx.h" |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 39 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 40 | static int tuner = -1; |
| 41 | module_param(tuner, int, 0444); |
| 42 | MODULE_PARM_DESC(tuner, "tuner type"); |
| 43 | |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 44 | static unsigned int disable_ir; |
| 45 | module_param(disable_ir, int, 0444); |
| 46 | MODULE_PARM_DESC(disable_ir, "disable infrared remote support"); |
| 47 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 48 | struct em28xx_hash_table { |
| 49 | unsigned long hash; |
| 50 | unsigned int model; |
| 51 | unsigned int tuner; |
| 52 | }; |
| 53 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 54 | struct em28xx_board em28xx_boards[] = { |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 55 | [EM2800_BOARD_UNKNOWN] = { |
| 56 | .name = "Unknown EM2800 video grabber", |
| 57 | .is_em2800 = 1, |
| 58 | .vchannels = 2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 59 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 60 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 61 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 62 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 63 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 64 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 65 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 66 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 67 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 68 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 69 | } }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 70 | }, |
| 71 | [EM2820_BOARD_UNKNOWN] = { |
Mauro Carvalho Chehab | 3dbd85b | 2007-11-03 08:07:07 -0300 | [diff] [blame] | 72 | .name = "Unknown EM2750/28xx video grabber", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 73 | .is_em2800 = 0, |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 74 | .tuner_type = TUNER_ABSENT, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 75 | }, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 76 | [EM2820_BOARD_KWORLD_PVRTV2800RF] = { |
Markus Rechberger | 33ccaa3 | 2006-02-07 06:25:41 -0200 | [diff] [blame] | 77 | .name = "Kworld PVR TV 2800 RF", |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 78 | .is_em2800 = 0, |
| 79 | .vchannels = 2, |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 80 | .tuner_type = TUNER_TEMIC_PAL, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 81 | .tda9887_conf = TDA9887_PRESENT, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 82 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 83 | .input = { { |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 84 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 85 | .vmux = SAA7115_COMPOSITE0, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 86 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 87 | }, { |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 88 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 89 | .vmux = SAA7115_SVIDEO3, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 90 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 91 | } }, |
Markus Rechberger | 4d17d08 | 2006-02-07 06:25:39 -0200 | [diff] [blame] | 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, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 96 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 97 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 98 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 99 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 100 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 101 | .vmux = SAA7115_COMPOSITE2, |
Markus Rechberger | 9475fb1 | 2006-02-27 00:07:34 -0300 | [diff] [blame] | 102 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 103 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 104 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 105 | .vmux = SAA7115_COMPOSITE0, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 106 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 107 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 108 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 109 | .vmux = SAA7115_SVIDEO3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 110 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 111 | } }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 112 | }, |
| 113 | [EM2820_BOARD_PINNACLE_USB_2] = { |
| 114 | .name = "Pinnacle PCTV USB 2", |
| 115 | .vchannels = 3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 116 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 117 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 118 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 119 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 120 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 121 | .vmux = SAA7115_COMPOSITE2, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 122 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 123 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 124 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 125 | .vmux = SAA7115_COMPOSITE0, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 126 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 127 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 128 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 129 | .vmux = SAA7115_SVIDEO3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 130 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 131 | } }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 132 | }, |
| 133 | [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { |
| 134 | .name = "Hauppauge WinTV USB 2", |
| 135 | .vchannels = 3, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 136 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 137 | .tda9887_conf = TDA9887_PRESENT | |
| 138 | TDA9887_PORT1_ACTIVE| |
| 139 | TDA9887_PORT2_ACTIVE, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 140 | .decoder = EM28XX_TVP5150, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 141 | .has_msp34xx = 1, |
| 142 | /*FIXME: S-Video not tested */ |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 143 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 144 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 145 | .vmux = TVP5150_COMPOSITE0, |
Hans Verkuil | 2474ed4 | 2006-03-19 12:35:57 -0300 | [diff] [blame] | 146 | .amux = MSP_INPUT_DEFAULT, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 147 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 148 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 149 | .vmux = TVP5150_SVIDEO, |
Hans Verkuil | 0715172 | 2006-04-01 18:03:23 -0300 | [diff] [blame] | 150 | .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, |
| 151 | MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 152 | } }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 153 | }, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 154 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 155 | .name = "Hauppauge WinTV HVR 900", |
| 156 | .vchannels = 3, |
| 157 | .tda9887_conf = TDA9887_PRESENT, |
| 158 | .tuner_type = TUNER_XC2028, |
Mauro Carvalho Chehab | 5add9a6 | 2007-11-22 12:08:53 -0300 | [diff] [blame] | 159 | .mts_firmware = 1, |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 160 | .decoder = EM28XX_TVP5150, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 161 | .input = { { |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 162 | .type = EM28XX_VMUX_TELEVISION, |
| 163 | .vmux = TVP5150_COMPOSITE0, |
| 164 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 165 | }, { |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 166 | .type = EM28XX_VMUX_COMPOSITE1, |
| 167 | .vmux = TVP5150_COMPOSITE1, |
| 168 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 169 | }, { |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 170 | .type = EM28XX_VMUX_SVIDEO, |
| 171 | .vmux = TVP5150_SVIDEO, |
| 172 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 173 | } }, |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 174 | }, |
| 175 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = { |
Mauro Carvalho Chehab | 3abee53 | 2008-01-05 17:01:41 -0300 | [diff] [blame] | 176 | .name = "Hauppauge WinTV HVR 950", |
| 177 | .vchannels = 3, |
| 178 | .tda9887_conf = TDA9887_PRESENT, |
| 179 | .tuner_type = TUNER_XC2028, |
Mauro Carvalho Chehab | 3abee53 | 2008-01-05 17:01:41 -0300 | [diff] [blame] | 180 | .mts_firmware = 1, |
| 181 | .has_12mhz_i2s = 1, |
Mauro Carvalho Chehab | 227ad4a | 2008-04-17 21:37:40 -0300 | [diff] [blame] | 182 | .has_dvb = 1, |
Mauro Carvalho Chehab | 3abee53 | 2008-01-05 17:01:41 -0300 | [diff] [blame] | 183 | .decoder = EM28XX_TVP5150, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 184 | .input = { { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 185 | .type = EM28XX_VMUX_TELEVISION, |
| 186 | .vmux = TVP5150_COMPOSITE0, |
| 187 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 188 | }, { |
Mauro Carvalho Chehab | 7d070e2 | 2007-11-01 21:52:58 -0300 | [diff] [blame] | 189 | .type = EM28XX_VMUX_COMPOSITE1, |
| 190 | .vmux = TVP5150_COMPOSITE1, |
| 191 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 192 | }, { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 193 | .type = EM28XX_VMUX_SVIDEO, |
| 194 | .vmux = TVP5150_SVIDEO, |
| 195 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 196 | } }, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 197 | }, |
| 198 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { |
| 199 | .name = "Terratec Hybrid XS", |
| 200 | .vchannels = 3, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 201 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 202 | .tuner_type = TUNER_XC2028, |
| 203 | .decoder = EM28XX_TVP5150, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 204 | .input = { { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 205 | .type = EM28XX_VMUX_TELEVISION, |
| 206 | .vmux = TVP5150_COMPOSITE0, |
| 207 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 208 | }, { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 209 | .type = EM28XX_VMUX_COMPOSITE1, |
| 210 | .vmux = TVP5150_COMPOSITE1, |
| 211 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 212 | }, { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 213 | .type = EM28XX_VMUX_SVIDEO, |
| 214 | .vmux = TVP5150_SVIDEO, |
| 215 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 216 | } }, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 217 | }, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 218 | /* maybe there's a reason behind it why Terratec sells the Hybrid XS |
| 219 | as Prodigy XS with a different PID, let's keep it separated for now |
| 220 | maybe we'll need it lateron */ |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 221 | [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { |
| 222 | .name = "Terratec Prodigy XS", |
| 223 | .vchannels = 3, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 224 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 225 | .tuner_type = TUNER_XC2028, |
| 226 | .decoder = EM28XX_TVP5150, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 227 | .input = { { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 228 | .type = EM28XX_VMUX_TELEVISION, |
| 229 | .vmux = TVP5150_COMPOSITE0, |
| 230 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 231 | }, { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 232 | .type = EM28XX_VMUX_COMPOSITE1, |
| 233 | .vmux = TVP5150_COMPOSITE1, |
| 234 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 235 | }, { |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 236 | .type = EM28XX_VMUX_SVIDEO, |
| 237 | .vmux = TVP5150_SVIDEO, |
| 238 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 239 | } }, |
Mauro Carvalho Chehab | 1246657 | 2007-10-24 11:08:20 -0300 | [diff] [blame] | 240 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 241 | [EM2820_BOARD_MSI_VOX_USB_2] = { |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 242 | .name = "MSI VOX USB 2.0", |
| 243 | .vchannels = 3, |
| 244 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 245 | .tda9887_conf = TDA9887_PRESENT | |
| 246 | TDA9887_PORT1_ACTIVE | |
| 247 | TDA9887_PORT2_ACTIVE, |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 248 | .max_range_640_480 = 1, |
| 249 | |
| 250 | .decoder = EM28XX_SAA7114, |
| 251 | .input = { { |
| 252 | .type = EM28XX_VMUX_TELEVISION, |
| 253 | .vmux = SAA7115_COMPOSITE4, |
| 254 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 255 | }, { |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 256 | .type = EM28XX_VMUX_COMPOSITE1, |
| 257 | .vmux = SAA7115_COMPOSITE0, |
| 258 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 259 | }, { |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 260 | .type = EM28XX_VMUX_SVIDEO, |
| 261 | .vmux = SAA7115_SVIDEO3, |
| 262 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 263 | } }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 264 | }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 265 | [EM2800_BOARD_TERRATEC_CINERGY_200] = { |
| 266 | .name = "Terratec Cinergy 200 USB", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 267 | .is_em2800 = 1, |
| 268 | .vchannels = 3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 269 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 270 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 271 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 272 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 273 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 274 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 275 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 276 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 277 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 278 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 279 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 280 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 281 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 282 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 283 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 284 | } }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 285 | }, |
| 286 | [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { |
| 287 | .name = "Leadtek Winfast USB II", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 288 | .is_em2800 = 1, |
| 289 | .vchannels = 3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 290 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 291 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 292 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 293 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 294 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 295 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 296 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 297 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 298 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 299 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 300 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 301 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 302 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 303 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 304 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 305 | } }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 306 | }, |
| 307 | [EM2800_BOARD_KWORLD_USB2800] = { |
| 308 | .name = "Kworld USB2800", |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 309 | .is_em2800 = 1, |
| 310 | .vchannels = 3, |
Michael Krufky | ab8b870 | 2008-04-22 14:46:05 -0300 | [diff] [blame] | 311 | .tuner_type = TUNER_PHILIPS_FCV1236D, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 312 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 313 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 314 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 315 | .type = EM28XX_VMUX_TELEVISION, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 316 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 317 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 318 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 319 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 320 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 321 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 322 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 323 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 324 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 325 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 326 | } }, |
Mauro Carvalho Chehab | 596d92d | 2005-11-08 21:37:24 -0800 | [diff] [blame] | 327 | }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 328 | [EM2820_BOARD_PINNACLE_DVC_90] = { |
Aurelien Jarno | aec2aef | 2007-12-17 13:49:17 -0300 | [diff] [blame] | 329 | .name = "Pinnacle Dazzle DVC 90/DVC 100", |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 330 | .vchannels = 3, |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 331 | .tuner_type = TUNER_ABSENT, |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 332 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 333 | .input = { { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 334 | .type = EM28XX_VMUX_COMPOSITE1, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 335 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 336 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 337 | }, { |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 338 | .type = EM28XX_VMUX_SVIDEO, |
Hans Verkuil | c7c0b34 | 2006-04-02 13:35:00 -0300 | [diff] [blame] | 339 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 340 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 341 | } }, |
Mauro Carvalho Chehab | 45632c4 | 2005-11-08 21:38:15 -0800 | [diff] [blame] | 342 | }, |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 343 | [EM2800_BOARD_VGEAR_POCKETTV] = { |
| 344 | .name = "V-Gear PocketTV", |
| 345 | .is_em2800 = 1, |
| 346 | .vchannels = 3, |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 347 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
| 348 | .tda9887_conf = TDA9887_PRESENT, |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 349 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 350 | .input = { { |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 351 | .type = EM28XX_VMUX_TELEVISION, |
| 352 | .vmux = SAA7115_COMPOSITE2, |
| 353 | .amux = 0, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 354 | }, { |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 355 | .type = EM28XX_VMUX_COMPOSITE1, |
| 356 | .vmux = SAA7115_COMPOSITE0, |
| 357 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 358 | }, { |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 359 | .type = EM28XX_VMUX_SVIDEO, |
| 360 | .vmux = SAA7115_SVIDEO3, |
| 361 | .amux = 1, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 362 | } }, |
Sascha Sommer | 4362559 | 2007-11-03 15:05:07 -0300 | [diff] [blame] | 363 | }, |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 364 | [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { |
| 365 | .name = "Pixelview Prolink PlayTV USB 2.0", |
| 366 | .vchannels = 3, |
| 367 | .tda9887_conf = TDA9887_PRESENT, |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 368 | .tuner_type = TUNER_YMEC_TVF_5533MF, |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 369 | .decoder = EM28XX_SAA7113, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 370 | .input = { { |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 371 | .type = EM28XX_VMUX_TELEVISION, |
| 372 | .vmux = SAA7115_COMPOSITE2, |
Mauro Carvalho Chehab | 7463dda | 2008-02-05 22:29:26 -0300 | [diff] [blame] | 373 | .amux = EM28XX_AMUX_LINE_IN, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 374 | }, { |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 375 | .type = EM28XX_VMUX_COMPOSITE1, |
| 376 | .vmux = SAA7115_COMPOSITE0, |
Mauro Carvalho Chehab | 7463dda | 2008-02-05 22:29:26 -0300 | [diff] [blame] | 377 | .amux = EM28XX_AMUX_LINE_IN, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 378 | }, { |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 379 | .type = EM28XX_VMUX_SVIDEO, |
| 380 | .vmux = SAA7115_SVIDEO3, |
Mauro Carvalho Chehab | 7463dda | 2008-02-05 22:29:26 -0300 | [diff] [blame] | 381 | .amux = EM28XX_AMUX_LINE_IN, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 382 | } }, |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 383 | }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 384 | }; |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 385 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 386 | |
| 387 | /* table of devices that work with this driver */ |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 388 | struct usb_device_id em28xx_id_table [] = { |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 389 | { USB_DEVICE(0xeb1a, 0x2750), |
| 390 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 391 | { USB_DEVICE(0xeb1a, 0x2800), |
| 392 | .driver_info = EM2800_BOARD_UNKNOWN }, |
| 393 | { USB_DEVICE(0xeb1a, 0x2820), |
| 394 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 395 | { USB_DEVICE(0xeb1a, 0x2821), |
| 396 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 397 | { USB_DEVICE(0xeb1a, 0x2860), |
| 398 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 399 | { USB_DEVICE(0xeb1a, 0x2861), |
| 400 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 401 | { USB_DEVICE(0xeb1a, 0x2870), |
| 402 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 403 | { USB_DEVICE(0xeb1a, 0x2881), |
| 404 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 405 | { USB_DEVICE(0xeb1a, 0x2883), |
| 406 | .driver_info = EM2820_BOARD_UNKNOWN }, |
| 407 | { USB_DEVICE(0x0ccd, 0x0036), |
| 408 | .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, |
| 409 | { USB_DEVICE(0x2304, 0x0208), |
| 410 | .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, |
| 411 | { USB_DEVICE(0x2040, 0x4200), |
| 412 | .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, |
Mauro Carvalho Chehab | 15b9bec | 2008-01-13 12:02:20 -0300 | [diff] [blame] | 413 | { USB_DEVICE(0x2040, 0x4201), |
| 414 | .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 415 | { USB_DEVICE(0x2304, 0x0207), |
| 416 | .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, |
Aurelien Jarno | aec2aef | 2007-12-17 13:49:17 -0300 | [diff] [blame] | 417 | { USB_DEVICE(0x2304, 0x021a), |
| 418 | .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 419 | { USB_DEVICE(0x2040, 0x6500), |
| 420 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
Luc Saillard | 427d20c | 2008-01-30 17:23:00 -0300 | [diff] [blame] | 421 | { USB_DEVICE(0x2040, 0x6502), |
| 422 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
Michael Krufky | 74ee051 | 2008-05-01 18:02:30 -0300 | [diff] [blame] | 423 | { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */ |
| 424 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
| 425 | { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */ |
| 426 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
| 427 | { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */ |
| 428 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
| 429 | { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */ |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 430 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
| 431 | { USB_DEVICE(0x0ccd, 0x0042), |
| 432 | .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, |
| 433 | { USB_DEVICE(0x0ccd, 0x0047), |
| 434 | .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 435 | { }, |
| 436 | }; |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 437 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 438 | |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 439 | /* |
| 440 | * Reset sequences for analog/digital modes |
| 441 | */ |
| 442 | |
| 443 | /* Board Hauppauge WinTV HVR 900 analog */ |
Mauro Carvalho Chehab | e54318e | 2008-04-18 18:34:31 -0300 | [diff] [blame] | 444 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 445 | {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10}, |
| 446 | {0x05, 0xff, 0x10, 10}, |
| 447 | { -1, -1, -1, -1}, |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 448 | }; |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 449 | |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 450 | /* Board Hauppauge WinTV HVR 900 digital */ |
Mauro Carvalho Chehab | e54318e | 2008-04-18 18:34:31 -0300 | [diff] [blame] | 451 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 452 | {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10}, |
| 453 | {EM2880_R04_GPO, 0x04, 0x0f, 10}, |
| 454 | {EM2880_R04_GPO, 0x0c, 0x0f, 10}, |
| 455 | { -1, -1, -1, -1}, |
| 456 | }; |
| 457 | |
| 458 | /* Board Hauppauge WinTV HVR 900 tuner_callback */ |
Mauro Carvalho Chehab | e54318e | 2008-04-18 18:34:31 -0300 | [diff] [blame] | 459 | static struct em28xx_reg_seq hauppauge_wintv_hvr_900_tuner_callback[] = { |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 460 | {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, |
| 461 | {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10}, |
| 462 | {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, |
| 463 | { -1, -1, -1, -1}, |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 464 | }; |
| 465 | |
| 466 | /* |
| 467 | * EEPROM hash table for devices with generic USB IDs |
| 468 | */ |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 469 | static struct em28xx_hash_table em28xx_eeprom_hash [] = { |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 470 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 471 | {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 472 | }; |
| 473 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 474 | /* I2C devicelist hash table for devices with generic USB IDs */ |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 475 | static struct em28xx_hash_table em28xx_i2c_hash[] = { |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 476 | {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC}, |
| 477 | {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC}, |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 478 | }; |
| 479 | |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 480 | int em28xx_tuner_callback(void *ptr, int command, int arg) |
| 481 | { |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 482 | int rc = 0; |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 483 | struct em28xx *dev = ptr; |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 484 | |
| 485 | if (dev->tuner_type != TUNER_XC2028) |
| 486 | return 0; |
| 487 | |
| 488 | if (command != XC2028_TUNER_RESET) |
| 489 | return 0; |
| 490 | |
| 491 | if (dev->mode == EM28XX_ANALOG_MODE) |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 492 | rc = em28xx_gpio_set(dev, dev->tun_analog_gpio); |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 493 | else |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 494 | rc = em28xx_gpio_set(dev, dev->tun_digital_gpio); |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 495 | |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 496 | return rc; |
| 497 | } |
| 498 | EXPORT_SYMBOL_GPL(em28xx_tuner_callback); |
| 499 | |
| 500 | static void em28xx_set_model(struct em28xx *dev) |
| 501 | { |
| 502 | dev->is_em2800 = em28xx_boards[dev->model].is_em2800; |
| 503 | dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx; |
| 504 | dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; |
| 505 | dev->decoder = em28xx_boards[dev->model].decoder; |
| 506 | dev->video_inputs = em28xx_boards[dev->model].vchannels; |
| 507 | dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s; |
| 508 | dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480; |
| 509 | dev->has_dvb = em28xx_boards[dev->model].has_dvb; |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 510 | } |
| 511 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 512 | /* Since em28xx_pre_card_setup() requires a proper dev->model, |
| 513 | * this won't work for boards with generic PCI IDs |
| 514 | */ |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 515 | void em28xx_pre_card_setup(struct em28xx *dev) |
| 516 | { |
Mauro Carvalho Chehab | 89b329e | 2008-04-17 21:42:14 -0300 | [diff] [blame] | 517 | int rc; |
| 518 | |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 519 | rc = em28xx_read_reg(dev, EM2880_R04_GPO); |
| 520 | if (rc >= 0) |
| 521 | dev->reg_gpo = rc; |
| 522 | |
Mauro Carvalho Chehab | 89b329e | 2008-04-17 21:42:14 -0300 | [diff] [blame] | 523 | dev->wait_after_write = 5; |
Mauro Carvalho Chehab | 41facaa | 2008-04-17 21:44:58 -0300 | [diff] [blame] | 524 | rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID); |
Mauro Carvalho Chehab | 89b329e | 2008-04-17 21:42:14 -0300 | [diff] [blame] | 525 | if (rc > 0) { |
| 526 | switch (rc) { |
Mauro Carvalho Chehab | 2ba890e | 2008-04-17 21:42:58 -0300 | [diff] [blame] | 527 | case CHIP_ID_EM2883: |
Mauro Carvalho Chehab | 89b329e | 2008-04-17 21:42:14 -0300 | [diff] [blame] | 528 | em28xx_info("chip ID is em2882/em2883\n"); |
| 529 | dev->wait_after_write = 0; |
| 530 | break; |
| 531 | default: |
| 532 | em28xx_info("em28xx chip ID = %d\n", rc); |
| 533 | } |
| 534 | } |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 535 | em28xx_set_model(dev); |
| 536 | |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 537 | /* request some modules */ |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 538 | switch (dev->model) { |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 539 | case EM2880_BOARD_TERRATEC_PRODIGY_XS: |
| 540 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
| 541 | case EM2880_BOARD_TERRATEC_HYBRID_XS: |
Mauro Carvalho Chehab | ee6e3a8 | 2008-04-17 21:37:31 -0300 | [diff] [blame] | 542 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 543 | em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1); |
Mauro Carvalho Chehab | 41facaa | 2008-04-17 21:44:58 -0300 | [diff] [blame] | 544 | em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 545 | msleep(50); |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 546 | |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 547 | /* Sets GPO/GPIO sequences for this device */ |
| 548 | dev->analog_gpio = hauppauge_wintv_hvr_900_analog; |
| 549 | dev->digital_gpio = hauppauge_wintv_hvr_900_digital; |
| 550 | dev->tun_analog_gpio = hauppauge_wintv_hvr_900_tuner_callback; |
| 551 | dev->tun_digital_gpio = hauppauge_wintv_hvr_900_tuner_callback; |
Mauro Carvalho Chehab | 102a0b0 | 2008-04-17 21:40:45 -0300 | [diff] [blame] | 552 | |
| 553 | break; |
| 554 | } |
Mauro Carvalho Chehab | c67ec53 | 2008-04-17 21:48:00 -0300 | [diff] [blame] | 555 | |
| 556 | em28xx_gpio_set(dev, dev->tun_analog_gpio); |
| 557 | em28xx_set_mode(dev, EM28XX_ANALOG_MODE); |
| 558 | |
| 559 | /* Unlock device */ |
| 560 | em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 561 | } |
| 562 | |
Mauro Carvalho Chehab | e54318e | 2008-04-18 18:34:31 -0300 | [diff] [blame] | 563 | static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) |
Mauro Carvalho Chehab | 3ca9c09 | 2008-04-17 21:37:53 -0300 | [diff] [blame] | 564 | { |
| 565 | memset(ctl, 0, sizeof(*ctl)); |
| 566 | |
| 567 | ctl->fname = XC2028_DEFAULT_FIRMWARE; |
| 568 | ctl->max_len = 64; |
| 569 | ctl->mts = em28xx_boards[dev->model].mts_firmware; |
| 570 | |
| 571 | switch (dev->model) { |
Mauro Carvalho Chehab | e77ebda | 2008-04-18 18:37:25 -0300 | [diff] [blame] | 572 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
| 573 | ctl->demod = XC3028_FE_ZARLINK456; |
| 574 | break; |
Devin Heitmueller | bdfbf95 | 2008-04-17 21:38:27 -0300 | [diff] [blame] | 575 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: |
Mauro Carvalho Chehab | e77ebda | 2008-04-18 18:37:25 -0300 | [diff] [blame] | 576 | /* FIXME: Better to specify the needed IF */ |
Devin Heitmueller | bdfbf95 | 2008-04-17 21:38:27 -0300 | [diff] [blame] | 577 | ctl->demod = XC3028_FE_DEFAULT; |
| 578 | break; |
Mauro Carvalho Chehab | 3ca9c09 | 2008-04-17 21:37:53 -0300 | [diff] [blame] | 579 | default: |
| 580 | ctl->demod = XC3028_FE_OREN538; |
| 581 | } |
| 582 | } |
Mauro Carvalho Chehab | 3ca9c09 | 2008-04-17 21:37:53 -0300 | [diff] [blame] | 583 | |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 584 | static void em28xx_config_tuner(struct em28xx *dev) |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 585 | { |
| 586 | struct v4l2_priv_tun_config xc2028_cfg; |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 587 | struct tuner_setup tun_setup; |
| 588 | struct v4l2_frequency f; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 589 | |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 590 | if (dev->tuner_type == TUNER_ABSENT) |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 591 | return; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 592 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 593 | tun_setup.mode_mask = T_ANALOG_TV | T_RADIO; |
| 594 | tun_setup.type = dev->tuner_type; |
| 595 | tun_setup.addr = dev->tuner_addr; |
| 596 | tun_setup.tuner_callback = em28xx_tuner_callback; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 597 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 598 | em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 599 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 600 | if (dev->tuner_type == TUNER_XC2028) { |
Mauro Carvalho Chehab | 3ca9c09 | 2008-04-17 21:37:53 -0300 | [diff] [blame] | 601 | struct xc2028_ctrl ctl; |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 602 | |
Mauro Carvalho Chehab | 3ca9c09 | 2008-04-17 21:37:53 -0300 | [diff] [blame] | 603 | em28xx_setup_xc3028(dev, &ctl); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 604 | |
| 605 | xc2028_cfg.tuner = TUNER_XC2028; |
| 606 | xc2028_cfg.priv = &ctl; |
| 607 | |
| 608 | em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg); |
| 609 | } |
| 610 | |
| 611 | /* configure tuner */ |
| 612 | f.tuner = 0; |
| 613 | f.type = V4L2_TUNER_ANALOG_TV; |
| 614 | f.frequency = 9076; /* just a magic number */ |
| 615 | dev->ctl_freq = f.frequency; |
| 616 | em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f); |
| 617 | } |
| 618 | |
| 619 | static int em28xx_hint_board(struct em28xx *dev) |
| 620 | { |
| 621 | int i; |
| 622 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 623 | /* HINT method: EEPROM |
| 624 | * |
| 625 | * This method works only for boards with eeprom. |
| 626 | * Uses a hash of all eeprom bytes. The hash should be |
| 627 | * unique for a vendor/tuner pair. |
| 628 | * There are a high chance that tuners for different |
| 629 | * video standards produce different hashes. |
| 630 | */ |
| 631 | for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) { |
| 632 | if (dev->hash == em28xx_eeprom_hash[i].hash) { |
| 633 | dev->model = em28xx_eeprom_hash[i].model; |
| 634 | dev->tuner_type = em28xx_eeprom_hash[i].tuner; |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 635 | |
| 636 | em28xx_errdev("Your board has no unique USB ID.\n"); |
| 637 | em28xx_errdev("A hint were successfully done, " |
| 638 | "based on eeprom hash.\n"); |
| 639 | em28xx_errdev("This method is not 100%% failproof.\n"); |
| 640 | em28xx_errdev("If the board were missdetected, " |
| 641 | "please email this log to:\n"); |
| 642 | em28xx_errdev("\tV4L Mailing List " |
| 643 | " <video4linux-list@redhat.com>\n"); |
| 644 | em28xx_errdev("Board detected as %s\n", |
| 645 | em28xx_boards[dev->model].name); |
| 646 | |
| 647 | return 0; |
| 648 | } |
| 649 | } |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 650 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 651 | /* HINT method: I2C attached devices |
| 652 | * |
| 653 | * This method works for all boards. |
| 654 | * Uses a hash of i2c scanned devices. |
| 655 | * Devices with the same i2c attached chips will |
| 656 | * be considered equal. |
| 657 | * This method is less precise than the eeprom one. |
| 658 | */ |
| 659 | |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 660 | /* user did not request i2c scanning => do it now */ |
| 661 | if (!dev->i2c_hash) |
| 662 | em28xx_do_i2c_scan(dev); |
| 663 | |
| 664 | for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) { |
| 665 | if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { |
| 666 | dev->model = em28xx_i2c_hash[i].model; |
| 667 | dev->tuner_type = em28xx_i2c_hash[i].tuner; |
| 668 | em28xx_errdev("Your board has no unique USB ID.\n"); |
| 669 | em28xx_errdev("A hint were successfully done, " |
| 670 | "based on i2c devicelist hash.\n"); |
| 671 | em28xx_errdev("This method is not 100%% failproof.\n"); |
| 672 | em28xx_errdev("If the board were missdetected, " |
| 673 | "please email this log to:\n"); |
| 674 | em28xx_errdev("\tV4L Mailing List " |
| 675 | " <video4linux-list@redhat.com>\n"); |
| 676 | em28xx_errdev("Board detected as %s\n", |
| 677 | em28xx_boards[dev->model].name); |
| 678 | |
| 679 | return 0; |
| 680 | } |
| 681 | } |
| 682 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 683 | em28xx_errdev("Your board has no unique USB ID and thus need a " |
| 684 | "hint to be detected.\n"); |
| 685 | em28xx_errdev("You may try to use card=<n> insmod option to " |
| 686 | "workaround that.\n"); |
| 687 | em28xx_errdev("Please send an email with this log to:\n"); |
| 688 | em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n"); |
| 689 | em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash); |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 690 | em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 691 | |
| 692 | em28xx_errdev("Here is a list of valid choices for the card=<n>" |
| 693 | " insmod option:\n"); |
| 694 | for (i = 0; i < em28xx_bcount; i++) { |
| 695 | em28xx_errdev(" card=%d -> %s\n", |
| 696 | i, em28xx_boards[i].name); |
| 697 | } |
| 698 | return -1; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 699 | } |
| 700 | |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 701 | /* ----------------------------------------------------------------------- */ |
| 702 | void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir) |
| 703 | { |
| 704 | if (disable_ir) { |
| 705 | ir->get_key = NULL; |
| 706 | return ; |
| 707 | } |
| 708 | |
| 709 | /* detect & configure */ |
| 710 | switch (dev->model) { |
| 711 | case (EM2800_BOARD_UNKNOWN): |
| 712 | break; |
| 713 | case (EM2820_BOARD_UNKNOWN): |
| 714 | break; |
| 715 | case (EM2800_BOARD_TERRATEC_CINERGY_200): |
| 716 | case (EM2820_BOARD_TERRATEC_CINERGY_250): |
| 717 | ir->ir_codes = ir_codes_em_terratec; |
| 718 | ir->get_key = em28xx_get_key_terratec; |
| 719 | snprintf(ir->c.name, sizeof(ir->c.name), |
| 720 | "i2c IR (EM28XX Terratec)"); |
| 721 | break; |
| 722 | case (EM2820_BOARD_PINNACLE_USB_2): |
| 723 | ir->ir_codes = ir_codes_pinnacle_grey; |
| 724 | ir->get_key = em28xx_get_key_pinnacle_usb_grey; |
| 725 | snprintf(ir->c.name, sizeof(ir->c.name), |
| 726 | "i2c IR (EM28XX Pinnacle PCTV)"); |
| 727 | break; |
| 728 | case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): |
| 729 | ir->ir_codes = ir_codes_hauppauge_new; |
| 730 | ir->get_key = em28xx_get_key_em_haup; |
| 731 | snprintf(ir->c.name, sizeof(ir->c.name), |
| 732 | "i2c IR (EM2840 Hauppauge)"); |
| 733 | break; |
| 734 | case (EM2820_BOARD_MSI_VOX_USB_2): |
| 735 | break; |
| 736 | case (EM2800_BOARD_LEADTEK_WINFAST_USBII): |
| 737 | break; |
| 738 | case (EM2800_BOARD_KWORLD_USB2800): |
| 739 | break; |
| 740 | } |
| 741 | } |
| 742 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 743 | void em28xx_card_setup(struct em28xx *dev) |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 744 | { |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 745 | em28xx_set_model(dev); |
| 746 | |
| 747 | dev->tuner_type = em28xx_boards[dev->model].tuner_type; |
| 748 | |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 749 | /* request some modules */ |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 750 | switch (dev->model) { |
| 751 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: |
Mauro Carvalho Chehab | 98ae127 | 2007-11-05 09:30:39 -0300 | [diff] [blame] | 752 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 753 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 754 | { |
| 755 | struct tveeprom tv; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 756 | #ifdef CONFIG_MODULES |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 757 | request_module("tveeprom"); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 758 | #endif |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 759 | /* Call first TVeeprom */ |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 760 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 761 | dev->i2c_client.addr = 0xa0 >> 1; |
| 762 | tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 763 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 764 | dev->tuner_type = tv.tuner_type; |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 765 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 766 | if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { |
| 767 | dev->i2s_speed = 2048000; |
| 768 | dev->has_msp34xx = 1; |
| 769 | } |
Mauro Carvalho Chehab | 98ae127 | 2007-11-05 09:30:39 -0300 | [diff] [blame] | 770 | #ifdef CONFIG_MODULES |
| 771 | if (tv.has_ir) |
| 772 | request_module("ir-kbd-i2c"); |
| 773 | #endif |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 774 | break; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 775 | } |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 776 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
| 777 | /* GPIO enables sound on KWORLD PVR TV 2800RF */ |
| 778 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xf9", 1); |
| 779 | break; |
| 780 | case EM2820_BOARD_UNKNOWN: |
| 781 | case EM2800_BOARD_UNKNOWN: |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 782 | if (!em28xx_hint_board(dev)) |
| 783 | em28xx_set_model(dev); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 784 | } |
| 785 | |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 786 | /* Allow override tuner type by a module parameter */ |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 787 | if (tuner >= 0) |
| 788 | dev->tuner_type = tuner; |
| 789 | |
| 790 | #ifdef CONFIG_MODULES |
| 791 | /* request some modules */ |
| 792 | if (dev->has_msp34xx) |
| 793 | request_module("msp3400"); |
| 794 | if (dev->decoder == EM28XX_SAA7113 || dev->decoder == EM28XX_SAA7114) |
| 795 | request_module("saa7115"); |
| 796 | if (dev->decoder == EM28XX_TVP5150) |
| 797 | request_module("tvp5150"); |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 798 | if (dev->tuner_type != TUNER_ABSENT) |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 799 | request_module("tuner"); |
| 800 | #endif |
| 801 | |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 802 | em28xx_config_tuner(dev); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 803 | } |