Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2add87a9 | 2 | /* |
1589a993 UB |
3 | * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III |
4 | * flexcop-misc.c - miscellaneous functions | |
5 | * see flexcop.c for copyright information | |
2add87a9 JS |
6 | */ |
7 | #include "flexcop.h" | |
8 | ||
9 | void flexcop_determine_revision(struct flexcop_device *fc) | |
10 | { | |
11 | flexcop_ibi_value v = fc->read_ibi_reg(fc,misc_204); | |
12 | ||
13 | switch (v.misc_204.Rev_N_sig_revision_hi) { | |
1589a993 UB |
14 | case 0x2: |
15 | deb_info("found a FlexCopII.\n"); | |
16 | fc->rev = FLEXCOP_II; | |
17 | break; | |
18 | case 0x3: | |
19 | deb_info("found a FlexCopIIb.\n"); | |
20 | fc->rev = FLEXCOP_IIB; | |
21 | break; | |
22 | case 0x0: | |
23 | deb_info("found a FlexCopIII.\n"); | |
24 | fc->rev = FLEXCOP_III; | |
25 | break; | |
26 | default: | |
d9942ad0 | 27 | err("unknown FlexCop Revision: %x. Please report this to linux-dvb@linuxtv.org.", |
1589a993 UB |
28 | v.misc_204.Rev_N_sig_revision_hi); |
29 | break; | |
2add87a9 JS |
30 | } |
31 | ||
32 | if ((fc->has_32_hw_pid_filter = v.misc_204.Rev_N_sig_caps)) | |
d9942ad0 | 33 | deb_info("this FlexCop has the additional 32 hardware pid filter.\n"); |
2add87a9 | 34 | else |
d9942ad0 | 35 | deb_info("this FlexCop has the 6 basic main hardware pid filter.\n"); |
2add87a9 JS |
36 | /* bus parts have to decide if hw pid filtering is used or not. */ |
37 | } | |
38 | ||
a22a6865 | 39 | static const char *flexcop_revision_names[] = { |
1589a993 | 40 | "Unknown chip", |
2add87a9 JS |
41 | "FlexCopII", |
42 | "FlexCopIIb", | |
43 | "FlexCopIII", | |
44 | }; | |
45 | ||
a22a6865 | 46 | static const char *flexcop_device_names[] = { |
1c905a45 MS |
47 | [FC_UNK] = "Unknown device", |
48 | [FC_CABLE] = "Cable2PC/CableStar 2 DVB-C", | |
49 | [FC_AIR_DVBT] = "Air2PC/AirStar 2 DVB-T", | |
50 | [FC_AIR_ATSC1] = "Air2PC/AirStar 2 ATSC 1st generation", | |
51 | [FC_AIR_ATSC2] = "Air2PC/AirStar 2 ATSC 2nd generation", | |
52 | [FC_AIR_ATSC3] = "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)", | |
53 | [FC_SKY_REV23] = "Sky2PC/SkyStar 2 DVB-S rev 2.3 (old version)", | |
54 | [FC_SKY_REV26] = "Sky2PC/SkyStar 2 DVB-S rev 2.6", | |
55 | [FC_SKY_REV27] = "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u", | |
56 | [FC_SKY_REV28] = "Sky2PC/SkyStar 2 DVB-S rev 2.8", | |
5afc9a25 | 57 | [FC_SKYS2_REV33] = "Sky2PC/SkyStar S2 DVB-S/S2 rev 3.3", |
2add87a9 JS |
58 | }; |
59 | ||
a22a6865 | 60 | static const char *flexcop_bus_names[] = { |
2add87a9 JS |
61 | "USB", |
62 | "PCI", | |
63 | }; | |
64 | ||
1589a993 UB |
65 | void flexcop_device_name(struct flexcop_device *fc, |
66 | const char *prefix, const char *suffix) | |
2add87a9 | 67 | { |
1589a993 UB |
68 | info("%s '%s' at the '%s' bus controlled by a '%s' %s", |
69 | prefix, flexcop_device_names[fc->dev_type], | |
70 | flexcop_bus_names[fc->bus_type], | |
71 | flexcop_revision_names[fc->rev], suffix); | |
2add87a9 | 72 | } |
64221be7 | 73 | |
1589a993 UB |
74 | void flexcop_dump_reg(struct flexcop_device *fc, |
75 | flexcop_ibi_register reg, int num) | |
64221be7 PB |
76 | { |
77 | flexcop_ibi_value v; | |
78 | int i; | |
79 | for (i = 0; i < num; i++) { | |
1589a993 UB |
80 | v = fc->read_ibi_reg(fc, reg+4*i); |
81 | deb_rdump("0x%03x: %08x, ", reg+4*i, v.raw); | |
64221be7 PB |
82 | } |
83 | deb_rdump("\n"); | |
84 | } | |
85 | EXPORT_SYMBOL(flexcop_dump_reg); |