flexcop-misc.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. void flexcop_determine_revision(struct flexcop_device *fc)
  10. {
  11. flexcop_ibi_value v = fc->read_ibi_reg(fc,misc_204);
  12. switch (v.misc_204.Rev_N_sig_revision_hi) {
  13. case 0x2:
  14. deb_info("found a FlexCopII.\n");
  15. fc->rev = FLEXCOP_II;
  16. break;
  17. case 0x3:
  18. deb_info("found a FlexCopIIb.\n");
  19. fc->rev = FLEXCOP_IIB;
  20. break;
  21. case 0x0:
  22. deb_info("found a FlexCopIII.\n");
  23. fc->rev = FLEXCOP_III;
  24. break;
  25. default:
  26. err("unkown FlexCop Revision: %x. Please report the linux-dvb@linuxtv.org.",v.misc_204.Rev_N_sig_revision_hi);
  27. break;
  28. }
  29. if ((fc->has_32_hw_pid_filter = v.misc_204.Rev_N_sig_caps))
  30. deb_info("this FlexCop has the additional 32 hardware pid filter.\n");
  31. else
  32. deb_info("this FlexCop has only the 6 basic main hardware pid filter.\n");
  33. /* bus parts have to decide if hw pid filtering is used or not. */
  34. }
  35. static const char *flexcop_revision_names[] = {
  36. "Unkown chip",
  37. "FlexCopII",
  38. "FlexCopIIb",
  39. "FlexCopIII",
  40. };
  41. static const char *flexcop_device_names[] = {
  42. "Unkown device",
  43. "Air2PC/AirStar 2 DVB-T",
  44. "Air2PC/AirStar 2 ATSC 1st generation",
  45. "Air2PC/AirStar 2 ATSC 2nd generation",
  46. "Sky2PC/SkyStar 2 DVB-S",
  47. "Sky2PC/SkyStar 2 DVB-S (old version)",
  48. "Cable2PC/CableStar 2 DVB-C",
  49. "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)",
  50. "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u",
  51. "Sky2PC/SkyStar 2 DVB-S rev 2.8",
  52. };
  53. static const char *flexcop_bus_names[] = {
  54. "USB",
  55. "PCI",
  56. };
  57. void flexcop_device_name(struct flexcop_device *fc,const char *prefix,const
  58. char *suffix)
  59. {
  60. info("%s '%s' at the '%s' bus controlled by a '%s' %s",prefix,
  61. flexcop_device_names[fc->dev_type],flexcop_bus_names[fc->bus_type],
  62. flexcop_revision_names[fc->rev],suffix);
  63. }
  64. void flexcop_dump_reg(struct flexcop_device *fc, flexcop_ibi_register reg, int num)
  65. {
  66. flexcop_ibi_value v;
  67. int i;
  68. for (i = 0; i < num; i++) {
  69. v = fc->read_ibi_reg(fc,reg+4*i);
  70. deb_rdump("0x%03x: %08x, ",reg+4*i, v.raw);
  71. }
  72. deb_rdump("\n");
  73. }
  74. EXPORT_SYMBOL(flexcop_dump_reg);