flexcop-misc.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. const char *flexcop_revision_names[] = {
  36. "Unkown chip",
  37. "FlexCopII",
  38. "FlexCopIIb",
  39. "FlexCopIII",
  40. };
  41. 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. };
  50. const char *flexcop_bus_names[] = {
  51. "USB",
  52. "PCI",
  53. };
  54. void flexcop_device_name(struct flexcop_device *fc,const char *prefix,const
  55. char *suffix)
  56. {
  57. info("%s '%s' at the '%s' bus controlled by a '%s' %s",prefix,
  58. flexcop_device_names[fc->dev_type],flexcop_bus_names[fc->bus_type],
  59. flexcop_revision_names[fc->rev],suffix);
  60. }
  61. void flexcop_dump_reg(struct flexcop_device *fc, flexcop_ibi_register reg, int num)
  62. {
  63. flexcop_ibi_value v;
  64. int i;
  65. for (i = 0; i < num; i++) {
  66. v = fc->read_ibi_reg(fc,reg+4*i);
  67. deb_rdump("0x%03x: %08x, ",reg+4*i, v.raw);
  68. }
  69. deb_rdump("\n");
  70. }
  71. EXPORT_SYMBOL(flexcop_dump_reg);