Path: blob/master/drivers/media/dvb/b2c2/flexcop-misc.c
15111 views
/*1* Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III2* flexcop-misc.c - miscellaneous functions3* see flexcop.c for copyright information4*/5#include "flexcop.h"67void flexcop_determine_revision(struct flexcop_device *fc)8{9flexcop_ibi_value v = fc->read_ibi_reg(fc,misc_204);1011switch (v.misc_204.Rev_N_sig_revision_hi) {12case 0x2:13deb_info("found a FlexCopII.\n");14fc->rev = FLEXCOP_II;15break;16case 0x3:17deb_info("found a FlexCopIIb.\n");18fc->rev = FLEXCOP_IIB;19break;20case 0x0:21deb_info("found a FlexCopIII.\n");22fc->rev = FLEXCOP_III;23break;24default:25err("unknown FlexCop Revision: %x. Please report this to "26"[email protected].",27v.misc_204.Rev_N_sig_revision_hi);28break;29}3031if ((fc->has_32_hw_pid_filter = v.misc_204.Rev_N_sig_caps))32deb_info("this FlexCop has "33"the additional 32 hardware pid filter.\n");34else35deb_info("this FlexCop has "36"the 6 basic main hardware pid filter.\n");37/* bus parts have to decide if hw pid filtering is used or not. */38}3940static const char *flexcop_revision_names[] = {41"Unknown chip",42"FlexCopII",43"FlexCopIIb",44"FlexCopIII",45};4647static const char *flexcop_device_names[] = {48[FC_UNK] = "Unknown device",49[FC_CABLE] = "Cable2PC/CableStar 2 DVB-C",50[FC_AIR_DVBT] = "Air2PC/AirStar 2 DVB-T",51[FC_AIR_ATSC1] = "Air2PC/AirStar 2 ATSC 1st generation",52[FC_AIR_ATSC2] = "Air2PC/AirStar 2 ATSC 2nd generation",53[FC_AIR_ATSC3] = "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)",54[FC_SKY_REV23] = "Sky2PC/SkyStar 2 DVB-S rev 2.3 (old version)",55[FC_SKY_REV26] = "Sky2PC/SkyStar 2 DVB-S rev 2.6",56[FC_SKY_REV27] = "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u",57[FC_SKY_REV28] = "Sky2PC/SkyStar 2 DVB-S rev 2.8",58};5960static const char *flexcop_bus_names[] = {61"USB",62"PCI",63};6465void flexcop_device_name(struct flexcop_device *fc,66const char *prefix, const char *suffix)67{68info("%s '%s' at the '%s' bus controlled by a '%s' %s",69prefix, flexcop_device_names[fc->dev_type],70flexcop_bus_names[fc->bus_type],71flexcop_revision_names[fc->rev], suffix);72}7374void flexcop_dump_reg(struct flexcop_device *fc,75flexcop_ibi_register reg, int num)76{77flexcop_ibi_value v;78int i;79for (i = 0; i < num; i++) {80v = fc->read_ibi_reg(fc, reg+4*i);81deb_rdump("0x%03x: %08x, ", reg+4*i, v.raw);82}83deb_rdump("\n");84}85EXPORT_SYMBOL(flexcop_dump_reg);868788