Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III |
| 3 | * |
| 4 | * flexcop-misc.c - miscellaneous functions. |
| 5 | * |
| 6 | * see flexcop.c for copyright information. |
| 7 | */ |
| 8 | #include "flexcop.h" |
| 9 | |
| 10 | void flexcop_determine_revision(struct flexcop_device *fc) |
| 11 | { |
| 12 | flexcop_ibi_value v = fc->read_ibi_reg(fc,misc_204); |
| 13 | |
| 14 | switch (v.misc_204.Rev_N_sig_revision_hi) { |
| 15 | case 0x2: |
| 16 | deb_info("found a FlexCopII.\n"); |
| 17 | fc->rev = FLEXCOP_II; |
| 18 | break; |
| 19 | case 0x3: |
| 20 | deb_info("found a FlexCopIIb.\n"); |
| 21 | fc->rev = FLEXCOP_IIB; |
| 22 | break; |
| 23 | case 0x0: |
| 24 | deb_info("found a FlexCopIII.\n"); |
| 25 | fc->rev = FLEXCOP_III; |
| 26 | break; |
| 27 | default: |
| 28 | err("unkown FlexCop Revision: %x. Please report the linux-dvb@linuxtv.org.",v.misc_204.Rev_N_sig_revision_hi); |
| 29 | break; |
| 30 | } |
| 31 | |
| 32 | if ((fc->has_32_hw_pid_filter = v.misc_204.Rev_N_sig_caps)) |
| 33 | deb_info("this FlexCop has the additional 32 hardware pid filter.\n"); |
| 34 | else |
| 35 | deb_info("this FlexCop has only the 6 basic main hardware pid filter.\n"); |
| 36 | /* bus parts have to decide if hw pid filtering is used or not. */ |
| 37 | } |
| 38 | |
Adrian Bunk | a22a6865 | 2006-01-23 09:58:17 -0200 | [diff] [blame] | 39 | static const char *flexcop_revision_names[] = { |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 40 | "Unkown chip", |
| 41 | "FlexCopII", |
| 42 | "FlexCopIIb", |
| 43 | "FlexCopIII", |
| 44 | }; |
| 45 | |
Adrian Bunk | a22a6865 | 2006-01-23 09:58:17 -0200 | [diff] [blame] | 46 | static const char *flexcop_device_names[] = { |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 47 | "Unkown device", |
Johannes Stezenbach | 55f51ef | 2005-06-23 22:02:41 -0700 | [diff] [blame] | 48 | "Air2PC/AirStar 2 DVB-T", |
| 49 | "Air2PC/AirStar 2 ATSC 1st generation", |
| 50 | "Air2PC/AirStar 2 ATSC 2nd generation", |
| 51 | "Sky2PC/SkyStar 2 DVB-S", |
| 52 | "Sky2PC/SkyStar 2 DVB-S (old version)", |
| 53 | "Cable2PC/CableStar 2 DVB-C", |
Michael Krufky | c0b11b9 | 2005-11-08 21:35:32 -0800 | [diff] [blame] | 54 | "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)", |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 55 | }; |
| 56 | |
Adrian Bunk | a22a6865 | 2006-01-23 09:58:17 -0200 | [diff] [blame] | 57 | static const char *flexcop_bus_names[] = { |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 58 | "USB", |
| 59 | "PCI", |
| 60 | }; |
| 61 | |
| 62 | void flexcop_device_name(struct flexcop_device *fc,const char *prefix,const |
| 63 | char *suffix) |
| 64 | { |
| 65 | info("%s '%s' at the '%s' bus controlled by a '%s' %s",prefix, |
| 66 | flexcop_device_names[fc->dev_type],flexcop_bus_names[fc->bus_type], |
| 67 | flexcop_revision_names[fc->rev],suffix); |
| 68 | } |
Patrick Boettcher | 64221be | 2005-07-07 17:57:49 -0700 | [diff] [blame] | 69 | |
| 70 | void flexcop_dump_reg(struct flexcop_device *fc, flexcop_ibi_register reg, int num) |
| 71 | { |
| 72 | flexcop_ibi_value v; |
| 73 | int i; |
| 74 | for (i = 0; i < num; i++) { |
| 75 | v = fc->read_ibi_reg(fc,reg+4*i); |
| 76 | deb_rdump("0x%03x: %08x, ",reg+4*i, v.raw); |
| 77 | } |
| 78 | deb_rdump("\n"); |
| 79 | } |
| 80 | EXPORT_SYMBOL(flexcop_dump_reg); |