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> |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 27 | |
| 28 | #include "cx23885.h" |
Steven Toth | 90a71b1 | 2008-08-04 21:38:46 -0300 | [diff] [blame] | 29 | #include "tuner-xc2028.h" |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 30 | #include "netup-init.h" |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 31 | |
| 32 | /* ------------------------------------------------------------------ */ |
| 33 | /* board config info */ |
| 34 | |
| 35 | struct cx23885_board cx23885_boards[] = { |
| 36 | [CX23885_BOARD_UNKNOWN] = { |
| 37 | .name = "UNKNOWN/GENERIC", |
Steven Toth | c771261 | 2008-01-10 02:24:27 -0300 | [diff] [blame] | 38 | /* Ensure safe default for unknown boards */ |
| 39 | .clk_freq = 0, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 40 | .input = {{ |
| 41 | .type = CX23885_VMUX_COMPOSITE1, |
| 42 | .vmux = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 43 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 44 | .type = CX23885_VMUX_COMPOSITE2, |
| 45 | .vmux = 1, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 46 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 47 | .type = CX23885_VMUX_COMPOSITE3, |
| 48 | .vmux = 2, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 49 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 50 | .type = CX23885_VMUX_COMPOSITE4, |
| 51 | .vmux = 3, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 52 | } }, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 53 | }, |
| 54 | [CX23885_BOARD_HAUPPAUGE_HVR1800lp] = { |
| 55 | .name = "Hauppauge WinTV-HVR1800lp", |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 56 | .portc = CX23885_MPEG_DVB, |
| 57 | .input = {{ |
| 58 | .type = CX23885_VMUX_TELEVISION, |
| 59 | .vmux = 0, |
| 60 | .gpio0 = 0xff00, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 61 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 62 | .type = CX23885_VMUX_DEBUG, |
| 63 | .vmux = 0, |
| 64 | .gpio0 = 0xff01, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 65 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 66 | .type = CX23885_VMUX_COMPOSITE1, |
| 67 | .vmux = 1, |
| 68 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 69 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 70 | .type = CX23885_VMUX_SVIDEO, |
| 71 | .vmux = 2, |
| 72 | .gpio0 = 0xff02, |
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_HVR1800] = { |
| 76 | .name = "Hauppauge WinTV-HVR1800", |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 77 | .porta = CX23885_ANALOG_VIDEO, |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 78 | .portb = CX23885_MPEG_ENCODER, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 79 | .portc = CX23885_MPEG_DVB, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 80 | .tuner_type = TUNER_PHILIPS_TDA8290, |
| 81 | .tuner_addr = 0x42, /* 0x84 >> 1 */ |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 82 | .input = {{ |
| 83 | .type = CX23885_VMUX_TELEVISION, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 84 | .vmux = CX25840_VIN7_CH3 | |
| 85 | CX25840_VIN5_CH2 | |
| 86 | CX25840_VIN2_CH1, |
| 87 | .gpio0 = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 88 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 89 | .type = CX23885_VMUX_COMPOSITE1, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 90 | .vmux = CX25840_VIN7_CH3 | |
| 91 | CX25840_VIN4_CH2 | |
| 92 | CX25840_VIN6_CH1, |
| 93 | .gpio0 = 0, |
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 | .type = CX23885_VMUX_SVIDEO, |
Steven Toth | 7b88801 | 2008-01-10 03:40:49 -0300 | [diff] [blame] | 96 | .vmux = CX25840_VIN7_CH3 | |
| 97 | CX25840_VIN4_CH2 | |
| 98 | CX25840_VIN8_CH1 | |
| 99 | CX25840_SVIDEO_ON, |
| 100 | .gpio0 = 0, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 101 | } }, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 102 | }, |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 103 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { |
| 104 | .name = "Hauppauge WinTV-HVR1250", |
| 105 | .portc = CX23885_MPEG_DVB, |
| 106 | .input = {{ |
| 107 | .type = CX23885_VMUX_TELEVISION, |
| 108 | .vmux = 0, |
| 109 | .gpio0 = 0xff00, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 110 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 111 | .type = CX23885_VMUX_DEBUG, |
| 112 | .vmux = 0, |
| 113 | .gpio0 = 0xff01, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 114 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 115 | .type = CX23885_VMUX_COMPOSITE1, |
| 116 | .vmux = 1, |
| 117 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 118 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 119 | .type = CX23885_VMUX_SVIDEO, |
| 120 | .vmux = 2, |
| 121 | .gpio0 = 0xff02, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 122 | } }, |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 123 | }, |
Michael Krufky | 9bc37ca | 2007-09-08 15:17:13 -0300 | [diff] [blame] | 124 | [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP] = { |
| 125 | .name = "DViCO FusionHDTV5 Express", |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 126 | .portb = CX23885_MPEG_DVB, |
Michael Krufky | 9bc37ca | 2007-09-08 15:17:13 -0300 | [diff] [blame] | 127 | }, |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 128 | [CX23885_BOARD_HAUPPAUGE_HVR1500Q] = { |
| 129 | .name = "Hauppauge WinTV-HVR1500Q", |
| 130 | .portc = CX23885_MPEG_DVB, |
| 131 | }, |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 132 | [CX23885_BOARD_HAUPPAUGE_HVR1500] = { |
| 133 | .name = "Hauppauge WinTV-HVR1500", |
| 134 | .portc = CX23885_MPEG_DVB, |
| 135 | }, |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 136 | [CX23885_BOARD_HAUPPAUGE_HVR1200] = { |
| 137 | .name = "Hauppauge WinTV-HVR1200", |
| 138 | .portc = CX23885_MPEG_DVB, |
| 139 | }, |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 140 | [CX23885_BOARD_HAUPPAUGE_HVR1700] = { |
| 141 | .name = "Hauppauge WinTV-HVR1700", |
| 142 | .portc = CX23885_MPEG_DVB, |
| 143 | }, |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 144 | [CX23885_BOARD_HAUPPAUGE_HVR1400] = { |
| 145 | .name = "Hauppauge WinTV-HVR1400", |
| 146 | .portc = CX23885_MPEG_DVB, |
| 147 | }, |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 148 | [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = { |
| 149 | .name = "DViCO FusionHDTV7 Dual Express", |
Steven Toth | aaadeac | 2008-06-30 20:58:38 -0300 | [diff] [blame] | 150 | .portb = CX23885_MPEG_DVB, |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 151 | .portc = CX23885_MPEG_DVB, |
| 152 | }, |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 153 | [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP] = { |
| 154 | .name = "DViCO FusionHDTV DVB-T Dual Express", |
| 155 | .portb = CX23885_MPEG_DVB, |
| 156 | .portc = CX23885_MPEG_DVB, |
| 157 | }, |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 158 | [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H] = { |
| 159 | .name = "Leadtek Winfast PxDVR3200 H", |
| 160 | .portc = CX23885_MPEG_DVB, |
| 161 | }, |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 162 | [CX23885_BOARD_COMPRO_VIDEOMATE_E650F] = { |
| 163 | .name = "Compro VideoMate E650F", |
| 164 | .portc = CX23885_MPEG_DVB, |
| 165 | }, |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 166 | [CX23885_BOARD_TBS_6920] = { |
| 167 | .name = "TurboSight TBS 6920", |
| 168 | .portb = CX23885_MPEG_DVB, |
| 169 | }, |
Igor M. Liplianin | 579943f | 2009-01-17 12:18:26 -0300 | [diff] [blame] | 170 | [CX23885_BOARD_TEVII_S470] = { |
| 171 | .name = "TeVii S470", |
| 172 | .portb = CX23885_MPEG_DVB, |
| 173 | }, |
Igor M. Liplianin | c9b8b04 | 2009-01-17 12:23:31 -0300 | [diff] [blame] | 174 | [CX23885_BOARD_DVBWORLD_2005] = { |
| 175 | .name = "DVBWorld DVB-S2 2005", |
| 176 | .portb = CX23885_MPEG_DVB, |
| 177 | }, |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 178 | [CX23885_BOARD_NETUP_DUAL_DVBS2_CI] = { |
| 179 | .cimax = 1, |
| 180 | .name = "NetUP Dual DVB-S2 CI", |
| 181 | .portb = CX23885_MPEG_DVB, |
| 182 | .portc = CX23885_MPEG_DVB, |
| 183 | }, |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 184 | [CX23885_BOARD_HAUPPAUGE_HVR1270] = { |
| 185 | .name = "Hauppauge WinTV-HVR1270", |
Michael Krufky | a5dbf45 | 2009-05-03 23:27:02 -0300 | [diff] [blame] | 186 | .portc = CX23885_MPEG_DVB, |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 187 | }, |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 188 | [CX23885_BOARD_HAUPPAUGE_HVR1275] = { |
| 189 | .name = "Hauppauge WinTV-HVR1275", |
| 190 | .portc = CX23885_MPEG_DVB, |
| 191 | }, |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 192 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { |
| 193 | .name = "Hauppauge WinTV-HVR1255", |
| 194 | .portc = CX23885_MPEG_DVB, |
| 195 | }, |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 196 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { |
| 197 | .name = "Hauppauge WinTV-HVR1210", |
| 198 | .portc = CX23885_MPEG_DVB, |
| 199 | }, |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 200 | [CX23885_BOARD_MYGICA_X8506] = { |
| 201 | .name = "Mygica X8506 DMB-TH", |
| 202 | .portb = CX23885_MPEG_DVB, |
| 203 | }, |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 204 | [CX23885_BOARD_MAGICPRO_PROHDTVE2] = { |
| 205 | .name = "Magic-Pro ProHDTV Extreme 2", |
| 206 | .portb = CX23885_MPEG_DVB, |
| 207 | }, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 208 | }; |
| 209 | const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); |
| 210 | |
| 211 | /* ------------------------------------------------------------------ */ |
| 212 | /* PCI subsystem IDs */ |
| 213 | |
| 214 | struct cx23885_subid cx23885_subids[] = { |
| 215 | { |
| 216 | .subvendor = 0x0070, |
| 217 | .subdevice = 0x3400, |
| 218 | .card = CX23885_BOARD_UNKNOWN, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 219 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 220 | .subvendor = 0x0070, |
| 221 | .subdevice = 0x7600, |
| 222 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800lp, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 223 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 224 | .subvendor = 0x0070, |
| 225 | .subdevice = 0x7800, |
| 226 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 227 | }, { |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 228 | .subvendor = 0x0070, |
| 229 | .subdevice = 0x7801, |
| 230 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 231 | }, { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 232 | .subvendor = 0x0070, |
Michael Krufky | 6ccb8cf | 2007-12-27 21:46:34 -0300 | [diff] [blame] | 233 | .subdevice = 0x7809, |
| 234 | .card = CX23885_BOARD_HAUPPAUGE_HVR1800, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 235 | }, { |
Michael Krufky | 6ccb8cf | 2007-12-27 21:46:34 -0300 | [diff] [blame] | 236 | .subvendor = 0x0070, |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 237 | .subdevice = 0x7911, |
| 238 | .card = CX23885_BOARD_HAUPPAUGE_HVR1250, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 239 | }, { |
Michael Krufky | 9bc37ca | 2007-09-08 15:17:13 -0300 | [diff] [blame] | 240 | .subvendor = 0x18ac, |
| 241 | .subdevice = 0xd500, |
| 242 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 243 | }, { |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 244 | .subvendor = 0x0070, |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 245 | .subdevice = 0x7790, |
| 246 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 247 | }, { |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 248 | .subvendor = 0x0070, |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 249 | .subdevice = 0x7797, |
| 250 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 251 | }, { |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 252 | .subvendor = 0x0070, |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 253 | .subdevice = 0x7710, |
| 254 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 255 | }, { |
Michael Krufky | b00fff0 | 2007-12-27 22:19:31 -0300 | [diff] [blame] | 256 | .subvendor = 0x0070, |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 257 | .subdevice = 0x7717, |
| 258 | .card = CX23885_BOARD_HAUPPAUGE_HVR1500, |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 259 | }, { |
| 260 | .subvendor = 0x0070, |
| 261 | .subdevice = 0x71d1, |
| 262 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 263 | }, { |
| 264 | .subvendor = 0x0070, |
Michael Krufky | 3c3852c | 2008-05-02 16:12:44 -0300 | [diff] [blame] | 265 | .subdevice = 0x71d3, |
| 266 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, |
| 267 | }, { |
| 268 | .subvendor = 0x0070, |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 269 | .subdevice = 0x8101, |
| 270 | .card = CX23885_BOARD_HAUPPAUGE_HVR1700, |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 271 | }, { |
| 272 | .subvendor = 0x0070, |
| 273 | .subdevice = 0x8010, |
| 274 | .card = CX23885_BOARD_HAUPPAUGE_HVR1400, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 275 | }, { |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 276 | .subvendor = 0x18ac, |
| 277 | .subdevice = 0xd618, |
| 278 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP, |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 279 | }, { |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 280 | .subvendor = 0x18ac, |
| 281 | .subdevice = 0xdb78, |
| 282 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP, |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 283 | }, { |
| 284 | .subvendor = 0x107d, |
| 285 | .subdevice = 0x6681, |
| 286 | .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H, |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 287 | }, { |
| 288 | .subvendor = 0x185b, |
| 289 | .subdevice = 0xe800, |
| 290 | .card = CX23885_BOARD_COMPRO_VIDEOMATE_E650F, |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 291 | }, { |
| 292 | .subvendor = 0x6920, |
| 293 | .subdevice = 0x8888, |
| 294 | .card = CX23885_BOARD_TBS_6920, |
Igor M. Liplianin | 579943f | 2009-01-17 12:18:26 -0300 | [diff] [blame] | 295 | }, { |
| 296 | .subvendor = 0xd470, |
| 297 | .subdevice = 0x9022, |
| 298 | .card = CX23885_BOARD_TEVII_S470, |
Igor M. Liplianin | c9b8b04 | 2009-01-17 12:23:31 -0300 | [diff] [blame] | 299 | }, { |
| 300 | .subvendor = 0x0001, |
| 301 | .subdevice = 0x2005, |
| 302 | .card = CX23885_BOARD_DVBWORLD_2005, |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 303 | }, { |
| 304 | .subvendor = 0x1b55, |
| 305 | .subdevice = 0x2a2c, |
| 306 | .card = CX23885_BOARD_NETUP_DUAL_DVBS2_CI, |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 307 | }, { |
| 308 | .subvendor = 0x0070, |
| 309 | .subdevice = 0x2211, |
| 310 | .card = CX23885_BOARD_HAUPPAUGE_HVR1270, |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 311 | }, { |
| 312 | .subvendor = 0x0070, |
| 313 | .subdevice = 0x2215, |
| 314 | .card = CX23885_BOARD_HAUPPAUGE_HVR1275, |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 315 | }, { |
| 316 | .subvendor = 0x0070, |
| 317 | .subdevice = 0x2251, |
| 318 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 319 | }, { |
| 320 | .subvendor = 0x0070, |
| 321 | .subdevice = 0x2291, |
| 322 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
| 323 | }, { |
| 324 | .subvendor = 0x0070, |
| 325 | .subdevice = 0x2295, |
| 326 | .card = CX23885_BOARD_HAUPPAUGE_HVR1210, |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 327 | }, { |
| 328 | .subvendor = 0x14f1, |
| 329 | .subdevice = 0x8651, |
| 330 | .card = CX23885_BOARD_MYGICA_X8506, |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 331 | }, { |
| 332 | .subvendor = 0x14f1, |
| 333 | .subdevice = 0x8657, |
| 334 | .card = CX23885_BOARD_MAGICPRO_PROHDTVE2, |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 335 | }, |
| 336 | }; |
| 337 | const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); |
| 338 | |
| 339 | void cx23885_card_list(struct cx23885_dev *dev) |
| 340 | { |
| 341 | int i; |
| 342 | |
| 343 | if (0 == dev->pci->subsystem_vendor && |
| 344 | 0 == dev->pci->subsystem_device) { |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 345 | printk(KERN_INFO |
| 346 | "%s: Board has no valid PCIe Subsystem ID and can't\n" |
| 347 | "%s: be autodetected. Pass card=<n> insmod option\n" |
| 348 | "%s: to workaround that. Redirect complaints to the\n" |
| 349 | "%s: vendor of the TV card. Best regards,\n" |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 350 | "%s: -- tux\n", |
| 351 | dev->name, dev->name, dev->name, dev->name, dev->name); |
| 352 | } else { |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 353 | printk(KERN_INFO |
| 354 | "%s: Your board isn't known (yet) to the driver.\n" |
| 355 | "%s: Try to pick one of the existing card configs via\n" |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 356 | "%s: card=<n> insmod option. Updating to the latest\n" |
| 357 | "%s: version might help as well.\n", |
| 358 | dev->name, dev->name, dev->name, dev->name); |
| 359 | } |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 360 | 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] | 361 | dev->name); |
| 362 | for (i = 0; i < cx23885_bcount; i++) |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 363 | printk(KERN_INFO "%s: card=%d -> %s\n", |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 364 | dev->name, i, cx23885_boards[i].name); |
| 365 | } |
| 366 | |
| 367 | static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) |
| 368 | { |
| 369 | struct tveeprom tv; |
| 370 | |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 371 | tveeprom_hauppauge_analog(&dev->i2c_bus[0].i2c_client, &tv, |
| 372 | eeprom_data); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 373 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 374 | /* Make sure we support the board model */ |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 375 | switch (tv.model) { |
Michael Krufky | 5308cf0 | 2009-05-12 18:37:35 -0300 | [diff] [blame] | 376 | case 22001: |
| 377 | /* WinTV-HVR1270 (PCIe, Retail, half height) |
| 378 | * ATSC/QAM and basic analog, IR Blast */ |
| 379 | case 22009: |
| 380 | /* WinTV-HVR1210 (PCIe, Retail, half height) |
| 381 | * DVB-T and basic analog, IR Blast */ |
| 382 | case 22011: |
| 383 | /* WinTV-HVR1270 (PCIe, Retail, half height) |
| 384 | * ATSC/QAM and basic analog, IR Recv */ |
| 385 | case 22019: |
| 386 | /* WinTV-HVR1210 (PCIe, Retail, half height) |
| 387 | * DVB-T and basic analog, IR Recv */ |
| 388 | case 22021: |
| 389 | /* WinTV-HVR1275 (PCIe, Retail, half height) |
| 390 | * ATSC/QAM and basic analog, IR Recv */ |
| 391 | case 22029: |
| 392 | /* WinTV-HVR1210 (PCIe, Retail, half height) |
| 393 | * DVB-T and basic analog, IR Recv */ |
| 394 | case 22101: |
| 395 | /* WinTV-HVR1270 (PCIe, Retail, full height) |
| 396 | * ATSC/QAM and basic analog, IR Blast */ |
| 397 | case 22109: |
| 398 | /* WinTV-HVR1210 (PCIe, Retail, full height) |
| 399 | * DVB-T and basic analog, IR Blast */ |
| 400 | case 22111: |
| 401 | /* WinTV-HVR1270 (PCIe, Retail, full height) |
| 402 | * ATSC/QAM and basic analog, IR Recv */ |
| 403 | case 22119: |
| 404 | /* WinTV-HVR1210 (PCIe, Retail, full height) |
| 405 | * DVB-T and basic analog, IR Recv */ |
| 406 | case 22121: |
| 407 | /* WinTV-HVR1275 (PCIe, Retail, full height) |
| 408 | * ATSC/QAM and basic analog, IR Recv */ |
| 409 | case 22129: |
| 410 | /* WinTV-HVR1210 (PCIe, Retail, full height) |
| 411 | * DVB-T and basic analog, IR Recv */ |
Michael Krufky | 36396c8 | 2008-05-02 16:14:33 -0300 | [diff] [blame] | 412 | case 71009: |
| 413 | /* WinTV-HVR1200 (PCIe, Retail, full height) |
| 414 | * DVB-T and basic analog */ |
| 415 | case 71359: |
| 416 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 417 | * DVB-T and basic analog */ |
| 418 | case 71439: |
| 419 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 420 | * DVB-T and basic analog */ |
| 421 | case 71449: |
| 422 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 423 | * DVB-T and basic analog */ |
| 424 | case 71939: |
| 425 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 426 | * DVB-T and basic analog */ |
| 427 | case 71949: |
| 428 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 429 | * DVB-T and basic analog */ |
| 430 | case 71959: |
| 431 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 432 | * DVB-T and basic analog */ |
| 433 | case 71979: |
| 434 | /* WinTV-HVR1200 (PCIe, OEM, half height) |
| 435 | * DVB-T and basic analog */ |
| 436 | case 71999: |
| 437 | /* WinTV-HVR1200 (PCIe, OEM, full height) |
| 438 | * DVB-T and basic analog */ |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 439 | case 76601: |
| 440 | /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual |
| 441 | channel ATSC and MPEG2 HW Encoder */ |
| 442 | case 77001: |
| 443 | /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC |
| 444 | and Basic analog */ |
| 445 | case 77011: |
| 446 | /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC |
| 447 | and Basic analog */ |
| 448 | case 77041: |
| 449 | /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM |
| 450 | and Basic analog */ |
| 451 | case 77051: |
| 452 | /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM |
| 453 | and Basic analog */ |
| 454 | case 78011: |
| 455 | /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM, |
| 456 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 457 | case 78501: |
| 458 | /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, |
| 459 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 460 | case 78521: |
| 461 | /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, |
| 462 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 463 | case 78531: |
| 464 | /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM, |
| 465 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 466 | case 78631: |
| 467 | /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, |
| 468 | Dual channel ATSC and MPEG2 HW Encoder */ |
| 469 | case 79001: |
| 470 | /* WinTV-HVR1250 (PCIe, Retail, IR, full height, |
| 471 | ATSC and Basic analog */ |
| 472 | case 79101: |
| 473 | /* WinTV-HVR1250 (PCIe, Retail, IR, half height, |
| 474 | ATSC and Basic analog */ |
| 475 | case 79561: |
| 476 | /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, |
| 477 | ATSC and Basic analog */ |
| 478 | case 79571: |
| 479 | /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, |
| 480 | ATSC and Basic analog */ |
| 481 | case 79671: |
| 482 | /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, |
| 483 | ATSC and Basic analog */ |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 484 | case 80019: |
| 485 | /* WinTV-HVR1400 (Express Card, Retail, IR, |
| 486 | * DVB-T and Basic analog */ |
Michael Krufky | 36396c8 | 2008-05-02 16:14:33 -0300 | [diff] [blame] | 487 | case 81509: |
| 488 | /* WinTV-HVR1700 (PCIe, OEM, No IR, half height) |
| 489 | * DVB-T and MPEG2 HW Encoder */ |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 490 | case 81519: |
Michael Krufky | 36396c8 | 2008-05-02 16:14:33 -0300 | [diff] [blame] | 491 | /* WinTV-HVR1700 (PCIe, OEM, No IR, full height) |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 492 | * DVB-T and MPEG2 HW Encoder */ |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 493 | break; |
| 494 | default: |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 495 | printk(KERN_WARNING "%s: warning: unknown hauppauge model #%d\n", |
| 496 | dev->name, tv.model); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 497 | break; |
| 498 | } |
| 499 | |
| 500 | printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", |
| 501 | dev->name, tv.model); |
| 502 | } |
| 503 | |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 504 | int cx23885_tuner_callback(void *priv, int component, int command, int arg) |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 505 | { |
Steven Toth | 89ce221 | 2008-08-04 22:18:19 -0300 | [diff] [blame] | 506 | struct cx23885_tsport *port = priv; |
| 507 | struct cx23885_dev *dev = port->dev; |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 508 | u32 bitmask = 0; |
| 509 | |
Steven Toth | 89ce221 | 2008-08-04 22:18:19 -0300 | [diff] [blame] | 510 | if (command == XC2028_RESET_CLK) |
| 511 | return 0; |
| 512 | |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 513 | if (command != 0) { |
| 514 | printk(KERN_ERR "%s(): Unknown command 0x%x.\n", |
| 515 | __func__, command); |
| 516 | return -EINVAL; |
| 517 | } |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 518 | |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 519 | switch (dev->board) { |
Steven Toth | 90a71b1 | 2008-08-04 21:38:46 -0300 | [diff] [blame] | 520 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
| 521 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 522 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 523 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 524 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Steven Toth | 90a71b1 | 2008-08-04 21:38:46 -0300 | [diff] [blame] | 525 | /* Tuner Reset Command */ |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 526 | bitmask = 0x04; |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 527 | break; |
| 528 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 529 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 530 | /* Two identical tuners on two different i2c buses, |
| 531 | * we need to reset the correct gpio. */ |
Christopher Pascoe | d4dc673 | 2009-04-27 11:27:04 -0300 | [diff] [blame] | 532 | if (port->nr == 1) |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 533 | bitmask = 0x01; |
Christopher Pascoe | d4dc673 | 2009-04-27 11:27:04 -0300 | [diff] [blame] | 534 | else if (port->nr == 2) |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 535 | bitmask = 0x04; |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 536 | break; |
| 537 | } |
| 538 | |
Steven Toth | 6df5169 | 2008-06-30 22:17:05 -0300 | [diff] [blame] | 539 | if (bitmask) { |
| 540 | /* Drive the tuner into reset and back out */ |
| 541 | cx_clear(GP0_IO, bitmask); |
| 542 | mdelay(200); |
| 543 | cx_set(GP0_IO, bitmask); |
| 544 | } |
| 545 | |
| 546 | return 0; |
Steven Toth | 8c70017 | 2008-01-05 16:55:45 -0300 | [diff] [blame] | 547 | } |
Steven Toth | 73c993a | 2008-01-05 17:08:05 -0300 | [diff] [blame] | 548 | |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 549 | void cx23885_gpio_setup(struct cx23885_dev *dev) |
| 550 | { |
Steven Toth | 9c8ced5 | 2008-10-16 20:18:44 -0300 | [diff] [blame] | 551 | switch (dev->board) { |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 552 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
| 553 | /* GPIO-0 cx24227 demodulator reset */ |
| 554 | cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */ |
| 555 | break; |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 556 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
| 557 | /* GPIO-0 cx24227 demodulator */ |
| 558 | /* GPIO-2 xc3028 tuner */ |
| 559 | |
| 560 | /* Put the parts into reset */ |
| 561 | cx_set(GP0_IO, 0x00050000); |
| 562 | cx_clear(GP0_IO, 0x00000005); |
| 563 | msleep(5); |
| 564 | |
| 565 | /* Bring the parts out of reset */ |
| 566 | cx_set(GP0_IO, 0x00050005); |
| 567 | break; |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 568 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
| 569 | /* GPIO-0 cx24227 demodulator reset */ |
| 570 | /* GPIO-2 xc5000 tuner reset */ |
| 571 | cx_set(GP0_IO, 0x00050005); /* Bring the part out of reset */ |
| 572 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 573 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 574 | /* GPIO-0 656_CLK */ |
| 575 | /* GPIO-1 656_D0 */ |
| 576 | /* GPIO-2 8295A Reset */ |
| 577 | /* GPIO-3-10 cx23417 data0-7 */ |
| 578 | /* GPIO-11-14 cx23417 addr0-3 */ |
| 579 | /* GPIO-15-18 cx23417 READY, CS, RD, WR */ |
| 580 | /* GPIO-19 IR_RX */ |
Michael Krufky | 3ba71d2 | 2007-12-07 01:40:36 -0300 | [diff] [blame] | 581 | |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 582 | /* CX23417 GPIO's */ |
| 583 | /* EIO15 Zilog Reset */ |
| 584 | /* EIO14 S5H1409/CX24227 Reset */ |
Steven Toth | f659c51 | 2009-06-25 23:43:31 -0300 | [diff] [blame^] | 585 | mc417_gpio_enable(dev, GPIO_15 | GPIO_14, 1); |
| 586 | |
| 587 | /* Put the demod into reset and protect the eeprom */ |
| 588 | mc417_gpio_clear(dev, GPIO_15 | GPIO_14); |
| 589 | mdelay(100); |
| 590 | |
| 591 | /* Bring the demod and blaster out of reset */ |
| 592 | mc417_gpio_set(dev, GPIO_15 | GPIO_14); |
| 593 | mdelay(100); |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 594 | |
Steven Toth | 5206d6e | 2008-01-10 02:09:27 -0300 | [diff] [blame] | 595 | /* Force the TDA8295A into reset and back */ |
| 596 | cx_set(GP0_IO, 0x00040004); |
| 597 | mdelay(20); |
| 598 | cx_clear(GP0_IO, 0x00000004); |
| 599 | mdelay(20); |
| 600 | cx_set(GP0_IO, 0x00040004); |
| 601 | mdelay(20); |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 602 | break; |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 603 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
| 604 | /* GPIO-0 tda10048 demodulator reset */ |
| 605 | /* GPIO-2 tda18271 tuner reset */ |
| 606 | |
| 607 | /* Put the parts into reset and back */ |
| 608 | cx_set(GP0_IO, 0x00050000); |
| 609 | mdelay(20); |
| 610 | cx_clear(GP0_IO, 0x00000005); |
| 611 | mdelay(20); |
| 612 | cx_set(GP0_IO, 0x00050005); |
| 613 | break; |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 614 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
| 615 | /* GPIO-0 TDA10048 demodulator reset */ |
| 616 | /* GPIO-2 TDA8295A Reset */ |
| 617 | /* GPIO-3-10 cx23417 data0-7 */ |
| 618 | /* GPIO-11-14 cx23417 addr0-3 */ |
| 619 | /* GPIO-15-18 cx23417 READY, CS, RD, WR */ |
| 620 | |
| 621 | /* The following GPIO's are on the interna AVCore (cx25840) */ |
| 622 | /* GPIO-19 IR_RX */ |
| 623 | /* GPIO-20 IR_TX 416/DVBT Select */ |
| 624 | /* GPIO-21 IIS DAT */ |
| 625 | /* GPIO-22 IIS WCLK */ |
| 626 | /* GPIO-23 IIS BCLK */ |
| 627 | |
| 628 | /* Put the parts into reset and back */ |
| 629 | cx_set(GP0_IO, 0x00050000); |
| 630 | mdelay(20); |
| 631 | cx_clear(GP0_IO, 0x00000005); |
| 632 | mdelay(20); |
| 633 | cx_set(GP0_IO, 0x00050005); |
| 634 | break; |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 635 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
| 636 | /* GPIO-0 Dibcom7000p demodulator reset */ |
| 637 | /* GPIO-2 xc3028L tuner reset */ |
| 638 | /* GPIO-13 LED */ |
| 639 | |
| 640 | /* Put the parts into reset and back */ |
| 641 | cx_set(GP0_IO, 0x00050000); |
| 642 | mdelay(20); |
| 643 | cx_clear(GP0_IO, 0x00000005); |
| 644 | mdelay(20); |
| 645 | cx_set(GP0_IO, 0x00050005); |
| 646 | break; |
Steven Toth | 1ecc5ae | 2008-06-30 21:23:50 -0300 | [diff] [blame] | 647 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
| 648 | /* GPIO-0 xc5000 tuner reset i2c bus 0 */ |
| 649 | /* GPIO-1 s5h1409 demod reset i2c bus 0 */ |
| 650 | /* GPIO-2 xc5000 tuner reset i2c bus 1 */ |
| 651 | /* GPIO-3 s5h1409 demod reset i2c bus 0 */ |
| 652 | |
| 653 | /* Put the parts into reset and back */ |
| 654 | cx_set(GP0_IO, 0x000f0000); |
| 655 | mdelay(20); |
| 656 | cx_clear(GP0_IO, 0x0000000f); |
| 657 | mdelay(20); |
| 658 | cx_set(GP0_IO, 0x000f000f); |
| 659 | break; |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 660 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
| 661 | /* GPIO-0 portb xc3028 reset */ |
| 662 | /* GPIO-1 portb zl10353 reset */ |
| 663 | /* GPIO-2 portc xc3028 reset */ |
| 664 | /* GPIO-3 portc zl10353 reset */ |
| 665 | |
| 666 | /* Put the parts into reset and back */ |
| 667 | cx_set(GP0_IO, 0x000f0000); |
| 668 | mdelay(20); |
| 669 | cx_clear(GP0_IO, 0x0000000f); |
| 670 | mdelay(20); |
| 671 | cx_set(GP0_IO, 0x000f000f); |
| 672 | break; |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 673 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 674 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 675 | /* GPIO-2 xc3028 tuner reset */ |
| 676 | |
| 677 | /* The following GPIO's are on the internal AVCore (cx25840) */ |
| 678 | /* GPIO-? zl10353 demod reset */ |
| 679 | |
| 680 | /* Put the parts into reset and back */ |
| 681 | cx_set(GP0_IO, 0x00040000); |
| 682 | mdelay(20); |
| 683 | cx_clear(GP0_IO, 0x00000004); |
| 684 | mdelay(20); |
| 685 | cx_set(GP0_IO, 0x00040004); |
| 686 | break; |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 687 | case CX23885_BOARD_TBS_6920: |
Igor M. Liplianin | 579943f | 2009-01-17 12:18:26 -0300 | [diff] [blame] | 688 | case CX23885_BOARD_TEVII_S470: |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 689 | cx_write(MC417_CTL, 0x00000036); |
| 690 | cx_write(MC417_OEN, 0x00001000); |
| 691 | cx_write(MC417_RWD, 0x00001800); |
| 692 | break; |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 693 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
| 694 | /* GPIO-0 INTA from CiMax1 |
| 695 | GPIO-1 INTB from CiMax2 |
| 696 | GPIO-2 reset chips |
| 697 | GPIO-3 to GPIO-10 data/addr for CA |
| 698 | GPIO-11 ~CS0 to CiMax1 |
| 699 | GPIO-12 ~CS1 to CiMax2 |
| 700 | GPIO-13 ADL0 load LSB addr |
| 701 | GPIO-14 ADL1 load MSB addr |
| 702 | GPIO-15 ~RDY from CiMax |
| 703 | GPIO-17 ~RD to CiMax |
| 704 | GPIO-18 ~WR to CiMax |
| 705 | */ |
| 706 | cx_set(GP0_IO, 0x00040000); /* GPIO as out */ |
| 707 | /* GPIO1 and GPIO2 as INTA and INTB from CiMaxes, reset low */ |
| 708 | cx_clear(GP0_IO, 0x00030004); |
| 709 | mdelay(100);/* reset delay */ |
| 710 | cx_set(GP0_IO, 0x00040004); /* GPIO as out, reset high */ |
| 711 | cx_write(MC417_CTL, 0x00000037);/* enable GPIO3-18 pins */ |
| 712 | /* GPIO-15 IN as ~ACK, rest as OUT */ |
| 713 | cx_write(MC417_OEN, 0x00001000); |
| 714 | /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */ |
| 715 | cx_write(MC417_RWD, 0x0000c300); |
| 716 | /* enable irq */ |
| 717 | cx_write(GPIO_ISM, 0x00000000);/* INTERRUPTS active low*/ |
| 718 | break; |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 719 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 720 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 721 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 722 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 723 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 724 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ |
| 725 | /* GPIO-9 Demod reset */ |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 726 | |
| 727 | /* Put the parts into reset and back */ |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 728 | cx23885_gpio_enable(dev, GPIO_9 | GPIO_6 | GPIO_5, 1); |
| 729 | cx23885_gpio_set(dev, GPIO_9 | GPIO_6 | GPIO_5); |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 730 | cx23885_gpio_clear(dev, GPIO_9); |
| 731 | mdelay(20); |
| 732 | cx23885_gpio_set(dev, GPIO_9); |
| 733 | break; |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 734 | case CX23885_BOARD_MYGICA_X8506: |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 735 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 736 | /* GPIO-1 reset XC5000 */ |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 737 | /* GPIO-2 reset LGS8GL5 / LGS8G75 */ |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 738 | cx_set(GP0_IO, 0x00060000); |
| 739 | cx_clear(GP0_IO, 0x00000006); |
| 740 | mdelay(100); |
| 741 | cx_set(GP0_IO, 0x00060006); |
| 742 | mdelay(100); |
| 743 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 744 | } |
| 745 | } |
| 746 | |
| 747 | int cx23885_ir_init(struct cx23885_dev *dev) |
| 748 | { |
| 749 | switch (dev->board) { |
| 750 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 751 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 752 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 753 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 754 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 755 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 756 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 757 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 758 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 759 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 760 | /* FIXME: Implement me */ |
| 761 | break; |
Steven Toth | 1288687 | 2008-08-04 21:41:06 -0300 | [diff] [blame] | 762 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
| 763 | request_module("ir-kbd-i2c"); |
| 764 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 765 | } |
| 766 | |
| 767 | return 0; |
| 768 | } |
| 769 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 770 | void cx23885_card_setup(struct cx23885_dev *dev) |
| 771 | { |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 772 | struct cx23885_tsport *ts1 = &dev->ts1; |
| 773 | struct cx23885_tsport *ts2 = &dev->ts2; |
| 774 | |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 775 | static u8 eeprom[256]; |
| 776 | |
| 777 | if (dev->i2c_bus[0].i2c_rc == 0) { |
| 778 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; |
Michael Krufky | 44a6481 | 2007-03-20 23:00:18 -0300 | [diff] [blame] | 779 | tveeprom_read(&dev->i2c_bus[0].i2c_client, |
| 780 | eeprom, sizeof(eeprom)); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 781 | } |
| 782 | |
| 783 | switch (dev->board) { |
Steven Toth | a77743b | 2007-08-22 21:01:20 -0300 | [diff] [blame] | 784 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 785 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 786 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 787 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
Steven Toth | c88133e | 2008-03-29 17:36:09 -0300 | [diff] [blame] | 788 | if (dev->i2c_bus[0].i2c_rc == 0) |
| 789 | hauppauge_eeprom(dev, eeprom+0x80); |
| 790 | break; |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 791 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 792 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 793 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 794 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 795 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 796 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 797 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 798 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 799 | if (dev->i2c_bus[0].i2c_rc == 0) |
Steven Toth | c88133e | 2008-03-29 17:36:09 -0300 | [diff] [blame] | 800 | hauppauge_eeprom(dev, eeprom+0xc0); |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 801 | break; |
| 802 | } |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 803 | |
| 804 | switch (dev->board) { |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 805 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
Steven Toth | aef2d18 | 2008-08-04 21:39:53 -0300 | [diff] [blame] | 806 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
Michael Krufky | 335377b | 2008-05-07 01:43:10 -0300 | [diff] [blame] | 807 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 808 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 809 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 810 | /* break omitted intentionally */ |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 811 | case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP: |
| 812 | ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 813 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 814 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 815 | break; |
Steven Toth | a589b66 | 2008-01-13 23:44:47 -0300 | [diff] [blame] | 816 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 817 | /* Defaults for VID B - Analog encoder */ |
| 818 | /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */ |
| 819 | ts1->gen_ctrl_val = 0x10e; |
| 820 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 821 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 822 | |
| 823 | /* APB_TSVALERR_POL (active low)*/ |
| 824 | ts1->vld_misc_val = 0x2000; |
| 825 | ts1->hw_sop_ctrl_val = (0x47 << 16 | 188 << 4 | 0xc); |
| 826 | |
| 827 | /* Defaults for VID C */ |
| 828 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 829 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 830 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 831 | break; |
Igor M. Liplianin | 579943f | 2009-01-17 12:18:26 -0300 | [diff] [blame] | 832 | case CX23885_BOARD_TEVII_S470: |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 833 | case CX23885_BOARD_TBS_6920: |
Igor M. Liplianin | c9b8b04 | 2009-01-17 12:23:31 -0300 | [diff] [blame] | 834 | case CX23885_BOARD_DVBWORLD_2005: |
Igor M. Liplianin | 96318d0 | 2009-01-17 12:11:20 -0300 | [diff] [blame] | 835 | ts1->gen_ctrl_val = 0x5; /* Parallel */ |
| 836 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 837 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 838 | break; |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 839 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
| 840 | ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 841 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 842 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 843 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 844 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 845 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 846 | break; |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 847 | case CX23885_BOARD_MYGICA_X8506: |
David Wong | 2365b2d | 2009-06-17 01:38:12 -0300 | [diff] [blame] | 848 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: |
David Wong | 493b712 | 2009-05-18 05:25:49 -0300 | [diff] [blame] | 849 | ts1->gen_ctrl_val = 0x5; /* Parallel */ |
| 850 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 851 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 852 | break; |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 853 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
Michael Krufky | 07b4a83 | 2007-12-18 01:09:11 -0300 | [diff] [blame] | 854 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
Steven Toth | d1987d5 | 2007-12-18 01:57:06 -0300 | [diff] [blame] | 855 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 856 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
Steven Toth | b3ea016 | 2008-04-19 01:14:19 -0300 | [diff] [blame] | 857 | case CX23885_BOARD_HAUPPAUGE_HVR1200: |
Steven Toth | a780a31 | 2008-04-19 01:25:52 -0300 | [diff] [blame] | 858 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
Steven Toth | 6676237 | 2008-04-22 15:38:26 -0300 | [diff] [blame] | 859 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 860 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 861 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Steven Toth | 2074dff | 2009-05-02 11:39:46 -0300 | [diff] [blame] | 862 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
Michael Krufky | d099bec | 2009-05-08 22:39:24 -0300 | [diff] [blame] | 863 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
Michael Krufky | 19bc579 | 2009-05-08 16:05:29 -0300 | [diff] [blame] | 864 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
Michael Krufky | 6b926ec | 2009-05-12 17:32:17 -0300 | [diff] [blame] | 865 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
Steven Toth | a6a3f14 | 2007-09-08 21:31:56 -0300 | [diff] [blame] | 866 | default: |
| 867 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
| 868 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
| 869 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
| 870 | } |
| 871 | |
Steven Toth | ce89cfb | 2008-04-19 01:36:06 -0300 | [diff] [blame] | 872 | /* Certain boards support analog, or require the avcore to be |
| 873 | * loaded, ensure this happens. |
| 874 | */ |
| 875 | switch (dev->board) { |
| 876 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 877 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
| 878 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
Steven Toth | 4c56b04 | 2008-08-12 13:30:03 -0300 | [diff] [blame] | 879 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
Igor M. Liplianin | 9bb1b7e | 2008-11-23 14:11:16 -0300 | [diff] [blame] | 880 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 881 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
Hans Verkuil | e6574f2 | 2009-04-01 03:57:53 -0300 | [diff] [blame] | 882 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 883 | &dev->i2c_bus[2].i2c_adap, |
Hans Verkuil | 0d5a19f | 2009-03-29 06:53:29 -0300 | [diff] [blame] | 884 | "cx25840", "cx25840", 0x88 >> 1); |
Hans Verkuil | cc26b07 | 2009-03-29 19:20:26 -0300 | [diff] [blame] | 885 | v4l2_subdev_call(dev->sd_cx25840, core, load_fw); |
Steven Toth | ce89cfb | 2008-04-19 01:36:06 -0300 | [diff] [blame] | 886 | break; |
| 887 | } |
Igor M. Liplianin | 5a23b07 | 2009-03-03 12:06:09 -0300 | [diff] [blame] | 888 | |
| 889 | /* AUX-PLL 27MHz CLK */ |
| 890 | switch (dev->board) { |
| 891 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
| 892 | netup_initialize(dev); |
| 893 | break; |
| 894 | } |
Steven Toth | d19770e | 2007-03-11 20:44:05 -0300 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | /* ------------------------------------------------------------------ */ |