1 // SPDX-License-Identifier: GPL-2.0
3 * ddbridge-hw.c: Digital Devices bridge hardware maps
5 * Copyright (C) 2010-2017 Digital Devices GmbH
6 * Ralph Metzler <rjkm@metzlerbros.de>
7 * Marcus Metzler <mocm@metzlerbros.de>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 only, as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
20 #include "ddbridge-hw.h"
22 /******************************************************************************/
24 static const struct ddb_regset octopus_input
= {
30 static const struct ddb_regset octopus_output
= {
36 static const struct ddb_regset octopus_idma
= {
42 static const struct ddb_regset octopus_idma_buf
= {
48 static const struct ddb_regset octopus_odma
= {
54 static const struct ddb_regset octopus_odma_buf
= {
60 static const struct ddb_regset octopus_i2c
= {
66 static const struct ddb_regset octopus_i2c_buf
= {
72 /****************************************************************************/
74 static const struct ddb_regmap octopus_map
= {
79 .i2c_buf
= &octopus_i2c_buf
,
80 .idma
= &octopus_idma
,
81 .idma_buf
= &octopus_idma_buf
,
82 .odma
= &octopus_odma
,
83 .odma_buf
= &octopus_odma_buf
,
84 .input
= &octopus_input
,
85 .output
= &octopus_output
,
88 /****************************************************************************/
90 static const struct ddb_info ddb_none
= {
92 .name
= "unknown Digital Devices PCIe card, install newer driver",
93 .regmap
= &octopus_map
,
96 static const struct ddb_info ddb_octopus
= {
98 .name
= "Digital Devices Octopus DVB adapter",
99 .regmap
= &octopus_map
,
104 static const struct ddb_info ddb_octopusv3
= {
106 .name
= "Digital Devices Octopus V3 DVB adapter",
107 .regmap
= &octopus_map
,
112 static const struct ddb_info ddb_octopus_le
= {
114 .name
= "Digital Devices Octopus LE DVB adapter",
115 .regmap
= &octopus_map
,
120 static const struct ddb_info ddb_octopus_oem
= {
122 .name
= "Digital Devices Octopus OEM",
123 .regmap
= &octopus_map
,
132 static const struct ddb_info ddb_octopus_mini
= {
134 .name
= "Digital Devices Octopus Mini",
135 .regmap
= &octopus_map
,
140 static const struct ddb_info ddb_v6
= {
142 .name
= "Digital Devices Cine S2 V6 DVB adapter",
143 .regmap
= &octopus_map
,
148 static const struct ddb_info ddb_v6_5
= {
150 .name
= "Digital Devices Cine S2 V6.5 DVB adapter",
151 .regmap
= &octopus_map
,
156 static const struct ddb_info ddb_v7
= {
158 .name
= "Digital Devices Cine S2 V7 DVB adapter",
159 .regmap
= &octopus_map
,
163 .board_control_2
= 4,
164 .ts_quirks
= TS_QUIRK_REVERSED
,
167 static const struct ddb_info ddb_v7a
= {
169 .name
= "Digital Devices Cine S2 V7 Advanced DVB adapter",
170 .regmap
= &octopus_map
,
174 .board_control_2
= 4,
175 .ts_quirks
= TS_QUIRK_REVERSED
,
178 static const struct ddb_info ddb_ctv7
= {
180 .name
= "Digital Devices Cine CT V7 DVB adapter",
181 .regmap
= &octopus_map
,
185 .board_control_2
= 4,
188 static const struct ddb_info ddb_satixs2v3
= {
190 .name
= "Mystique SaTiX-S2 V3 DVB adapter",
191 .regmap
= &octopus_map
,
196 static const struct ddb_info ddb_ci
= {
197 .type
= DDB_OCTOPUS_CI
,
198 .name
= "Digital Devices Octopus CI",
199 .regmap
= &octopus_map
,
204 static const struct ddb_info ddb_cis
= {
205 .type
= DDB_OCTOPUS_CI
,
206 .name
= "Digital Devices Octopus CI single",
207 .regmap
= &octopus_map
,
212 static const struct ddb_info ddb_ci_s2_pro
= {
213 .type
= DDB_OCTOPUS_CI
,
214 .name
= "Digital Devices Octopus CI S2 Pro",
215 .regmap
= &octopus_map
,
219 .board_control_2
= 4,
222 static const struct ddb_info ddb_ci_s2_pro_a
= {
223 .type
= DDB_OCTOPUS_CI
,
224 .name
= "Digital Devices Octopus CI S2 Pro Advanced",
225 .regmap
= &octopus_map
,
229 .board_control_2
= 4,
232 static const struct ddb_info ddb_dvbct
= {
234 .name
= "Digital Devices DVBCT V6.1 DVB adapter",
235 .regmap
= &octopus_map
,
240 /****************************************************************************/
242 static const struct ddb_info ddb_ct2_8
= {
243 .type
= DDB_OCTOPUS_MAX_CT
,
244 .name
= "Digital Devices MAX A8 CT2",
245 .regmap
= &octopus_map
,
248 .board_control
= 0x0ff,
249 .board_control_2
= 0xf00,
250 .ts_quirks
= TS_QUIRK_SERIAL
,
254 static const struct ddb_info ddb_c2t2_8
= {
255 .type
= DDB_OCTOPUS_MAX_CT
,
256 .name
= "Digital Devices MAX A8 C2T2",
257 .regmap
= &octopus_map
,
260 .board_control
= 0x0ff,
261 .board_control_2
= 0xf00,
262 .ts_quirks
= TS_QUIRK_SERIAL
,
266 static const struct ddb_info ddb_isdbt_8
= {
267 .type
= DDB_OCTOPUS_MAX_CT
,
268 .name
= "Digital Devices MAX A8 ISDBT",
269 .regmap
= &octopus_map
,
272 .board_control
= 0x0ff,
273 .board_control_2
= 0xf00,
274 .ts_quirks
= TS_QUIRK_SERIAL
,
278 static const struct ddb_info ddb_c2t2i_v0_8
= {
279 .type
= DDB_OCTOPUS_MAX_CT
,
280 .name
= "Digital Devices MAX A8 C2T2I V0",
281 .regmap
= &octopus_map
,
284 .board_control
= 0x0ff,
285 .board_control_2
= 0xf00,
286 .ts_quirks
= TS_QUIRK_SERIAL
| TS_QUIRK_ALT_OSC
,
290 static const struct ddb_info ddb_c2t2i_8
= {
291 .type
= DDB_OCTOPUS_MAX_CT
,
292 .name
= "Digital Devices MAX A8 C2T2I",
293 .regmap
= &octopus_map
,
296 .board_control
= 0x0ff,
297 .board_control_2
= 0xf00,
298 .ts_quirks
= TS_QUIRK_SERIAL
,
302 /****************************************************************************/
304 static const struct ddb_info ddb_s2_48
= {
305 .type
= DDB_OCTOPUS_MAX
,
306 .name
= "Digital Devices MAX S8 4/8",
307 .regmap
= &octopus_map
,
314 static const struct ddb_info ddb_s2x_48
= {
315 .type
= DDB_OCTOPUS_MCI
,
316 .name
= "Digital Devices MAX SX8",
317 .regmap
= &octopus_map
,
325 /****************************************************************************/
326 /****************************************************************************/
327 /****************************************************************************/
329 #define DDB_DEVID(_device, _subdevice, _info) { \
332 .subvendor = DDVID, \
333 .subdevice = _subdevice, \
336 static const struct ddb_device_id ddb_device_ids
[] = {
338 DDB_DEVID(0x0002, 0x0001, ddb_octopus
),
339 DDB_DEVID(0x0003, 0x0001, ddb_octopus
),
340 DDB_DEVID(0x0005, 0x0004, ddb_octopusv3
),
341 DDB_DEVID(0x0003, 0x0002, ddb_octopus_le
),
342 DDB_DEVID(0x0003, 0x0003, ddb_octopus_oem
),
343 DDB_DEVID(0x0003, 0x0010, ddb_octopus_mini
),
344 DDB_DEVID(0x0005, 0x0011, ddb_octopus_mini
),
345 DDB_DEVID(0x0003, 0x0020, ddb_v6
),
346 DDB_DEVID(0x0003, 0x0021, ddb_v6_5
),
347 DDB_DEVID(0x0006, 0x0022, ddb_v7
),
348 DDB_DEVID(0x0006, 0x0024, ddb_v7a
),
349 DDB_DEVID(0x0003, 0x0030, ddb_dvbct
),
350 DDB_DEVID(0x0003, 0xdb03, ddb_satixs2v3
),
351 DDB_DEVID(0x0006, 0x0031, ddb_ctv7
),
352 DDB_DEVID(0x0006, 0x0032, ddb_ctv7
),
353 DDB_DEVID(0x0006, 0x0033, ddb_ctv7
),
354 DDB_DEVID(0x0007, 0x0023, ddb_s2_48
),
355 DDB_DEVID(0x0008, 0x0034, ddb_ct2_8
),
356 DDB_DEVID(0x0008, 0x0035, ddb_c2t2_8
),
357 DDB_DEVID(0x0008, 0x0036, ddb_isdbt_8
),
358 DDB_DEVID(0x0008, 0x0037, ddb_c2t2i_v0_8
),
359 DDB_DEVID(0x0008, 0x0038, ddb_c2t2i_8
),
360 DDB_DEVID(0x0009, 0x0025, ddb_s2x_48
),
361 DDB_DEVID(0x0006, 0x0039, ddb_ctv7
),
362 DDB_DEVID(0x0011, 0x0040, ddb_ci
),
363 DDB_DEVID(0x0011, 0x0041, ddb_cis
),
364 DDB_DEVID(0x0012, 0x0042, ddb_ci
),
365 DDB_DEVID(0x0013, 0x0043, ddb_ci_s2_pro
),
366 DDB_DEVID(0x0013, 0x0044, ddb_ci_s2_pro_a
),
369 /****************************************************************************/
371 const struct ddb_info
*get_ddb_info(u16 vendor
, u16 device
,
372 u16 subvendor
, u16 subdevice
)
376 for (i
= 0; i
< ARRAY_SIZE(ddb_device_ids
); i
++) {
377 const struct ddb_device_id
*id
= &ddb_device_ids
[i
];
379 if (vendor
== id
->vendor
&&
380 device
== id
->device
&&
381 subvendor
== id
->subvendor
&&
382 (subdevice
== id
->subdevice
||
383 id
->subdevice
== 0xffff))