diff options
Diffstat (limited to 'drivers/media/video/cx23885')
-rw-r--r-- | drivers/media/video/cx23885/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-417.c | 19 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-cards.c | 54 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-core.c | 147 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 19 |
5 files changed, 202 insertions, 39 deletions
diff --git a/drivers/media/video/cx23885/Kconfig b/drivers/media/video/cx23885/Kconfig index 5cfb46bbdaa9..e60bd31b51a3 100644 --- a/drivers/media/video/cx23885/Kconfig +++ b/drivers/media/video/cx23885/Kconfig | |||
@@ -1,9 +1,7 @@ | |||
1 | config VIDEO_CX23885 | 1 | config VIDEO_CX23885 |
2 | tristate "Conexant cx23885 (2388x successor) support" | 2 | tristate "Conexant cx23885 (2388x successor) support" |
3 | depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT | 3 | depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT |
4 | depends on HOTPLUG # due to FW_LOADER | ||
5 | select I2C_ALGOBIT | 4 | select I2C_ALGOBIT |
6 | select FW_LOADER | ||
7 | select VIDEO_BTCX | 5 | select VIDEO_BTCX |
8 | select VIDEO_TUNER | 6 | select VIDEO_TUNER |
9 | select VIDEO_TVEEPROM | 7 | select VIDEO_TVEEPROM |
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index e7ef093265af..8118091568fc 100644 --- a/drivers/media/video/cx23885/cx23885-417.c +++ b/drivers/media/video/cx23885/cx23885-417.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/device.h> | 32 | #include <linux/device.h> |
33 | #include <linux/firmware.h> | 33 | #include <linux/firmware.h> |
34 | #include <media/v4l2-common.h> | 34 | #include <media/v4l2-common.h> |
35 | #include <media/v4l2-ioctl.h> | ||
35 | #include <media/cx2341x.h> | 36 | #include <media/cx2341x.h> |
36 | 37 | ||
37 | #include "cx23885.h" | 38 | #include "cx23885.h" |
@@ -1699,14 +1700,7 @@ static struct file_operations mpeg_fops = { | |||
1699 | .llseek = no_llseek, | 1700 | .llseek = no_llseek, |
1700 | }; | 1701 | }; |
1701 | 1702 | ||
1702 | static struct video_device cx23885_mpeg_template = { | 1703 | static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { |
1703 | .name = "cx23885", | ||
1704 | .type = VID_TYPE_CAPTURE | | ||
1705 | VID_TYPE_TUNER | | ||
1706 | VID_TYPE_SCALES | | ||
1707 | VID_TYPE_MPEG_ENCODER, | ||
1708 | .fops = &mpeg_fops, | ||
1709 | .minor = -1, | ||
1710 | .vidioc_s_std = vidioc_s_std, | 1704 | .vidioc_s_std = vidioc_s_std, |
1711 | .vidioc_enum_input = vidioc_enum_input, | 1705 | .vidioc_enum_input = vidioc_enum_input, |
1712 | .vidioc_g_input = vidioc_g_input, | 1706 | .vidioc_g_input = vidioc_g_input, |
@@ -1735,6 +1729,13 @@ static struct video_device cx23885_mpeg_template = { | |||
1735 | .vidioc_queryctrl = vidioc_queryctrl, | 1729 | .vidioc_queryctrl = vidioc_queryctrl, |
1736 | }; | 1730 | }; |
1737 | 1731 | ||
1732 | static struct video_device cx23885_mpeg_template = { | ||
1733 | .name = "cx23885", | ||
1734 | .fops = &mpeg_fops, | ||
1735 | .ioctl_ops = &mpeg_ioctl_ops, | ||
1736 | .minor = -1, | ||
1737 | }; | ||
1738 | |||
1738 | void cx23885_417_unregister(struct cx23885_dev *dev) | 1739 | void cx23885_417_unregister(struct cx23885_dev *dev) |
1739 | { | 1740 | { |
1740 | dprintk(1, "%s()\n", __func__); | 1741 | dprintk(1, "%s()\n", __func__); |
@@ -1766,7 +1767,7 @@ static struct video_device *cx23885_video_dev_alloc( | |||
1766 | vfd->minor = -1; | 1767 | vfd->minor = -1; |
1767 | snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, | 1768 | snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, |
1768 | type, cx23885_boards[tsport->dev->board].name); | 1769 | type, cx23885_boards[tsport->dev->board].name); |
1769 | vfd->dev = &pci->dev; | 1770 | vfd->parent = &pci->dev; |
1770 | vfd->release = video_device_release; | 1771 | vfd->release = video_device_release; |
1771 | return vfd; | 1772 | return vfd; |
1772 | } | 1773 | } |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index fd7112c11d35..a19de850955d 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -145,6 +145,7 @@ struct cx23885_board cx23885_boards[] = { | |||
145 | }, | 145 | }, |
146 | [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = { | 146 | [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = { |
147 | .name = "DViCO FusionHDTV7 Dual Express", | 147 | .name = "DViCO FusionHDTV7 Dual Express", |
148 | .portb = CX23885_MPEG_DVB, | ||
148 | .portc = CX23885_MPEG_DVB, | 149 | .portc = CX23885_MPEG_DVB, |
149 | }, | 150 | }, |
150 | }; | 151 | }; |
@@ -325,25 +326,41 @@ int cx23885_tuner_callback(void *priv, int command, int arg) | |||
325 | { | 326 | { |
326 | struct cx23885_i2c *bus = priv; | 327 | struct cx23885_i2c *bus = priv; |
327 | struct cx23885_dev *dev = bus->dev; | 328 | struct cx23885_dev *dev = bus->dev; |
329 | u32 bitmask = 0; | ||
330 | |||
331 | if (command != 0) { | ||
332 | printk(KERN_ERR "%s(): Unknown command 0x%x.\n", | ||
333 | __func__, command); | ||
334 | return -EINVAL; | ||
335 | } | ||
328 | 336 | ||
329 | switch(dev->board) { | 337 | switch(dev->board) { |
330 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | 338 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
331 | if(command == 0) { /* Tuner Reset Command from xc5000 */ | 339 | /* Tuner Reset Command from xc5000 */ |
332 | /* Drive the tuner into reset and out */ | 340 | if (command == 0) |
333 | cx_clear(GP0_IO, 0x00000004); | 341 | bitmask = 0x04; |
334 | mdelay(200); | 342 | break; |
335 | cx_set(GP0_IO, 0x00000004); | 343 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
336 | return 0; | 344 | if (command == 0) { |
337 | } | 345 | |
338 | else { | 346 | /* Two identical tuners on two different i2c buses, |
339 | printk(KERN_ERR | 347 | * we need to reset the correct gpio. */ |
340 | "%s(): Unknow command.\n", __func__); | 348 | if (bus->nr == 0) |
341 | return -EINVAL; | 349 | bitmask = 0x01; |
350 | else if (bus->nr == 1) | ||
351 | bitmask = 0x04; | ||
342 | } | 352 | } |
343 | break; | 353 | break; |
344 | } | 354 | } |
345 | 355 | ||
346 | return 0; /* Should never be here */ | 356 | if (bitmask) { |
357 | /* Drive the tuner into reset and back out */ | ||
358 | cx_clear(GP0_IO, bitmask); | ||
359 | mdelay(200); | ||
360 | cx_set(GP0_IO, bitmask); | ||
361 | } | ||
362 | |||
363 | return 0; | ||
347 | } | 364 | } |
348 | 365 | ||
349 | void cx23885_gpio_setup(struct cx23885_dev *dev) | 366 | void cx23885_gpio_setup(struct cx23885_dev *dev) |
@@ -435,6 +452,19 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) | |||
435 | mdelay(20); | 452 | mdelay(20); |
436 | cx_set(GP0_IO, 0x00050005); | 453 | cx_set(GP0_IO, 0x00050005); |
437 | break; | 454 | break; |
455 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: | ||
456 | /* GPIO-0 xc5000 tuner reset i2c bus 0 */ | ||
457 | /* GPIO-1 s5h1409 demod reset i2c bus 0 */ | ||
458 | /* GPIO-2 xc5000 tuner reset i2c bus 1 */ | ||
459 | /* GPIO-3 s5h1409 demod reset i2c bus 0 */ | ||
460 | |||
461 | /* Put the parts into reset and back */ | ||
462 | cx_set(GP0_IO, 0x000f0000); | ||
463 | mdelay(20); | ||
464 | cx_clear(GP0_IO, 0x0000000f); | ||
465 | mdelay(20); | ||
466 | cx_set(GP0_IO, 0x000f000f); | ||
467 | break; | ||
438 | } | 468 | } |
439 | } | 469 | } |
440 | 470 | ||
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index d17343ea0d33..6286a9cf957e 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c | |||
@@ -76,6 +76,117 @@ LIST_HEAD(cx23885_devlist); | |||
76 | * 0x00010ea0 0x00010xxx Free | 76 | * 0x00010ea0 0x00010xxx Free |
77 | */ | 77 | */ |
78 | 78 | ||
79 | static struct sram_channel cx23885_sram_channels[] = { | ||
80 | [SRAM_CH01] = { | ||
81 | .name = "VID A", | ||
82 | .cmds_start = 0x10000, | ||
83 | .ctrl_start = 0x10380, | ||
84 | .cdt = 0x104c0, | ||
85 | .fifo_start = 0x40, | ||
86 | .fifo_size = 0x2800, | ||
87 | .ptr1_reg = DMA1_PTR1, | ||
88 | .ptr2_reg = DMA1_PTR2, | ||
89 | .cnt1_reg = DMA1_CNT1, | ||
90 | .cnt2_reg = DMA1_CNT2, | ||
91 | }, | ||
92 | [SRAM_CH02] = { | ||
93 | .name = "ch2", | ||
94 | .cmds_start = 0x0, | ||
95 | .ctrl_start = 0x0, | ||
96 | .cdt = 0x0, | ||
97 | .fifo_start = 0x0, | ||
98 | .fifo_size = 0x0, | ||
99 | .ptr1_reg = DMA2_PTR1, | ||
100 | .ptr2_reg = DMA2_PTR2, | ||
101 | .cnt1_reg = DMA2_CNT1, | ||
102 | .cnt2_reg = DMA2_CNT2, | ||
103 | }, | ||
104 | [SRAM_CH03] = { | ||
105 | .name = "TS1 B", | ||
106 | .cmds_start = 0x100A0, | ||
107 | .ctrl_start = 0x10400, | ||
108 | .cdt = 0x10580, | ||
109 | .fifo_start = 0x5000, | ||
110 | .fifo_size = 0x1000, | ||
111 | .ptr1_reg = DMA3_PTR1, | ||
112 | .ptr2_reg = DMA3_PTR2, | ||
113 | .cnt1_reg = DMA3_CNT1, | ||
114 | .cnt2_reg = DMA3_CNT2, | ||
115 | }, | ||
116 | [SRAM_CH04] = { | ||
117 | .name = "ch4", | ||
118 | .cmds_start = 0x0, | ||
119 | .ctrl_start = 0x0, | ||
120 | .cdt = 0x0, | ||
121 | .fifo_start = 0x0, | ||
122 | .fifo_size = 0x0, | ||
123 | .ptr1_reg = DMA4_PTR1, | ||
124 | .ptr2_reg = DMA4_PTR2, | ||
125 | .cnt1_reg = DMA4_CNT1, | ||
126 | .cnt2_reg = DMA4_CNT2, | ||
127 | }, | ||
128 | [SRAM_CH05] = { | ||
129 | .name = "ch5", | ||
130 | .cmds_start = 0x0, | ||
131 | .ctrl_start = 0x0, | ||
132 | .cdt = 0x0, | ||
133 | .fifo_start = 0x0, | ||
134 | .fifo_size = 0x0, | ||
135 | .ptr1_reg = DMA5_PTR1, | ||
136 | .ptr2_reg = DMA5_PTR2, | ||
137 | .cnt1_reg = DMA5_CNT1, | ||
138 | .cnt2_reg = DMA5_CNT2, | ||
139 | }, | ||
140 | [SRAM_CH06] = { | ||
141 | .name = "TS2 C", | ||
142 | .cmds_start = 0x10140, | ||
143 | .ctrl_start = 0x10440, | ||
144 | .cdt = 0x105e0, | ||
145 | .fifo_start = 0x6000, | ||
146 | .fifo_size = 0x1000, | ||
147 | .ptr1_reg = DMA5_PTR1, | ||
148 | .ptr2_reg = DMA5_PTR2, | ||
149 | .cnt1_reg = DMA5_CNT1, | ||
150 | .cnt2_reg = DMA5_CNT2, | ||
151 | }, | ||
152 | [SRAM_CH07] = { | ||
153 | .name = "ch7", | ||
154 | .cmds_start = 0x0, | ||
155 | .ctrl_start = 0x0, | ||
156 | .cdt = 0x0, | ||
157 | .fifo_start = 0x0, | ||
158 | .fifo_size = 0x0, | ||
159 | .ptr1_reg = DMA6_PTR1, | ||
160 | .ptr2_reg = DMA6_PTR2, | ||
161 | .cnt1_reg = DMA6_CNT1, | ||
162 | .cnt2_reg = DMA6_CNT2, | ||
163 | }, | ||
164 | [SRAM_CH08] = { | ||
165 | .name = "ch8", | ||
166 | .cmds_start = 0x0, | ||
167 | .ctrl_start = 0x0, | ||
168 | .cdt = 0x0, | ||
169 | .fifo_start = 0x0, | ||
170 | .fifo_size = 0x0, | ||
171 | .ptr1_reg = DMA7_PTR1, | ||
172 | .ptr2_reg = DMA7_PTR2, | ||
173 | .cnt1_reg = DMA7_CNT1, | ||
174 | .cnt2_reg = DMA7_CNT2, | ||
175 | }, | ||
176 | [SRAM_CH09] = { | ||
177 | .name = "ch9", | ||
178 | .cmds_start = 0x0, | ||
179 | .ctrl_start = 0x0, | ||
180 | .cdt = 0x0, | ||
181 | .fifo_start = 0x0, | ||
182 | .fifo_size = 0x0, | ||
183 | .ptr1_reg = DMA8_PTR1, | ||
184 | .ptr2_reg = DMA8_PTR2, | ||
185 | .cnt1_reg = DMA8_CNT1, | ||
186 | .cnt2_reg = DMA8_CNT2, | ||
187 | }, | ||
188 | }; | ||
189 | |||
79 | static struct sram_channel cx23887_sram_channels[] = { | 190 | static struct sram_channel cx23887_sram_channels[] = { |
80 | [SRAM_CH01] = { | 191 | [SRAM_CH01] = { |
81 | .name = "VID A", | 192 | .name = "VID A", |
@@ -104,8 +215,8 @@ static struct sram_channel cx23887_sram_channels[] = { | |||
104 | [SRAM_CH03] = { | 215 | [SRAM_CH03] = { |
105 | .name = "TS1 B", | 216 | .name = "TS1 B", |
106 | .cmds_start = 0x100A0, | 217 | .cmds_start = 0x100A0, |
107 | .ctrl_start = 0x10780, | 218 | .ctrl_start = 0x10630, |
108 | .cdt = 0x10400, | 219 | .cdt = 0x10870, |
109 | .fifo_start = 0x5000, | 220 | .fifo_start = 0x5000, |
110 | .fifo_size = 0x1000, | 221 | .fifo_size = 0x1000, |
111 | .ptr1_reg = DMA3_PTR1, | 222 | .ptr1_reg = DMA3_PTR1, |
@@ -140,7 +251,7 @@ static struct sram_channel cx23887_sram_channels[] = { | |||
140 | [SRAM_CH06] = { | 251 | [SRAM_CH06] = { |
141 | .name = "TS2 C", | 252 | .name = "TS2 C", |
142 | .cmds_start = 0x10140, | 253 | .cmds_start = 0x10140, |
143 | .ctrl_start = 0x10680, | 254 | .ctrl_start = 0x10670, |
144 | .cdt = 0x108d0, | 255 | .cdt = 0x108d0, |
145 | .fifo_start = 0x6000, | 256 | .fifo_start = 0x6000, |
146 | .fifo_size = 0x1000, | 257 | .fifo_size = 0x1000, |
@@ -460,6 +571,7 @@ static void cx23885_reset(struct cx23885_dev *dev) | |||
460 | cx_write(AUDIO_INT_INT_STAT, 0xffffffff); | 571 | cx_write(AUDIO_INT_INT_STAT, 0xffffffff); |
461 | cx_write(AUDIO_EXT_INT_STAT, 0xffffffff); | 572 | cx_write(AUDIO_EXT_INT_STAT, 0xffffffff); |
462 | cx_write(CLK_DELAY, cx_read(CLK_DELAY) & 0x80000000); | 573 | cx_write(CLK_DELAY, cx_read(CLK_DELAY) & 0x80000000); |
574 | cx_write(PAD_CTRL, 0x00500300); | ||
463 | 575 | ||
464 | mdelay(100); | 576 | mdelay(100); |
465 | 577 | ||
@@ -625,7 +737,6 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
625 | atomic_inc(&dev->refcount); | 737 | atomic_inc(&dev->refcount); |
626 | 738 | ||
627 | dev->nr = cx23885_devcount++; | 739 | dev->nr = cx23885_devcount++; |
628 | dev->sram_channels = cx23887_sram_channels; | ||
629 | sprintf(dev->name, "cx23885[%d]", dev->nr); | 740 | sprintf(dev->name, "cx23885[%d]", dev->nr); |
630 | 741 | ||
631 | mutex_lock(&devlist); | 742 | mutex_lock(&devlist); |
@@ -637,11 +748,13 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
637 | dev->bridge = CX23885_BRIDGE_887; | 748 | dev->bridge = CX23885_BRIDGE_887; |
638 | /* Apply a sensible clock frequency for the PCIe bridge */ | 749 | /* Apply a sensible clock frequency for the PCIe bridge */ |
639 | dev->clk_freq = 25000000; | 750 | dev->clk_freq = 25000000; |
751 | dev->sram_channels = cx23887_sram_channels; | ||
640 | } else | 752 | } else |
641 | if(dev->pci->device == 0x8852) { | 753 | if(dev->pci->device == 0x8852) { |
642 | dev->bridge = CX23885_BRIDGE_885; | 754 | dev->bridge = CX23885_BRIDGE_885; |
643 | /* Apply a sensible clock frequency for the PCIe bridge */ | 755 | /* Apply a sensible clock frequency for the PCIe bridge */ |
644 | dev->clk_freq = 28000000; | 756 | dev->clk_freq = 28000000; |
757 | dev->sram_channels = cx23885_sram_channels; | ||
645 | } else | 758 | } else |
646 | BUG(); | 759 | BUG(); |
647 | 760 | ||
@@ -1010,8 +1123,9 @@ static void cx23885_tsport_reg_dump(struct cx23885_tsport *port) | |||
1010 | port->reg_gpcnt_ctl, cx_read(port->reg_gpcnt_ctl)); | 1123 | port->reg_gpcnt_ctl, cx_read(port->reg_gpcnt_ctl)); |
1011 | dprintk(1, "%s() dma_ctl(0x%08X) 0x%08x\n", __func__, | 1124 | dprintk(1, "%s() dma_ctl(0x%08X) 0x%08x\n", __func__, |
1012 | port->reg_dma_ctl, cx_read(port->reg_dma_ctl)); | 1125 | port->reg_dma_ctl, cx_read(port->reg_dma_ctl)); |
1013 | dprintk(1, "%s() src_sel(0x%08X) 0x%08x\n", __func__, | 1126 | if (port->reg_src_sel) |
1014 | port->reg_src_sel, cx_read(port->reg_src_sel)); | 1127 | dprintk(1, "%s() src_sel(0x%08X) 0x%08x\n", __func__, |
1128 | port->reg_src_sel, cx_read(port->reg_src_sel)); | ||
1015 | dprintk(1, "%s() lngth(0x%08X) 0x%08x\n", __func__, | 1129 | dprintk(1, "%s() lngth(0x%08X) 0x%08x\n", __func__, |
1016 | port->reg_lngth, cx_read(port->reg_lngth)); | 1130 | port->reg_lngth, cx_read(port->reg_lngth)); |
1017 | dprintk(1, "%s() hw_sop_ctrl(0x%08X) 0x%08x\n", __func__, | 1131 | dprintk(1, "%s() hw_sop_ctrl(0x%08X) 0x%08x\n", __func__, |
@@ -1042,6 +1156,9 @@ static int cx23885_start_dma(struct cx23885_tsport *port, | |||
1042 | dprintk(1, "%s() w: %d, h: %d, f: %d\n", __func__, | 1156 | dprintk(1, "%s() w: %d, h: %d, f: %d\n", __func__, |
1043 | buf->vb.width, buf->vb.height, buf->vb.field); | 1157 | buf->vb.width, buf->vb.height, buf->vb.field); |
1044 | 1158 | ||
1159 | /* Stop the fifo and risc engine for this port */ | ||
1160 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); | ||
1161 | |||
1045 | /* setup fifo + format */ | 1162 | /* setup fifo + format */ |
1046 | cx23885_sram_channel_setup(dev, | 1163 | cx23885_sram_channel_setup(dev, |
1047 | &dev->sram_channels[ port->sram_chno ], | 1164 | &dev->sram_channels[ port->sram_chno ], |
@@ -1083,7 +1200,21 @@ static int cx23885_start_dma(struct cx23885_tsport *port, | |||
1083 | cx_write(port->reg_gpcnt_ctl, 3); | 1200 | cx_write(port->reg_gpcnt_ctl, 3); |
1084 | q->count = 1; | 1201 | q->count = 1; |
1085 | 1202 | ||
1086 | if (cx23885_boards[dev->board].portb & CX23885_MPEG_ENCODER) { | 1203 | /* Set VIDB pins to input */ |
1204 | if (cx23885_boards[dev->board].portb == CX23885_MPEG_DVB) { | ||
1205 | reg = cx_read(PAD_CTRL); | ||
1206 | reg &= ~0x3; /* Clear TS1_OE & TS1_SOP_OE */ | ||
1207 | cx_write(PAD_CTRL, reg); | ||
1208 | } | ||
1209 | |||
1210 | /* Set VIDC pins to input */ | ||
1211 | if (cx23885_boards[dev->board].portc == CX23885_MPEG_DVB) { | ||
1212 | reg = cx_read(PAD_CTRL); | ||
1213 | reg &= ~0x4; /* Clear TS2_SOP_OE */ | ||
1214 | cx_write(PAD_CTRL, reg); | ||
1215 | } | ||
1216 | |||
1217 | if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) { | ||
1087 | 1218 | ||
1088 | reg = cx_read(PAD_CTRL); | 1219 | reg = cx_read(PAD_CTRL); |
1089 | reg = reg & ~0x1; /* Clear TS1_OE */ | 1220 | reg = reg & ~0x1; /* Clear TS1_OE */ |
@@ -1133,7 +1264,7 @@ static int cx23885_stop_dma(struct cx23885_tsport *port) | |||
1133 | cx_clear(port->reg_ts_int_msk, port->ts_int_msk_val); | 1264 | cx_clear(port->reg_ts_int_msk, port->ts_int_msk_val); |
1134 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); | 1265 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); |
1135 | 1266 | ||
1136 | if (cx23885_boards[dev->board].portb & CX23885_MPEG_ENCODER) { | 1267 | if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) { |
1137 | 1268 | ||
1138 | reg = cx_read(PAD_CTRL); | 1269 | reg = cx_read(PAD_CTRL); |
1139 | 1270 | ||
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 043fc4e5c586..ad2235dab5b1 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include "cx23885.h" | 34 | #include "cx23885.h" |
35 | #include <media/v4l2-common.h> | 35 | #include <media/v4l2-common.h> |
36 | #include <media/v4l2-ioctl.h> | ||
36 | 37 | ||
37 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 38 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
38 | /* Include V4L1 specific functions. Should be removed soon */ | 39 | /* Include V4L1 specific functions. Should be removed soon */ |
@@ -326,7 +327,7 @@ struct video_device *cx23885_vdev_init(struct cx23885_dev *dev, | |||
326 | return NULL; | 327 | return NULL; |
327 | *vfd = *template; | 328 | *vfd = *template; |
328 | vfd->minor = -1; | 329 | vfd->minor = -1; |
329 | vfd->dev = &pci->dev; | 330 | vfd->parent = &pci->dev; |
330 | vfd->release = video_device_release; | 331 | vfd->release = video_device_release; |
331 | snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", | 332 | snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", |
332 | dev->name, type, cx23885_boards[dev->board].name); | 333 | dev->name, type, cx23885_boards[dev->board].name); |
@@ -1433,12 +1434,7 @@ static const struct file_operations video_fops = { | |||
1433 | .llseek = no_llseek, | 1434 | .llseek = no_llseek, |
1434 | }; | 1435 | }; |
1435 | 1436 | ||
1436 | static struct video_device cx23885_vbi_template; | 1437 | static const struct v4l2_ioctl_ops video_ioctl_ops = { |
1437 | static struct video_device cx23885_video_template = { | ||
1438 | .name = "cx23885-video", | ||
1439 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, | ||
1440 | .fops = &video_fops, | ||
1441 | .minor = -1, | ||
1442 | .vidioc_querycap = vidioc_querycap, | 1438 | .vidioc_querycap = vidioc_querycap, |
1443 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | 1439 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, |
1444 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, | 1440 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, |
@@ -1471,6 +1467,14 @@ static struct video_device cx23885_video_template = { | |||
1471 | .vidioc_g_register = vidioc_g_register, | 1467 | .vidioc_g_register = vidioc_g_register, |
1472 | .vidioc_s_register = vidioc_s_register, | 1468 | .vidioc_s_register = vidioc_s_register, |
1473 | #endif | 1469 | #endif |
1470 | }; | ||
1471 | |||
1472 | static struct video_device cx23885_vbi_template; | ||
1473 | static struct video_device cx23885_video_template = { | ||
1474 | .name = "cx23885-video", | ||
1475 | .fops = &video_fops, | ||
1476 | .minor = -1, | ||
1477 | .ioctl_ops = &video_ioctl_ops, | ||
1474 | .tvnorms = CX23885_NORMS, | 1478 | .tvnorms = CX23885_NORMS, |
1475 | .current_norm = V4L2_STD_NTSC_M, | 1479 | .current_norm = V4L2_STD_NTSC_M, |
1476 | }; | 1480 | }; |
@@ -1512,7 +1516,6 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
1512 | memcpy(&cx23885_vbi_template, &cx23885_video_template, | 1516 | memcpy(&cx23885_vbi_template, &cx23885_video_template, |
1513 | sizeof(cx23885_vbi_template)); | 1517 | sizeof(cx23885_vbi_template)); |
1514 | strcpy(cx23885_vbi_template.name, "cx23885-vbi"); | 1518 | strcpy(cx23885_vbi_template.name, "cx23885-vbi"); |
1515 | cx23885_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER; | ||
1516 | 1519 | ||
1517 | dev->tvnorm = cx23885_video_template.current_norm; | 1520 | dev->tvnorm = cx23885_video_template.current_norm; |
1518 | 1521 | ||