Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
0004  * flexcop-misc.c - miscellaneous functions
0005  * see flexcop.c for copyright information
0006  */
0007 #include "flexcop.h"
0008 
0009 void flexcop_determine_revision(struct flexcop_device *fc)
0010 {
0011     flexcop_ibi_value v = fc->read_ibi_reg(fc,misc_204);
0012 
0013     switch (v.misc_204.Rev_N_sig_revision_hi) {
0014     case 0x2:
0015         deb_info("found a FlexCopII.\n");
0016         fc->rev = FLEXCOP_II;
0017         break;
0018     case 0x3:
0019         deb_info("found a FlexCopIIb.\n");
0020         fc->rev = FLEXCOP_IIB;
0021         break;
0022     case 0x0:
0023         deb_info("found a FlexCopIII.\n");
0024         fc->rev = FLEXCOP_III;
0025         break;
0026     default:
0027         err("unknown FlexCop Revision: %x. Please report this to linux-dvb@linuxtv.org.",
0028                 v.misc_204.Rev_N_sig_revision_hi);
0029         break;
0030     }
0031 
0032     if ((fc->has_32_hw_pid_filter = v.misc_204.Rev_N_sig_caps))
0033         deb_info("this FlexCop has the additional 32 hardware pid filter.\n");
0034     else
0035         deb_info("this FlexCop has the 6 basic main hardware pid filter.\n");
0036     /* bus parts have to decide if hw pid filtering is used or not. */
0037 }
0038 
0039 static const char *flexcop_revision_names[] = {
0040     "Unknown chip",
0041     "FlexCopII",
0042     "FlexCopIIb",
0043     "FlexCopIII",
0044 };
0045 
0046 static const char *flexcop_device_names[] = {
0047     [FC_UNK]    = "Unknown device",
0048     [FC_CABLE]  = "Cable2PC/CableStar 2 DVB-C",
0049     [FC_AIR_DVBT]   = "Air2PC/AirStar 2 DVB-T",
0050     [FC_AIR_ATSC1]  = "Air2PC/AirStar 2 ATSC 1st generation",
0051     [FC_AIR_ATSC2]  = "Air2PC/AirStar 2 ATSC 2nd generation",
0052     [FC_AIR_ATSC3]  = "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)",
0053     [FC_SKY_REV23]  = "Sky2PC/SkyStar 2 DVB-S rev 2.3 (old version)",
0054     [FC_SKY_REV26]  = "Sky2PC/SkyStar 2 DVB-S rev 2.6",
0055     [FC_SKY_REV27]  = "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u",
0056     [FC_SKY_REV28]  = "Sky2PC/SkyStar 2 DVB-S rev 2.8",
0057     [FC_SKYS2_REV33] = "Sky2PC/SkyStar S2 DVB-S/S2 rev 3.3",
0058 };
0059 
0060 static const char *flexcop_bus_names[] = {
0061     "USB",
0062     "PCI",
0063 };
0064 
0065 void flexcop_device_name(struct flexcop_device *fc,
0066         const char *prefix, const char *suffix)
0067 {
0068     info("%s '%s' at the '%s' bus controlled by a '%s' %s",
0069             prefix, flexcop_device_names[fc->dev_type],
0070             flexcop_bus_names[fc->bus_type],
0071             flexcop_revision_names[fc->rev], suffix);
0072 }
0073 
0074 void flexcop_dump_reg(struct flexcop_device *fc,
0075         flexcop_ibi_register reg, int num)
0076 {
0077     flexcop_ibi_value v;
0078     int i;
0079     for (i = 0; i < num; i++) {
0080         v = fc->read_ibi_reg(fc, reg+4*i);
0081         deb_rdump("0x%03x: %08x, ", reg+4*i, v.raw);
0082     }
0083     deb_rdump("\n");
0084 }
0085 EXPORT_SYMBOL(flexcop_dump_reg);