dibusb-mc.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /* DVB USB compliant linux driver for mobile DVB-T USB devices based on
  2. * reference designs made by DiBcom (http://www.dibcom.fr/) (DiB3000M-C/P)
  3. *
  4. * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
  5. *
  6. * based on GPL code from DiBcom, which has
  7. * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr)
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the Free
  11. * Software Foundation, version 2.
  12. *
  13. * see Documentation/dvb/README.dvb-usb for more information
  14. */
  15. #include "dibusb.h"
  16. DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
  17. /* USB Driver stuff */
  18. static struct dvb_usb_device_properties dibusb_mc_properties;
  19. static int dibusb_mc_probe(struct usb_interface *intf,
  20. const struct usb_device_id *id)
  21. {
  22. return dvb_usb_device_init(intf, &dibusb_mc_properties, THIS_MODULE,
  23. NULL, adapter_nr);
  24. }
  25. /* do not change the order of the ID table */
  26. static struct usb_device_id dibusb_dib3000mc_table [] = {
  27. /* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) },
  28. /* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) },
  29. /* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
  30. /* 03 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, // ( ? )
  31. /* 04 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_COLD) },
  32. /* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) },
  33. /* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) },
  34. /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) },
  35. /* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) },
  36. /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) },
  37. /* 10 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_COLD) },
  38. /* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) },
  39. /* 12 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_COLD) },
  40. /* 13 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_WARM) },
  41. /* 14 */ { USB_DEVICE(USB_VID_HUMAX_COEX, USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD) },
  42. /* 15 */ { USB_DEVICE(USB_VID_HUMAX_COEX, USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM) },
  43. { } /* Terminating entry */
  44. };
  45. MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table);
  46. static struct dvb_usb_device_properties dibusb_mc_properties = {
  47. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  48. .usb_ctrl = CYPRESS_FX2,
  49. .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
  50. .num_adapters = 1,
  51. .adapter = {
  52. {
  53. .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  54. .pid_filter_count = 32,
  55. .streaming_ctrl = dibusb2_0_streaming_ctrl,
  56. .pid_filter = dibusb_pid_filter,
  57. .pid_filter_ctrl = dibusb_pid_filter_ctrl,
  58. .frontend_attach = dibusb_dib3000mc_frontend_attach,
  59. .tuner_attach = dibusb_dib3000mc_tuner_attach,
  60. /* parameter for the MPEG2-data transfer */
  61. .stream = {
  62. .type = USB_BULK,
  63. .count = 8,
  64. .endpoint = 0x06,
  65. .u = {
  66. .bulk = {
  67. .buffersize = 4096,
  68. }
  69. }
  70. },
  71. .size_of_priv = sizeof(struct dibusb_state),
  72. }
  73. },
  74. .power_ctrl = dibusb2_0_power_ctrl,
  75. .rc.legacy = {
  76. .rc_interval = DEFAULT_RC_INTERVAL,
  77. .rc_map_table = rc_map_dibusb_table,
  78. .rc_map_size = 111, /* FIXME */
  79. .rc_query = dibusb_rc_query,
  80. },
  81. .i2c_algo = &dibusb_i2c_algo,
  82. .generic_bulk_ctrl_endpoint = 0x01,
  83. .num_device_descs = 8,
  84. .devices = {
  85. { "DiBcom USB2.0 DVB-T reference design (MOD3000P)",
  86. { &dibusb_dib3000mc_table[0], NULL },
  87. { &dibusb_dib3000mc_table[1], NULL },
  88. },
  89. { "Artec T1 USB2.0 TVBOX (please check the warm ID)",
  90. { &dibusb_dib3000mc_table[2], NULL },
  91. { &dibusb_dib3000mc_table[3], NULL },
  92. },
  93. { "LITE-ON USB2.0 DVB-T Tuner",
  94. /* Also rebranded as Intuix S800, Toshiba */
  95. { &dibusb_dib3000mc_table[4], NULL },
  96. { &dibusb_dib3000mc_table[5], NULL },
  97. },
  98. { "MSI Digivox Mini SL",
  99. { &dibusb_dib3000mc_table[6], NULL },
  100. { &dibusb_dib3000mc_table[7], NULL },
  101. },
  102. { "GRAND - USB2.0 DVB-T adapter",
  103. { &dibusb_dib3000mc_table[8], NULL },
  104. { &dibusb_dib3000mc_table[9], NULL },
  105. },
  106. { "Artec T14 - USB2.0 DVB-T",
  107. { &dibusb_dib3000mc_table[10], NULL },
  108. { &dibusb_dib3000mc_table[11], NULL },
  109. },
  110. { "Leadtek - USB2.0 Winfast DTV dongle",
  111. { &dibusb_dib3000mc_table[12], NULL },
  112. { &dibusb_dib3000mc_table[13], NULL },
  113. },
  114. { "Humax/Coex DVB-T USB Stick 2.0 High Speed",
  115. { &dibusb_dib3000mc_table[14], NULL },
  116. { &dibusb_dib3000mc_table[15], NULL },
  117. },
  118. { NULL },
  119. }
  120. };
  121. static struct usb_driver dibusb_mc_driver = {
  122. .name = "dvb_usb_dibusb_mc",
  123. .probe = dibusb_mc_probe,
  124. .disconnect = dvb_usb_device_exit,
  125. .id_table = dibusb_dib3000mc_table,
  126. };
  127. /* module stuff */
  128. static int __init dibusb_mc_module_init(void)
  129. {
  130. int result;
  131. if ((result = usb_register(&dibusb_mc_driver))) {
  132. err("usb_register failed. Error number %d",result);
  133. return result;
  134. }
  135. return 0;
  136. }
  137. static void __exit dibusb_mc_module_exit(void)
  138. {
  139. /* deregister this driver from the USB subsystem */
  140. usb_deregister(&dibusb_mc_driver);
  141. }
  142. module_init (dibusb_mc_module_init);
  143. module_exit (dibusb_mc_module_exit);
  144. MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
  145. MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices");
  146. MODULE_VERSION("1.0");
  147. MODULE_LICENSE("GPL");