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