aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/ivtv/ivtv-audio.c3
-rw-r--r--drivers/media/video/ivtv/ivtv-audio.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-cards.h64
-rw-r--r--drivers/media/video/ivtv/ivtv-controls.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c7
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h74
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c1
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-firmware.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-gpio.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-irq.c3
-rw-r--r--drivers/media/video/ivtv/ivtv-irq.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-mailbox.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-queue.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-queue.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c8
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-udma.c1
-rw-r--r--drivers/media/video/ivtv/ivtv-udma.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-vbi.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-version.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-video.h5
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.c9
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.h18
26 files changed, 167 insertions, 98 deletions
diff --git a/drivers/media/video/ivtv/ivtv-audio.c b/drivers/media/video/ivtv/ivtv-audio.c
index d702b8b539a1..6cb65d69c986 100644
--- a/drivers/media/video/ivtv/ivtv-audio.c
+++ b/drivers/media/video/ivtv/ivtv-audio.c
@@ -19,13 +19,10 @@
19 */ 19 */
20 20
21#include "ivtv-driver.h" 21#include "ivtv-driver.h"
22#include "ivtv-mailbox.h"
23#include "ivtv-i2c.h" 22#include "ivtv-i2c.h"
24#include "ivtv-gpio.h"
25#include "ivtv-cards.h" 23#include "ivtv-cards.h"
26#include "ivtv-audio.h" 24#include "ivtv-audio.h"
27#include <media/msp3400.h> 25#include <media/msp3400.h>
28#include <linux/videodev.h>
29 26
30/* Selects the audio input and output according to the current 27/* Selects the audio input and output according to the current
31 settings. */ 28 settings. */
diff --git a/drivers/media/video/ivtv/ivtv-audio.h b/drivers/media/video/ivtv/ivtv-audio.h
index 9c42846d8124..ebb90cc8f861 100644
--- a/drivers/media/video/ivtv/ivtv-audio.h
+++ b/drivers/media/video/ivtv/ivtv-audio.h
@@ -18,6 +18,11 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_AUDIO_H
22#define IVTV_AUDIO_H
23
21int ivtv_audio_set_io(struct ivtv *itv); 24int ivtv_audio_set_io(struct ivtv *itv);
22void ivtv_audio_set_route(struct ivtv *itv, struct v4l2_routing *route); 25void ivtv_audio_set_route(struct ivtv *itv, struct v4l2_routing *route);
23void ivtv_audio_set_audio_clock_freq(struct ivtv *itv, u8 freq); 26void ivtv_audio_set_audio_clock_freq(struct ivtv *itv, u8 freq);
27
28#endif
diff --git a/drivers/media/video/ivtv/ivtv-cards.h b/drivers/media/video/ivtv/ivtv-cards.h
index 3191920f4c6b..ff46e5ae8653 100644
--- a/drivers/media/video/ivtv/ivtv-cards.h
+++ b/drivers/media/video/ivtv/ivtv-cards.h
@@ -18,6 +18,68 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_CARDS_H
22#define IVTV_CARDS_H
23
24/* Supported cards */
25#define IVTV_CARD_PVR_250 0 /* WinTV PVR 250 */
26#define IVTV_CARD_PVR_350 1 /* encoder, decoder, tv-out */
27#define IVTV_CARD_PVR_150 2 /* WinTV PVR 150 and PVR 500 (really just two
28 PVR150s on one PCI board) */
29#define IVTV_CARD_M179 3 /* AVerMedia M179 (encoder only) */
30#define IVTV_CARD_MPG600 4 /* Kuroutoshikou ITVC16-STVLP/YUAN MPG600, encoder only */
31#define IVTV_CARD_MPG160 5 /* Kuroutoshikou ITVC15-STVLP/YUAN MPG160
32 cx23415 based, but does not have tv-out */
33#define IVTV_CARD_PG600 6 /* YUAN PG600/DIAMONDMM PVR-550 based on the CX Falcon 2 */
34#define IVTV_CARD_AVC2410 7 /* Adaptec AVC-2410 */
35#define IVTV_CARD_AVC2010 8 /* Adaptec AVD-2010 (No Tuner) */
36#define IVTV_CARD_TG5000TV 9 /* NAGASE TRANSGEAR 5000TV, encoder only */
37#define IVTV_CARD_VA2000MAX_SNT6 10 /* VA2000MAX-STN6 */
38#define IVTV_CARD_CX23416GYC 11 /* Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */
39#define IVTV_CARD_GV_MVPRX 12 /* I/O Data GV-MVP/RX, RX2, RX2W */
40#define IVTV_CARD_GV_MVPRX2E 13 /* I/O Data GV-MVP/RX2E */
41#define IVTV_CARD_GOTVIEW_PCI_DVD 14 /* GotView PCI DVD */
42#define IVTV_CARD_GOTVIEW_PCI_DVD2 15 /* GotView PCI DVD2 */
43#define IVTV_CARD_YUAN_MPC622 16 /* Yuan MPC622 miniPCI */
44#define IVTV_CARD_DCTMTVP1 17 /* DIGITAL COWBOY DCT-MTVP1 */
45#define IVTV_CARD_PG600V2 18 /* Yuan PG600V2/GotView PCI DVD Lite */
46#define IVTV_CARD_CLUB3D 19 /* Club3D ZAP-TV1x01 */
47#define IVTV_CARD_AVERTV_MCE116 20 /* AVerTV MCE 116 Plus */
48#define IVTV_CARD_LAST 20
49
50/* Variants of existing cards but with the same PCI IDs. The driver
51 detects these based on other device information.
52 These cards must always come last.
53 New cards must be inserted above, and the indices of the cards below
54 must be adjusted accordingly. */
55
56/* PVR-350 V1 (uses saa7114) */
57#define IVTV_CARD_PVR_350_V1 (IVTV_CARD_LAST+1)
58/* 2 variants of Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */
59#define IVTV_CARD_CX23416GYC_NOGR (IVTV_CARD_LAST+2)
60#define IVTV_CARD_CX23416GYC_NOGRYCS (IVTV_CARD_LAST+3)
61
62/* system vendor and device IDs */
63#define PCI_VENDOR_ID_ICOMP 0x4444
64#define PCI_DEVICE_ID_IVTV15 0x0803
65#define PCI_DEVICE_ID_IVTV16 0x0016
66
67/* subsystem vendor ID */
68#define IVTV_PCI_ID_HAUPPAUGE 0x0070
69#define IVTV_PCI_ID_HAUPPAUGE_ALT1 0x0270
70#define IVTV_PCI_ID_HAUPPAUGE_ALT2 0x4070
71#define IVTV_PCI_ID_ADAPTEC 0x9005
72#define IVTV_PCI_ID_AVERMEDIA 0x1461
73#define IVTV_PCI_ID_YUAN1 0x12ab
74#define IVTV_PCI_ID_YUAN2 0xff01
75#define IVTV_PCI_ID_YUAN3 0xffab
76#define IVTV_PCI_ID_YUAN4 0xfbab
77#define IVTV_PCI_ID_DIAMONDMM 0xff92
78#define IVTV_PCI_ID_IODATA 0x10fc
79#define IVTV_PCI_ID_MELCO 0x1154
80#define IVTV_PCI_ID_GOTVIEW1 0xffac
81#define IVTV_PCI_ID_GOTVIEW2 0xffad
82
21/* hardware flags */ 83/* hardware flags */
22#define IVTV_HW_CX25840 (1 << 0) 84#define IVTV_HW_CX25840 (1 << 0)
23#define IVTV_HW_SAA7115 (1 << 1) 85#define IVTV_HW_SAA7115 (1 << 1)
@@ -206,3 +268,5 @@ int ivtv_get_output(struct ivtv *itv, u16 index, struct v4l2_output *output);
206int ivtv_get_audio_input(struct ivtv *itv, u16 index, struct v4l2_audio *input); 268int ivtv_get_audio_input(struct ivtv *itv, u16 index, struct v4l2_audio *input);
207int ivtv_get_audio_output(struct ivtv *itv, u16 index, struct v4l2_audioout *output); 269int ivtv_get_audio_output(struct ivtv *itv, u16 index, struct v4l2_audioout *output);
208const struct ivtv_card *ivtv_get_card(u16 index); 270const struct ivtv_card *ivtv_get_card(u16 index);
271
272#endif
diff --git a/drivers/media/video/ivtv/ivtv-controls.h b/drivers/media/video/ivtv/ivtv-controls.h
index 5a11149725ad..bb8a6a5ed2bc 100644
--- a/drivers/media/video/ivtv/ivtv-controls.h
+++ b/drivers/media/video/ivtv/ivtv-controls.h
@@ -18,4 +18,9 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_CONTROLS_H
22#define IVTV_CONTROLS_H
23
21int ivtv_control_ioctls(struct ivtv *itv, unsigned int cmd, void *arg); 24int ivtv_control_ioctls(struct ivtv *itv, unsigned int cmd, void *arg);
25
26#endif
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 93ddea49f0ed..2ed9894672f4 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -87,13 +87,6 @@ static struct pci_device_id ivtv_pci_tbl[] __devinitdata = {
87 87
88MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl); 88MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
89 89
90const u32 yuv_offset[4] = {
91 IVTV_YUV_BUFFER_OFFSET,
92 IVTV_YUV_BUFFER_OFFSET_1,
93 IVTV_YUV_BUFFER_OFFSET_2,
94 IVTV_YUV_BUFFER_OFFSET_3
95};
96
97/* Parameter declarations */ 90/* Parameter declarations */
98static int cardtype[IVTV_MAX_CARDS]; 91static int cardtype[IVTV_MAX_CARDS];
99static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, 92static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index 3ed4703956d3..f7849f852e9d 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -74,61 +74,10 @@
74#define IVTV_REG_OFFSET 0x02000000 74#define IVTV_REG_OFFSET 0x02000000
75#define IVTV_REG_SIZE 0x00010000 75#define IVTV_REG_SIZE 0x00010000
76 76
77/* Buffers on hardware offsets */
78#define IVTV_YUV_BUFFER_OFFSET 0x001a8600 /* First YUV Buffer */
79#define IVTV_YUV_BUFFER_OFFSET_1 0x00240400 /* Second YUV Buffer */
80#define IVTV_YUV_BUFFER_OFFSET_2 0x002d8200 /* Third YUV Buffer */
81#define IVTV_YUV_BUFFER_OFFSET_3 0x00370000 /* Fourth YUV Buffer */
82#define IVTV_YUV_BUFFER_UV_OFFSET 0x65400 /* Offset to UV Buffer */
83
84/* Offset to filter table in firmware */
85#define IVTV_YUV_HORIZONTAL_FILTER_OFFSET 0x025d8
86#define IVTV_YUV_VERTICAL_FILTER_OFFSET 0x03358
87
88extern const u32 yuv_offset[4];
89
90/* Maximum ivtv driver instances. Some people have a huge number of 77/* Maximum ivtv driver instances. Some people have a huge number of
91 capture cards, so set this to a high value. */ 78 capture cards, so set this to a high value. */
92#define IVTV_MAX_CARDS 32 79#define IVTV_MAX_CARDS 32
93 80
94/* Supported cards */
95#define IVTV_CARD_PVR_250 0 /* WinTV PVR 250 */
96#define IVTV_CARD_PVR_350 1 /* encoder, decoder, tv-out */
97#define IVTV_CARD_PVR_150 2 /* WinTV PVR 150 and PVR 500 (really just two
98 PVR150s on one PCI board) */
99#define IVTV_CARD_M179 3 /* AVerMedia M179 (encoder only) */
100#define IVTV_CARD_MPG600 4 /* Kuroutoshikou ITVC16-STVLP/YUAN MPG600, encoder only */
101#define IVTV_CARD_MPG160 5 /* Kuroutoshikou ITVC15-STVLP/YUAN MPG160
102 cx23415 based, but does not have tv-out */
103#define IVTV_CARD_PG600 6 /* YUAN PG600/DIAMONDMM PVR-550 based on the CX Falcon 2 */
104#define IVTV_CARD_AVC2410 7 /* Adaptec AVC-2410 */
105#define IVTV_CARD_AVC2010 8 /* Adaptec AVD-2010 (No Tuner) */
106#define IVTV_CARD_TG5000TV 9 /* NAGASE TRANSGEAR 5000TV, encoder only */
107#define IVTV_CARD_VA2000MAX_SNT6 10 /* VA2000MAX-STN6 */
108#define IVTV_CARD_CX23416GYC 11 /* Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */
109#define IVTV_CARD_GV_MVPRX 12 /* I/O Data GV-MVP/RX, RX2, RX2W */
110#define IVTV_CARD_GV_MVPRX2E 13 /* I/O Data GV-MVP/RX2E */
111#define IVTV_CARD_GOTVIEW_PCI_DVD 14 /* GotView PCI DVD */
112#define IVTV_CARD_GOTVIEW_PCI_DVD2 15 /* GotView PCI DVD2 */
113#define IVTV_CARD_YUAN_MPC622 16 /* Yuan MPC622 miniPCI */
114#define IVTV_CARD_DCTMTVP1 17 /* DIGITAL COWBOY DCT-MTVP1 */
115#define IVTV_CARD_PG600V2 18 /* Yuan PG600V2/GotView PCI DVD Lite */
116#define IVTV_CARD_CLUB3D 19 /* Club3D ZAP-TV1x01 */
117#define IVTV_CARD_AVERTV_MCE116 20 /* AVerTV MCE 116 Plus */
118#define IVTV_CARD_LAST 20
119
120/* Variants of existing cards but with the same PCI IDs. The driver
121 detects these based on other device information.
122 These cards must always come last.
123 New cards must be inserted above, and the indices of the cards below
124 must be adjusted accordingly. */
125
126/* PVR-350 V1 (uses saa7114) */
127#define IVTV_CARD_PVR_350_V1 (IVTV_CARD_LAST+1)
128/* 2 variants of Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */
129#define IVTV_CARD_CX23416GYC_NOGR (IVTV_CARD_LAST+2)
130#define IVTV_CARD_CX23416GYC_NOGRYCS (IVTV_CARD_LAST+3)
131
132#define IVTV_ENC_STREAM_TYPE_MPG 0 81#define IVTV_ENC_STREAM_TYPE_MPG 0
133#define IVTV_ENC_STREAM_TYPE_YUV 1 82#define IVTV_ENC_STREAM_TYPE_YUV 1
134#define IVTV_ENC_STREAM_TYPE_VBI 2 83#define IVTV_ENC_STREAM_TYPE_VBI 2
@@ -150,27 +99,6 @@ extern const u32 yuv_offset[4];
150#define IVTV_ENC_MEM_START 0x00000000 99#define IVTV_ENC_MEM_START 0x00000000
151#define IVTV_DEC_MEM_START 0x01000000 100#define IVTV_DEC_MEM_START 0x01000000
152 101
153/* system vendor and device IDs */
154#define PCI_VENDOR_ID_ICOMP 0x4444
155#define PCI_DEVICE_ID_IVTV15 0x0803
156#define PCI_DEVICE_ID_IVTV16 0x0016
157
158/* subsystem vendor ID */
159#define IVTV_PCI_ID_HAUPPAUGE 0x0070
160#define IVTV_PCI_ID_HAUPPAUGE_ALT1 0x0270
161#define IVTV_PCI_ID_HAUPPAUGE_ALT2 0x4070
162#define IVTV_PCI_ID_ADAPTEC 0x9005
163#define IVTV_PCI_ID_AVERMEDIA 0x1461
164#define IVTV_PCI_ID_YUAN1 0x12ab
165#define IVTV_PCI_ID_YUAN2 0xff01
166#define IVTV_PCI_ID_YUAN3 0xffab
167#define IVTV_PCI_ID_YUAN4 0xfbab
168#define IVTV_PCI_ID_DIAMONDMM 0xff92
169#define IVTV_PCI_ID_IODATA 0x10fc
170#define IVTV_PCI_ID_MELCO 0x1154
171#define IVTV_PCI_ID_GOTVIEW1 0xffac
172#define IVTV_PCI_ID_GOTVIEW2 0xffad
173
174/* Decoder Buffer hardware size on Chip */ 102/* Decoder Buffer hardware size on Chip */
175#define IVTV_DEC_MAX_BUF 0x00100000 /* max bytes in decoder buffer */ 103#define IVTV_DEC_MAX_BUF 0x00100000 /* max bytes in decoder buffer */
176#define IVTV_DEC_MIN_BUF 0x00010000 /* min bytes in dec buffer */ 104#define IVTV_DEC_MIN_BUF 0x00010000 /* min bytes in dec buffer */
@@ -890,4 +818,4 @@ int ivtv_init_on_first_open(struct ivtv *itv);
890#define write_dec_sync(val, addr) \ 818#define write_dec_sync(val, addr) \
891 do { write_dec(val, addr); read_dec(addr); } while (0) 819 do { write_dec(val, addr); read_dec(addr); } while (0)
892 820
893#endif /* IVTV_DRIVER_H */ 821#endif
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 62ee41c5220b..6449f5831e66 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -30,7 +30,6 @@
30#include "ivtv-audio.h" 30#include "ivtv-audio.h"
31#include "ivtv-streams.h" 31#include "ivtv-streams.h"
32#include "ivtv-yuv.h" 32#include "ivtv-yuv.h"
33#include "ivtv-controls.h"
34#include "ivtv-ioctl.h" 33#include "ivtv-ioctl.h"
35#include "ivtv-cards.h" 34#include "ivtv-cards.h"
36#include <media/saa7115.h> 35#include <media/saa7115.h>
diff --git a/drivers/media/video/ivtv/ivtv-fileops.h b/drivers/media/video/ivtv/ivtv-fileops.h
index 74a1745fabbc..2c8d5186c9c3 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.h
+++ b/drivers/media/video/ivtv/ivtv-fileops.h
@@ -18,6 +18,9 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_FILEOPS_H
22#define IVTV_FILEOPS_H
23
21/* Testing/Debugging */ 24/* Testing/Debugging */
22int ivtv_v4l2_open(struct inode *inode, struct file *filp); 25int ivtv_v4l2_open(struct inode *inode, struct file *filp);
23ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count, 26ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count,
@@ -42,3 +45,5 @@ int ivtv_claim_stream(struct ivtv_open_id *id, int type);
42 45
43/* Release a previously claimed stream. */ 46/* Release a previously claimed stream. */
44void ivtv_release_stream(struct ivtv_stream *s); 47void ivtv_release_stream(struct ivtv_stream *s);
48
49#endif
diff --git a/drivers/media/video/ivtv/ivtv-firmware.h b/drivers/media/video/ivtv/ivtv-firmware.h
index 8b2ffe658905..041ba94e65bc 100644
--- a/drivers/media/video/ivtv/ivtv-firmware.h
+++ b/drivers/media/video/ivtv/ivtv-firmware.h
@@ -19,7 +19,12 @@
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#ifndef IVTV_FIRMWARE_H
23#define IVTV_FIRMWARE_H
24
22int ivtv_firmware_init(struct ivtv *itv); 25int ivtv_firmware_init(struct ivtv *itv);
23void ivtv_firmware_versions(struct ivtv *itv); 26void ivtv_firmware_versions(struct ivtv *itv);
24void ivtv_halt_firmware(struct ivtv *itv); 27void ivtv_halt_firmware(struct ivtv *itv);
25void ivtv_init_mpeg_decoder(struct ivtv *itv); 28void ivtv_init_mpeg_decoder(struct ivtv *itv);
29
30#endif
diff --git a/drivers/media/video/ivtv/ivtv-gpio.h b/drivers/media/video/ivtv/ivtv-gpio.h
index b31c679bbd8e..964a265d91a9 100644
--- a/drivers/media/video/ivtv/ivtv-gpio.h
+++ b/drivers/media/video/ivtv/ivtv-gpio.h
@@ -18,8 +18,13 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_GPIO_H
22#define IVTV_GPIO_H
23
21/* GPIO stuff */ 24/* GPIO stuff */
22void ivtv_gpio_init(struct ivtv *itv); 25void ivtv_gpio_init(struct ivtv *itv);
23void ivtv_reset_ir_gpio(struct ivtv *itv); 26void ivtv_reset_ir_gpio(struct ivtv *itv);
24int ivtv_reset_tuner_gpio(void *dev, int cmd, int value); 27int ivtv_reset_tuner_gpio(void *dev, int cmd, int value);
25int ivtv_gpio(struct ivtv *itv, unsigned int command, void *arg); 28int ivtv_gpio(struct ivtv *itv, unsigned int command, void *arg);
29
30#endif
diff --git a/drivers/media/video/ivtv/ivtv-i2c.h b/drivers/media/video/ivtv/ivtv-i2c.h
index 5d210adb5c52..677c3292855e 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.h
+++ b/drivers/media/video/ivtv/ivtv-i2c.h
@@ -18,6 +18,9 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_I2C_H
22#define IVTV_I2C_H
23
21int ivtv_cx25840(struct ivtv *itv, unsigned int cmd, void *arg); 24int ivtv_cx25840(struct ivtv *itv, unsigned int cmd, void *arg);
22int ivtv_saa7115(struct ivtv *itv, unsigned int cmd, void *arg); 25int ivtv_saa7115(struct ivtv *itv, unsigned int cmd, void *arg);
23int ivtv_saa7127(struct ivtv *itv, unsigned int cmd, void *arg); 26int ivtv_saa7127(struct ivtv *itv, unsigned int cmd, void *arg);
@@ -34,3 +37,5 @@ void ivtv_call_i2c_clients(struct ivtv *itv, unsigned int cmd, void *arg);
34/* init + register i2c algo-bit adapter */ 37/* init + register i2c algo-bit adapter */
35int __devinit init_ivtv_i2c(struct ivtv *itv); 38int __devinit init_ivtv_i2c(struct ivtv *itv);
36void __devexit exit_ivtv_i2c(struct ivtv *itv); 39void __devexit exit_ivtv_i2c(struct ivtv *itv);
40
41#endif
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.h b/drivers/media/video/ivtv/ivtv-ioctl.h
index cbccf7a9f65c..a03351b6853d 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.h
+++ b/drivers/media/video/ivtv/ivtv-ioctl.h
@@ -18,6 +18,9 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_IOCTL_H
22#define IVTV_IOCTL_H
23
21u16 service2vbi(int type); 24u16 service2vbi(int type);
22void expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); 25void expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal);
23u16 get_service_set(struct v4l2_sliced_vbi_format *fmt); 26u16 get_service_set(struct v4l2_sliced_vbi_format *fmt);
@@ -26,3 +29,5 @@ int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
26int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg); 29int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg);
27void ivtv_set_osd_alpha(struct ivtv *itv); 30void ivtv_set_osd_alpha(struct ivtv *itv);
28int ivtv_set_speed(struct ivtv *itv, int speed); 31int ivtv_set_speed(struct ivtv *itv, int speed);
32
33#endif
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index d68853fd60a3..b6a94a1ad19b 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -19,12 +19,9 @@
19 */ 19 */
20 20
21#include "ivtv-driver.h" 21#include "ivtv-driver.h"
22#include "ivtv-firmware.h"
23#include "ivtv-fileops.h"
24#include "ivtv-queue.h" 22#include "ivtv-queue.h"
25#include "ivtv-udma.h" 23#include "ivtv-udma.h"
26#include "ivtv-irq.h" 24#include "ivtv-irq.h"
27#include "ivtv-ioctl.h"
28#include "ivtv-mailbox.h" 25#include "ivtv-mailbox.h"
29#include "ivtv-vbi.h" 26#include "ivtv-vbi.h"
30#include "ivtv-yuv.h" 27#include "ivtv-yuv.h"
diff --git a/drivers/media/video/ivtv/ivtv-irq.h b/drivers/media/video/ivtv/ivtv-irq.h
index a43348a30309..e180bd348989 100644
--- a/drivers/media/video/ivtv/ivtv-irq.h
+++ b/drivers/media/video/ivtv/ivtv-irq.h
@@ -19,8 +19,13 @@
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#ifndef IVTV_IRQ_H
23#define IVTV_IRQ_H
24
22irqreturn_t ivtv_irq_handler(int irq, void *dev_id); 25irqreturn_t ivtv_irq_handler(int irq, void *dev_id);
23 26
24void ivtv_irq_work_handler(struct work_struct *work); 27void ivtv_irq_work_handler(struct work_struct *work);
25void ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock); 28void ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock);
26void ivtv_unfinished_dma(unsigned long arg); 29void ivtv_unfinished_dma(unsigned long arg);
30
31#endif
diff --git a/drivers/media/video/ivtv/ivtv-mailbox.h b/drivers/media/video/ivtv/ivtv-mailbox.h
index 79b8aec14370..90c871b8e23b 100644
--- a/drivers/media/video/ivtv/ivtv-mailbox.h
+++ b/drivers/media/video/ivtv/ivtv-mailbox.h
@@ -18,8 +18,13 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_MAILBOX_H
22#define IVTV_MAILBOX_H
23
21void ivtv_api_get_data(struct ivtv_mailbox_data *mbox, int mb, u32 data[]); 24void ivtv_api_get_data(struct ivtv_mailbox_data *mbox, int mb, u32 data[]);
22int ivtv_api(struct ivtv *itv, int cmd, int args, u32 data[]); 25int ivtv_api(struct ivtv *itv, int cmd, int args, u32 data[]);
23int ivtv_vapi_result(struct ivtv *itv, u32 data[CX2341X_MBOX_MAX_DATA], int cmd, int args, ...); 26int ivtv_vapi_result(struct ivtv *itv, u32 data[CX2341X_MBOX_MAX_DATA], int cmd, int args, ...);
24int ivtv_vapi(struct ivtv *itv, int cmd, int args, ...); 27int ivtv_vapi(struct ivtv *itv, int cmd, int args, ...);
25int ivtv_api_func(void *priv, int cmd, int in, int out, u32 data[CX2341X_MBOX_MAX_DATA]); 28int ivtv_api_func(void *priv, int cmd, int in, int out, u32 data[CX2341X_MBOX_MAX_DATA]);
29
30#endif
diff --git a/drivers/media/video/ivtv/ivtv-queue.c b/drivers/media/video/ivtv/ivtv-queue.c
index d9a1478ca1f7..437f134796e3 100644
--- a/drivers/media/video/ivtv/ivtv-queue.c
+++ b/drivers/media/video/ivtv/ivtv-queue.c
@@ -20,9 +20,7 @@
20 */ 20 */
21 21
22#include "ivtv-driver.h" 22#include "ivtv-driver.h"
23#include "ivtv-streams.h"
24#include "ivtv-queue.h" 23#include "ivtv-queue.h"
25#include "ivtv-mailbox.h"
26 24
27int ivtv_buf_copy_from_user(struct ivtv_stream *s, struct ivtv_buffer *buf, const char __user *src, int copybytes) 25int ivtv_buf_copy_from_user(struct ivtv_stream *s, struct ivtv_buffer *buf, const char __user *src, int copybytes)
28{ 26{
diff --git a/drivers/media/video/ivtv/ivtv-queue.h b/drivers/media/video/ivtv/ivtv-queue.h
index 14a9f7fe50aa..7cfc0c9ab050 100644
--- a/drivers/media/video/ivtv/ivtv-queue.h
+++ b/drivers/media/video/ivtv/ivtv-queue.h
@@ -19,6 +19,9 @@
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#ifndef IVTV_QUEUE_H
23#define IVTV_QUEUE_H
24
22#define IVTV_DMA_UNMAPPED ((u32) -1) 25#define IVTV_DMA_UNMAPPED ((u32) -1)
23#define SLICED_VBI_PIO 1 26#define SLICED_VBI_PIO 1
24 27
@@ -89,3 +92,5 @@ static inline void ivtv_stream_sync_for_device(struct ivtv_stream *s)
89 pci_dma_sync_single_for_device(s->itv->dev, s->sg_handle, 92 pci_dma_sync_single_for_device(s->itv->dev, s->sg_handle,
90 sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE); 93 sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE);
91} 94}
95
96#endif
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index ebf925c549fd..fae151a31e85 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -35,16 +35,12 @@
35 35
36#include "ivtv-driver.h" 36#include "ivtv-driver.h"
37#include "ivtv-fileops.h" 37#include "ivtv-fileops.h"
38#include "ivtv-i2c.h"
39#include "ivtv-queue.h" 38#include "ivtv-queue.h"
40#include "ivtv-mailbox.h" 39#include "ivtv-mailbox.h"
41#include "ivtv-audio.h"
42#include "ivtv-video.h"
43#include "ivtv-vbi.h"
44#include "ivtv-ioctl.h" 40#include "ivtv-ioctl.h"
45#include "ivtv-irq.h" 41#include "ivtv-yuv.h"
46#include "ivtv-streams.h"
47#include "ivtv-cards.h" 42#include "ivtv-cards.h"
43#include "ivtv-streams.h"
48 44
49static struct file_operations ivtv_v4l2_enc_fops = { 45static struct file_operations ivtv_v4l2_enc_fops = {
50 .owner = THIS_MODULE, 46 .owner = THIS_MODULE,
diff --git a/drivers/media/video/ivtv/ivtv-streams.h b/drivers/media/video/ivtv/ivtv-streams.h
index 8597b75384a7..8f5f5b1c7c89 100644
--- a/drivers/media/video/ivtv/ivtv-streams.h
+++ b/drivers/media/video/ivtv/ivtv-streams.h
@@ -18,6 +18,9 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_STREAMS_H
22#define IVTV_STREAMS_H
23
21int ivtv_streams_setup(struct ivtv *itv); 24int ivtv_streams_setup(struct ivtv *itv);
22void ivtv_streams_cleanup(struct ivtv *itv); 25void ivtv_streams_cleanup(struct ivtv *itv);
23 26
@@ -29,3 +32,5 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts);
29 32
30void ivtv_stop_all_captures(struct ivtv *itv); 33void ivtv_stop_all_captures(struct ivtv *itv);
31int ivtv_passthrough_mode(struct ivtv *itv, int enable); 34int ivtv_passthrough_mode(struct ivtv *itv, int enable);
35
36#endif
diff --git a/drivers/media/video/ivtv/ivtv-udma.c b/drivers/media/video/ivtv/ivtv-udma.c
index 7e503adacea0..c4626d1cdf41 100644
--- a/drivers/media/video/ivtv/ivtv-udma.c
+++ b/drivers/media/video/ivtv/ivtv-udma.c
@@ -21,7 +21,6 @@
21 */ 21 */
22 22
23#include "ivtv-driver.h" 23#include "ivtv-driver.h"
24#include "ivtv-streams.h"
25#include "ivtv-udma.h" 24#include "ivtv-udma.h"
26 25
27void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size) 26void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size)
diff --git a/drivers/media/video/ivtv/ivtv-udma.h b/drivers/media/video/ivtv/ivtv-udma.h
index e131bccedec0..df727e23be0a 100644
--- a/drivers/media/video/ivtv/ivtv-udma.h
+++ b/drivers/media/video/ivtv/ivtv-udma.h
@@ -18,6 +18,9 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_UDMA_H
22#define IVTV_UDMA_H
23
21/* User DMA functions */ 24/* User DMA functions */
22void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size); 25void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size);
23int ivtv_udma_fill_sg_list(struct ivtv_user_dma *dma, struct ivtv_dma_page_info *dma_page, int map_offset); 26int ivtv_udma_fill_sg_list(struct ivtv_user_dma *dma, struct ivtv_dma_page_info *dma_page, int map_offset);
@@ -41,3 +44,5 @@ static inline void ivtv_udma_sync_for_cpu(struct ivtv *itv)
41 pci_dma_sync_single_for_cpu((struct pci_dev *)itv->dev, itv->udma.SG_handle, 44 pci_dma_sync_single_for_cpu((struct pci_dev *)itv->dev, itv->udma.SG_handle,
42 sizeof(itv->udma.SGarray), PCI_DMA_TODEVICE); 45 sizeof(itv->udma.SGarray), PCI_DMA_TODEVICE);
43} 46}
47
48#endif
diff --git a/drivers/media/video/ivtv/ivtv-vbi.h b/drivers/media/video/ivtv/ivtv-vbi.h
index ec211b49702c..d5740493a690 100644
--- a/drivers/media/video/ivtv/ivtv-vbi.h
+++ b/drivers/media/video/ivtv/ivtv-vbi.h
@@ -17,6 +17,9 @@
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#ifndef IVTV_VBI_H
21#define IVTV_VBI_H
22
20ssize_t ivtv_write_vbi(struct ivtv *itv, const char __user *ubuf, size_t count); 23ssize_t ivtv_write_vbi(struct ivtv *itv, const char __user *ubuf, size_t count);
21void ivtv_process_vbi_data(struct ivtv *itv, struct ivtv_buffer *buf, 24void ivtv_process_vbi_data(struct ivtv *itv, struct ivtv_buffer *buf,
22 u64 pts_stamp, int streamtype); 25 u64 pts_stamp, int streamtype);
@@ -24,3 +27,5 @@ int ivtv_used_line(struct ivtv *itv, int line, int field);
24void ivtv_disable_vbi(struct ivtv *itv); 27void ivtv_disable_vbi(struct ivtv *itv);
25void ivtv_set_vbi(unsigned long arg); 28void ivtv_set_vbi(unsigned long arg);
26void ivtv_vbi_work_handler(struct ivtv *itv); 29void ivtv_vbi_work_handler(struct ivtv *itv);
30
31#endif
diff --git a/drivers/media/video/ivtv/ivtv-version.h b/drivers/media/video/ivtv/ivtv-version.h
index 122d56105969..d050de2a7229 100644
--- a/drivers/media/video/ivtv/ivtv-version.h
+++ b/drivers/media/video/ivtv/ivtv-version.h
@@ -17,6 +17,9 @@
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#ifndef IVTV_VERSION_H
21#define IVTV_VERSION_H
22
20#define IVTV_DRIVER_NAME "ivtv" 23#define IVTV_DRIVER_NAME "ivtv"
21#define IVTV_DRIVER_VERSION_MAJOR 1 24#define IVTV_DRIVER_VERSION_MAJOR 1
22#define IVTV_DRIVER_VERSION_MINOR 1 25#define IVTV_DRIVER_VERSION_MINOR 1
@@ -24,3 +27,5 @@
24 27
25#define IVTV_VERSION __stringify(IVTV_DRIVER_VERSION_MAJOR) "." __stringify(IVTV_DRIVER_VERSION_MINOR) "." __stringify(IVTV_DRIVER_VERSION_PATCHLEVEL) 28#define IVTV_VERSION __stringify(IVTV_DRIVER_VERSION_MAJOR) "." __stringify(IVTV_DRIVER_VERSION_MINOR) "." __stringify(IVTV_DRIVER_VERSION_PATCHLEVEL)
26#define IVTV_DRIVER_VERSION KERNEL_VERSION(IVTV_DRIVER_VERSION_MAJOR,IVTV_DRIVER_VERSION_MINOR,IVTV_DRIVER_VERSION_PATCHLEVEL) 29#define IVTV_DRIVER_VERSION KERNEL_VERSION(IVTV_DRIVER_VERSION_MAJOR,IVTV_DRIVER_VERSION_MINOR,IVTV_DRIVER_VERSION_PATCHLEVEL)
30
31#endif
diff --git a/drivers/media/video/ivtv/ivtv-video.h b/drivers/media/video/ivtv/ivtv-video.h
index c8ade5d3c413..498e9b61c227 100644
--- a/drivers/media/video/ivtv/ivtv-video.h
+++ b/drivers/media/video/ivtv/ivtv-video.h
@@ -17,8 +17,13 @@
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#ifndef IVTV_VIDEO_H
21#define IVTV_VIDEO_H
22
20void ivtv_set_wss(struct ivtv *itv, int enabled, int mode); 23void ivtv_set_wss(struct ivtv *itv, int enabled, int mode);
21void ivtv_set_cc(struct ivtv *itv, int mode, u8 cc1, u8 cc2, u8 cc3, u8 cc4); 24void ivtv_set_cc(struct ivtv *itv, int mode, u8 cc1, u8 cc2, u8 cc3, u8 cc4);
22void ivtv_set_vps(struct ivtv *itv, int enabled, u8 vps1, u8 vps2, u8 vps3, 25void ivtv_set_vps(struct ivtv *itv, int enabled, u8 vps1, u8 vps2, u8 vps3,
23 u8 vps4, u8 vps5); 26 u8 vps4, u8 vps5);
24void ivtv_video_set_io(struct ivtv *itv); 27void ivtv_video_set_io(struct ivtv *itv);
28
29#endif
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c
index 1922c1da20d3..bb2cbb206c14 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -19,11 +19,16 @@
19 */ 19 */
20 20
21#include "ivtv-driver.h" 21#include "ivtv-driver.h"
22#include "ivtv-queue.h"
23#include "ivtv-udma.h" 22#include "ivtv-udma.h"
24#include "ivtv-irq.h"
25#include "ivtv-yuv.h" 23#include "ivtv-yuv.h"
26 24
25const u32 yuv_offset[4] = {
26 IVTV_YUV_BUFFER_OFFSET,
27 IVTV_YUV_BUFFER_OFFSET_1,
28 IVTV_YUV_BUFFER_OFFSET_2,
29 IVTV_YUV_BUFFER_OFFSET_3
30};
31
27static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, 32static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
28 struct ivtv_dma_frame *args) 33 struct ivtv_dma_frame *args)
29{ 34{
diff --git a/drivers/media/video/ivtv/ivtv-yuv.h b/drivers/media/video/ivtv/ivtv-yuv.h
index 88972d3f77c4..0824048ce3a2 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.h
+++ b/drivers/media/video/ivtv/ivtv-yuv.h
@@ -18,7 +18,25 @@
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef IVTV_YUV_H
22#define IVTV_YUV_H
23
24/* Buffers on hardware offsets */
25#define IVTV_YUV_BUFFER_OFFSET 0x001a8600 /* First YUV Buffer */
26#define IVTV_YUV_BUFFER_OFFSET_1 0x00240400 /* Second YUV Buffer */
27#define IVTV_YUV_BUFFER_OFFSET_2 0x002d8200 /* Third YUV Buffer */
28#define IVTV_YUV_BUFFER_OFFSET_3 0x00370000 /* Fourth YUV Buffer */
29#define IVTV_YUV_BUFFER_UV_OFFSET 0x65400 /* Offset to UV Buffer */
30
31/* Offset to filter table in firmware */
32#define IVTV_YUV_HORIZONTAL_FILTER_OFFSET 0x025d8
33#define IVTV_YUV_VERTICAL_FILTER_OFFSET 0x03358
34
35extern const u32 yuv_offset[4];
36
21int ivtv_yuv_filter_check(struct ivtv *itv); 37int ivtv_yuv_filter_check(struct ivtv *itv);
22int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args); 38int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args);
23void ivtv_yuv_close(struct ivtv *itv); 39void ivtv_yuv_close(struct ivtv *itv);
24void ivtv_yuv_work_handler (struct ivtv *itv); 40void ivtv_yuv_work_handler (struct ivtv *itv);
41
42#endif