flexcop-misc.c 2.3 KB

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