Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Driver for the Conexant CX23885 PCIe bridge |
| 3 | * |
Steven Toth | 6d89761 | 2008-09-03 17:12:12 -0300 | [diff] [blame] | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | */ |
| 21 | |
| 22 | #include <linux/init.h> |
| 23 | #include <linux/module.h> |
| 24 | #include <linux/pci.h> |
| 25 | #include <linux/delay.h> |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 26 | #include <media/cx25840.h> |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 27 | #include <linux/firmware.h> |
Igor M. Liplianin | cff4fa8 | 2011-09-23 11:17:41 -0300 | [diff] [blame] | 28 | #include <misc/altera.h> |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 29 | |
| 30 | #include "cx23885.h" |
Steven Toth | 90a71b1 | 2008-08-04 21:38:46 -0300 | [diff] [blame] | 31 | #include "tuner-xc2028.h" |
Abylay Ospan | b8f0d30 | 2011-07-14 05:20:29 -0300 | [diff] [blame] | 32 | #include "netup-eeprom.h" |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 33 | #include "netup-init.h" |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 34 | #include "altera-ci.h" |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 35 | #include "xc4000.h" |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 36 | #include "xc5000.h" |
Andy Walls | 29f8a0a | 2009-09-26 23:17:30 -0300 | [diff] [blame] | 37 | #include "cx23888-ir.h" |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 38 | |
Abylay Ospan | 2d12421 | 2011-07-18 04:14:28 -0300 | [diff] [blame] | 39 | static unsigned int netup_card_rev = 1; |
| 40 | module_param(netup_card_rev, int, 0644); |
| 41 | MODULE_PARM_DESC(netup_card_rev, |
| 42 | "NetUP Dual DVB-T/C CI card revision"); |
Andy Walls | fa647f2 | 2010-07-19 21:22:05 -0300 | [diff] [blame] | 43 | static unsigned int enable_885_ir; |
| 44 | module_param(enable_885_ir, int, 0644); |
| 45 | MODULE_PARM_DESC(enable_885_ir, |
| 46 | "Enable integrated IR controller for supported\n" |
| 47 | "\t\t CX2388[57] boards that are wired for it:\n" |
| 48 | "\t\t\tHVR-1250 (reported safe)\n" |
| 49 | "\t\t\tTeVii S470 (reported unsafe)\n" |
| 50 | "\t\t This can cause an interrupt storm with some cards.\n" |
| 51 | "\t\t Default: 0 [Disabled]"); |
| 52 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 53 | /* ------------------------------------------------------------------ */ |
| 54 | /* board config info */ |
| 55 | |
| 56 | struct cx23885_board cx23885_boards[] = { |
| 57 | [CX23885_BOARD_UNKNOWN] = { |
| 58 | .name = "UNKNOWN/GENERIC", |
Steven Toth | c771261 | 2008-01-10 02:24:27 -0300 | [diff] [blame] | 59 | /* Ensure safe default for unknown boards */ |
| 60 | .clk_freq = 0, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 61 | .input = {{ |
| 62 | .type = CX23885_VMUX_COMPOSITE1, |
| 63 | .vmux = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 64 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 65 | .type = CX23885_VMUX_COMPOSITE2, |
| 66 | .vmux = 1, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 67 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 68 | .type = CX23885_VMUX_COMPOSITE3, |
| 69 | .vmux = 2, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 70 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 71 | .type = CX23885_VMUX_COMPOSITE4, |
| 72 | .vmux = 3, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 73 | } }, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 74 | }, |
| 75 | [CX23885_BOARD_HAUPPAUGE_HVR1800lp] = { |
| 76 | .name = "Hauppauge WinTV-HVR1800lp", |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 77 | .portc = CX23885_MPEG_DVB, |
| 78 | .input = {{ |
| 79 | .type = CX23885_VMUX_TELEVISION, |
| 80 | .vmux = 0, |
| 81 | .gpio0 = 0xff00, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 82 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 83 | .type = CX23885_VMUX_DEBUG, |
| 84 | .vmux = 0, |
| 85 | .gpio0 = 0xff01, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 86 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 87 | .type = CX23885_VMUX_COMPOSITE1, |
| 88 | .vmux = 1, |
| 89 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 90 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 91 | .type = CX23885_VMUX_SVIDEO, |
| 92 | .vmux = 2, |
| 93 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 94 | } }, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 95 | }, |
| 96 | [CX23885_BOARD_HAUPPAUGE_HVR1800] = { |
| 97 | .name = "Hauppauge WinTV-HVR1800", |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 98 | .porta = CX23885_ANALOG_VIDEO, |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 99 | .portb = CX23885_MPEG_ENCODER, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 100 | .portc = CX23885_MPEG_DVB, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 101 | .tuner_type = TUNER_PHILIPS_TDA8290, |
| 102 | .tuner_addr = 0x42, /* 0x84 >> 1 */ |
Igor M. Liplianin | 557f48d | 2011-01-25 17:05:00 -0300 | [diff] [blame] | 103 | .tuner_bus = 1, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 104 | .input = {{ |
| 105 | .type = CX23885_VMUX_TELEVISION, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 106 | .vmux = CX25840_VIN7_CH3 | |
| 107 | CX25840_VIN5_CH2 | |
| 108 | CX25840_VIN2_CH1, |
Steven Toth | 33cdeb3 | 2011-10-10 11:09:55 -0300 | [diff] [blame] | 109 | .amux = CX25840_AUDIO8, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 110 | .gpio0 = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 111 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 112 | .type = CX23885_VMUX_COMPOSITE1, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 113 | .vmux = CX25840_VIN7_CH3 | |
| 114 | CX25840_VIN4_CH2 | |
| 115 | CX25840_VIN6_CH1, |
Steven Toth | 33cdeb3 | 2011-10-10 11:09:55 -0300 | [diff] [blame] | 116 | .amux = CX25840_AUDIO7, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 117 | .gpio0 = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 118 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 119 | .type = CX23885_VMUX_SVIDEO, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 120 | .vmux = CX25840_VIN7_CH3 | |
| 121 | CX25840_VIN4_CH2 | |
| 122 | CX25840_VIN8_CH1 | |
| 123 | CX25840_SVIDEO_ON, |
Steven Toth | 33cdeb3 | 2011-10-10 11:09:55 -0300 | [diff] [blame] | 124 | .amux = CX25840_AUDIO7, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 125 | .gpio0 = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 126 | } }, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 127 | }, |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { |
| 129 | .name = "Hauppauge WinTV-HVR1250", |
| 130 | .portc = CX23885_MPEG_DVB, |
| 131 | .input = {{ |
| 132 | .type = CX23885_VMUX_TELEVISION, |
| 133 | .vmux = 0, |
| 134 | .gpio0 = 0xff00, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 135 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 136 | .type = CX23885_VMUX_DEBUG, |
| 137 | .vmux = 0, |
| 138 | .gpio0 = 0xff01, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 139 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 140 | .type = CX23885_VMUX_COMPOSITE1, |
| 141 | .vmux = 1, |
| 142 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 143 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 144 | .type = CX23885_VMUX_SVIDEO, |
| 145 | .vmux = 2, |
| 146 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 147 | } }, |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 148 | }, |
Michael Krufky | 9bc37ca | 2007-09-08 15:17:13 -0300 | [diff] [blame] | 149 | [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP] = { |
| 150 | .name = "DViCO FusionHDTV5 Express", |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 151 | .portb = CX23885_MPEG_DVB, |
Michael Krufky | 9bc37ca | 2007-09-08 15:17:13 -0300 | [diff] [blame] | 152 | }, |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 153 | [CX23885_BOARD_HAUPPAUGE_HVR1500Q] = { |
| 154 | .name = "Hauppauge WinTV-HVR1500Q", |
| 155 | .portc = CX23885_MPEG_DVB, |
| 156 | }, |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 157 | [CX23885_BOARD_HAUPPAUGE_HVR1500] = { |
| 158 | .name = "Hauppauge WinTV-HVR1500", |
Mijhail Moreyra | 18d6447 | 2011-10-10 11:09:53 -0300 | [diff] [blame] | 159 | .porta = CX23885_ANALOG_VIDEO, |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 160 | .portc = CX23885_MPEG_DVB, |
Mijhail Moreyra | 18d6447 | 2011-10-10 11:09:53 -0300 | [diff] [blame] | 161 | .tuner_type = TUNER_XC2028, |
| 162 | .tuner_addr = 0x61, /* 0xc2 >> 1 */ |
| 163 | .input = {{ |
| 164 | .type = CX23885_VMUX_TELEVISION, |
| 165 | .vmux = CX25840_VIN7_CH3 | |
| 166 | CX25840_VIN5_CH2 | |
| 167 | CX25840_VIN2_CH1, |
| 168 | .gpio0 = 0, |
| 169 | }, { |
| 170 | .type = CX23885_VMUX_COMPOSITE1, |
| 171 | .vmux = CX25840_VIN7_CH3 | |
| 172 | CX25840_VIN4_CH2 | |
| 173 | CX25840_VIN6_CH1, |
| 174 | .gpio0 = 0, |
| 175 | }, { |
| 176 | .type = CX23885_VMUX_SVIDEO, |
| 177 | .vmux = CX25840_VIN7_CH3 | |
| 178 | CX25840_VIN4_CH2 | |
| 179 | CX25840_VIN8_CH1 | |
| 180 | CX25840_SVIDEO_ON, |
| 181 | .gpio0 = 0, |
| 182 | } }, |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 183 | }, |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 184 | [CX23885_BOARD_HAUPPAUGE_HVR1200] = { |
| 185 | .name = "Hauppauge WinTV-HVR1200", |
| 186 | .portc = CX23885_MPEG_DVB, |
| 187 | }, |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 188 | [CX23885_BOARD_HAUPPAUGE_HVR1700] = { |
| 189 | .name = "Hauppauge WinTV-HVR1700", |
| 190 | .portc = CX23885_MPEG_DVB, |
| 191 | }, |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 192 | [CX23885_BOARD_HAUPPAUGE_HVR1400] = { |
| 193 | .name = "Hauppauge WinTV-HVR1400", |
| 194 | .portc = CX23885_MPEG_DVB, |
| 195 | }, |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 196 | [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = { |
| 197 | .name = "DViCO FusionHDTV7 Dual Express", |
Steven Toth | aaadeac | 2008-06-30 20:58:38 -0300 | [diff] [blame] | 198 | .portb = CX23885_MPEG_DVB, |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 199 | .portc = CX23885_MPEG_DVB, |
| 200 | }, |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 201 | [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP] = { |
| 202 | .name = "DViCO FusionHDTV DVB-T Dual Express", |
| 203 | .portb = CX23885_MPEG_DVB, |
| 204 | .portc = CX23885_MPEG_DVB, |
| 205 | }, |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 206 | [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H] = { |
| 207 | .name = "Leadtek Winfast PxDVR3200 H", |
| 208 | .portc = CX23885_MPEG_DVB, |
| 209 | }, |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 210 | [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000] = { |
| 211 | .name = "Leadtek Winfast PxDVR3200 H XC4000", |
| 212 | .porta = CX23885_ANALOG_VIDEO, |
| 213 | .portc = CX23885_MPEG_DVB, |
| 214 | .tuner_type = TUNER_XC4000, |
| 215 | .tuner_addr = 0x61, |
Miroslav Slugen | 9ee8537 | 2011-12-11 20:19:34 -0300 | [diff] [blame] | 216 | .radio_type = UNSET, |
| 217 | .radio_addr = ADDR_UNSET, |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 218 | .input = {{ |
| 219 | .type = CX23885_VMUX_TELEVISION, |
| 220 | .vmux = CX25840_VIN2_CH1 | |
| 221 | CX25840_VIN5_CH2 | |
| 222 | CX25840_NONE0_CH3, |
| 223 | }, { |
| 224 | .type = CX23885_VMUX_COMPOSITE1, |
| 225 | .vmux = CX25840_COMPOSITE1, |
| 226 | }, { |
| 227 | .type = CX23885_VMUX_SVIDEO, |
| 228 | .vmux = CX25840_SVIDEO_LUMA3 | |
| 229 | CX25840_SVIDEO_CHROMA4, |
| 230 | }, { |
| 231 | .type = CX23885_VMUX_COMPONENT, |
| 232 | .vmux = CX25840_VIN7_CH1 | |
| 233 | CX25840_VIN6_CH2 | |
| 234 | CX25840_VIN8_CH3 | |
| 235 | CX25840_COMPONENT_ON, |
| 236 | } }, |
| 237 | }, |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 238 | [CX23885_BOARD_COMPRO_VIDEOMATE_E650F] = { |
| 239 | .name = "Compro VideoMate E650F", |
| 240 | .portc = CX23885_MPEG_DVB, |
| 241 | }, |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 242 | [CX23885_BOARD_TBS_6920] = { |
| 243 | .name = "TurboSight TBS 6920", |
| 244 | .portb = CX23885_MPEG_DVB, |
| 245 | }, |
Igor M. Liplianin | 579943f | 2009-01-17 12:18:26 -0300 | [diff] [blame] | 246 | [CX23885_BOARD_TEVII_S470] = { |
| 247 | .name = "TeVii S470", |
| 248 | .portb = CX23885_MPEG_DVB, |
| 249 | }, |
Igor M. Liplianin | c9b8b04 | 2009-01-17 12:23:31 -0300 | [diff] [blame] | 250 | [CX23885_BOARD_DVBWORLD_2005] = { |
| 251 | .name = "DVBWorld DVB-S2 2005", |
| 252 | .portb = CX23885_MPEG_DVB, |
| 253 | }, |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 254 | [CX23885_BOARD_NETUP_DUAL_DVBS2_CI] = { |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 255 | .ci_type = 1, |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 256 | .name = "NetUP Dual DVB-S2 CI", |
| 257 | .portb = CX23885_MPEG_DVB, |
| 258 | .portc = CX23885_MPEG_DVB, |
| 259 | }, |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 260 | [CX23885_BOARD_HAUPPAUGE_HVR1270] = { |
| 261 | .name = "Hauppauge WinTV-HVR1270", |
Michael Krufky | a5dbf45 | 2009-05-03 23:27:02 -0300 | [diff] [blame] | 262 | .portc = CX23885_MPEG_DVB, |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 263 | }, |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 264 | [CX23885_BOARD_HAUPPAUGE_HVR1275] = { |
| 265 | .name = "Hauppauge WinTV-HVR1275", |
| 266 | .portc = CX23885_MPEG_DVB, |
| 267 | }, |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 268 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { |
| 269 | .name = "Hauppauge WinTV-HVR1255", |
| 270 | .portc = CX23885_MPEG_DVB, |
| 271 | }, |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 272 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { |
| 273 | .name = "Hauppauge WinTV-HVR1210", |
| 274 | .portc = CX23885_MPEG_DVB, |
| 275 | }, |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 276 | [CX23885_BOARD_MYGICA_X8506] = { |
| 277 | .name = "Mygica X8506 DMB-TH", |
David T.L. Wong | 6f0d8c0 | 2009-10-21 13:15:30 -0300 | [diff] [blame] | 278 | .tuner_type = TUNER_XC5000, |
| 279 | .tuner_addr = 0x61, |
Igor M. Liplianin | 557f48d | 2011-01-25 17:05:00 -0300 | [diff] [blame] | 280 | .tuner_bus = 1, |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 281 | .porta = CX23885_ANALOG_VIDEO, |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 282 | .portb = CX23885_MPEG_DVB, |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 283 | .input = { |
| 284 | { |
David T.L. Wong | 6f0d8c0 | 2009-10-21 13:15:30 -0300 | [diff] [blame] | 285 | .type = CX23885_VMUX_TELEVISION, |
| 286 | .vmux = CX25840_COMPOSITE2, |
| 287 | }, |
| 288 | { |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 289 | .type = CX23885_VMUX_COMPOSITE1, |
| 290 | .vmux = CX25840_COMPOSITE8, |
| 291 | }, |
| 292 | { |
| 293 | .type = CX23885_VMUX_SVIDEO, |
| 294 | .vmux = CX25840_SVIDEO_LUMA3 | |
| 295 | CX25840_SVIDEO_CHROMA4, |
| 296 | }, |
| 297 | { |
| 298 | .type = CX23885_VMUX_COMPONENT, |
| 299 | .vmux = CX25840_COMPONENT_ON | |
| 300 | CX25840_VIN1_CH1 | |
| 301 | CX25840_VIN6_CH2 | |
| 302 | CX25840_VIN7_CH3, |
| 303 | }, |
| 304 | }, |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 305 | }, |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 306 | [CX23885_BOARD_MAGICPRO_PROHDTVE2] = { |
| 307 | .name = "Magic-Pro ProHDTV Extreme 2", |
David T.L. Wong | 6f0d8c0 | 2009-10-21 13:15:30 -0300 | [diff] [blame] | 308 | .tuner_type = TUNER_XC5000, |
| 309 | .tuner_addr = 0x61, |
Igor M. Liplianin | 557f48d | 2011-01-25 17:05:00 -0300 | [diff] [blame] | 310 | .tuner_bus = 1, |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 311 | .porta = CX23885_ANALOG_VIDEO, |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 312 | .portb = CX23885_MPEG_DVB, |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 313 | .input = { |
| 314 | { |
David T.L. Wong | 6f0d8c0 | 2009-10-21 13:15:30 -0300 | [diff] [blame] | 315 | .type = CX23885_VMUX_TELEVISION, |
| 316 | .vmux = CX25840_COMPOSITE2, |
| 317 | }, |
| 318 | { |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 319 | .type = CX23885_VMUX_COMPOSITE1, |
| 320 | .vmux = CX25840_COMPOSITE8, |
| 321 | }, |
| 322 | { |
| 323 | .type = CX23885_VMUX_SVIDEO, |
| 324 | .vmux = CX25840_SVIDEO_LUMA3 | |
| 325 | CX25840_SVIDEO_CHROMA4, |
| 326 | }, |
| 327 | { |
| 328 | .type = CX23885_VMUX_COMPONENT, |
| 329 | .vmux = CX25840_COMPONENT_ON | |
| 330 | CX25840_VIN1_CH1 | |
| 331 | CX25840_VIN6_CH2 | |
| 332 | CX25840_VIN7_CH3, |
| 333 | }, |
| 334 | }, |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 335 | }, |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 336 | [CX23885_BOARD_HAUPPAUGE_HVR1850] = { |
| 337 | .name = "Hauppauge WinTV-HVR1850", |
Steven Toth | 3504513 | 2012-01-04 21:08:35 -0300 | [diff] [blame] | 338 | .porta = CX23885_ANALOG_VIDEO, |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 339 | .portb = CX23885_MPEG_ENCODER, |
| 340 | .portc = CX23885_MPEG_DVB, |
Steven Toth | 3504513 | 2012-01-04 21:08:35 -0300 | [diff] [blame] | 341 | .tuner_type = TUNER_ABSENT, |
| 342 | .tuner_addr = 0x42, /* 0x84 >> 1 */ |
| 343 | .force_bff = 1, |
| 344 | .input = {{ |
| 345 | .type = CX23885_VMUX_TELEVISION, |
| 346 | .vmux = CX25840_VIN7_CH3 | |
| 347 | CX25840_VIN5_CH2 | |
| 348 | CX25840_VIN2_CH1 | |
| 349 | CX25840_DIF_ON, |
| 350 | .amux = CX25840_AUDIO8, |
| 351 | }, { |
| 352 | .type = CX23885_VMUX_COMPOSITE1, |
| 353 | .vmux = CX25840_VIN7_CH3 | |
| 354 | CX25840_VIN4_CH2 | |
| 355 | CX25840_VIN6_CH1, |
| 356 | .amux = CX25840_AUDIO7, |
| 357 | }, { |
| 358 | .type = CX23885_VMUX_SVIDEO, |
| 359 | .vmux = CX25840_VIN7_CH3 | |
| 360 | CX25840_VIN4_CH2 | |
| 361 | CX25840_VIN8_CH1 | |
| 362 | CX25840_SVIDEO_ON, |
| 363 | .amux = CX25840_AUDIO7, |
| 364 | } }, |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 365 | }, |
Vladimir Geroy | 34e383d | 2009-09-18 18:55:47 -0300 | [diff] [blame] | 366 | [CX23885_BOARD_COMPRO_VIDEOMATE_E800] = { |
| 367 | .name = "Compro VideoMate E800", |
| 368 | .portc = CX23885_MPEG_DVB, |
| 369 | }, |
Michael Krufky | aee0b24 | 2009-11-11 01:52:45 -0300 | [diff] [blame] | 370 | [CX23885_BOARD_HAUPPAUGE_HVR1290] = { |
| 371 | .name = "Hauppauge WinTV-HVR1290", |
| 372 | .portc = CX23885_MPEG_DVB, |
| 373 | }, |
David T. L. Wong | ea5697f | 2009-10-26 08:54:04 -0300 | [diff] [blame] | 374 | [CX23885_BOARD_MYGICA_X8558PRO] = { |
| 375 | .name = "Mygica X8558 PRO DMB-TH", |
| 376 | .portb = CX23885_MPEG_DVB, |
| 377 | .portc = CX23885_MPEG_DVB, |
| 378 | }, |
Kusanagi Kouichi | 0b32d65 | 2010-01-22 04:55:28 -0300 | [diff] [blame] | 379 | [CX23885_BOARD_LEADTEK_WINFAST_PXTV1200] = { |
| 380 | .name = "LEADTEK WinFast PxTV1200", |
| 381 | .porta = CX23885_ANALOG_VIDEO, |
| 382 | .tuner_type = TUNER_XC2028, |
| 383 | .tuner_addr = 0x61, |
Igor M. Liplianin | 557f48d | 2011-01-25 17:05:00 -0300 | [diff] [blame] | 384 | .tuner_bus = 1, |
Kusanagi Kouichi | 0b32d65 | 2010-01-22 04:55:28 -0300 | [diff] [blame] | 385 | .input = {{ |
| 386 | .type = CX23885_VMUX_TELEVISION, |
| 387 | .vmux = CX25840_VIN2_CH1 | |
| 388 | CX25840_VIN5_CH2 | |
| 389 | CX25840_NONE0_CH3, |
| 390 | }, { |
| 391 | .type = CX23885_VMUX_COMPOSITE1, |
| 392 | .vmux = CX25840_COMPOSITE1, |
| 393 | }, { |
| 394 | .type = CX23885_VMUX_SVIDEO, |
| 395 | .vmux = CX25840_SVIDEO_LUMA3 | |
| 396 | CX25840_SVIDEO_CHROMA4, |
| 397 | }, { |
| 398 | .type = CX23885_VMUX_COMPONENT, |
| 399 | .vmux = CX25840_VIN7_CH1 | |
| 400 | CX25840_VIN6_CH2 | |
| 401 | CX25840_VIN8_CH3 | |
| 402 | CX25840_COMPONENT_ON, |
| 403 | } }, |
| 404 | }, |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 405 | [CX23885_BOARD_GOTVIEW_X5_3D_HYBRID] = { |
| 406 | .name = "GoTView X5 3D Hybrid", |
| 407 | .tuner_type = TUNER_XC5000, |
| 408 | .tuner_addr = 0x64, |
Igor M. Liplianin | 557f48d | 2011-01-25 17:05:00 -0300 | [diff] [blame] | 409 | .tuner_bus = 1, |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 410 | .porta = CX23885_ANALOG_VIDEO, |
| 411 | .portb = CX23885_MPEG_DVB, |
| 412 | .input = {{ |
| 413 | .type = CX23885_VMUX_TELEVISION, |
| 414 | .vmux = CX25840_VIN2_CH1 | |
| 415 | CX25840_VIN5_CH2, |
| 416 | .gpio0 = 0x02, |
| 417 | }, { |
| 418 | .type = CX23885_VMUX_COMPOSITE1, |
| 419 | .vmux = CX23885_VMUX_COMPOSITE1, |
| 420 | }, { |
| 421 | .type = CX23885_VMUX_SVIDEO, |
| 422 | .vmux = CX25840_SVIDEO_LUMA3 | |
| 423 | CX25840_SVIDEO_CHROMA4, |
| 424 | } }, |
| 425 | }, |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 426 | [CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF] = { |
| 427 | .ci_type = 2, |
| 428 | .name = "NetUP Dual DVB-T/C-CI RF", |
| 429 | .porta = CX23885_ANALOG_VIDEO, |
| 430 | .portb = CX23885_MPEG_DVB, |
| 431 | .portc = CX23885_MPEG_DVB, |
Igor M. Liplianin | 10d0dcd | 2011-01-25 17:06:00 -0300 | [diff] [blame] | 432 | .num_fds_portb = 2, |
| 433 | .num_fds_portc = 2, |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 434 | .tuner_type = TUNER_XC5000, |
| 435 | .tuner_addr = 0x64, |
| 436 | .input = { { |
| 437 | .type = CX23885_VMUX_TELEVISION, |
| 438 | .vmux = CX25840_COMPOSITE1, |
| 439 | } }, |
| 440 | }, |
Steven Toth | 2cb9ccd | 2011-10-10 11:09:55 -0300 | [diff] [blame] | 441 | [CX23885_BOARD_MPX885] = { |
| 442 | .name = "MPX-885", |
| 443 | .porta = CX23885_ANALOG_VIDEO, |
| 444 | .input = {{ |
| 445 | .type = CX23885_VMUX_COMPOSITE1, |
| 446 | .vmux = CX25840_COMPOSITE1, |
| 447 | .amux = CX25840_AUDIO6, |
| 448 | .gpio0 = 0, |
| 449 | }, { |
| 450 | .type = CX23885_VMUX_COMPOSITE2, |
| 451 | .vmux = CX25840_COMPOSITE2, |
| 452 | .amux = CX25840_AUDIO6, |
| 453 | .gpio0 = 0, |
| 454 | }, { |
| 455 | .type = CX23885_VMUX_COMPOSITE3, |
| 456 | .vmux = CX25840_COMPOSITE3, |
| 457 | .amux = CX25840_AUDIO7, |
| 458 | .gpio0 = 0, |
| 459 | }, { |
| 460 | .type = CX23885_VMUX_COMPOSITE4, |
| 461 | .vmux = CX25840_COMPOSITE4, |
| 462 | .amux = CX25840_AUDIO7, |
| 463 | .gpio0 = 0, |
| 464 | } }, |
| 465 | }, |
Alfredo Jesús Delaiti | 8798875 | 2011-11-09 15:13:00 -0300 | [diff] [blame] | 466 | [CX23885_BOARD_MYGICA_X8507] = { |
| 467 | .name = "Mygica X8507", |
| 468 | .tuner_type = TUNER_XC5000, |
| 469 | .tuner_addr = 0x61, |
| 470 | .tuner_bus = 1, |
| 471 | .porta = CX23885_ANALOG_VIDEO, |
| 472 | .input = { |
| 473 | { |
| 474 | .type = CX23885_VMUX_TELEVISION, |
| 475 | .vmux = CX25840_COMPOSITE2, |
| 476 | .amux = CX25840_AUDIO8, |
| 477 | }, |
| 478 | { |
| 479 | .type = CX23885_VMUX_COMPOSITE1, |
| 480 | .vmux = CX25840_COMPOSITE8, |
| 481 | }, |
| 482 | { |
| 483 | .type = CX23885_VMUX_SVIDEO, |
| 484 | .vmux = CX25840_SVIDEO_LUMA3 | |
| 485 | CX25840_SVIDEO_CHROMA4, |
| 486 | }, |
| 487 | { |
| 488 | .type = CX23885_VMUX_COMPONENT, |
| 489 | .vmux = CX25840_COMPONENT_ON | |
| 490 | CX25840_VIN1_CH1 | |
| 491 | CX25840_VIN6_CH2 | |
| 492 | CX25840_VIN7_CH3, |
| 493 | }, |
| 494 | }, |
Stefan Ringel | 722c90e | 2012-01-07 09:20:48 -0300 | [diff] [blame] | 495 | }, |
| 496 | [CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL] = { |
| 497 | .name = "TerraTec Cinergy T PCIe Dual", |
| 498 | .portb = CX23885_MPEG_DVB, |
| 499 | .portc = CX23885_MPEG_DVB, |
Igor M. Liplianin | 7b134e8 | 2012-05-11 11:45:42 -0300 | [diff] [blame^] | 500 | }, |
| 501 | [CX23885_BOARD_TEVII_S471] = { |
| 502 | .name = "TeVii S471", |
| 503 | .portb = CX23885_MPEG_DVB, |
Alfredo Jesús Delaiti | 8798875 | 2011-11-09 15:13:00 -0300 | [diff] [blame] | 504 | } |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 505 | }; |
| 506 | const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); |
| 507 | |
| 508 | /* ------------------------------------------------------------------ */ |
| 509 | /* PCI subsystem IDs */ |
| 510 | |
| 511 | struct cx23885_subid cx23885_subids[] = { |
| 512 | { |
| 513 | .subvendor = 0x0070, |
| 514 | .subdevice = 0x3400, |
| 515 | .card = CX23885_BOARD_UNKNOWN, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 516 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 517 | .subvendor = 0x0070, |
| 518 | .subdevice = 0x7600, |
| 519 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800lp, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 520 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 521 | .subvendor = 0x0070, |
| 522 | .subdevice = 0x7800, |
| 523 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 524 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 525 | .subvendor = 0x0070, |
| 526 | .subdevice = 0x7801, |
| 527 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 528 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 529 | .subvendor = 0x0070, |
Michael Krufky | 6ccb8cf | 2007-12-27 21:46:34 -0300 | [diff] [blame] | 530 | .subdevice = 0x7809, |
| 531 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 532 | }, { |
Michael Krufky | 6ccb8cf | 2007-12-27 21:46:34 -0300 | [diff] [blame] | 533 | .subvendor = 0x0070, |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 534 | .subdevice = 0x7911, |
| 535 | .card = CX23885_BOARD_HAUPPAUGE_HVR1250, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 536 | }, { |
Michael Krufky | 9bc37ca | 2007-09-08 15:17:13 -0300 | [diff] [blame] | 537 | .subvendor = 0x18ac, |
| 538 | .subdevice = 0xd500, |
| 539 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 540 | }, { |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 541 | .subvendor = 0x0070, |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 542 | .subdevice = 0x7790, |
| 543 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 544 | }, { |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 545 | .subvendor = 0x0070, |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 546 | .subdevice = 0x7797, |
| 547 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 548 | }, { |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 549 | .subvendor = 0x0070, |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 550 | .subdevice = 0x7710, |
| 551 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 552 | }, { |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 553 | .subvendor = 0x0070, |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 554 | .subdevice = 0x7717, |
| 555 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500, |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 556 | }, { |
| 557 | .subvendor = 0x0070, |
| 558 | .subdevice = 0x71d1, |
| 559 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 560 | }, { |
| 561 | .subvendor = 0x0070, |
Michael Krufky | 3c3852c | 2008-05-02 16:12:44 -0300 | [diff] [blame] | 562 | .subdevice = 0x71d3, |
| 563 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, |
| 564 | }, { |
| 565 | .subvendor = 0x0070, |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 566 | .subdevice = 0x8101, |
| 567 | .card = CX23885_BOARD_HAUPPAUGE_HVR1700, |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 568 | }, { |
| 569 | .subvendor = 0x0070, |
| 570 | .subdevice = 0x8010, |
| 571 | .card = CX23885_BOARD_HAUPPAUGE_HVR1400, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 572 | }, { |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 573 | .subvendor = 0x18ac, |
| 574 | .subdevice = 0xd618, |
| 575 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 576 | }, { |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 577 | .subvendor = 0x18ac, |
| 578 | .subdevice = 0xdb78, |
| 579 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP, |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 580 | }, { |
| 581 | .subvendor = 0x107d, |
| 582 | .subdevice = 0x6681, |
| 583 | .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H, |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 584 | }, { |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 585 | .subvendor = 0x107d, |
| 586 | .subdevice = 0x6f39, |
| 587 | .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000, |
| 588 | }, { |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 589 | .subvendor = 0x185b, |
| 590 | .subdevice = 0xe800, |
| 591 | .card = CX23885_BOARD_COMPRO_VIDEOMATE_E650F, |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 592 | }, { |
| 593 | .subvendor = 0x6920, |
| 594 | .subdevice = 0x8888, |
| 595 | .card = CX23885_BOARD_TBS_6920, |
Igor M. Liplianin | 579943f | 2009-01-17 12:18:26 -0300 | [diff] [blame] | 596 | }, { |
| 597 | .subvendor = 0xd470, |
| 598 | .subdevice = 0x9022, |
| 599 | .card = CX23885_BOARD_TEVII_S470, |
Igor M. Liplianin | c9b8b04 | 2009-01-17 12:23:31 -0300 | [diff] [blame] | 600 | }, { |
| 601 | .subvendor = 0x0001, |
| 602 | .subdevice = 0x2005, |
| 603 | .card = CX23885_BOARD_DVBWORLD_2005, |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 604 | }, { |
| 605 | .subvendor = 0x1b55, |
| 606 | .subdevice = 0x2a2c, |
| 607 | .card = CX23885_BOARD_NETUP_DUAL_DVBS2_CI, |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 608 | }, { |
| 609 | .subvendor = 0x0070, |
| 610 | .subdevice = 0x2211, |
| 611 | .card = CX23885_BOARD_HAUPPAUGE_HVR1270, |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 612 | }, { |
| 613 | .subvendor = 0x0070, |
| 614 | .subdevice = 0x2215, |
| 615 | .card = CX23885_BOARD_HAUPPAUGE_HVR1275, |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 616 | }, { |
| 617 | .subvendor = 0x0070, |
Michael Krufky | 7d7b528 | 2010-06-30 18:17:35 -0300 | [diff] [blame] | 618 | .subdevice = 0x221d, |
| 619 | .card = CX23885_BOARD_HAUPPAUGE_HVR1275, |
| 620 | }, { |
| 621 | .subvendor = 0x0070, |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 622 | .subdevice = 0x2251, |
| 623 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 624 | }, { |
| 625 | .subvendor = 0x0070, |
Michael Krufky | 7d7b528 | 2010-06-30 18:17:35 -0300 | [diff] [blame] | 626 | .subdevice = 0x2259, |
| 627 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, |
| 628 | }, { |
| 629 | .subvendor = 0x0070, |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 630 | .subdevice = 0x2291, |
| 631 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
| 632 | }, { |
| 633 | .subvendor = 0x0070, |
| 634 | .subdevice = 0x2295, |
| 635 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 636 | }, { |
Michael Krufky | 7d7b528 | 2010-06-30 18:17:35 -0300 | [diff] [blame] | 637 | .subvendor = 0x0070, |
| 638 | .subdevice = 0x2299, |
| 639 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
| 640 | }, { |
| 641 | .subvendor = 0x0070, |
| 642 | .subdevice = 0x229d, |
| 643 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, /* HVR1215 */ |
| 644 | }, { |
| 645 | .subvendor = 0x0070, |
| 646 | .subdevice = 0x22f0, |
| 647 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
| 648 | }, { |
| 649 | .subvendor = 0x0070, |
| 650 | .subdevice = 0x22f1, |
| 651 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, |
| 652 | }, { |
| 653 | .subvendor = 0x0070, |
| 654 | .subdevice = 0x22f2, |
| 655 | .card = CX23885_BOARD_HAUPPAUGE_HVR1275, |
| 656 | }, { |
| 657 | .subvendor = 0x0070, |
| 658 | .subdevice = 0x22f3, |
| 659 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, /* HVR1215 */ |
| 660 | }, { |
| 661 | .subvendor = 0x0070, |
| 662 | .subdevice = 0x22f4, |
| 663 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
| 664 | }, { |
| 665 | .subvendor = 0x0070, |
| 666 | .subdevice = 0x22f5, |
| 667 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, /* HVR1215 */ |
| 668 | }, { |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 669 | .subvendor = 0x14f1, |
| 670 | .subdevice = 0x8651, |
| 671 | .card = CX23885_BOARD_MYGICA_X8506, |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 672 | }, { |
| 673 | .subvendor = 0x14f1, |
| 674 | .subdevice = 0x8657, |
| 675 | .card = CX23885_BOARD_MAGICPRO_PROHDTVE2, |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 676 | }, { |
| 677 | .subvendor = 0x0070, |
| 678 | .subdevice = 0x8541, |
| 679 | .card = CX23885_BOARD_HAUPPAUGE_HVR1850, |
Vladimir Geroy | 34e383d | 2009-09-18 18:55:47 -0300 | [diff] [blame] | 680 | }, { |
| 681 | .subvendor = 0x1858, |
| 682 | .subdevice = 0xe800, |
| 683 | .card = CX23885_BOARD_COMPRO_VIDEOMATE_E800, |
Michael Krufky | aee0b24 | 2009-11-11 01:52:45 -0300 | [diff] [blame] | 684 | }, { |
| 685 | .subvendor = 0x0070, |
| 686 | .subdevice = 0x8551, |
| 687 | .card = CX23885_BOARD_HAUPPAUGE_HVR1290, |
David T. L. Wong | ea5697f | 2009-10-26 08:54:04 -0300 | [diff] [blame] | 688 | }, { |
| 689 | .subvendor = 0x14f1, |
| 690 | .subdevice = 0x8578, |
| 691 | .card = CX23885_BOARD_MYGICA_X8558PRO, |
Kusanagi Kouichi | 0b32d65 | 2010-01-22 04:55:28 -0300 | [diff] [blame] | 692 | }, { |
| 693 | .subvendor = 0x107d, |
| 694 | .subdevice = 0x6f22, |
| 695 | .card = CX23885_BOARD_LEADTEK_WINFAST_PXTV1200, |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 696 | }, { |
| 697 | .subvendor = 0x5654, |
| 698 | .subdevice = 0x2390, |
| 699 | .card = CX23885_BOARD_GOTVIEW_X5_3D_HYBRID, |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 700 | }, { |
| 701 | .subvendor = 0x1b55, |
| 702 | .subdevice = 0xe2e4, |
| 703 | .card = CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF, |
Alfredo Jesús Delaiti | 8798875 | 2011-11-09 15:13:00 -0300 | [diff] [blame] | 704 | }, { |
| 705 | .subvendor = 0x14f1, |
| 706 | .subdevice = 0x8502, |
| 707 | .card = CX23885_BOARD_MYGICA_X8507, |
Stefan Ringel | 722c90e | 2012-01-07 09:20:48 -0300 | [diff] [blame] | 708 | }, { |
| 709 | .subvendor = 0x153b, |
| 710 | .subdevice = 0x117e, |
| 711 | .card = CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL, |
Igor M. Liplianin | 7b134e8 | 2012-05-11 11:45:42 -0300 | [diff] [blame^] | 712 | }, { |
| 713 | .subvendor = 0xd471, |
| 714 | .subdevice = 0x9022, |
| 715 | .card = CX23885_BOARD_TEVII_S471, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 716 | }, |
| 717 | }; |
| 718 | const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); |
| 719 | |
| 720 | void cx23885_card_list(struct cx23885_dev *dev) |
| 721 | { |
| 722 | int i; |
| 723 | |
| 724 | if (0 == dev->pci->subsystem_vendor && |
| 725 | 0 == dev->pci->subsystem_device) { |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 726 | printk(KERN_INFO |
| 727 | "%s: Board has no valid PCIe Subsystem ID and can't\n" |
| 728 | "%s: be autodetected. Pass card=<n> insmod option\n" |
| 729 | "%s: to workaround that. Redirect complaints to the\n" |
| 730 | "%s: vendor of the TV card. Best regards,\n" |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 731 | "%s: -- tux\n", |
| 732 | dev->name, dev->name, dev->name, dev->name, dev->name); |
| 733 | } else { |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 734 | printk(KERN_INFO |
| 735 | "%s: Your board isn't known (yet) to the driver.\n" |
| 736 | "%s: Try to pick one of the existing card configs via\n" |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 737 | "%s: card=<n> insmod option. Updating to the latest\n" |
| 738 | "%s: version might help as well.\n", |
| 739 | dev->name, dev->name, dev->name, dev->name); |
| 740 | } |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 741 | printk(KERN_INFO "%s: Here is a list of valid choices for the card=<n> insmod option:\n", |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 742 | dev->name); |
| 743 | for (i = 0; i < cx23885_bcount; i++) |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 744 | printk(KERN_INFO "%s: card=%d -> %s\n", |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 745 | dev->name, i, cx23885_boards[i].name); |
| 746 | } |
| 747 | |
| 748 | static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) |
| 749 | { |
| 750 | struct tveeprom tv; |
| 751 | |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 752 | tveeprom_hauppauge_analog(&dev->i2c_bus[0].i2c_client, &tv, |
| 753 | eeprom_data); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 754 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 755 | /* Make sure we support the board model */ |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 756 | switch (tv.model) { |
Michael Krufky | 5308cf0 | 2009-05-12 18:37:35 -0300 | [diff] [blame] | 757 | case 22001: |
| 758 | /* WinTV-HVR1270 (PCIe, Retail, half height) |
| 759 | * ATSC/QAM and basic analog, IR Blast */ |
| 760 | case 22009: |
| 761 | /* WinTV-HVR1210 (PCIe, Retail, half height) |
| 762 | * DVB-T and basic analog, IR Blast */ |
| 763 | case 22011: |
| 764 | /* WinTV-HVR1270 (PCIe, Retail, half height) |
| 765 | * ATSC/QAM and basic analog, IR Recv */ |
| 766 | case 22019: |
| 767 | /* WinTV-HVR1210 (PCIe, Retail, half height) |
| 768 | * DVB-T and basic analog, IR Recv */ |
| 769 | case 22021: |
| 770 | /* WinTV-HVR1275 (PCIe, Retail, half height) |
| 771 | * ATSC/QAM and basic analog, IR Recv */ |
| 772 | case 22029: |
| 773 | /* WinTV-HVR1210 (PCIe, Retail, half height) |
| 774 | * DVB-T and basic analog, IR Recv */ |
| 775 | case 22101: |
| 776 | /* WinTV-HVR1270 (PCIe, Retail, full height) |
| 777 | * ATSC/QAM and basic analog, IR Blast */ |
| 778 | case 22109: |
| 779 | /* WinTV-HVR1210 (PCIe, Retail, full height) |
| 780 | * DVB-T and basic analog, IR Blast */ |
| 781 | case 22111: |
| 782 | /* WinTV-HVR1270 (PCIe, Retail, full height) |
| 783 | * ATSC/QAM and basic analog, IR Recv */ |
| 784 | case 22119: |
| 785 | /* WinTV-HVR1210 (PCIe, Retail, full height) |
| 786 | * DVB-T and basic analog, IR Recv */ |
| 787 | case 22121: |
| 788 | /* WinTV-HVR1275 (PCIe, Retail, full height) |
| 789 | * ATSC/QAM and basic analog, IR Recv */ |
| 790 | case 22129: |
| 791 | /* WinTV-HVR1210 (PCIe, Retail, full height) |
| 792 | * DVB-T and basic analog, IR Recv */ |
Michael Krufky | 36396c8 | 2008-05-02 16:14:33 -0300 | [diff] [blame] | 793 | case 71009: |
| 794 | /* WinTV-HVR1200 (PCIe, Retail, full height) |
| 795 | * DVB-T and basic analog */ |
| 796 | case 71359: |
| 797 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 798 | * DVB-T and basic analog */ |
| 799 | case 71439: |
| 800 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 801 | * DVB-T and basic analog */ |
| 802 | case 71449: |
| 803 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 804 | * DVB-T and basic analog */ |
| 805 | case 71939: |
| 806 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 807 | * DVB-T and basic analog */ |
| 808 | case 71949: |
| 809 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 810 | * DVB-T and basic analog */ |
| 811 | case 71959: |
| 812 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 813 | * DVB-T and basic analog */ |
| 814 | case 71979: |
| 815 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 816 | * DVB-T and basic analog */ |
| 817 | case 71999: |
| 818 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 819 | * DVB-T and basic analog */ |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 820 | case 76601: |
| 821 | /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual |
| 822 | channel ATSC and MPEG2 HW Encoder */ |
| 823 | case 77001: |
| 824 | /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC |
| 825 | and Basic analog */ |
| 826 | case 77011: |
| 827 | /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC |
| 828 | and Basic analog */ |
| 829 | case 77041: |
| 830 | /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM |
| 831 | and Basic analog */ |
| 832 | case 77051: |
| 833 | /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM |
| 834 | and Basic analog */ |
| 835 | case 78011: |
| 836 | /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM, |
| 837 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 838 | case 78501: |
| 839 | /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, |
| 840 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 841 | case 78521: |
| 842 | /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, |
| 843 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 844 | case 78531: |
| 845 | /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM, |
| 846 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 847 | case 78631: |
| 848 | /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, |
| 849 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 850 | case 79001: |
| 851 | /* WinTV-HVR1250 (PCIe, Retail, IR, full height, |
| 852 | ATSC and Basic analog */ |
| 853 | case 79101: |
| 854 | /* WinTV-HVR1250 (PCIe, Retail, IR, half height, |
| 855 | ATSC and Basic analog */ |
Andy Walls | ebbeb46 | 2010-07-18 17:35:00 -0300 | [diff] [blame] | 856 | case 79501: |
| 857 | /* WinTV-HVR1250 (PCIe, No IR, half height, |
| 858 | ATSC [at least] and Basic analog) */ |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 859 | case 79561: |
| 860 | /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, |
| 861 | ATSC and Basic analog */ |
| 862 | case 79571: |
| 863 | /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, |
| 864 | ATSC and Basic analog */ |
| 865 | case 79671: |
| 866 | /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, |
| 867 | ATSC and Basic analog */ |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 868 | case 80019: |
| 869 | /* WinTV-HVR1400 (Express Card, Retail, IR, |
| 870 | * DVB-T and Basic analog */ |
Michael Krufky | 36396c8 | 2008-05-02 16:14:33 -0300 | [diff] [blame] | 871 | case 81509: |
| 872 | /* WinTV-HVR1700 (PCIe, OEM, No IR, half height) |
| 873 | * DVB-T and MPEG2 HW Encoder */ |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 874 | case 81519: |
Michael Krufky | 36396c8 | 2008-05-02 16:14:33 -0300 | [diff] [blame] | 875 | /* WinTV-HVR1700 (PCIe, OEM, No IR, full height) |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 876 | * DVB-T and MPEG2 HW Encoder */ |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 877 | break; |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 878 | case 85021: |
Michael Krufky | 73a5f41 | 2009-11-11 10:46:40 -0300 | [diff] [blame] | 879 | /* WinTV-HVR1850 (PCIe, Retail, 3.5mm in, IR, FM, |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 880 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 881 | break; |
Michael Krufky | 73a5f41 | 2009-11-11 10:46:40 -0300 | [diff] [blame] | 882 | case 85721: |
| 883 | /* WinTV-HVR1290 (PCIe, OEM, RCA in, IR, |
| 884 | Dual channel ATSC and Basic analog */ |
| 885 | break; |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 886 | default: |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 887 | printk(KERN_WARNING "%s: warning: " |
| 888 | "unknown hauppauge model #%d\n", |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 889 | dev->name, tv.model); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 890 | break; |
| 891 | } |
| 892 | |
| 893 | printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", |
| 894 | dev->name, tv.model); |
| 895 | } |
| 896 | |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 897 | int cx23885_tuner_callback(void *priv, int component, int command, int arg) |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 898 | { |
Steven Toth | 89ce221 | 2008-08-04 22:18:19 -0300 | [diff] [blame] | 899 | struct cx23885_tsport *port = priv; |
| 900 | struct cx23885_dev *dev = port->dev; |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 901 | u32 bitmask = 0; |
| 902 | |
Steven Toth | 89ce221 | 2008-08-04 22:18:19 -0300 | [diff] [blame] | 903 | if (command == XC2028_RESET_CLK) |
| 904 | return 0; |
| 905 | |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 906 | if (command != 0) { |
| 907 | printk(KERN_ERR "%s(): Unknown command 0x%x.\n", |
| 908 | __func__, command); |
| 909 | return -EINVAL; |
| 910 | } |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 911 | |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 912 | switch (dev->board) { |
Steven Toth | 90a71b1 | 2008-08-04 21:38:46 -0300 | [diff] [blame] | 913 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
| 914 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 915 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 916 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 917 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 918 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Vladimir Geroy | 34e383d | 2009-09-18 18:55:47 -0300 | [diff] [blame] | 919 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
Kusanagi Kouichi | 0b32d65 | 2010-01-22 04:55:28 -0300 | [diff] [blame] | 920 | case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200: |
Steven Toth | 90a71b1 | 2008-08-04 21:38:46 -0300 | [diff] [blame] | 921 | /* Tuner Reset Command */ |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 922 | bitmask = 0x04; |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 923 | break; |
| 924 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 925 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 926 | /* Two identical tuners on two different i2c buses, |
| 927 | * we need to reset the correct gpio. */ |
Christopher Pascoe | d4dc673 | 2009-04-27 11:27:04 -0300 | [diff] [blame] | 928 | if (port->nr == 1) |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 929 | bitmask = 0x01; |
Christopher Pascoe | d4dc673 | 2009-04-27 11:27:04 -0300 | [diff] [blame] | 930 | else if (port->nr == 2) |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 931 | bitmask = 0x04; |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 932 | break; |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 933 | case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID: |
| 934 | /* Tuner Reset Command */ |
| 935 | bitmask = 0x02; |
| 936 | break; |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 937 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
| 938 | altera_ci_tuner_reset(dev, port->nr); |
| 939 | break; |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 940 | } |
| 941 | |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 942 | if (bitmask) { |
| 943 | /* Drive the tuner into reset and back out */ |
| 944 | cx_clear(GP0_IO, bitmask); |
| 945 | mdelay(200); |
| 946 | cx_set(GP0_IO, bitmask); |
| 947 | } |
| 948 | |
| 949 | return 0; |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 950 | } |
Steven Toth | 73c993a | 2008-01-05 17:08:05 -0300 | [diff] [blame] | 951 | |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 952 | void cx23885_gpio_setup(struct cx23885_dev *dev) |
| 953 | { |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 954 | switch (dev->board) { |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 955 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
| 956 | /* GPIO-0 cx24227 demodulator reset */ |
| 957 | cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */ |
| 958 | break; |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 959 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
| 960 | /* GPIO-0 cx24227 demodulator */ |
| 961 | /* GPIO-2 xc3028 tuner */ |
| 962 | |
| 963 | /* Put the parts into reset */ |
| 964 | cx_set(GP0_IO, 0x00050000); |
| 965 | cx_clear(GP0_IO, 0x00000005); |
| 966 | msleep(5); |
| 967 | |
| 968 | /* Bring the parts out of reset */ |
| 969 | cx_set(GP0_IO, 0x00050005); |
| 970 | break; |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 971 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
| 972 | /* GPIO-0 cx24227 demodulator reset */ |
| 973 | /* GPIO-2 xc5000 tuner reset */ |
| 974 | cx_set(GP0_IO, 0x00050005); /* Bring the part out of reset */ |
| 975 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 976 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 977 | /* GPIO-0 656_CLK */ |
| 978 | /* GPIO-1 656_D0 */ |
| 979 | /* GPIO-2 8295A Reset */ |
| 980 | /* GPIO-3-10 cx23417 data0-7 */ |
| 981 | /* GPIO-11-14 cx23417 addr0-3 */ |
| 982 | /* GPIO-15-18 cx23417 READY, CS, RD, WR */ |
| 983 | /* GPIO-19 IR_RX */ |
Michael Krufky | 3ba71d2 | 2007-12-07 01:40:36 -0300 | [diff] [blame] | 984 | |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 985 | /* CX23417 GPIO's */ |
| 986 | /* EIO15 Zilog Reset */ |
| 987 | /* EIO14 S5H1409/CX24227 Reset */ |
Steven Toth | f659c51 | 2009-06-25 23:43:31 -0300 | [diff] [blame] | 988 | mc417_gpio_enable(dev, GPIO_15 | GPIO_14, 1); |
| 989 | |
| 990 | /* Put the demod into reset and protect the eeprom */ |
| 991 | mc417_gpio_clear(dev, GPIO_15 | GPIO_14); |
| 992 | mdelay(100); |
| 993 | |
| 994 | /* Bring the demod and blaster out of reset */ |
| 995 | mc417_gpio_set(dev, GPIO_15 | GPIO_14); |
| 996 | mdelay(100); |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 997 | |
Steven Toth | 5206d6e | 2008-01-10 02:09:27 -0300 | [diff] [blame] | 998 | /* Force the TDA8295A into reset and back */ |
Steven Toth | 21ff3e4 | 2009-06-25 23:50:39 -0300 | [diff] [blame] | 999 | cx23885_gpio_enable(dev, GPIO_2, 1); |
| 1000 | cx23885_gpio_set(dev, GPIO_2); |
Steven Toth | 5206d6e | 2008-01-10 02:09:27 -0300 | [diff] [blame] | 1001 | mdelay(20); |
Steven Toth | 21ff3e4 | 2009-06-25 23:50:39 -0300 | [diff] [blame] | 1002 | cx23885_gpio_clear(dev, GPIO_2); |
Steven Toth | 5206d6e | 2008-01-10 02:09:27 -0300 | [diff] [blame] | 1003 | mdelay(20); |
Steven Toth | 21ff3e4 | 2009-06-25 23:50:39 -0300 | [diff] [blame] | 1004 | cx23885_gpio_set(dev, GPIO_2); |
Steven Toth | 5206d6e | 2008-01-10 02:09:27 -0300 | [diff] [blame] | 1005 | mdelay(20); |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1006 | break; |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 1007 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
| 1008 | /* GPIO-0 tda10048 demodulator reset */ |
| 1009 | /* GPIO-2 tda18271 tuner reset */ |
| 1010 | |
| 1011 | /* Put the parts into reset and back */ |
| 1012 | cx_set(GP0_IO, 0x00050000); |
| 1013 | mdelay(20); |
| 1014 | cx_clear(GP0_IO, 0x00000005); |
| 1015 | mdelay(20); |
| 1016 | cx_set(GP0_IO, 0x00050005); |
| 1017 | break; |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 1018 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
| 1019 | /* GPIO-0 TDA10048 demodulator reset */ |
| 1020 | /* GPIO-2 TDA8295A Reset */ |
| 1021 | /* GPIO-3-10 cx23417 data0-7 */ |
| 1022 | /* GPIO-11-14 cx23417 addr0-3 */ |
| 1023 | /* GPIO-15-18 cx23417 READY, CS, RD, WR */ |
| 1024 | |
| 1025 | /* The following GPIO's are on the interna AVCore (cx25840) */ |
| 1026 | /* GPIO-19 IR_RX */ |
| 1027 | /* GPIO-20 IR_TX 416/DVBT Select */ |
| 1028 | /* GPIO-21 IIS DAT */ |
| 1029 | /* GPIO-22 IIS WCLK */ |
| 1030 | /* GPIO-23 IIS BCLK */ |
| 1031 | |
| 1032 | /* Put the parts into reset and back */ |
| 1033 | cx_set(GP0_IO, 0x00050000); |
| 1034 | mdelay(20); |
| 1035 | cx_clear(GP0_IO, 0x00000005); |
| 1036 | mdelay(20); |
| 1037 | cx_set(GP0_IO, 0x00050005); |
| 1038 | break; |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 1039 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
| 1040 | /* GPIO-0 Dibcom7000p demodulator reset */ |
| 1041 | /* GPIO-2 xc3028L tuner reset */ |
| 1042 | /* GPIO-13 LED */ |
| 1043 | |
| 1044 | /* Put the parts into reset and back */ |
| 1045 | cx_set(GP0_IO, 0x00050000); |
| 1046 | mdelay(20); |
| 1047 | cx_clear(GP0_IO, 0x00000005); |
| 1048 | mdelay(20); |
| 1049 | cx_set(GP0_IO, 0x00050005); |
| 1050 | break; |
Steven Toth | 1ecc5ae | 2008-06-30 21:23:50 -0300 | [diff] [blame] | 1051 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
| 1052 | /* GPIO-0 xc5000 tuner reset i2c bus 0 */ |
| 1053 | /* GPIO-1 s5h1409 demod reset i2c bus 0 */ |
| 1054 | /* GPIO-2 xc5000 tuner reset i2c bus 1 */ |
| 1055 | /* GPIO-3 s5h1409 demod reset i2c bus 0 */ |
| 1056 | |
| 1057 | /* Put the parts into reset and back */ |
| 1058 | cx_set(GP0_IO, 0x000f0000); |
| 1059 | mdelay(20); |
| 1060 | cx_clear(GP0_IO, 0x0000000f); |
| 1061 | mdelay(20); |
| 1062 | cx_set(GP0_IO, 0x000f000f); |
| 1063 | break; |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 1064 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
| 1065 | /* GPIO-0 portb xc3028 reset */ |
| 1066 | /* GPIO-1 portb zl10353 reset */ |
| 1067 | /* GPIO-2 portc xc3028 reset */ |
| 1068 | /* GPIO-3 portc zl10353 reset */ |
| 1069 | |
| 1070 | /* Put the parts into reset and back */ |
| 1071 | cx_set(GP0_IO, 0x000f0000); |
| 1072 | mdelay(20); |
| 1073 | cx_clear(GP0_IO, 0x0000000f); |
| 1074 | mdelay(20); |
| 1075 | cx_set(GP0_IO, 0x000f000f); |
| 1076 | break; |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 1077 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 1078 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 1079 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Vladimir Geroy | 34e383d | 2009-09-18 18:55:47 -0300 | [diff] [blame] | 1080 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
Kusanagi Kouichi | 0b32d65 | 2010-01-22 04:55:28 -0300 | [diff] [blame] | 1081 | case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 1082 | /* GPIO-2 xc3028 tuner reset */ |
| 1083 | |
| 1084 | /* The following GPIO's are on the internal AVCore (cx25840) */ |
| 1085 | /* GPIO-? zl10353 demod reset */ |
| 1086 | |
| 1087 | /* Put the parts into reset and back */ |
| 1088 | cx_set(GP0_IO, 0x00040000); |
| 1089 | mdelay(20); |
| 1090 | cx_clear(GP0_IO, 0x00000004); |
| 1091 | mdelay(20); |
| 1092 | cx_set(GP0_IO, 0x00040004); |
| 1093 | break; |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 1094 | case CX23885_BOARD_TBS_6920: |
| 1095 | cx_write(MC417_CTL, 0x00000036); |
| 1096 | cx_write(MC417_OEN, 0x00001000); |
Igor M. Liplianin | 09ea33e | 2009-11-24 20:16:04 -0300 | [diff] [blame] | 1097 | cx_set(MC417_RWD, 0x00000002); |
| 1098 | mdelay(200); |
| 1099 | cx_clear(MC417_RWD, 0x00000800); |
| 1100 | mdelay(200); |
| 1101 | cx_set(MC417_RWD, 0x00000800); |
| 1102 | mdelay(200); |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 1103 | break; |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 1104 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
| 1105 | /* GPIO-0 INTA from CiMax1 |
| 1106 | GPIO-1 INTB from CiMax2 |
| 1107 | GPIO-2 reset chips |
| 1108 | GPIO-3 to GPIO-10 data/addr for CA |
| 1109 | GPIO-11 ~CS0 to CiMax1 |
| 1110 | GPIO-12 ~CS1 to CiMax2 |
| 1111 | GPIO-13 ADL0 load LSB addr |
| 1112 | GPIO-14 ADL1 load MSB addr |
| 1113 | GPIO-15 ~RDY from CiMax |
| 1114 | GPIO-17 ~RD to CiMax |
| 1115 | GPIO-18 ~WR to CiMax |
| 1116 | */ |
| 1117 | cx_set(GP0_IO, 0x00040000); /* GPIO as out */ |
| 1118 | /* GPIO1 and GPIO2 as INTA and INTB from CiMaxes, reset low */ |
| 1119 | cx_clear(GP0_IO, 0x00030004); |
| 1120 | mdelay(100);/* reset delay */ |
| 1121 | cx_set(GP0_IO, 0x00040004); /* GPIO as out, reset high */ |
| 1122 | cx_write(MC417_CTL, 0x00000037);/* enable GPIO3-18 pins */ |
| 1123 | /* GPIO-15 IN as ~ACK, rest as OUT */ |
| 1124 | cx_write(MC417_OEN, 0x00001000); |
| 1125 | /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */ |
| 1126 | cx_write(MC417_RWD, 0x0000c300); |
| 1127 | /* enable irq */ |
| 1128 | cx_write(GPIO_ISM, 0x00000000);/* INTERRUPTS active low*/ |
| 1129 | break; |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 1130 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 1131 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 1132 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 1133 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 1134 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 1135 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ |
| 1136 | /* GPIO-9 Demod reset */ |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 1137 | |
| 1138 | /* Put the parts into reset and back */ |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 1139 | cx23885_gpio_enable(dev, GPIO_9 | GPIO_6 | GPIO_5, 1); |
| 1140 | cx23885_gpio_set(dev, GPIO_9 | GPIO_6 | GPIO_5); |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 1141 | cx23885_gpio_clear(dev, GPIO_9); |
| 1142 | mdelay(20); |
| 1143 | cx23885_gpio_set(dev, GPIO_9); |
| 1144 | break; |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 1145 | case CX23885_BOARD_MYGICA_X8506: |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 1146 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: |
Alfredo Jesús Delaiti | 8798875 | 2011-11-09 15:13:00 -0300 | [diff] [blame] | 1147 | case CX23885_BOARD_MYGICA_X8507: |
David T.L. Wong | 8e069bb | 2009-10-21 12:29:11 -0300 | [diff] [blame] | 1148 | /* GPIO-0 (0)Analog / (1)Digital TV */ |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 1149 | /* GPIO-1 reset XC5000 */ |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 1150 | /* GPIO-2 reset LGS8GL5 / LGS8G75 */ |
David T.L. Wong | 8e069bb | 2009-10-21 12:29:11 -0300 | [diff] [blame] | 1151 | cx23885_gpio_enable(dev, GPIO_0 | GPIO_1 | GPIO_2, 1); |
| 1152 | cx23885_gpio_clear(dev, GPIO_1 | GPIO_2); |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 1153 | mdelay(100); |
David T.L. Wong | 8e069bb | 2009-10-21 12:29:11 -0300 | [diff] [blame] | 1154 | cx23885_gpio_set(dev, GPIO_0 | GPIO_1 | GPIO_2); |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 1155 | mdelay(100); |
| 1156 | break; |
David T. L. Wong | ea5697f | 2009-10-26 08:54:04 -0300 | [diff] [blame] | 1157 | case CX23885_BOARD_MYGICA_X8558PRO: |
| 1158 | /* GPIO-0 reset first ATBM8830 */ |
| 1159 | /* GPIO-1 reset second ATBM8830 */ |
| 1160 | cx23885_gpio_enable(dev, GPIO_0 | GPIO_1, 1); |
| 1161 | cx23885_gpio_clear(dev, GPIO_0 | GPIO_1); |
| 1162 | mdelay(100); |
| 1163 | cx23885_gpio_set(dev, GPIO_0 | GPIO_1); |
| 1164 | mdelay(100); |
| 1165 | break; |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 1166 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
Michael Krufky | aee0b24 | 2009-11-11 01:52:45 -0300 | [diff] [blame] | 1167 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 1168 | /* GPIO-0 656_CLK */ |
| 1169 | /* GPIO-1 656_D0 */ |
| 1170 | /* GPIO-2 Wake# */ |
| 1171 | /* GPIO-3-10 cx23417 data0-7 */ |
| 1172 | /* GPIO-11-14 cx23417 addr0-3 */ |
| 1173 | /* GPIO-15-18 cx23417 READY, CS, RD, WR */ |
| 1174 | /* GPIO-19 IR_RX */ |
| 1175 | /* GPIO-20 C_IR_TX */ |
| 1176 | /* GPIO-21 I2S DAT */ |
| 1177 | /* GPIO-22 I2S WCLK */ |
| 1178 | /* GPIO-23 I2S BCLK */ |
| 1179 | /* ALT GPIO: EXP GPIO LATCH */ |
| 1180 | |
| 1181 | /* CX23417 GPIO's */ |
| 1182 | /* GPIO-14 S5H1411/CX24228 Reset */ |
| 1183 | /* GPIO-13 EEPROM write protect */ |
| 1184 | mc417_gpio_enable(dev, GPIO_14 | GPIO_13, 1); |
| 1185 | |
| 1186 | /* Put the demod into reset and protect the eeprom */ |
| 1187 | mc417_gpio_clear(dev, GPIO_14 | GPIO_13); |
| 1188 | mdelay(100); |
| 1189 | |
| 1190 | /* Bring the demod out of reset */ |
| 1191 | mc417_gpio_set(dev, GPIO_14); |
| 1192 | mdelay(100); |
| 1193 | |
| 1194 | /* CX24228 GPIO */ |
| 1195 | /* Connected to IF / Mux */ |
| 1196 | break; |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 1197 | case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID: |
| 1198 | cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */ |
| 1199 | break; |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1200 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
| 1201 | /* GPIO-0 ~INT in |
| 1202 | GPIO-1 TMS out |
| 1203 | GPIO-2 ~reset chips out |
| 1204 | GPIO-3 to GPIO-10 data/addr for CA in/out |
| 1205 | GPIO-11 ~CS out |
| 1206 | GPIO-12 ADDR out |
| 1207 | GPIO-13 ~WR out |
| 1208 | GPIO-14 ~RD out |
| 1209 | GPIO-15 ~RDY in |
| 1210 | GPIO-16 TCK out |
| 1211 | GPIO-17 TDO in |
| 1212 | GPIO-18 TDI out |
| 1213 | */ |
| 1214 | cx_set(GP0_IO, 0x00060000); /* GPIO-1,2 as out */ |
| 1215 | /* GPIO-0 as INT, reset & TMS low */ |
| 1216 | cx_clear(GP0_IO, 0x00010006); |
| 1217 | mdelay(100);/* reset delay */ |
| 1218 | cx_set(GP0_IO, 0x00000004); /* reset high */ |
| 1219 | cx_write(MC417_CTL, 0x00000037);/* enable GPIO-3..18 pins */ |
| 1220 | /* GPIO-17 is TDO in, GPIO-15 is ~RDY in, rest is out */ |
| 1221 | cx_write(MC417_OEN, 0x00005000); |
| 1222 | /* ~RD, ~WR high; ADDR low; ~CS high */ |
| 1223 | cx_write(MC417_RWD, 0x00000d00); |
| 1224 | /* enable irq */ |
| 1225 | cx_write(GPIO_ISM, 0x00000000);/* INTERRUPTS active low*/ |
| 1226 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | int cx23885_ir_init(struct cx23885_dev *dev) |
| 1231 | { |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1232 | static struct v4l2_subdev_io_pin_config ir_rxtx_pin_cfg[] = { |
Andy Walls | 81f287d | 2010-07-18 20:26:37 -0300 | [diff] [blame] | 1233 | { |
| 1234 | .flags = V4L2_SUBDEV_IO_PIN_INPUT, |
| 1235 | .pin = CX23885_PIN_IR_RX_GPIO19, |
| 1236 | .function = CX23885_PAD_IR_RX, |
| 1237 | .value = 0, |
| 1238 | .strength = CX25840_PIN_DRIVE_MEDIUM, |
| 1239 | }, { |
| 1240 | .flags = V4L2_SUBDEV_IO_PIN_OUTPUT, |
| 1241 | .pin = CX23885_PIN_IR_TX_GPIO20, |
| 1242 | .function = CX23885_PAD_IR_TX, |
| 1243 | .value = 0, |
| 1244 | .strength = CX25840_PIN_DRIVE_MEDIUM, |
| 1245 | } |
| 1246 | }; |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1247 | const size_t ir_rxtx_pin_cfg_count = ARRAY_SIZE(ir_rxtx_pin_cfg); |
| 1248 | |
| 1249 | static struct v4l2_subdev_io_pin_config ir_rx_pin_cfg[] = { |
| 1250 | { |
| 1251 | .flags = V4L2_SUBDEV_IO_PIN_INPUT, |
| 1252 | .pin = CX23885_PIN_IR_RX_GPIO19, |
| 1253 | .function = CX23885_PAD_IR_RX, |
| 1254 | .value = 0, |
| 1255 | .strength = CX25840_PIN_DRIVE_MEDIUM, |
| 1256 | } |
| 1257 | }; |
| 1258 | const size_t ir_rx_pin_cfg_count = ARRAY_SIZE(ir_rx_pin_cfg); |
Andy Walls | 81f287d | 2010-07-18 20:26:37 -0300 | [diff] [blame] | 1259 | |
| 1260 | struct v4l2_subdev_ir_parameters params; |
Andy Walls | 29f8a0a | 2009-09-26 23:17:30 -0300 | [diff] [blame] | 1261 | int ret = 0; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1262 | switch (dev->board) { |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 1263 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 1264 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1265 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 1266 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 1267 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 1268 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 1269 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 1270 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1271 | /* FIXME: Implement me */ |
| 1272 | break; |
Andy Walls | 9b3d8ec | 2011-06-08 21:24:25 -0300 | [diff] [blame] | 1273 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
| 1274 | ret = cx23888_ir_probe(dev); |
| 1275 | if (ret) |
| 1276 | break; |
| 1277 | dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_888_IR); |
| 1278 | v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config, |
| 1279 | ir_rx_pin_cfg_count, ir_rx_pin_cfg); |
| 1280 | break; |
Andy Walls | 29f8a0a | 2009-09-26 23:17:30 -0300 | [diff] [blame] | 1281 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
Michael Krufky | 7fec6fe | 2009-11-11 15:46:09 -0300 | [diff] [blame] | 1282 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Andy Walls | 29f8a0a | 2009-09-26 23:17:30 -0300 | [diff] [blame] | 1283 | ret = cx23888_ir_probe(dev); |
| 1284 | if (ret) |
| 1285 | break; |
| 1286 | dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_888_IR); |
Andy Walls | 81f287d | 2010-07-18 20:26:37 -0300 | [diff] [blame] | 1287 | v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config, |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1288 | ir_rxtx_pin_cfg_count, ir_rxtx_pin_cfg); |
Andy Walls | 81f287d | 2010-07-18 20:26:37 -0300 | [diff] [blame] | 1289 | /* |
| 1290 | * For these boards we need to invert the Tx output via the |
| 1291 | * IR controller to have the LED off while idle |
| 1292 | */ |
| 1293 | v4l2_subdev_call(dev->sd_ir, ir, tx_g_parameters, ¶ms); |
| 1294 | params.enable = false; |
| 1295 | params.shutdown = false; |
| 1296 | params.invert_level = true; |
| 1297 | v4l2_subdev_call(dev->sd_ir, ir, tx_s_parameters, ¶ms); |
| 1298 | params.shutdown = true; |
| 1299 | v4l2_subdev_call(dev->sd_ir, ir, tx_s_parameters, ¶ms); |
Andy Walls | 29f8a0a | 2009-09-26 23:17:30 -0300 | [diff] [blame] | 1300 | break; |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1301 | case CX23885_BOARD_TEVII_S470: |
Andy Walls | fa647f2 | 2010-07-19 21:22:05 -0300 | [diff] [blame] | 1302 | if (!enable_885_ir) |
| 1303 | break; |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1304 | dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE); |
| 1305 | if (dev->sd_ir == NULL) { |
| 1306 | ret = -ENODEV; |
| 1307 | break; |
| 1308 | } |
| 1309 | v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config, |
| 1310 | ir_rx_pin_cfg_count, ir_rx_pin_cfg); |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1311 | break; |
| 1312 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Andy Walls | fa647f2 | 2010-07-19 21:22:05 -0300 | [diff] [blame] | 1313 | if (!enable_885_ir) |
| 1314 | break; |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1315 | dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE); |
| 1316 | if (dev->sd_ir == NULL) { |
| 1317 | ret = -ENODEV; |
| 1318 | break; |
| 1319 | } |
| 1320 | v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config, |
| 1321 | ir_rxtx_pin_cfg_count, ir_rxtx_pin_cfg); |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1322 | break; |
Steven Toth | 1288687 | 2008-08-04 21:41:06 -0300 | [diff] [blame] | 1323 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
| 1324 | request_module("ir-kbd-i2c"); |
| 1325 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1326 | } |
| 1327 | |
Andy Walls | 29f8a0a | 2009-09-26 23:17:30 -0300 | [diff] [blame] | 1328 | return ret; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1329 | } |
| 1330 | |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1331 | void cx23885_ir_fini(struct cx23885_dev *dev) |
| 1332 | { |
| 1333 | switch (dev->board) { |
Andy Walls | 9b3d8ec | 2011-06-08 21:24:25 -0300 | [diff] [blame] | 1334 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1335 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
Michael Krufky | 7fec6fe | 2009-11-11 15:46:09 -0300 | [diff] [blame] | 1336 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Andy Walls | dbe83a3 | 2010-07-19 01:19:43 -0300 | [diff] [blame] | 1337 | cx23885_irq_remove(dev, PCI_MSK_IR); |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1338 | cx23888_ir_remove(dev); |
| 1339 | dev->sd_ir = NULL; |
| 1340 | break; |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1341 | case CX23885_BOARD_TEVII_S470: |
| 1342 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Andy Walls | dbe83a3 | 2010-07-19 01:19:43 -0300 | [diff] [blame] | 1343 | cx23885_irq_remove(dev, PCI_MSK_AV_CORE); |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1344 | /* sd_ir is a duplicate pointer to the AV Core, just clear it */ |
| 1345 | dev->sd_ir = NULL; |
| 1346 | break; |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1347 | } |
| 1348 | } |
| 1349 | |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1350 | int netup_jtag_io(void *device, int tms, int tdi, int read_tdo) |
| 1351 | { |
| 1352 | int data; |
| 1353 | int tdo = 0; |
| 1354 | struct cx23885_dev *dev = (struct cx23885_dev *)device; |
| 1355 | /*TMS*/ |
| 1356 | data = ((cx_read(GP0_IO)) & (~0x00000002)); |
| 1357 | data |= (tms ? 0x00020002 : 0x00020000); |
| 1358 | cx_write(GP0_IO, data); |
| 1359 | |
| 1360 | /*TDI*/ |
| 1361 | data = ((cx_read(MC417_RWD)) & (~0x0000a000)); |
| 1362 | data |= (tdi ? 0x00008000 : 0); |
| 1363 | cx_write(MC417_RWD, data); |
| 1364 | if (read_tdo) |
| 1365 | tdo = (data & 0x00004000) ? 1 : 0; /*TDO*/ |
| 1366 | |
| 1367 | cx_write(MC417_RWD, data | 0x00002000); |
| 1368 | udelay(1); |
| 1369 | /*TCK*/ |
| 1370 | cx_write(MC417_RWD, data); |
| 1371 | |
| 1372 | return tdo; |
| 1373 | } |
| 1374 | |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1375 | void cx23885_ir_pci_int_enable(struct cx23885_dev *dev) |
| 1376 | { |
| 1377 | switch (dev->board) { |
Andy Walls | 9b3d8ec | 2011-06-08 21:24:25 -0300 | [diff] [blame] | 1378 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1379 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
Michael Krufky | 7fec6fe | 2009-11-11 15:46:09 -0300 | [diff] [blame] | 1380 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Andy Walls | dbe83a3 | 2010-07-19 01:19:43 -0300 | [diff] [blame] | 1381 | if (dev->sd_ir) |
| 1382 | cx23885_irq_add_enable(dev, PCI_MSK_IR); |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1383 | break; |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1384 | case CX23885_BOARD_TEVII_S470: |
| 1385 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Andy Walls | dbe83a3 | 2010-07-19 01:19:43 -0300 | [diff] [blame] | 1386 | if (dev->sd_ir) |
| 1387 | cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE); |
Andy Walls | 98d109f | 2010-07-19 00:41:41 -0300 | [diff] [blame] | 1388 | break; |
Andy Walls | f59ad61 | 2009-09-27 19:51:50 -0300 | [diff] [blame] | 1389 | } |
| 1390 | } |
| 1391 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1392 | void cx23885_card_setup(struct cx23885_dev *dev) |
| 1393 | { |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1394 | struct cx23885_tsport *ts1 = &dev->ts1; |
| 1395 | struct cx23885_tsport *ts2 = &dev->ts2; |
| 1396 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1397 | static u8 eeprom[256]; |
| 1398 | |
| 1399 | if (dev->i2c_bus[0].i2c_rc == 0) { |
| 1400 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; |
Michael Krufky | 44a6481 | 2007-03-20 23:00:18 -0300 | [diff] [blame] | 1401 | tveeprom_read(&dev->i2c_bus[0].i2c_client, |
| 1402 | eeprom, sizeof(eeprom)); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1403 | } |
| 1404 | |
| 1405 | switch (dev->board) { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 1406 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Andy Walls | ebbeb46 | 2010-07-18 17:35:00 -0300 | [diff] [blame] | 1407 | if (dev->i2c_bus[0].i2c_rc == 0) { |
| 1408 | if (eeprom[0x80] != 0x84) |
| 1409 | hauppauge_eeprom(dev, eeprom+0xc0); |
| 1410 | else |
| 1411 | hauppauge_eeprom(dev, eeprom+0x80); |
| 1412 | } |
| 1413 | break; |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 1414 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 1415 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 1416 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
Steven Toth | c88133e | 2008-03-29 17:36:09 -0300 | [diff] [blame] | 1417 | if (dev->i2c_bus[0].i2c_rc == 0) |
| 1418 | hauppauge_eeprom(dev, eeprom+0x80); |
| 1419 | break; |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1420 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 1421 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 1422 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 1423 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 1424 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 1425 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 1426 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 1427 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Steven Toth | 13697380 | 2009-07-20 15:37:25 -0300 | [diff] [blame] | 1428 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
Michael Krufky | aee0b24 | 2009-11-11 01:52:45 -0300 | [diff] [blame] | 1429 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1430 | if (dev->i2c_bus[0].i2c_rc == 0) |
Steven Toth | c88133e | 2008-03-29 17:36:09 -0300 | [diff] [blame] | 1431 | hauppauge_eeprom(dev, eeprom+0xc0); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1432 | break; |
| 1433 | } |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1434 | |
| 1435 | switch (dev->board) { |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 1436 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 1437 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 1438 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1439 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1440 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1441 | /* break omitted intentionally */ |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1442 | case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP: |
| 1443 | ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1444 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1445 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1446 | break; |
Steven Toth | 3504513 | 2012-01-04 21:08:35 -0300 | [diff] [blame] | 1447 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 1448 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 1449 | /* Defaults for VID B - Analog encoder */ |
| 1450 | /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */ |
| 1451 | ts1->gen_ctrl_val = 0x10e; |
| 1452 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1453 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1454 | |
| 1455 | /* APB_TSVALERR_POL (active low)*/ |
| 1456 | ts1->vld_misc_val = 0x2000; |
| 1457 | ts1->hw_sop_ctrl_val = (0x47 << 16 | 188 << 4 | 0xc); |
Steven Toth | 3504513 | 2012-01-04 21:08:35 -0300 | [diff] [blame] | 1458 | cx_write(0x130184, 0xc); |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 1459 | |
| 1460 | /* Defaults for VID C */ |
| 1461 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1462 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1463 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1464 | break; |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 1465 | case CX23885_BOARD_TBS_6920: |
Igor M. Liplianin | 09ea33e | 2009-11-24 20:16:04 -0300 | [diff] [blame] | 1466 | ts1->gen_ctrl_val = 0x4; /* Parallel */ |
| 1467 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1468 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1469 | break; |
| 1470 | case CX23885_BOARD_TEVII_S470: |
Igor M. Liplianin | 7b134e8 | 2012-05-11 11:45:42 -0300 | [diff] [blame^] | 1471 | case CX23885_BOARD_TEVII_S471: |
Igor M. Liplianin | c9b8b04 | 2009-01-17 12:23:31 -0300 | [diff] [blame] | 1472 | case CX23885_BOARD_DVBWORLD_2005: |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 1473 | ts1->gen_ctrl_val = 0x5; /* Parallel */ |
| 1474 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1475 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1476 | break; |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 1477 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1478 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
Stefan Ringel | 722c90e | 2012-01-07 09:20:48 -0300 | [diff] [blame] | 1479 | case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 1480 | ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1481 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1482 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1483 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1484 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1485 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1486 | break; |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 1487 | case CX23885_BOARD_MYGICA_X8506: |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 1488 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 1489 | ts1->gen_ctrl_val = 0x5; /* Parallel */ |
| 1490 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1491 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1492 | break; |
David T. L. Wong | ea5697f | 2009-10-26 08:54:04 -0300 | [diff] [blame] | 1493 | case CX23885_BOARD_MYGICA_X8558PRO: |
| 1494 | ts1->gen_ctrl_val = 0x5; /* Parallel */ |
| 1495 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1496 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1497 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1498 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1499 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1500 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1501 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 1502 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 1503 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1504 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 1505 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 1506 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 1507 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 1508 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 1509 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 1510 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 1511 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 1512 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 1513 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 1514 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Vladimir Geroy | 34e383d | 2009-09-18 18:55:47 -0300 | [diff] [blame] | 1515 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
Michael Krufky | aee0b24 | 2009-11-11 01:52:45 -0300 | [diff] [blame] | 1516 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 1517 | case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 1518 | default: |
| 1519 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 1520 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 1521 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 1522 | } |
| 1523 | |
Steven Toth | ce89cfb | 2008-04-19 01:36:06 -0300 | [diff] [blame] | 1524 | /* Certain boards support analog, or require the avcore to be |
| 1525 | * loaded, ensure this happens. |
| 1526 | */ |
| 1527 | switch (dev->board) { |
Andy Walls | fa647f2 | 2010-07-19 21:22:05 -0300 | [diff] [blame] | 1528 | case CX23885_BOARD_TEVII_S470: |
| 1529 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
| 1530 | /* Currently only enabled for the integrated IR controller */ |
| 1531 | if (!enable_885_ir) |
| 1532 | break; |
Steven Toth | ce89cfb | 2008-04-19 01:36:06 -0300 | [diff] [blame] | 1533 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 1534 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
| 1535 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 1536 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
istvan_v@mailbox.hu | 0cf8af5 | 2011-07-11 10:58:35 -0300 | [diff] [blame] | 1537 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 1538 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 1539 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1540 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
Vladimir Geroy | 34e383d | 2009-09-18 18:55:47 -0300 | [diff] [blame] | 1541 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
Andy Walls | 9b3d8ec | 2011-06-08 21:24:25 -0300 | [diff] [blame] | 1542 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Andy Walls | c6b7053 | 2009-09-27 00:14:33 -0300 | [diff] [blame] | 1543 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
David T.L. Wong | bc1548a | 2009-10-21 11:09:28 -0300 | [diff] [blame] | 1544 | case CX23885_BOARD_MYGICA_X8506: |
| 1545 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: |
Michael Krufky | aee0b24 | 2009-11-11 01:52:45 -0300 | [diff] [blame] | 1546 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
Kusanagi Kouichi | 0b32d65 | 2010-01-22 04:55:28 -0300 | [diff] [blame] | 1547 | case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200: |
Alexey Chernov | 9028f58 | 2010-12-06 17:09:53 -0300 | [diff] [blame] | 1548 | case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID: |
Mijhail Moreyra | 18d6447 | 2011-10-10 11:09:53 -0300 | [diff] [blame] | 1549 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | 2cb9ccd | 2011-10-10 11:09:55 -0300 | [diff] [blame] | 1550 | case CX23885_BOARD_MPX885: |
Alfredo Jesús Delaiti | 8798875 | 2011-11-09 15:13:00 -0300 | [diff] [blame] | 1551 | case CX23885_BOARD_MYGICA_X8507: |
Stefan Ringel | 722c90e | 2012-01-07 09:20:48 -0300 | [diff] [blame] | 1552 | case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: |
Hans Verkuil | e6574f2 | 2009-04-01 03:57:53 -0300 | [diff] [blame] | 1553 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 1554 | &dev->i2c_bus[2].i2c_adap, |
Laurent Pinchart | 9a1f8b3 | 2010-09-24 10:16:44 -0300 | [diff] [blame] | 1555 | "cx25840", 0x88 >> 1, NULL); |
Andy Walls | d6b1850 | 2010-07-18 23:26:29 -0300 | [diff] [blame] | 1556 | if (dev->sd_cx25840) { |
| 1557 | dev->sd_cx25840->grp_id = CX23885_HW_AV_CORE; |
| 1558 | v4l2_subdev_call(dev->sd_cx25840, core, load_fw); |
| 1559 | } |
Steven Toth | ce89cfb | 2008-04-19 01:36:06 -0300 | [diff] [blame] | 1560 | break; |
| 1561 | } |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 1562 | |
| 1563 | /* AUX-PLL 27MHz CLK */ |
| 1564 | switch (dev->board) { |
| 1565 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
| 1566 | netup_initialize(dev); |
| 1567 | break; |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1568 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: { |
| 1569 | int ret; |
| 1570 | const struct firmware *fw; |
| 1571 | const char *filename = "dvb-netup-altera-01.fw"; |
| 1572 | char *action = "configure"; |
Abylay Ospan | b8f0d30 | 2011-07-14 05:20:29 -0300 | [diff] [blame] | 1573 | static struct netup_card_info cinfo; |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1574 | struct altera_config netup_config = { |
| 1575 | .dev = dev, |
| 1576 | .action = action, |
| 1577 | .jtag_io = netup_jtag_io, |
| 1578 | }; |
| 1579 | |
| 1580 | netup_initialize(dev); |
| 1581 | |
Abylay Ospan | b8f0d30 | 2011-07-14 05:20:29 -0300 | [diff] [blame] | 1582 | netup_get_card_info(&dev->i2c_bus[0].i2c_adap, &cinfo); |
Abylay Ospan | 2d12421 | 2011-07-18 04:14:28 -0300 | [diff] [blame] | 1583 | if (netup_card_rev) |
| 1584 | cinfo.rev = netup_card_rev; |
| 1585 | |
Abylay Ospan | b8f0d30 | 2011-07-14 05:20:29 -0300 | [diff] [blame] | 1586 | switch (cinfo.rev) { |
| 1587 | case 0x4: |
| 1588 | filename = "dvb-netup-altera-04.fw"; |
| 1589 | break; |
| 1590 | default: |
| 1591 | filename = "dvb-netup-altera-01.fw"; |
| 1592 | break; |
| 1593 | } |
| 1594 | printk(KERN_INFO "NetUP card rev=0x%x fw_filename=%s\n", |
| 1595 | cinfo.rev, filename); |
| 1596 | |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1597 | ret = request_firmware(&fw, filename, &dev->pci->dev); |
| 1598 | if (ret != 0) |
| 1599 | printk(KERN_ERR "did not find the firmware file. (%s) " |
| 1600 | "Please see linux/Documentation/dvb/ for more details " |
| 1601 | "on firmware-problems.", filename); |
| 1602 | else |
| 1603 | altera_init(&netup_config, fw); |
| 1604 | |
Jesper Juhl | 3f84a4e | 2011-04-07 16:23:48 -0300 | [diff] [blame] | 1605 | release_firmware(fw); |
Igor M. Liplianin | 78db854 | 2011-01-25 17:04:00 -0300 | [diff] [blame] | 1606 | break; |
| 1607 | } |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 1608 | } |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 1609 | } |
| 1610 | |
| 1611 | /* ------------------------------------------------------------------ */ |