saa7134-go7007.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /*
  2. * Copyright (C) 2005-2006 Micronas USA Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License (Version 2) as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software Foundation,
  15. * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  16. */
  17. #include <linux/module.h>
  18. #include <linux/kernel.h>
  19. #include <linux/init.h>
  20. #include <linux/spinlock.h>
  21. #include <linux/wait.h>
  22. #include <linux/list.h>
  23. #include <linux/slab.h>
  24. #include <linux/time.h>
  25. #include <linux/mm.h>
  26. #include <linux/usb.h>
  27. #include <linux/i2c.h>
  28. #include <asm/byteorder.h>
  29. #include <media/v4l2-common.h>
  30. #include "saa7134-reg.h"
  31. #include "saa7134.h"
  32. #include "go7007-priv.h"
  33. #define GO7007_HPI_DEBUG
  34. enum hpi_address {
  35. HPI_ADDR_VIDEO_BUFFER = 0xe4,
  36. HPI_ADDR_INIT_BUFFER = 0xea,
  37. HPI_ADDR_INTR_RET_VALUE = 0xee,
  38. HPI_ADDR_INTR_RET_DATA = 0xec,
  39. HPI_ADDR_INTR_STATUS = 0xf4,
  40. HPI_ADDR_INTR_WR_PARAM = 0xf6,
  41. HPI_ADDR_INTR_WR_INDEX = 0xf8,
  42. };
  43. enum gpio_command {
  44. GPIO_COMMAND_RESET = 0x00, /* 000b */
  45. GPIO_COMMAND_REQ1 = 0x04, /* 001b */
  46. GPIO_COMMAND_WRITE = 0x20, /* 010b */
  47. GPIO_COMMAND_REQ2 = 0x24, /* 011b */
  48. GPIO_COMMAND_READ = 0x80, /* 100b */
  49. GPIO_COMMAND_VIDEO = 0x84, /* 101b */
  50. GPIO_COMMAND_IDLE = 0xA0, /* 110b */
  51. GPIO_COMMAND_ADDR = 0xA4, /* 111b */
  52. };
  53. struct saa7134_go7007 {
  54. struct saa7134_dev *dev;
  55. u8 *top;
  56. u8 *bottom;
  57. dma_addr_t top_dma;
  58. dma_addr_t bottom_dma;
  59. };
  60. static struct go7007_board_info board_voyager = {
  61. .firmware = "go7007tv.bin",
  62. .flags = 0,
  63. .sensor_flags = GO7007_SENSOR_656 |
  64. GO7007_SENSOR_VALID_ENABLE |
  65. GO7007_SENSOR_TV |
  66. GO7007_SENSOR_VBI,
  67. .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
  68. GO7007_AUDIO_WORD_16,
  69. .audio_rate = 48000,
  70. .audio_bclk_div = 8,
  71. .audio_main_div = 2,
  72. .hpi_buffer_cap = 7,
  73. .num_inputs = 1,
  74. .inputs = {
  75. {
  76. .name = "SAA7134",
  77. },
  78. },
  79. };
  80. MODULE_FIRMWARE("go7007tv.bin");
  81. /********************* Driver for GPIO HPI interface *********************/
  82. static int gpio_write(struct saa7134_dev *dev, u8 addr, u16 data)
  83. {
  84. saa_writeb(SAA7134_GPIO_GPMODE0, 0xff);
  85. /* Write HPI address */
  86. saa_writeb(SAA7134_GPIO_GPSTATUS0, addr);
  87. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_ADDR);
  88. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  89. /* Write low byte */
  90. saa_writeb(SAA7134_GPIO_GPSTATUS0, data & 0xff);
  91. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_WRITE);
  92. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  93. /* Write high byte */
  94. saa_writeb(SAA7134_GPIO_GPSTATUS0, data >> 8);
  95. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_WRITE);
  96. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  97. return 0;
  98. }
  99. static int gpio_read(struct saa7134_dev *dev, u8 addr, u16 *data)
  100. {
  101. saa_writeb(SAA7134_GPIO_GPMODE0, 0xff);
  102. /* Write HPI address */
  103. saa_writeb(SAA7134_GPIO_GPSTATUS0, addr);
  104. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_ADDR);
  105. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  106. saa_writeb(SAA7134_GPIO_GPMODE0, 0x00);
  107. /* Read low byte */
  108. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_READ);
  109. saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  110. saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  111. *data = saa_readb(SAA7134_GPIO_GPSTATUS0);
  112. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  113. /* Read high byte */
  114. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_READ);
  115. saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  116. saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  117. *data |= saa_readb(SAA7134_GPIO_GPSTATUS0) << 8;
  118. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  119. return 0;
  120. }
  121. static int saa7134_go7007_interface_reset(struct go7007 *go)
  122. {
  123. struct saa7134_go7007 *saa = go->hpi_context;
  124. struct saa7134_dev *dev = saa->dev;
  125. u32 status;
  126. u16 intr_val, intr_data;
  127. int count = 20;
  128. saa_clearb(SAA7134_TS_PARALLEL, 0x80); /* Disable TS interface */
  129. saa_writeb(SAA7134_GPIO_GPMODE2, 0xa4);
  130. saa_writeb(SAA7134_GPIO_GPMODE0, 0xff);
  131. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_REQ1);
  132. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_RESET);
  133. msleep(1);
  134. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_REQ1);
  135. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_REQ2);
  136. msleep(10);
  137. saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  138. saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  139. status = saa_readb(SAA7134_GPIO_GPSTATUS2);
  140. /*printk(KERN_DEBUG "status is %s\n", status & 0x40 ? "OK" : "not OK"); */
  141. /* enter command mode...(?) */
  142. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_REQ1);
  143. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_REQ2);
  144. do {
  145. saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  146. saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
  147. status = saa_readb(SAA7134_GPIO_GPSTATUS2);
  148. /*printk(KERN_INFO "gpio is %08x\n", saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2)); */
  149. } while (--count > 0);
  150. /* Wait for an interrupt to indicate successful hardware reset */
  151. if (go7007_read_interrupt(go, &intr_val, &intr_data) < 0 ||
  152. (intr_val & ~0x1) != 0x55aa) {
  153. printk(KERN_ERR
  154. "saa7134-go7007: unable to reset the GO7007\n");
  155. return -1;
  156. }
  157. return 0;
  158. }
  159. static int saa7134_go7007_write_interrupt(struct go7007 *go, int addr, int data)
  160. {
  161. struct saa7134_go7007 *saa = go->hpi_context;
  162. struct saa7134_dev *dev = saa->dev;
  163. int i;
  164. u16 status_reg;
  165. #ifdef GO7007_HPI_DEBUG
  166. printk(KERN_DEBUG
  167. "saa7134-go7007: WriteInterrupt: %04x %04x\n", addr, data);
  168. #endif
  169. for (i = 0; i < 100; ++i) {
  170. gpio_read(dev, HPI_ADDR_INTR_STATUS, &status_reg);
  171. if (!(status_reg & 0x0010))
  172. break;
  173. msleep(10);
  174. }
  175. if (i == 100) {
  176. printk(KERN_ERR
  177. "saa7134-go7007: device is hung, status reg = 0x%04x\n",
  178. status_reg);
  179. return -1;
  180. }
  181. gpio_write(dev, HPI_ADDR_INTR_WR_PARAM, data);
  182. gpio_write(dev, HPI_ADDR_INTR_WR_INDEX, addr);
  183. return 0;
  184. }
  185. static int saa7134_go7007_read_interrupt(struct go7007 *go)
  186. {
  187. struct saa7134_go7007 *saa = go->hpi_context;
  188. struct saa7134_dev *dev = saa->dev;
  189. /* XXX we need to wait if there is no interrupt available */
  190. go->interrupt_available = 1;
  191. gpio_read(dev, HPI_ADDR_INTR_RET_VALUE, &go->interrupt_value);
  192. gpio_read(dev, HPI_ADDR_INTR_RET_DATA, &go->interrupt_data);
  193. #ifdef GO7007_HPI_DEBUG
  194. printk(KERN_DEBUG "saa7134-go7007: ReadInterrupt: %04x %04x\n",
  195. go->interrupt_value, go->interrupt_data);
  196. #endif
  197. return 0;
  198. }
  199. static void saa7134_go7007_irq_ts_done(struct saa7134_dev *dev,
  200. unsigned long status)
  201. {
  202. struct go7007 *go = video_get_drvdata(dev->empress_dev);
  203. struct saa7134_go7007 *saa = go->hpi_context;
  204. if (!go->streaming)
  205. return;
  206. if (0 != (status & 0x000f0000))
  207. printk(KERN_DEBUG "saa7134-go7007: irq: lost %ld\n",
  208. (status >> 16) & 0x0f);
  209. if (status & 0x100000) {
  210. dma_sync_single_for_cpu(&dev->pci->dev,
  211. saa->bottom_dma, PAGE_SIZE, DMA_FROM_DEVICE);
  212. go7007_parse_video_stream(go, saa->bottom, PAGE_SIZE);
  213. saa_writel(SAA7134_RS_BA2(5), cpu_to_le32(saa->bottom_dma));
  214. } else {
  215. dma_sync_single_for_cpu(&dev->pci->dev,
  216. saa->top_dma, PAGE_SIZE, DMA_FROM_DEVICE);
  217. go7007_parse_video_stream(go, saa->top, PAGE_SIZE);
  218. saa_writel(SAA7134_RS_BA1(5), cpu_to_le32(saa->top_dma));
  219. }
  220. }
  221. static int saa7134_go7007_stream_start(struct go7007 *go)
  222. {
  223. struct saa7134_go7007 *saa = go->hpi_context;
  224. struct saa7134_dev *dev = saa->dev;
  225. saa->top_dma = dma_map_page(&dev->pci->dev, virt_to_page(saa->top),
  226. 0, PAGE_SIZE, DMA_FROM_DEVICE);
  227. if (!saa->top_dma)
  228. return -ENOMEM;
  229. saa->bottom_dma = dma_map_page(&dev->pci->dev,
  230. virt_to_page(saa->bottom),
  231. 0, PAGE_SIZE, DMA_FROM_DEVICE);
  232. if (!saa->bottom_dma) {
  233. dma_unmap_page(&dev->pci->dev, saa->top_dma, PAGE_SIZE,
  234. DMA_FROM_DEVICE);
  235. return -ENOMEM;
  236. }
  237. saa_writel(SAA7134_VIDEO_PORT_CTRL0 >> 2, 0xA300B000);
  238. saa_writel(SAA7134_VIDEO_PORT_CTRL4 >> 2, 0x40000200);
  239. /* Set HPI interface for video */
  240. saa_writeb(SAA7134_GPIO_GPMODE0, 0xff);
  241. saa_writeb(SAA7134_GPIO_GPSTATUS0, HPI_ADDR_VIDEO_BUFFER);
  242. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_ADDR);
  243. saa_writeb(SAA7134_GPIO_GPMODE0, 0x00);
  244. /* Enable TS interface */
  245. saa_writeb(SAA7134_TS_PARALLEL, 0xe6);
  246. /* Reset TS interface */
  247. saa_setb(SAA7134_TS_SERIAL1, 0x01);
  248. saa_clearb(SAA7134_TS_SERIAL1, 0x01);
  249. /* Set up transfer block size */
  250. saa_writeb(SAA7134_TS_PARALLEL_SERIAL, 128 - 1);
  251. saa_writeb(SAA7134_TS_DMA0, (PAGE_SIZE >> 7) - 1);
  252. saa_writeb(SAA7134_TS_DMA1, 0);
  253. saa_writeb(SAA7134_TS_DMA2, 0);
  254. /* Enable video streaming mode */
  255. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_VIDEO);
  256. saa_writel(SAA7134_RS_BA1(5), cpu_to_le32(saa->top_dma));
  257. saa_writel(SAA7134_RS_BA2(5), cpu_to_le32(saa->bottom_dma));
  258. saa_writel(SAA7134_RS_PITCH(5), 128);
  259. saa_writel(SAA7134_RS_CONTROL(5), SAA7134_RS_CONTROL_BURST_MAX);
  260. /* Enable TS FIFO */
  261. saa_setl(SAA7134_MAIN_CTRL, SAA7134_MAIN_CTRL_TE5);
  262. /* Enable DMA IRQ */
  263. saa_setl(SAA7134_IRQ1,
  264. SAA7134_IRQ1_INTE_RA2_1 | SAA7134_IRQ1_INTE_RA2_0);
  265. return 0;
  266. }
  267. static int saa7134_go7007_stream_stop(struct go7007 *go)
  268. {
  269. struct saa7134_go7007 *saa = go->hpi_context;
  270. struct saa7134_dev *dev;
  271. if (!saa)
  272. return -EINVAL;
  273. dev = saa->dev;
  274. if (!dev)
  275. return -EINVAL;
  276. /* Shut down TS FIFO */
  277. saa_clearl(SAA7134_MAIN_CTRL, SAA7134_MAIN_CTRL_TE5);
  278. /* Disable DMA IRQ */
  279. saa_clearl(SAA7134_IRQ1,
  280. SAA7134_IRQ1_INTE_RA2_1 | SAA7134_IRQ1_INTE_RA2_0);
  281. /* Disable TS interface */
  282. saa_clearb(SAA7134_TS_PARALLEL, 0x80);
  283. dma_unmap_page(&dev->pci->dev, saa->top_dma, PAGE_SIZE,
  284. DMA_FROM_DEVICE);
  285. dma_unmap_page(&dev->pci->dev, saa->bottom_dma, PAGE_SIZE,
  286. DMA_FROM_DEVICE);
  287. return 0;
  288. }
  289. static int saa7134_go7007_send_firmware(struct go7007 *go, u8 *data, int len)
  290. {
  291. struct saa7134_go7007 *saa = go->hpi_context;
  292. struct saa7134_dev *dev = saa->dev;
  293. u16 status_reg;
  294. int i;
  295. #ifdef GO7007_HPI_DEBUG
  296. printk(KERN_DEBUG "saa7134-go7007: DownloadBuffer "
  297. "sending %d bytes\n", len);
  298. #endif
  299. while (len > 0) {
  300. i = len > 64 ? 64 : len;
  301. saa_writeb(SAA7134_GPIO_GPMODE0, 0xff);
  302. saa_writeb(SAA7134_GPIO_GPSTATUS0, HPI_ADDR_INIT_BUFFER);
  303. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_ADDR);
  304. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  305. while (i-- > 0) {
  306. saa_writeb(SAA7134_GPIO_GPSTATUS0, *data);
  307. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_WRITE);
  308. saa_writeb(SAA7134_GPIO_GPSTATUS2, GPIO_COMMAND_IDLE);
  309. ++data;
  310. --len;
  311. }
  312. for (i = 0; i < 100; ++i) {
  313. gpio_read(dev, HPI_ADDR_INTR_STATUS, &status_reg);
  314. if (!(status_reg & 0x0002))
  315. break;
  316. }
  317. if (i == 100) {
  318. printk(KERN_ERR "saa7134-go7007: device is hung, "
  319. "status reg = 0x%04x\n", status_reg);
  320. return -1;
  321. }
  322. }
  323. return 0;
  324. }
  325. static int saa7134_go7007_send_command(struct go7007 *go, unsigned int cmd,
  326. void *arg)
  327. {
  328. struct saa7134_go7007 *saa = go->hpi_context;
  329. struct saa7134_dev *dev = saa->dev;
  330. switch (cmd) {
  331. case VIDIOC_S_STD:
  332. {
  333. v4l2_std_id *std = arg;
  334. return saa7134_s_std_internal(dev, NULL, std);
  335. }
  336. case VIDIOC_G_STD:
  337. {
  338. v4l2_std_id *std = arg;
  339. *std = dev->tvnorm->id;
  340. return 0;
  341. }
  342. case VIDIOC_QUERYCTRL:
  343. {
  344. struct v4l2_queryctrl *ctrl = arg;
  345. if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_USER)
  346. return saa7134_queryctrl(NULL, NULL, ctrl);
  347. }
  348. case VIDIOC_G_CTRL:
  349. {
  350. struct v4l2_control *ctrl = arg;
  351. if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_USER)
  352. return saa7134_g_ctrl_internal(dev, NULL, ctrl);
  353. }
  354. case VIDIOC_S_CTRL:
  355. {
  356. struct v4l2_control *ctrl = arg;
  357. if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_USER)
  358. return saa7134_s_ctrl_internal(dev, NULL, ctrl);
  359. }
  360. }
  361. return -EINVAL;
  362. }
  363. static struct go7007_hpi_ops saa7134_go7007_hpi_ops = {
  364. .interface_reset = saa7134_go7007_interface_reset,
  365. .write_interrupt = saa7134_go7007_write_interrupt,
  366. .read_interrupt = saa7134_go7007_read_interrupt,
  367. .stream_start = saa7134_go7007_stream_start,
  368. .stream_stop = saa7134_go7007_stream_stop,
  369. .send_firmware = saa7134_go7007_send_firmware,
  370. .send_command = saa7134_go7007_send_command,
  371. };
  372. /********************* Add/remove functions *********************/
  373. static int saa7134_go7007_init(struct saa7134_dev *dev)
  374. {
  375. struct go7007 *go;
  376. struct saa7134_go7007 *saa;
  377. printk(KERN_DEBUG "saa7134-go7007: probing new SAA713X board\n");
  378. saa = kzalloc(sizeof(struct saa7134_go7007), GFP_KERNEL);
  379. if (saa == NULL)
  380. return -ENOMEM;
  381. /* Allocate a couple pages for receiving the compressed stream */
  382. saa->top = (u8 *)get_zeroed_page(GFP_KERNEL);
  383. if (!saa->top)
  384. goto allocfail;
  385. saa->bottom = (u8 *)get_zeroed_page(GFP_KERNEL);
  386. if (!saa->bottom)
  387. goto allocfail;
  388. go = go7007_alloc(&board_voyager, &dev->pci->dev);
  389. if (go == NULL)
  390. goto allocfail;
  391. go->board_id = GO7007_BOARDID_PCI_VOYAGER;
  392. strncpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name));
  393. go->hpi_ops = &saa7134_go7007_hpi_ops;
  394. go->hpi_context = saa;
  395. saa->dev = dev;
  396. /* Boot the GO7007 */
  397. if (go7007_boot_encoder(go, go->board_info->flags &
  398. GO7007_BOARD_USE_ONBOARD_I2C) < 0)
  399. goto initfail;
  400. /* Do any final GO7007 initialization, then register the
  401. * V4L2 and ALSA interfaces */
  402. if (go7007_register_encoder(go) < 0)
  403. goto initfail;
  404. dev->empress_dev = go->video_dev;
  405. video_set_drvdata(dev->empress_dev, go);
  406. go->status = STATUS_ONLINE;
  407. return 0;
  408. initfail:
  409. go->status = STATUS_SHUTDOWN;
  410. return 0;
  411. allocfail:
  412. if (saa->top)
  413. free_page((unsigned long)saa->top);
  414. if (saa->bottom)
  415. free_page((unsigned long)saa->bottom);
  416. kfree(saa);
  417. return -ENOMEM;
  418. }
  419. static int saa7134_go7007_fini(struct saa7134_dev *dev)
  420. {
  421. struct go7007 *go;
  422. struct saa7134_go7007 *saa;
  423. if (NULL == dev->empress_dev)
  424. return 0;
  425. go = video_get_drvdata(dev->empress_dev);
  426. saa = go->hpi_context;
  427. go->status = STATUS_SHUTDOWN;
  428. free_page((unsigned long)saa->top);
  429. free_page((unsigned long)saa->bottom);
  430. kfree(saa);
  431. go7007_remove(go);
  432. dev->empress_dev = NULL;
  433. return 0;
  434. }
  435. static struct saa7134_mpeg_ops saa7134_go7007_ops = {
  436. .type = SAA7134_MPEG_GO7007,
  437. .init = saa7134_go7007_init,
  438. .fini = saa7134_go7007_fini,
  439. .irq_ts_done = saa7134_go7007_irq_ts_done,
  440. };
  441. static int __init saa7134_go7007_mod_init(void)
  442. {
  443. return saa7134_ts_register(&saa7134_go7007_ops);
  444. }
  445. static void __exit saa7134_go7007_mod_cleanup(void)
  446. {
  447. saa7134_ts_unregister(&saa7134_go7007_ops);
  448. }
  449. module_init(saa7134_go7007_mod_init);
  450. module_exit(saa7134_go7007_mod_cleanup);
  451. MODULE_LICENSE("GPL v2");