flexcop-misc.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. "AirStar 2 DVB-T",
  44. "AirStar 2 ATSC",
  45. "SkyStar 2 DVB-S",
  46. "SkyStar 2 DVB-S (old version)",
  47. "CableStar 2 DVB-C",
  48. };
  49. const char *flexcop_bus_names[] = {
  50. "USB",
  51. "PCI",
  52. };
  53. void flexcop_device_name(struct flexcop_device *fc,const char *prefix,const
  54. char *suffix)
  55. {
  56. info("%s '%s' at the '%s' bus controlled by a '%s' %s",prefix,
  57. flexcop_device_names[fc->dev_type],flexcop_bus_names[fc->bus_type],
  58. flexcop_revision_names[fc->rev],suffix);
  59. }