em28xx-cards.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. em2820-cards.c - driver for Empia EM2820/2840 USB video capture devices
  3. Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
  4. Ludovico Cavedon <cavedon@sssup.it>
  5. Mauro Carvalho Chehab <mchehab@brturbo.com.br>
  6. Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #include <linux/init.h>
  20. #include <linux/module.h>
  21. #include <linux/pci.h>
  22. #include <linux/delay.h>
  23. #include <linux/i2c.h>
  24. #include <linux/usb.h>
  25. #include <media/tuner.h>
  26. #include <media/audiochip.h>
  27. #include <media/tveeprom.h>
  28. #include "msp3400.h"
  29. #include "em2820.h"
  30. enum em2820_board_entry {
  31. EM2820_BOARD_TERRATEC_CINERGY_250,
  32. EM2820_BOARD_PINNACLE_USB_2,
  33. EM2820_BOARD_HAUPPAUGE_WINTV_USB_2,
  34. EM2820_BOARD_MSI_VOX_USB_2
  35. };
  36. struct em2820_board em2820_boards[] = {
  37. [EM2820_BOARD_TERRATEC_CINERGY_250] = {
  38. .name = "Terratec Cinergy 250 USB",
  39. .vchannels = 3,
  40. .norm = VIDEO_MODE_PAL,
  41. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  42. .tda9887_conf = TDA9887_PRESENT,
  43. .has_tuner = 1,
  44. .decoder = EM2820_SAA7113,
  45. .input = {{
  46. .type = EM2820_VMUX_TELEVISION,
  47. .vmux = 2,
  48. .amux = 0,
  49. },{
  50. .type = EM2820_VMUX_COMPOSITE1,
  51. .vmux = 0,
  52. .amux = 1,
  53. },{
  54. .type = EM2820_VMUX_SVIDEO,
  55. .vmux = 9,
  56. .amux = 1,
  57. }},
  58. },
  59. [EM2820_BOARD_PINNACLE_USB_2] = {
  60. .name = "Pinnacle PCTV USB 2",
  61. .vchannels = 3,
  62. .norm = VIDEO_MODE_PAL,
  63. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  64. .tda9887_conf = TDA9887_PRESENT,
  65. .has_tuner = 1,
  66. .decoder = EM2820_SAA7113,
  67. .input = {{
  68. .type = EM2820_VMUX_TELEVISION,
  69. .vmux = 2,
  70. .amux = 0,
  71. },{
  72. .type = EM2820_VMUX_COMPOSITE1,
  73. .vmux = 0,
  74. .amux = 1,
  75. },{
  76. .type = EM2820_VMUX_SVIDEO,
  77. .vmux = 9,
  78. .amux = 1,
  79. }},
  80. },
  81. [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
  82. .name = "Hauppauge WinTV USB 2",
  83. .vchannels = 3,
  84. .norm = VIDEO_MODE_NTSC,
  85. .tuner_type = TUNER_PHILIPS_FM1236_MK3,
  86. .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
  87. .has_tuner = 1,
  88. .decoder = EM2820_TVP5150,
  89. .has_msp34xx = 1,
  90. /*FIXME: S-Video not tested */
  91. .input = {{
  92. .type = EM2820_VMUX_TELEVISION,
  93. .vmux = 0,
  94. .amux = 0,
  95. },{
  96. .type = EM2820_VMUX_SVIDEO,
  97. .vmux = 2,
  98. .amux = 1,
  99. }},
  100. },
  101. [EM2820_BOARD_MSI_VOX_USB_2] = {
  102. .name = "MSI VOX USB 2.0",
  103. .vchannels = 3,
  104. .norm = VIDEO_MODE_PAL,
  105. .tuner_type = TUNER_PHILIPS_PAL,
  106. .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
  107. .has_tuner = 1,
  108. .decoder = EM2820_SAA7114,
  109. .input = {{
  110. .type = EM2820_VMUX_TELEVISION,
  111. .vmux = 2,
  112. .amux = 0,
  113. },{
  114. .type = EM2820_VMUX_COMPOSITE1,
  115. .vmux = 0,
  116. .amux = 1,
  117. },{
  118. .type = EM2820_VMUX_SVIDEO,
  119. .vmux = 9,
  120. .amux = 1,
  121. }},
  122. },
  123. { } /* Terminating entry */
  124. };
  125. /* table of devices that work with this driver */
  126. struct usb_device_id em2820_id_table [] = {
  127. /* Terratec Cinerhy 200 USB: em2800 nor supported, at the moment */
  128. /* { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_TERRATEC_CINERGY_200 }, */
  129. { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
  130. { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
  131. { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
  132. { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },
  133. { },
  134. };
  135. void em2820_card_setup(struct em2820 *dev)
  136. {
  137. /* request some modules */
  138. if (dev->model == EM2820_BOARD_HAUPPAUGE_WINTV_USB_2) {
  139. struct tveeprom tv;
  140. #ifdef CONFIG_MODULES
  141. request_module("tveeprom");
  142. #endif
  143. /* Call first TVeeprom */
  144. tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
  145. dev->tuner_type= tv.tuner_type;
  146. if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
  147. dev->has_msp34xx=1;
  148. } else dev->has_msp34xx=0;
  149. }
  150. }
  151. EXPORT_SYMBOL(em2820_boards);
  152. EXPORT_SYMBOL(em2820_id_table);
  153. MODULE_DEVICE_TABLE (usb, em2820_id_table);