dibusb-mc.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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_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. { } /* Terminating entry */
  29. };
  30. MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table);
  31. static struct dvb_usb_properties dibusb_mc_properties = {
  32. .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER,
  33. .pid_filter_count = 32,
  34. .usb_ctrl = CYPRESS_FX2,
  35. .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
  36. .size_of_priv = sizeof(struct dibusb_state),
  37. .streaming_ctrl = dibusb2_0_streaming_ctrl,
  38. .pid_filter = dibusb_pid_filter,
  39. .pid_filter_ctrl = dibusb_pid_filter_ctrl,
  40. .power_ctrl = dibusb2_0_power_ctrl,
  41. .frontend_attach = dibusb_dib3000mc_frontend_attach,
  42. .tuner_attach = dibusb_dib3000mc_tuner_attach,
  43. .rc_interval = DEFAULT_RC_INTERVAL,
  44. .rc_key_map = dibusb_rc_keys,
  45. .rc_key_map_size = 63, /* FIXME */
  46. .rc_query = dibusb_rc_query,
  47. .i2c_algo = &dibusb_i2c_algo,
  48. .generic_bulk_ctrl_endpoint = 0x01,
  49. /* parameter for the MPEG2-data transfer */
  50. .urb = {
  51. .type = DVB_USB_BULK,
  52. .count = 7,
  53. .endpoint = 0x06,
  54. .u = {
  55. .bulk = {
  56. .buffersize = 4096,
  57. }
  58. }
  59. },
  60. .num_device_descs = 2,
  61. .devices = {
  62. { "DiBcom USB2.0 DVB-T reference design (MOD3000P)",
  63. { &dibusb_dib3000mc_table[0], NULL },
  64. { &dibusb_dib3000mc_table[1], NULL },
  65. },
  66. { "Artec T1 USB2.0 TVBOX (please report the warm ID)",
  67. { &dibusb_dib3000mc_table[2], NULL },
  68. { NULL },
  69. },
  70. }
  71. };
  72. static struct usb_driver dibusb_mc_driver = {
  73. .name = "dvb_usb_dibusb_mc",
  74. .probe = dibusb_mc_probe,
  75. .disconnect = dvb_usb_device_exit,
  76. .id_table = dibusb_dib3000mc_table,
  77. };
  78. /* module stuff */
  79. static int __init dibusb_mc_module_init(void)
  80. {
  81. int result;
  82. if ((result = usb_register(&dibusb_mc_driver))) {
  83. err("usb_register failed. Error number %d",result);
  84. return result;
  85. }
  86. return 0;
  87. }
  88. static void __exit dibusb_mc_module_exit(void)
  89. {
  90. /* deregister this driver from the USB subsystem */
  91. usb_deregister(&dibusb_mc_driver);
  92. }
  93. module_init (dibusb_mc_module_init);
  94. module_exit (dibusb_mc_module_exit);
  95. MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
  96. MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices");
  97. MODULE_VERSION("1.0");
  98. MODULE_LICENSE("GPL");