PageRenderTime 26ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/release/src-rt-6.x/linux/linux-2.6/drivers/media/dvb/dvb-usb/dibusb-mc.c

https://gitlab.com/envieidoc/advancedtomato2
C | 154 lines | 117 code | 17 blank | 20 comment | 1 complexity | d5e60a2b11b3eeedc4769cbd7dd20121 MD5 | raw file
  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. /* USB Driver stuff */
  17. static struct dvb_usb_device_properties dibusb_mc_properties;
  18. static int dibusb_mc_probe(struct usb_interface *intf,
  19. const struct usb_device_id *id)
  20. {
  21. return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
  22. }
  23. /* do not change the order of the ID table */
  24. static struct usb_device_id dibusb_dib3000mc_table [] = {
  25. /* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) },
  26. /* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) },
  27. /* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
  28. /* 03 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, // ( ? )
  29. /* 04 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_COLD) },
  30. /* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) },
  31. /* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) },
  32. /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) },
  33. /* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) },
  34. /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) },
  35. /* 10 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_COLD) },
  36. /* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) },
  37. /* 12 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_COLD) },
  38. /* 13 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_WARM) },
  39. { } /* Terminating entry */
  40. };
  41. MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table);
  42. static struct dvb_usb_device_properties dibusb_mc_properties = {
  43. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  44. .usb_ctrl = CYPRESS_FX2,
  45. .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
  46. .num_adapters = 1,
  47. .adapter = {
  48. {
  49. .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  50. .pid_filter_count = 32,
  51. .streaming_ctrl = dibusb2_0_streaming_ctrl,
  52. .pid_filter = dibusb_pid_filter,
  53. .pid_filter_ctrl = dibusb_pid_filter_ctrl,
  54. .frontend_attach = dibusb_dib3000mc_frontend_attach,
  55. .tuner_attach = dibusb_dib3000mc_tuner_attach,
  56. /* parameter for the MPEG2-data transfer */
  57. .stream = {
  58. .type = USB_BULK,
  59. .count = 7,
  60. .endpoint = 0x06,
  61. .u = {
  62. .bulk = {
  63. .buffersize = 4096,
  64. }
  65. }
  66. },
  67. .size_of_priv = sizeof(struct dibusb_state),
  68. }
  69. },
  70. .power_ctrl = dibusb2_0_power_ctrl,
  71. .rc_interval = DEFAULT_RC_INTERVAL,
  72. .rc_key_map = dibusb_rc_keys,
  73. .rc_key_map_size = 111, /* FIXME */
  74. .rc_query = dibusb_rc_query,
  75. .i2c_algo = &dibusb_i2c_algo,
  76. .generic_bulk_ctrl_endpoint = 0x01,
  77. .num_device_descs = 7,
  78. .devices = {
  79. { "DiBcom USB2.0 DVB-T reference design (MOD3000P)",
  80. { &dibusb_dib3000mc_table[0], NULL },
  81. { &dibusb_dib3000mc_table[1], NULL },
  82. },
  83. { "Artec T1 USB2.0 TVBOX (please check the warm ID)",
  84. { &dibusb_dib3000mc_table[2], NULL },
  85. { &dibusb_dib3000mc_table[3], NULL },
  86. },
  87. { "LITE-ON USB2.0 DVB-T Tuner",
  88. /* Also rebranded as Intuix S800, Toshiba */
  89. { &dibusb_dib3000mc_table[4], NULL },
  90. { &dibusb_dib3000mc_table[5], NULL },
  91. },
  92. { "MSI Digivox Mini SL",
  93. { &dibusb_dib3000mc_table[6], NULL },
  94. { &dibusb_dib3000mc_table[7], NULL },
  95. },
  96. { "GRAND - USB2.0 DVB-T adapter",
  97. { &dibusb_dib3000mc_table[8], NULL },
  98. { &dibusb_dib3000mc_table[9], NULL },
  99. },
  100. { "Artec T14 - USB2.0 DVB-T",
  101. { &dibusb_dib3000mc_table[10], NULL },
  102. { &dibusb_dib3000mc_table[11], NULL },
  103. },
  104. { "Leadtek - USB2.0 Winfast DTV dongle",
  105. { &dibusb_dib3000mc_table[12], NULL },
  106. { &dibusb_dib3000mc_table[13], NULL },
  107. },
  108. { NULL },
  109. }
  110. };
  111. static struct usb_driver dibusb_mc_driver = {
  112. .name = "dvb_usb_dibusb_mc",
  113. .probe = dibusb_mc_probe,
  114. .disconnect = dvb_usb_device_exit,
  115. .id_table = dibusb_dib3000mc_table,
  116. };
  117. /* module stuff */
  118. static int __init dibusb_mc_module_init(void)
  119. {
  120. int result;
  121. if ((result = usb_register(&dibusb_mc_driver))) {
  122. err("usb_register failed. Error number %d",result);
  123. return result;
  124. }
  125. return 0;
  126. }
  127. static void __exit dibusb_mc_module_exit(void)
  128. {
  129. /* deregister this driver from the USB subsystem */
  130. usb_deregister(&dibusb_mc_driver);
  131. }
  132. module_init (dibusb_mc_module_init);
  133. module_exit (dibusb_mc_module_exit);
  134. MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
  135. MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices");
  136. MODULE_VERSION("1.0");
  137. MODULE_LICENSE("GPL");