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, |
Mauro Carvalho Chehab | 7463dda | 2008-02-05 22:29:26 -0300 | [diff] [blame^] | 396 | .amux = EM28XX_AMUX_LINE_IN, |
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, |
Mauro Carvalho Chehab | 7463dda | 2008-02-05 22:29:26 -0300 | [diff] [blame^] | 400 | .amux = EM28XX_AMUX_LINE_IN, |
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, |
Mauro Carvalho Chehab | 7463dda | 2008-02-05 22:29:26 -0300 | [diff] [blame^] | 404 | .amux = EM28XX_AMUX_LINE_IN, |
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 }, |
Luc Saillard | 427d20c | 2008-01-30 17:23:00 -0300 | [diff] [blame] | 444 | { USB_DEVICE(0x2040, 0x6502), |
| 445 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 446 | { USB_DEVICE(0x2040, 0x6513), |
| 447 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
| 448 | { USB_DEVICE(0x0ccd, 0x0042), |
| 449 | .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, |
| 450 | { USB_DEVICE(0x0ccd, 0x0047), |
| 451 | .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 452 | { }, |
| 453 | }; |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 454 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 455 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 456 | /* EEPROM hash table for devices with generic USB IDs */ |
| 457 | static struct em28xx_hash_table em28xx_eeprom_hash [] = { |
Mauro Carvalho Chehab | ea4fd56 | 2007-11-03 21:21:57 -0300 | [diff] [blame] | 458 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 459 | {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 460 | }; |
| 461 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 462 | /* I2C devicelist hash table for devices with generic USB IDs */ |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 463 | static struct em28xx_hash_table em28xx_i2c_hash[] = { |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 464 | {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC}, |
| 465 | {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC}, |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 466 | }; |
| 467 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 468 | /* Since em28xx_pre_card_setup() requires a proper dev->model, |
| 469 | * this won't work for boards with generic PCI IDs |
| 470 | */ |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 471 | void em28xx_pre_card_setup(struct em28xx *dev) |
| 472 | { |
| 473 | /* request some modules */ |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 474 | switch (dev->model) { |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 475 | case EM2880_BOARD_TERRATEC_PRODIGY_XS: |
| 476 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 477 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 478 | case EM2880_BOARD_TERRATEC_HYBRID_XS: |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 479 | em28xx_write_regs(dev, XCLK_REG, "\x27", 1); |
| 480 | em28xx_write_regs(dev, I2C_CLK_REG, "\x40", 1); |
| 481 | em28xx_write_regs(dev, 0x08, "\xff", 1); |
| 482 | em28xx_write_regs(dev, 0x04, "\x00", 1); |
| 483 | msleep(100); |
| 484 | em28xx_write_regs(dev, 0x04, "\x08", 1); |
| 485 | msleep(100); |
| 486 | em28xx_write_regs(dev, 0x08, "\xff", 1); |
| 487 | msleep(50); |
| 488 | em28xx_write_regs(dev, 0x08, "\x2d", 1); |
| 489 | msleep(50); |
| 490 | em28xx_write_regs(dev, 0x08, "\x3d", 1); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 491 | break; |
Markus Rechberger | a94e95b | 2006-01-23 17:11:10 -0200 | [diff] [blame] | 492 | } |
| 493 | } |
| 494 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 495 | static int em28xx_tuner_callback(void *ptr, int command, int arg) |
| 496 | { |
| 497 | int rc = 0; |
| 498 | struct em28xx *dev = ptr; |
| 499 | |
| 500 | if (dev->tuner_type != TUNER_XC2028) |
| 501 | return 0; |
| 502 | |
| 503 | switch (command) { |
| 504 | case XC2028_TUNER_RESET: |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 505 | { |
Mauro Carvalho Chehab | a495013 | 2008-01-06 09:45:44 -0300 | [diff] [blame] | 506 | /* GPIO and initialization codes for analog TV and radio |
| 507 | This code should be complemented for DTV, since reset |
| 508 | codes are different. |
| 509 | */ |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 510 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 511 | dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); |
| 512 | dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1); |
| 513 | |
Mauro Carvalho Chehab | a495013 | 2008-01-06 09:45:44 -0300 | [diff] [blame] | 514 | if (dev->analog_gpio) { |
| 515 | char gpio0 = dev->analog_gpio & 0xff; |
| 516 | char gpio1 = (dev->analog_gpio >> 8) & 0xff; |
| 517 | char gpio4 = dev->analog_gpio >> 24; |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 518 | |
Mauro Carvalho Chehab | a495013 | 2008-01-06 09:45:44 -0300 | [diff] [blame] | 519 | if (gpio4) { |
| 520 | dev->em28xx_write_regs(dev, 0x04, &gpio4, 1); |
| 521 | msleep(140); |
| 522 | } |
| 523 | |
| 524 | msleep(6); |
| 525 | dev->em28xx_write_regs(dev, 0x08, &gpio0, 1); |
| 526 | msleep(10); |
| 527 | dev->em28xx_write_regs(dev, 0x08, &gpio1, 1); |
| 528 | msleep(5); |
| 529 | } |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 530 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 531 | break; |
| 532 | } |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 533 | } |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 534 | return rc; |
| 535 | } |
| 536 | |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 537 | static void em28xx_config_tuner(struct em28xx *dev) |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 538 | { |
| 539 | struct v4l2_priv_tun_config xc2028_cfg; |
| 540 | struct xc2028_ctrl ctl; |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 541 | struct tuner_setup tun_setup; |
| 542 | struct v4l2_frequency f; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 543 | |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 544 | if (dev->tuner_type == TUNER_ABSENT) |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 545 | return; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 546 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 547 | tun_setup.mode_mask = T_ANALOG_TV | T_RADIO; |
| 548 | tun_setup.type = dev->tuner_type; |
| 549 | tun_setup.addr = dev->tuner_addr; |
| 550 | tun_setup.tuner_callback = em28xx_tuner_callback; |
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 | em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 553 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 554 | if (dev->tuner_type == TUNER_XC2028) { |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 555 | memset(&ctl, 0, sizeof(ctl)); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 556 | |
| 557 | ctl.fname = XC2028_DEFAULT_FIRMWARE; |
| 558 | ctl.max_len = 64; |
Mauro Carvalho Chehab | 5add9a6 | 2007-11-22 12:08:53 -0300 | [diff] [blame] | 559 | ctl.mts = em28xx_boards[dev->model].mts_firmware; |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 560 | |
| 561 | xc2028_cfg.tuner = TUNER_XC2028; |
| 562 | xc2028_cfg.priv = &ctl; |
| 563 | |
| 564 | em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg); |
| 565 | } |
| 566 | |
| 567 | /* configure tuner */ |
| 568 | f.tuner = 0; |
| 569 | f.type = V4L2_TUNER_ANALOG_TV; |
| 570 | f.frequency = 9076; /* just a magic number */ |
| 571 | dev->ctl_freq = f.frequency; |
| 572 | em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f); |
| 573 | } |
| 574 | |
| 575 | static int em28xx_hint_board(struct em28xx *dev) |
| 576 | { |
| 577 | int i; |
| 578 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 579 | /* HINT method: EEPROM |
| 580 | * |
| 581 | * This method works only for boards with eeprom. |
| 582 | * Uses a hash of all eeprom bytes. The hash should be |
| 583 | * unique for a vendor/tuner pair. |
| 584 | * There are a high chance that tuners for different |
| 585 | * video standards produce different hashes. |
| 586 | */ |
| 587 | for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) { |
| 588 | if (dev->hash == em28xx_eeprom_hash[i].hash) { |
| 589 | dev->model = em28xx_eeprom_hash[i].model; |
| 590 | dev->tuner_type = em28xx_eeprom_hash[i].tuner; |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 591 | |
| 592 | em28xx_errdev("Your board has no unique USB ID.\n"); |
| 593 | em28xx_errdev("A hint were successfully done, " |
| 594 | "based on eeprom hash.\n"); |
| 595 | em28xx_errdev("This method is not 100%% failproof.\n"); |
| 596 | em28xx_errdev("If the board were missdetected, " |
| 597 | "please email this log to:\n"); |
| 598 | em28xx_errdev("\tV4L Mailing List " |
| 599 | " <video4linux-list@redhat.com>\n"); |
| 600 | em28xx_errdev("Board detected as %s\n", |
| 601 | em28xx_boards[dev->model].name); |
| 602 | |
| 603 | return 0; |
| 604 | } |
| 605 | } |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 606 | |
Mauro Carvalho Chehab | d2ba055 | 2007-11-04 08:32:42 -0300 | [diff] [blame] | 607 | /* HINT method: I2C attached devices |
| 608 | * |
| 609 | * This method works for all boards. |
| 610 | * Uses a hash of i2c scanned devices. |
| 611 | * Devices with the same i2c attached chips will |
| 612 | * be considered equal. |
| 613 | * This method is less precise than the eeprom one. |
| 614 | */ |
| 615 | |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 616 | /* user did not request i2c scanning => do it now */ |
| 617 | if (!dev->i2c_hash) |
| 618 | em28xx_do_i2c_scan(dev); |
| 619 | |
| 620 | for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) { |
| 621 | if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { |
| 622 | dev->model = em28xx_i2c_hash[i].model; |
| 623 | dev->tuner_type = em28xx_i2c_hash[i].tuner; |
| 624 | em28xx_errdev("Your board has no unique USB ID.\n"); |
| 625 | em28xx_errdev("A hint were successfully done, " |
| 626 | "based on i2c devicelist hash.\n"); |
| 627 | em28xx_errdev("This method is not 100%% failproof.\n"); |
| 628 | em28xx_errdev("If the board were missdetected, " |
| 629 | "please email this log to:\n"); |
| 630 | em28xx_errdev("\tV4L Mailing List " |
| 631 | " <video4linux-list@redhat.com>\n"); |
| 632 | em28xx_errdev("Board detected as %s\n", |
| 633 | em28xx_boards[dev->model].name); |
| 634 | |
| 635 | return 0; |
| 636 | } |
| 637 | } |
| 638 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 639 | em28xx_errdev("Your board has no unique USB ID and thus need a " |
| 640 | "hint to be detected.\n"); |
| 641 | em28xx_errdev("You may try to use card=<n> insmod option to " |
| 642 | "workaround that.\n"); |
| 643 | em28xx_errdev("Please send an email with this log to:\n"); |
| 644 | em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n"); |
| 645 | em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash); |
Sascha Sommer | fad7b95 | 2007-11-04 08:06:48 -0300 | [diff] [blame] | 646 | 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] | 647 | |
| 648 | em28xx_errdev("Here is a list of valid choices for the card=<n>" |
| 649 | " insmod option:\n"); |
| 650 | for (i = 0; i < em28xx_bcount; i++) { |
| 651 | em28xx_errdev(" card=%d -> %s\n", |
| 652 | i, em28xx_boards[i].name); |
| 653 | } |
| 654 | return -1; |
Mauro Carvalho Chehab | 882876b | 2007-10-29 11:33:18 -0300 | [diff] [blame] | 655 | } |
| 656 | |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 657 | |
| 658 | static void em28xx_set_model(struct em28xx *dev) |
| 659 | { |
| 660 | dev->is_em2800 = em28xx_boards[dev->model].is_em2800; |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 661 | dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx; |
| 662 | dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; |
| 663 | dev->decoder = em28xx_boards[dev->model].decoder; |
| 664 | dev->video_inputs = em28xx_boards[dev->model].vchannels; |
Mauro Carvalho Chehab | 74f38a8 | 2008-01-05 09:54:58 -0300 | [diff] [blame] | 665 | dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; |
Mauro Carvalho Chehab | 3abee53 | 2008-01-05 17:01:41 -0300 | [diff] [blame] | 666 | dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s; |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 667 | 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] | 668 | } |
| 669 | |
Mauro Carvalho Chehab | c8793b0 | 2008-01-13 15:42:17 -0300 | [diff] [blame] | 670 | /* ----------------------------------------------------------------------- */ |
| 671 | void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir) |
| 672 | { |
| 673 | if (disable_ir) { |
| 674 | ir->get_key = NULL; |
| 675 | return ; |
| 676 | } |
| 677 | |
| 678 | /* detect & configure */ |
| 679 | switch (dev->model) { |
| 680 | case (EM2800_BOARD_UNKNOWN): |
| 681 | break; |
| 682 | case (EM2820_BOARD_UNKNOWN): |
| 683 | break; |
| 684 | case (EM2800_BOARD_TERRATEC_CINERGY_200): |
| 685 | case (EM2820_BOARD_TERRATEC_CINERGY_250): |
| 686 | ir->ir_codes = ir_codes_em_terratec; |
| 687 | ir->get_key = em28xx_get_key_terratec; |
| 688 | snprintf(ir->c.name, sizeof(ir->c.name), |
| 689 | "i2c IR (EM28XX Terratec)"); |
| 690 | break; |
| 691 | case (EM2820_BOARD_PINNACLE_USB_2): |
| 692 | ir->ir_codes = ir_codes_pinnacle_grey; |
| 693 | ir->get_key = em28xx_get_key_pinnacle_usb_grey; |
| 694 | snprintf(ir->c.name, sizeof(ir->c.name), |
| 695 | "i2c IR (EM28XX Pinnacle PCTV)"); |
| 696 | break; |
| 697 | case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): |
| 698 | ir->ir_codes = ir_codes_hauppauge_new; |
| 699 | ir->get_key = em28xx_get_key_em_haup; |
| 700 | snprintf(ir->c.name, sizeof(ir->c.name), |
| 701 | "i2c IR (EM2840 Hauppauge)"); |
| 702 | break; |
| 703 | case (EM2820_BOARD_MSI_VOX_USB_2): |
| 704 | break; |
| 705 | case (EM2800_BOARD_LEADTEK_WINFAST_USBII): |
| 706 | break; |
| 707 | case (EM2800_BOARD_KWORLD_USB2800): |
| 708 | break; |
| 709 | } |
| 710 | } |
| 711 | |
Mauro Carvalho Chehab | 3acf280 | 2005-11-08 21:38:27 -0800 | [diff] [blame] | 712 | void em28xx_card_setup(struct em28xx *dev) |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 713 | { |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 714 | em28xx_set_model(dev); |
| 715 | |
| 716 | dev->tuner_type = em28xx_boards[dev->model].tuner_type; |
| 717 | |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 718 | /* request some modules */ |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 719 | switch (dev->model) { |
| 720 | case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: |
Mauro Carvalho Chehab | 98ae127 | 2007-11-05 09:30:39 -0300 | [diff] [blame] | 721 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
Aidan Thornton | 122d158 | 2007-11-20 15:25:08 -0300 | [diff] [blame] | 722 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 723 | { |
| 724 | struct tveeprom tv; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 725 | #ifdef CONFIG_MODULES |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 726 | request_module("tveeprom"); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 727 | #endif |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 728 | /* Call first TVeeprom */ |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 729 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 730 | dev->i2c_client.addr = 0xa0 >> 1; |
| 731 | tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 732 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 733 | dev->tuner_type = tv.tuner_type; |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 734 | |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 735 | if (tv.audio_processor == AUDIO_CHIP_MSP34XX) { |
| 736 | dev->i2s_speed = 2048000; |
| 737 | dev->has_msp34xx = 1; |
| 738 | } |
Mauro Carvalho Chehab | 98ae127 | 2007-11-05 09:30:39 -0300 | [diff] [blame] | 739 | #ifdef CONFIG_MODULES |
| 740 | if (tv.has_ir) |
| 741 | request_module("ir-kbd-i2c"); |
| 742 | #endif |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 743 | break; |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 744 | } |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 745 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
| 746 | /* GPIO enables sound on KWORLD PVR TV 2800RF */ |
| 747 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xf9", 1); |
| 748 | break; |
| 749 | case EM2820_BOARD_UNKNOWN: |
| 750 | case EM2800_BOARD_UNKNOWN: |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 751 | if (!em28xx_hint_board(dev)) |
| 752 | em28xx_set_model(dev); |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 753 | } |
| 754 | |
Mauro Carvalho Chehab | f8b6030 | 2007-11-05 08:42:55 -0300 | [diff] [blame] | 755 | /* Allow override tuner type by a module parameter */ |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 756 | if (tuner >= 0) |
| 757 | dev->tuner_type = tuner; |
| 758 | |
| 759 | #ifdef CONFIG_MODULES |
| 760 | /* request some modules */ |
| 761 | if (dev->has_msp34xx) |
| 762 | request_module("msp3400"); |
| 763 | if (dev->decoder == EM28XX_SAA7113 || dev->decoder == EM28XX_SAA7114) |
| 764 | request_module("saa7115"); |
| 765 | if (dev->decoder == EM28XX_TVP5150) |
| 766 | request_module("tvp5150"); |
Mauro Carvalho Chehab | ed08631 | 2008-01-24 06:59:20 -0300 | [diff] [blame] | 767 | if (dev->tuner_type != TUNER_ABSENT) |
Mauro Carvalho Chehab | 03910cc | 2007-11-03 21:20:59 -0300 | [diff] [blame] | 768 | request_module("tuner"); |
| 769 | #endif |
| 770 | |
Mauro Carvalho Chehab | c23f594 | 2007-11-23 14:22:14 -0300 | [diff] [blame] | 771 | em28xx_config_tuner(dev); |
akpm@osdl.org | a6c2ba2 | 2005-11-08 21:37:07 -0800 | [diff] [blame] | 772 | } |