diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-06 14:27:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-06 14:27:48 -0500 |
commit | 68c5735eaa5e680e701c9a2d1e3c7880bdf5ab66 (patch) | |
tree | 4f584693638bf257b66a1646cc30d823cacc0a58 /drivers/media/pci/ivtv | |
parent | 2246edfaf88dc368e8671b04afd54412625df60a (diff) | |
parent | 273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 (diff) |
Merge tag 'media/v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
- videobuf2 was moved to a media/common dir, as it is now used by the
DVB subsystem too
- Digital TV core memory mapped support interface
- new sensor driver: ov7740
- several improvements at ddbridge driver
- new V4L2 driver: IPU3 CIO2 CSI-2 receiver unit, found on some Intel
SoCs
- new tuner driver: tda18250
- finally got rid of all LIRC staging drivers
- as we don't have old lirc drivers anymore, restruct the lirc device
code
- add support for UVC metadata
- add a new staging driver for NVIDIA Tegra Video Decoder Engine
- DVB kAPI headers moved to include/media
- synchronize the kAPI and uAPI for the DVB subsystem, removing the gap
for non-legacy APIs
- reduce the kAPI gap for V4L2
- lots of other driver enhancements, cleanups, etc.
* tag 'media/v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (407 commits)
media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs
media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic
media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors
media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type
media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32
media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer
media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32
media: v4l2-compat-ioctl32.c: avoid sizeof(type)
media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32
media: v4l2-compat-ioctl32.c: fix the indentation
media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF
media: v4l2-ioctl.c: don't copy back the result for -ENOTTY
media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt
media: vivid: fix module load error when enabling fb and no_error_inj=1
media: dvb_demux: improve debug messages
media: dvb_demux: Better handle discontinuity errors
media: cxusb, dib0700: ignore XC2028_I2C_FLUSH
media: ts2020: avoid integer overflows on 32 bit machines
media: i2c: ov7740: use gpio/consumer.h instead of gpio.h
media: entity: Add a nop variant of media_entity_cleanup
...
Diffstat (limited to 'drivers/media/pci/ivtv')
-rw-r--r-- | drivers/media/pci/ivtv/Makefile | 2 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-cards.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-cards.h | 148 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-driver.h | 102 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-firmware.c | 36 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-i2c.c | 46 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-ioctl.c | 74 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-mailbox.c | 182 |
8 files changed, 285 insertions, 307 deletions
diff --git a/drivers/media/pci/ivtv/Makefile b/drivers/media/pci/ivtv/Makefile index 48f8a23f9a0f..5de95dbe3256 100644 --- a/drivers/media/pci/ivtv/Makefile +++ b/drivers/media/pci/ivtv/Makefile | |||
@@ -10,8 +10,6 @@ obj-$(CONFIG_VIDEO_IVTV) += ivtv.o | |||
10 | obj-$(CONFIG_VIDEO_IVTV_ALSA) += ivtv-alsa.o | 10 | obj-$(CONFIG_VIDEO_IVTV_ALSA) += ivtv-alsa.o |
11 | obj-$(CONFIG_VIDEO_FB_IVTV) += ivtvfb.o | 11 | obj-$(CONFIG_VIDEO_FB_IVTV) += ivtvfb.o |
12 | 12 | ||
13 | ccflags-y += -I$(srctree)/drivers/media/i2c | ||
14 | ccflags-y += -I$(srctree)/drivers/media/tuners | 13 | ccflags-y += -I$(srctree)/drivers/media/tuners |
15 | ccflags-y += -I$(srctree)/drivers/media/dvb-core | ||
16 | ccflags-y += -I$(srctree)/drivers/media/dvb-frontends | 14 | ccflags-y += -I$(srctree)/drivers/media/dvb-frontends |
17 | 15 | ||
diff --git a/drivers/media/pci/ivtv/ivtv-cards.c b/drivers/media/pci/ivtv/ivtv-cards.c index 410d97bdf541..c63792964a03 100644 --- a/drivers/media/pci/ivtv/ivtv-cards.c +++ b/drivers/media/pci/ivtv/ivtv-cards.c | |||
@@ -65,7 +65,7 @@ static struct ivtv_card_tuner_i2c ivtv_i2c_tda8290 = { | |||
65 | 65 | ||
66 | /********************** card configuration *******************************/ | 66 | /********************** card configuration *******************************/ |
67 | 67 | ||
68 | /* Please add new PCI IDs to: http://pci-ids.ucw.cz/ | 68 | /* Please add new PCI IDs to: http://pci-ids.ucw.cz/ |
69 | This keeps the PCI ID database up to date. Note that the entries | 69 | This keeps the PCI ID database up to date. Note that the entries |
70 | must be added under vendor 0x4444 (Conexant) as subsystem IDs. | 70 | must be added under vendor 0x4444 (Conexant) as subsystem IDs. |
71 | New vendor IDs should still be added to the vendor ID list. */ | 71 | New vendor IDs should still be added to the vendor ID list. */ |
diff --git a/drivers/media/pci/ivtv/ivtv-cards.h b/drivers/media/pci/ivtv/ivtv-cards.h index e6f5c02981f1..1557a6ea4dd9 100644 --- a/drivers/media/pci/ivtv/ivtv-cards.h +++ b/drivers/media/pci/ivtv/ivtv-cards.h | |||
@@ -22,26 +22,26 @@ | |||
22 | #define IVTV_CARDS_H | 22 | #define IVTV_CARDS_H |
23 | 23 | ||
24 | /* Supported cards */ | 24 | /* Supported cards */ |
25 | #define IVTV_CARD_PVR_250 0 /* WinTV PVR 250 */ | 25 | #define IVTV_CARD_PVR_250 0 /* WinTV PVR 250 */ |
26 | #define IVTV_CARD_PVR_350 1 /* encoder, decoder, tv-out */ | 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 | 27 | #define IVTV_CARD_PVR_150 2 /* WinTV PVR 150 and PVR 500 (really just two |
28 | PVR150s on one PCI board) */ | 28 | PVR150s on one PCI board) */ |
29 | #define IVTV_CARD_M179 3 /* AVerMedia M179 (encoder only) */ | 29 | #define IVTV_CARD_M179 3 /* AVerMedia M179 (encoder only) */ |
30 | #define IVTV_CARD_MPG600 4 /* Kuroutoshikou ITVC16-STVLP/YUAN MPG600, 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 | 31 | #define IVTV_CARD_MPG160 5 /* Kuroutoshikou ITVC15-STVLP/YUAN MPG160 |
32 | cx23415 based, but does not have tv-out */ | 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 */ | 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 */ | 34 | #define IVTV_CARD_AVC2410 7 /* Adaptec AVC-2410 */ |
35 | #define IVTV_CARD_AVC2010 8 /* Adaptec AVD-2010 (No Tuner) */ | 35 | #define IVTV_CARD_AVC2010 8 /* Adaptec AVD-2010 (No Tuner) */ |
36 | #define IVTV_CARD_TG5000TV 9 /* NAGASE TRANSGEAR 5000TV, encoder only */ | 36 | #define IVTV_CARD_TG5000TV 9 /* NAGASE TRANSGEAR 5000TV, encoder only */ |
37 | #define IVTV_CARD_VA2000MAX_SNT6 10 /* VA2000MAX-STN6 */ | 37 | #define IVTV_CARD_VA2000MAX_SNT6 10 /* VA2000MAX-STN6 */ |
38 | #define IVTV_CARD_CX23416GYC 11 /* Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */ | 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 */ | 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 */ | 40 | #define IVTV_CARD_GV_MVPRX2E 13 /* I/O Data GV-MVP/RX2E */ |
41 | #define IVTV_CARD_GOTVIEW_PCI_DVD 14 /* GotView PCI DVD */ | 41 | #define IVTV_CARD_GOTVIEW_PCI_DVD 14 /* GotView PCI DVD */ |
42 | #define IVTV_CARD_GOTVIEW_PCI_DVD2 15 /* GotView PCI DVD2 */ | 42 | #define IVTV_CARD_GOTVIEW_PCI_DVD2 15 /* GotView PCI DVD2 */ |
43 | #define IVTV_CARD_YUAN_MPC622 16 /* Yuan MPC622 miniPCI */ | 43 | #define IVTV_CARD_YUAN_MPC622 16 /* Yuan MPC622 miniPCI */ |
44 | #define IVTV_CARD_DCTMTVP1 17 /* DIGITAL COWBOY DCT-MTVP1 */ | 44 | #define IVTV_CARD_DCTMTVP1 17 /* DIGITAL COWBOY DCT-MTVP1 */ |
45 | #define IVTV_CARD_PG600V2 18 /* Yuan PG600V2/GotView PCI DVD Lite */ | 45 | #define IVTV_CARD_PG600V2 18 /* Yuan PG600V2/GotView PCI DVD Lite */ |
46 | #define IVTV_CARD_CLUB3D 19 /* Club3D ZAP-TV1x01 */ | 46 | #define IVTV_CARD_CLUB3D 19 /* Club3D ZAP-TV1x01 */ |
47 | #define IVTV_CARD_AVERTV_MCE116 20 /* AVerTV MCE 116 Plus */ | 47 | #define IVTV_CARD_AVERTV_MCE116 20 /* AVerTV MCE 116 Plus */ |
@@ -52,7 +52,7 @@ | |||
52 | #define IVTV_CARD_BUFFALO_MV5L 25 /* Buffalo PC-MV5L/PCI card */ | 52 | #define IVTV_CARD_BUFFALO_MV5L 25 /* Buffalo PC-MV5L/PCI card */ |
53 | #define IVTV_CARD_AVER_ULTRA1500MCE 26 /* AVerMedia UltraTV 1500 MCE */ | 53 | #define IVTV_CARD_AVER_ULTRA1500MCE 26 /* AVerMedia UltraTV 1500 MCE */ |
54 | #define IVTV_CARD_KIKYOU 27 /* Sony VAIO Giga Pocket (ENX Kikyou) */ | 54 | #define IVTV_CARD_KIKYOU 27 /* Sony VAIO Giga Pocket (ENX Kikyou) */ |
55 | #define IVTV_CARD_LAST 27 | 55 | #define IVTV_CARD_LAST 27 |
56 | 56 | ||
57 | /* Variants of existing cards but with the same PCI IDs. The driver | 57 | /* Variants of existing cards but with the same PCI IDs. The driver |
58 | detects these based on other device information. | 58 | detects these based on other device information. |
@@ -61,7 +61,7 @@ | |||
61 | must be adjusted accordingly. */ | 61 | must be adjusted accordingly. */ |
62 | 62 | ||
63 | /* PVR-350 V1 (uses saa7114) */ | 63 | /* PVR-350 V1 (uses saa7114) */ |
64 | #define IVTV_CARD_PVR_350_V1 (IVTV_CARD_LAST+1) | 64 | #define IVTV_CARD_PVR_350_V1 (IVTV_CARD_LAST+1) |
65 | /* 2 variants of Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */ | 65 | /* 2 variants of Kuroutoshikou CX23416GYC-STVLP (Yuan MPG600GR OEM) */ |
66 | #define IVTV_CARD_CX23416GYC_NOGR (IVTV_CARD_LAST+2) | 66 | #define IVTV_CARD_CX23416GYC_NOGR (IVTV_CARD_LAST+2) |
67 | #define IVTV_CARD_CX23416GYC_NOGRYCS (IVTV_CARD_LAST+3) | 67 | #define IVTV_CARD_CX23416GYC_NOGRYCS (IVTV_CARD_LAST+3) |
@@ -72,22 +72,22 @@ | |||
72 | #define PCI_DEVICE_ID_IVTV16 0x0016 | 72 | #define PCI_DEVICE_ID_IVTV16 0x0016 |
73 | 73 | ||
74 | /* subsystem vendor ID */ | 74 | /* subsystem vendor ID */ |
75 | #define IVTV_PCI_ID_HAUPPAUGE 0x0070 | 75 | #define IVTV_PCI_ID_HAUPPAUGE 0x0070 |
76 | #define IVTV_PCI_ID_HAUPPAUGE_ALT1 0x0270 | 76 | #define IVTV_PCI_ID_HAUPPAUGE_ALT1 0x0270 |
77 | #define IVTV_PCI_ID_HAUPPAUGE_ALT2 0x4070 | 77 | #define IVTV_PCI_ID_HAUPPAUGE_ALT2 0x4070 |
78 | #define IVTV_PCI_ID_ADAPTEC 0x9005 | 78 | #define IVTV_PCI_ID_ADAPTEC 0x9005 |
79 | #define IVTV_PCI_ID_ASUSTEK 0x1043 | 79 | #define IVTV_PCI_ID_ASUSTEK 0x1043 |
80 | #define IVTV_PCI_ID_AVERMEDIA 0x1461 | 80 | #define IVTV_PCI_ID_AVERMEDIA 0x1461 |
81 | #define IVTV_PCI_ID_YUAN1 0x12ab | 81 | #define IVTV_PCI_ID_YUAN1 0x12ab |
82 | #define IVTV_PCI_ID_YUAN2 0xff01 | 82 | #define IVTV_PCI_ID_YUAN2 0xff01 |
83 | #define IVTV_PCI_ID_YUAN3 0xffab | 83 | #define IVTV_PCI_ID_YUAN3 0xffab |
84 | #define IVTV_PCI_ID_YUAN4 0xfbab | 84 | #define IVTV_PCI_ID_YUAN4 0xfbab |
85 | #define IVTV_PCI_ID_DIAMONDMM 0xff92 | 85 | #define IVTV_PCI_ID_DIAMONDMM 0xff92 |
86 | #define IVTV_PCI_ID_IODATA 0x10fc | 86 | #define IVTV_PCI_ID_IODATA 0x10fc |
87 | #define IVTV_PCI_ID_MELCO 0x1154 | 87 | #define IVTV_PCI_ID_MELCO 0x1154 |
88 | #define IVTV_PCI_ID_GOTVIEW1 0xffac | 88 | #define IVTV_PCI_ID_GOTVIEW1 0xffac |
89 | #define IVTV_PCI_ID_GOTVIEW2 0xffad | 89 | #define IVTV_PCI_ID_GOTVIEW2 0xffad |
90 | #define IVTV_PCI_ID_SONY 0x104d | 90 | #define IVTV_PCI_ID_SONY 0x104d |
91 | 91 | ||
92 | /* hardware flags, no gaps allowed */ | 92 | /* hardware flags, no gaps allowed */ |
93 | #define IVTV_HW_CX25840 (1 << 0) | 93 | #define IVTV_HW_CX25840 (1 << 0) |
@@ -109,41 +109,33 @@ | |||
109 | #define IVTV_HW_I2C_IR_RX_AVER (1 << 16) | 109 | #define IVTV_HW_I2C_IR_RX_AVER (1 << 16) |
110 | #define IVTV_HW_I2C_IR_RX_HAUP_EXT (1 << 17) /* External before internal */ | 110 | #define IVTV_HW_I2C_IR_RX_HAUP_EXT (1 << 17) /* External before internal */ |
111 | #define IVTV_HW_I2C_IR_RX_HAUP_INT (1 << 18) | 111 | #define IVTV_HW_I2C_IR_RX_HAUP_INT (1 << 18) |
112 | #define IVTV_HW_Z8F0811_IR_TX_HAUP (1 << 19) | 112 | #define IVTV_HW_Z8F0811_IR_HAUP (1 << 19) |
113 | #define IVTV_HW_Z8F0811_IR_RX_HAUP (1 << 20) | 113 | #define IVTV_HW_I2C_IR_RX_ADAPTEC (1 << 20) |
114 | #define IVTV_HW_I2C_IR_RX_ADAPTEC (1 << 21) | ||
115 | |||
116 | #define IVTV_HW_Z8F0811_IR_HAUP (IVTV_HW_Z8F0811_IR_RX_HAUP | \ | ||
117 | IVTV_HW_Z8F0811_IR_TX_HAUP) | ||
118 | 114 | ||
119 | #define IVTV_HW_SAA711X (IVTV_HW_SAA7115 | IVTV_HW_SAA7114) | 115 | #define IVTV_HW_SAA711X (IVTV_HW_SAA7115 | IVTV_HW_SAA7114) |
120 | 116 | ||
121 | #define IVTV_HW_IR_RX_ANY (IVTV_HW_I2C_IR_RX_AVER | \ | 117 | #define IVTV_HW_IR_ANY (IVTV_HW_I2C_IR_RX_AVER | \ |
122 | IVTV_HW_I2C_IR_RX_HAUP_EXT | \ | 118 | IVTV_HW_I2C_IR_RX_HAUP_EXT | \ |
123 | IVTV_HW_I2C_IR_RX_HAUP_INT | \ | 119 | IVTV_HW_I2C_IR_RX_HAUP_INT | \ |
124 | IVTV_HW_Z8F0811_IR_RX_HAUP | \ | 120 | IVTV_HW_Z8F0811_IR_HAUP | \ |
125 | IVTV_HW_I2C_IR_RX_ADAPTEC) | 121 | IVTV_HW_I2C_IR_RX_ADAPTEC) |
126 | |||
127 | #define IVTV_HW_IR_TX_ANY (IVTV_HW_Z8F0811_IR_TX_HAUP) | ||
128 | |||
129 | #define IVTV_HW_IR_ANY (IVTV_HW_IR_RX_ANY | IVTV_HW_IR_TX_ANY) | ||
130 | 122 | ||
131 | /* video inputs */ | 123 | /* video inputs */ |
132 | #define IVTV_CARD_INPUT_VID_TUNER 1 | 124 | #define IVTV_CARD_INPUT_VID_TUNER 1 |
133 | #define IVTV_CARD_INPUT_SVIDEO1 2 | 125 | #define IVTV_CARD_INPUT_SVIDEO1 2 |
134 | #define IVTV_CARD_INPUT_SVIDEO2 3 | 126 | #define IVTV_CARD_INPUT_SVIDEO2 3 |
135 | #define IVTV_CARD_INPUT_COMPOSITE1 4 | 127 | #define IVTV_CARD_INPUT_COMPOSITE1 4 |
136 | #define IVTV_CARD_INPUT_COMPOSITE2 5 | 128 | #define IVTV_CARD_INPUT_COMPOSITE2 5 |
137 | #define IVTV_CARD_INPUT_COMPOSITE3 6 | 129 | #define IVTV_CARD_INPUT_COMPOSITE3 6 |
138 | 130 | ||
139 | /* audio inputs */ | 131 | /* audio inputs */ |
140 | #define IVTV_CARD_INPUT_AUD_TUNER 1 | 132 | #define IVTV_CARD_INPUT_AUD_TUNER 1 |
141 | #define IVTV_CARD_INPUT_LINE_IN1 2 | 133 | #define IVTV_CARD_INPUT_LINE_IN1 2 |
142 | #define IVTV_CARD_INPUT_LINE_IN2 3 | 134 | #define IVTV_CARD_INPUT_LINE_IN2 3 |
143 | 135 | ||
144 | #define IVTV_CARD_MAX_VIDEO_INPUTS 6 | 136 | #define IVTV_CARD_MAX_VIDEO_INPUTS 6 |
145 | #define IVTV_CARD_MAX_AUDIO_INPUTS 3 | 137 | #define IVTV_CARD_MAX_AUDIO_INPUTS 3 |
146 | #define IVTV_CARD_MAX_TUNERS 3 | 138 | #define IVTV_CARD_MAX_TUNERS 3 |
147 | 139 | ||
148 | /* SAA71XX HW inputs */ | 140 | /* SAA71XX HW inputs */ |
149 | #define IVTV_SAA71XX_COMPOSITE0 0 | 141 | #define IVTV_SAA71XX_COMPOSITE0 0 |
@@ -180,7 +172,7 @@ | |||
180 | V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_OVERLAY) | 172 | V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_OVERLAY) |
181 | 173 | ||
182 | struct ivtv_card_video_input { | 174 | struct ivtv_card_video_input { |
183 | u8 video_type; /* video input type */ | 175 | u8 video_type; /* video input type */ |
184 | u8 audio_index; /* index in ivtv_card_audio_input array */ | 176 | u8 audio_index; /* index in ivtv_card_audio_input array */ |
185 | u16 video_input; /* hardware video input */ | 177 | u16 video_input; /* hardware video input */ |
186 | }; | 178 | }; |
@@ -207,55 +199,55 @@ struct ivtv_card_pci_info { | |||
207 | 199 | ||
208 | /* The mask is the set of bits used by the operation */ | 200 | /* The mask is the set of bits used by the operation */ |
209 | 201 | ||
210 | struct ivtv_gpio_init { /* set initial GPIO DIR and OUT values */ | 202 | struct ivtv_gpio_init { /* set initial GPIO DIR and OUT values */ |
211 | u16 direction; /* DIR setting. Leave to 0 if no init is needed */ | 203 | u16 direction; /* DIR setting. Leave to 0 if no init is needed */ |
212 | u16 initial_value; | 204 | u16 initial_value; |
213 | }; | 205 | }; |
214 | 206 | ||
215 | struct ivtv_gpio_video_input { /* select tuner/line in input */ | 207 | struct ivtv_gpio_video_input { /* select tuner/line in input */ |
216 | u16 mask; /* leave to 0 if not supported */ | 208 | u16 mask; /* leave to 0 if not supported */ |
217 | u16 tuner; | 209 | u16 tuner; |
218 | u16 composite; | 210 | u16 composite; |
219 | u16 svideo; | 211 | u16 svideo; |
220 | }; | 212 | }; |
221 | 213 | ||
222 | struct ivtv_gpio_audio_input { /* select tuner/line in input */ | 214 | struct ivtv_gpio_audio_input { /* select tuner/line in input */ |
223 | u16 mask; /* leave to 0 if not supported */ | 215 | u16 mask; /* leave to 0 if not supported */ |
224 | u16 tuner; | 216 | u16 tuner; |
225 | u16 linein; | 217 | u16 linein; |
226 | u16 radio; | 218 | u16 radio; |
227 | }; | 219 | }; |
228 | 220 | ||
229 | struct ivtv_gpio_audio_mute { | 221 | struct ivtv_gpio_audio_mute { |
230 | u16 mask; /* leave to 0 if not supported */ | 222 | u16 mask; /* leave to 0 if not supported */ |
231 | u16 mute; /* set this value to mute, 0 to unmute */ | 223 | u16 mute; /* set this value to mute, 0 to unmute */ |
232 | }; | 224 | }; |
233 | 225 | ||
234 | struct ivtv_gpio_audio_mode { | 226 | struct ivtv_gpio_audio_mode { |
235 | u16 mask; /* leave to 0 if not supported */ | 227 | u16 mask; /* leave to 0 if not supported */ |
236 | u16 mono; /* set audio to mono */ | 228 | u16 mono; /* set audio to mono */ |
237 | u16 stereo; /* set audio to stereo */ | 229 | u16 stereo; /* set audio to stereo */ |
238 | u16 lang1; /* set audio to the first language */ | 230 | u16 lang1; /* set audio to the first language */ |
239 | u16 lang2; /* set audio to the second language */ | 231 | u16 lang2; /* set audio to the second language */ |
240 | u16 both; /* both languages are output */ | 232 | u16 both; /* both languages are output */ |
241 | }; | 233 | }; |
242 | 234 | ||
243 | struct ivtv_gpio_audio_freq { | 235 | struct ivtv_gpio_audio_freq { |
244 | u16 mask; /* leave to 0 if not supported */ | 236 | u16 mask; /* leave to 0 if not supported */ |
245 | u16 f32000; | 237 | u16 f32000; |
246 | u16 f44100; | 238 | u16 f44100; |
247 | u16 f48000; | 239 | u16 f48000; |
248 | }; | 240 | }; |
249 | 241 | ||
250 | struct ivtv_gpio_audio_detect { | 242 | struct ivtv_gpio_audio_detect { |
251 | u16 mask; /* leave to 0 if not supported */ | 243 | u16 mask; /* leave to 0 if not supported */ |
252 | u16 stereo; /* if the input matches this value then | 244 | u16 stereo; /* if the input matches this value then |
253 | stereo is detected */ | 245 | stereo is detected */ |
254 | }; | 246 | }; |
255 | 247 | ||
256 | struct ivtv_card_tuner { | 248 | struct ivtv_card_tuner { |
257 | v4l2_std_id std; /* standard for which the tuner is suitable */ | 249 | v4l2_std_id std; /* standard for which the tuner is suitable */ |
258 | int tuner; /* tuner ID (from tuner.h) */ | 250 | int tuner; /* tuner ID (from tuner.h) */ |
259 | }; | 251 | }; |
260 | 252 | ||
261 | struct ivtv_card_tuner_i2c { | 253 | struct ivtv_card_tuner_i2c { |
@@ -280,17 +272,17 @@ struct ivtv_card { | |||
280 | struct ivtv_card_audio_input radio_input; | 272 | struct ivtv_card_audio_input radio_input; |
281 | int nof_outputs; | 273 | int nof_outputs; |
282 | const struct ivtv_card_output *video_outputs; | 274 | const struct ivtv_card_output *video_outputs; |
283 | u8 gr_config; /* config byte for the ghost reduction device */ | 275 | u8 gr_config; /* config byte for the ghost reduction device */ |
284 | u8 xceive_pin; /* XCeive tuner GPIO reset pin */ | 276 | u8 xceive_pin; /* XCeive tuner GPIO reset pin */ |
285 | 277 | ||
286 | /* GPIO card-specific settings */ | 278 | /* GPIO card-specific settings */ |
287 | struct ivtv_gpio_init gpio_init; | 279 | struct ivtv_gpio_init gpio_init; |
288 | struct ivtv_gpio_video_input gpio_video_input; | 280 | struct ivtv_gpio_video_input gpio_video_input; |
289 | struct ivtv_gpio_audio_input gpio_audio_input; | 281 | struct ivtv_gpio_audio_input gpio_audio_input; |
290 | struct ivtv_gpio_audio_mute gpio_audio_mute; | 282 | struct ivtv_gpio_audio_mute gpio_audio_mute; |
291 | struct ivtv_gpio_audio_mode gpio_audio_mode; | 283 | struct ivtv_gpio_audio_mode gpio_audio_mode; |
292 | struct ivtv_gpio_audio_freq gpio_audio_freq; | 284 | struct ivtv_gpio_audio_freq gpio_audio_freq; |
293 | struct ivtv_gpio_audio_detect gpio_audio_detect; | 285 | struct ivtv_gpio_audio_detect gpio_audio_detect; |
294 | 286 | ||
295 | struct ivtv_card_tuner tuners[IVTV_CARD_MAX_TUNERS]; | 287 | struct ivtv_card_tuner tuners[IVTV_CARD_MAX_TUNERS]; |
296 | struct ivtv_card_tuner_i2c *i2c; | 288 | struct ivtv_card_tuner_i2c *i2c; |
diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h index d27c5c2c07ea..cafba6b1055d 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.h +++ b/drivers/media/pci/ivtv/ivtv-driver.h | |||
@@ -76,7 +76,7 @@ | |||
76 | #define IVTV_ENCODER_SIZE 0x00800000 /* Total size is 0x01000000, but only first half is used */ | 76 | #define IVTV_ENCODER_SIZE 0x00800000 /* Total size is 0x01000000, but only first half is used */ |
77 | #define IVTV_DECODER_OFFSET 0x01000000 | 77 | #define IVTV_DECODER_OFFSET 0x01000000 |
78 | #define IVTV_DECODER_SIZE 0x00800000 /* Total size is 0x01000000, but only first half is used */ | 78 | #define IVTV_DECODER_SIZE 0x00800000 /* Total size is 0x01000000, but only first half is used */ |
79 | #define IVTV_REG_OFFSET 0x02000000 | 79 | #define IVTV_REG_OFFSET 0x02000000 |
80 | #define IVTV_REG_SIZE 0x00010000 | 80 | #define IVTV_REG_SIZE 0x00010000 |
81 | 81 | ||
82 | /* Maximum ivtv driver instances. Some people have a huge number of | 82 | /* Maximum ivtv driver instances. Some people have a huge number of |
@@ -97,26 +97,26 @@ | |||
97 | #define IVTV_DMA_SG_OSD_ENT (2883584/PAGE_SIZE) /* sg entities */ | 97 | #define IVTV_DMA_SG_OSD_ENT (2883584/PAGE_SIZE) /* sg entities */ |
98 | 98 | ||
99 | /* DMA Registers */ | 99 | /* DMA Registers */ |
100 | #define IVTV_REG_DMAXFER (0x0000) | 100 | #define IVTV_REG_DMAXFER (0x0000) |
101 | #define IVTV_REG_DMASTATUS (0x0004) | 101 | #define IVTV_REG_DMASTATUS (0x0004) |
102 | #define IVTV_REG_DECDMAADDR (0x0008) | 102 | #define IVTV_REG_DECDMAADDR (0x0008) |
103 | #define IVTV_REG_ENCDMAADDR (0x000c) | 103 | #define IVTV_REG_ENCDMAADDR (0x000c) |
104 | #define IVTV_REG_DMACONTROL (0x0010) | 104 | #define IVTV_REG_DMACONTROL (0x0010) |
105 | #define IVTV_REG_IRQSTATUS (0x0040) | 105 | #define IVTV_REG_IRQSTATUS (0x0040) |
106 | #define IVTV_REG_IRQMASK (0x0048) | 106 | #define IVTV_REG_IRQMASK (0x0048) |
107 | 107 | ||
108 | /* Setup Registers */ | 108 | /* Setup Registers */ |
109 | #define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8) | 109 | #define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8) |
110 | #define IVTV_REG_ENC_SDRAM_PRECHARGE (0x07FC) | 110 | #define IVTV_REG_ENC_SDRAM_PRECHARGE (0x07FC) |
111 | #define IVTV_REG_DEC_SDRAM_REFRESH (0x08F8) | 111 | #define IVTV_REG_DEC_SDRAM_REFRESH (0x08F8) |
112 | #define IVTV_REG_DEC_SDRAM_PRECHARGE (0x08FC) | 112 | #define IVTV_REG_DEC_SDRAM_PRECHARGE (0x08FC) |
113 | #define IVTV_REG_VDM (0x2800) | 113 | #define IVTV_REG_VDM (0x2800) |
114 | #define IVTV_REG_AO (0x2D00) | 114 | #define IVTV_REG_AO (0x2D00) |
115 | #define IVTV_REG_BYTEFLUSH (0x2D24) | 115 | #define IVTV_REG_BYTEFLUSH (0x2D24) |
116 | #define IVTV_REG_SPU (0x9050) | 116 | #define IVTV_REG_SPU (0x9050) |
117 | #define IVTV_REG_HW_BLOCKS (0x9054) | 117 | #define IVTV_REG_HW_BLOCKS (0x9054) |
118 | #define IVTV_REG_VPU (0x9058) | 118 | #define IVTV_REG_VPU (0x9058) |
119 | #define IVTV_REG_APU (0xA064) | 119 | #define IVTV_REG_APU (0xA064) |
120 | 120 | ||
121 | /* Other registers */ | 121 | /* Other registers */ |
122 | #define IVTV_REG_DEC_LINE_FIELD (0x28C0) | 122 | #define IVTV_REG_DEC_LINE_FIELD (0x28C0) |
@@ -158,7 +158,7 @@ extern int ivtv_fw_debug; | |||
158 | 158 | ||
159 | #define IVTV_DEBUG_HIGH_VOL(x, type, fmt, args...) \ | 159 | #define IVTV_DEBUG_HIGH_VOL(x, type, fmt, args...) \ |
160 | do { \ | 160 | do { \ |
161 | if (((x) & ivtv_debug) && (ivtv_debug & IVTV_DBGFLG_HIGHVOL)) \ | 161 | if (((x) & ivtv_debug) && (ivtv_debug & IVTV_DBGFLG_HIGHVOL)) \ |
162 | v4l2_info(&itv->v4l2_dev, " " type ": " fmt , ##args); \ | 162 | v4l2_info(&itv->v4l2_dev, " " type ": " fmt , ##args); \ |
163 | } while (0) | 163 | } while (0) |
164 | #define IVTV_DEBUG_HI_WARN(fmt, args...) IVTV_DEBUG_HIGH_VOL(IVTV_DBGFLG_WARN, "warn", fmt , ## args) | 164 | #define IVTV_DEBUG_HI_WARN(fmt, args...) IVTV_DEBUG_HIGH_VOL(IVTV_DBGFLG_WARN, "warn", fmt , ## args) |
@@ -226,9 +226,9 @@ struct ivtv_mailbox_data { | |||
226 | /* per-stream, s_flags */ | 226 | /* per-stream, s_flags */ |
227 | #define IVTV_F_S_DMA_PENDING 0 /* this stream has pending DMA */ | 227 | #define IVTV_F_S_DMA_PENDING 0 /* this stream has pending DMA */ |
228 | #define IVTV_F_S_DMA_HAS_VBI 1 /* the current DMA request also requests VBI data */ | 228 | #define IVTV_F_S_DMA_HAS_VBI 1 /* the current DMA request also requests VBI data */ |
229 | #define IVTV_F_S_NEEDS_DATA 2 /* this decoding stream needs more data */ | 229 | #define IVTV_F_S_NEEDS_DATA 2 /* this decoding stream needs more data */ |
230 | 230 | ||
231 | #define IVTV_F_S_CLAIMED 3 /* this stream is claimed */ | 231 | #define IVTV_F_S_CLAIMED 3 /* this stream is claimed */ |
232 | #define IVTV_F_S_STREAMING 4 /* the fw is decoding/encoding this stream */ | 232 | #define IVTV_F_S_STREAMING 4 /* the fw is decoding/encoding this stream */ |
233 | #define IVTV_F_S_INTERNAL_USE 5 /* this stream is used internally (sliced VBI processing) */ | 233 | #define IVTV_F_S_INTERNAL_USE 5 /* this stream is used internally (sliced VBI processing) */ |
234 | #define IVTV_F_S_PASSTHROUGH 6 /* this stream is in passthrough mode */ | 234 | #define IVTV_F_S_PASSTHROUGH 6 /* this stream is in passthrough mode */ |
@@ -239,35 +239,35 @@ struct ivtv_mailbox_data { | |||
239 | #define IVTV_F_S_PIO_HAS_VBI 1 /* the current PIO request also requests VBI data */ | 239 | #define IVTV_F_S_PIO_HAS_VBI 1 /* the current PIO request also requests VBI data */ |
240 | 240 | ||
241 | /* per-ivtv, i_flags */ | 241 | /* per-ivtv, i_flags */ |
242 | #define IVTV_F_I_DMA 0 /* DMA in progress */ | 242 | #define IVTV_F_I_DMA 0 /* DMA in progress */ |
243 | #define IVTV_F_I_UDMA 1 /* UDMA in progress */ | 243 | #define IVTV_F_I_UDMA 1 /* UDMA in progress */ |
244 | #define IVTV_F_I_UDMA_PENDING 2 /* UDMA pending */ | 244 | #define IVTV_F_I_UDMA_PENDING 2 /* UDMA pending */ |
245 | #define IVTV_F_I_SPEED_CHANGE 3 /* a speed change is in progress */ | 245 | #define IVTV_F_I_SPEED_CHANGE 3 /* a speed change is in progress */ |
246 | #define IVTV_F_I_EOS 4 /* end of encoder stream reached */ | 246 | #define IVTV_F_I_EOS 4 /* end of encoder stream reached */ |
247 | #define IVTV_F_I_RADIO_USER 5 /* the radio tuner is selected */ | 247 | #define IVTV_F_I_RADIO_USER 5 /* the radio tuner is selected */ |
248 | #define IVTV_F_I_DIG_RST 6 /* reset digitizer */ | 248 | #define IVTV_F_I_DIG_RST 6 /* reset digitizer */ |
249 | #define IVTV_F_I_DEC_YUV 7 /* YUV instead of MPG is being decoded */ | 249 | #define IVTV_F_I_DEC_YUV 7 /* YUV instead of MPG is being decoded */ |
250 | #define IVTV_F_I_UPDATE_CC 9 /* CC should be updated */ | 250 | #define IVTV_F_I_UPDATE_CC 9 /* CC should be updated */ |
251 | #define IVTV_F_I_UPDATE_WSS 10 /* WSS should be updated */ | 251 | #define IVTV_F_I_UPDATE_WSS 10 /* WSS should be updated */ |
252 | #define IVTV_F_I_UPDATE_VPS 11 /* VPS should be updated */ | 252 | #define IVTV_F_I_UPDATE_VPS 11 /* VPS should be updated */ |
253 | #define IVTV_F_I_DECODING_YUV 12 /* this stream is YUV frame decoding */ | 253 | #define IVTV_F_I_DECODING_YUV 12 /* this stream is YUV frame decoding */ |
254 | #define IVTV_F_I_ENC_PAUSED 13 /* the encoder is paused */ | 254 | #define IVTV_F_I_ENC_PAUSED 13 /* the encoder is paused */ |
255 | #define IVTV_F_I_VALID_DEC_TIMINGS 14 /* last_dec_timing is valid */ | 255 | #define IVTV_F_I_VALID_DEC_TIMINGS 14 /* last_dec_timing is valid */ |
256 | #define IVTV_F_I_HAVE_WORK 15 /* used in the interrupt handler: there is work to be done */ | 256 | #define IVTV_F_I_HAVE_WORK 15 /* used in the interrupt handler: there is work to be done */ |
257 | #define IVTV_F_I_WORK_HANDLER_VBI 16 /* there is work to be done for VBI */ | 257 | #define IVTV_F_I_WORK_HANDLER_VBI 16 /* there is work to be done for VBI */ |
258 | #define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */ | 258 | #define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */ |
259 | #define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */ | 259 | #define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */ |
260 | #define IVTV_F_I_PIO 19 /* PIO in progress */ | 260 | #define IVTV_F_I_PIO 19 /* PIO in progress */ |
261 | #define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */ | 261 | #define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */ |
262 | #define IVTV_F_I_INITED 21 /* set after first open */ | 262 | #define IVTV_F_I_INITED 21 /* set after first open */ |
263 | #define IVTV_F_I_FAILED 22 /* set if first open failed */ | 263 | #define IVTV_F_I_FAILED 22 /* set if first open failed */ |
264 | #define IVTV_F_I_WORK_HANDLER_PCM 23 /* there is work to be done for PCM */ | 264 | #define IVTV_F_I_WORK_HANDLER_PCM 23 /* there is work to be done for PCM */ |
265 | 265 | ||
266 | /* Event notifications */ | 266 | /* Event notifications */ |
267 | #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ | 267 | #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ |
268 | #define IVTV_F_I_EV_VSYNC 29 /* VSYNC event */ | 268 | #define IVTV_F_I_EV_VSYNC 29 /* VSYNC event */ |
269 | #define IVTV_F_I_EV_VSYNC_FIELD 30 /* VSYNC event field (0 = first, 1 = second field) */ | 269 | #define IVTV_F_I_EV_VSYNC_FIELD 30 /* VSYNC event field (0 = first, 1 = second field) */ |
270 | #define IVTV_F_I_EV_VSYNC_ENABLED 31 /* VSYNC event enabled */ | 270 | #define IVTV_F_I_EV_VSYNC_ENABLED 31 /* VSYNC event enabled */ |
271 | 271 | ||
272 | /* Scatter-Gather array element, used in DMA transfers */ | 272 | /* Scatter-Gather array element, used in DMA transfers */ |
273 | struct ivtv_sg_element { | 273 | struct ivtv_sg_element { |
@@ -330,13 +330,13 @@ struct ivtv_stream { | |||
330 | /* These first four fields are always set, even if the stream | 330 | /* These first four fields are always set, even if the stream |
331 | is not actually created. */ | 331 | is not actually created. */ |
332 | struct video_device vdev; /* vdev.v4l2_dev is NULL if there is no device */ | 332 | struct video_device vdev; /* vdev.v4l2_dev is NULL if there is no device */ |
333 | struct ivtv *itv; /* for ease of use */ | 333 | struct ivtv *itv; /* for ease of use */ |
334 | const char *name; /* name of the stream */ | 334 | const char *name; /* name of the stream */ |
335 | int type; /* stream type */ | 335 | int type; /* stream type */ |
336 | u32 caps; /* V4L2 capabilities */ | 336 | u32 caps; /* V4L2 capabilities */ |
337 | 337 | ||
338 | struct v4l2_fh *fh; /* pointer to the streaming filehandle */ | 338 | struct v4l2_fh *fh; /* pointer to the streaming filehandle */ |
339 | spinlock_t qlock; /* locks access to the queues */ | 339 | spinlock_t qlock; /* locks access to the queues */ |
340 | unsigned long s_flags; /* status flags, see above */ | 340 | unsigned long s_flags; /* status flags, see above */ |
341 | int dma; /* can be PCI_DMA_TODEVICE, PCI_DMA_FROMDEVICE or PCI_DMA_NONE */ | 341 | int dma; /* can be PCI_DMA_TODEVICE, PCI_DMA_FROMDEVICE or PCI_DMA_NONE */ |
342 | u32 pending_offset; | 342 | u32 pending_offset; |
@@ -564,7 +564,7 @@ struct vbi_info { | |||
564 | 564 | ||
565 | /* Raw VBI compatibility hack */ | 565 | /* Raw VBI compatibility hack */ |
566 | 566 | ||
567 | u32 frame; /* frame counter hack needed for backwards compatibility | 567 | u32 frame; /* frame counter hack needed for backwards compatibility |
568 | of old VBI software */ | 568 | of old VBI software */ |
569 | 569 | ||
570 | /* Sliced VBI output data */ | 570 | /* Sliced VBI output data */ |
@@ -620,7 +620,7 @@ struct ivtv { | |||
620 | u8 nof_inputs; /* number of video inputs */ | 620 | u8 nof_inputs; /* number of video inputs */ |
621 | u8 nof_audio_inputs; /* number of audio inputs */ | 621 | u8 nof_audio_inputs; /* number of audio inputs */ |
622 | u32 v4l2_cap; /* V4L2 capabilities of card */ | 622 | u32 v4l2_cap; /* V4L2 capabilities of card */ |
623 | u32 hw_flags; /* hardware description of the board */ | 623 | u32 hw_flags; /* hardware description of the board */ |
624 | v4l2_std_id tuner_std; /* the norm of the card's tuner (fixed) */ | 624 | v4l2_std_id tuner_std; /* the norm of the card's tuner (fixed) */ |
625 | struct v4l2_subdev *sd_video; /* controlling video decoder subdev */ | 625 | struct v4l2_subdev *sd_video; /* controlling video decoder subdev */ |
626 | struct v4l2_subdev *sd_audio; /* controlling audio subdev */ | 626 | struct v4l2_subdev *sd_audio; /* controlling audio subdev */ |
@@ -629,7 +629,7 @@ struct ivtv { | |||
629 | volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */ | 629 | volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */ |
630 | volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */ | 630 | volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */ |
631 | volatile void __iomem *reg_mem; /* pointer to mapped registers */ | 631 | volatile void __iomem *reg_mem; /* pointer to mapped registers */ |
632 | struct ivtv_options options; /* user options */ | 632 | struct ivtv_options options; /* user options */ |
633 | 633 | ||
634 | struct v4l2_device v4l2_dev; | 634 | struct v4l2_device v4l2_dev; |
635 | struct cx2341x_handler cxhdl; | 635 | struct cx2341x_handler cxhdl; |
@@ -668,7 +668,7 @@ struct ivtv { | |||
668 | 668 | ||
669 | /* Streams */ | 669 | /* Streams */ |
670 | int stream_buf_size[IVTV_MAX_STREAMS]; /* stream buffer size */ | 670 | int stream_buf_size[IVTV_MAX_STREAMS]; /* stream buffer size */ |
671 | struct ivtv_stream streams[IVTV_MAX_STREAMS]; /* stream data */ | 671 | struct ivtv_stream streams[IVTV_MAX_STREAMS]; /* stream data */ |
672 | atomic_t capturing; /* count number of active capture streams */ | 672 | atomic_t capturing; /* count number of active capture streams */ |
673 | atomic_t decoding; /* count number of active decoding streams */ | 673 | atomic_t decoding; /* count number of active decoding streams */ |
674 | 674 | ||
@@ -704,7 +704,7 @@ struct ivtv { | |||
704 | /* Mailbox */ | 704 | /* Mailbox */ |
705 | struct ivtv_mailbox_data enc_mbox; /* encoder mailboxes */ | 705 | struct ivtv_mailbox_data enc_mbox; /* encoder mailboxes */ |
706 | struct ivtv_mailbox_data dec_mbox; /* decoder mailboxes */ | 706 | struct ivtv_mailbox_data dec_mbox; /* decoder mailboxes */ |
707 | struct ivtv_api_cache api_cache[256]; /* cached API commands */ | 707 | struct ivtv_api_cache api_cache[256]; /* cached API commands */ |
708 | 708 | ||
709 | 709 | ||
710 | /* I2C */ | 710 | /* I2C */ |
@@ -828,7 +828,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv) | |||
828 | 828 | ||
829 | /* Call the specified callback for all subdevs matching hw (if 0, then | 829 | /* Call the specified callback for all subdevs matching hw (if 0, then |
830 | match them all). Ignore any errors. */ | 830 | match them all). Ignore any errors. */ |
831 | #define ivtv_call_hw(itv, hw, o, f, args...) \ | 831 | #define ivtv_call_hw(itv, hw, o, f, args...) \ |
832 | v4l2_device_mask_call_all(&(itv)->v4l2_dev, hw, o, f, ##args) | 832 | v4l2_device_mask_call_all(&(itv)->v4l2_dev, hw, o, f, ##args) |
833 | 833 | ||
834 | #define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args) | 834 | #define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args) |
diff --git a/drivers/media/pci/ivtv/ivtv-firmware.c b/drivers/media/pci/ivtv/ivtv-firmware.c index ba279fdb3df8..9f05472fca20 100644 --- a/drivers/media/pci/ivtv/ivtv-firmware.c +++ b/drivers/media/pci/ivtv/ivtv-firmware.c | |||
@@ -28,26 +28,26 @@ | |||
28 | #include <linux/firmware.h> | 28 | #include <linux/firmware.h> |
29 | #include <media/i2c/saa7127.h> | 29 | #include <media/i2c/saa7127.h> |
30 | 30 | ||
31 | #define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE | 31 | #define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE |
32 | #define IVTV_MASK_VPU_ENABLE15 0xFFFFFFF6 | 32 | #define IVTV_MASK_VPU_ENABLE15 0xFFFFFFF6 |
33 | #define IVTV_MASK_VPU_ENABLE16 0xFFFFFFFB | 33 | #define IVTV_MASK_VPU_ENABLE16 0xFFFFFFFB |
34 | #define IVTV_CMD_VDM_STOP 0x00000000 | 34 | #define IVTV_CMD_VDM_STOP 0x00000000 |
35 | #define IVTV_CMD_AO_STOP 0x00000005 | 35 | #define IVTV_CMD_AO_STOP 0x00000005 |
36 | #define IVTV_CMD_APU_PING 0x00000000 | 36 | #define IVTV_CMD_APU_PING 0x00000000 |
37 | #define IVTV_CMD_VPU_STOP15 0xFFFFFFFE | 37 | #define IVTV_CMD_VPU_STOP15 0xFFFFFFFE |
38 | #define IVTV_CMD_VPU_STOP16 0xFFFFFFEE | 38 | #define IVTV_CMD_VPU_STOP16 0xFFFFFFEE |
39 | #define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF | 39 | #define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF |
40 | #define IVTV_CMD_SPU_STOP 0x00000001 | 40 | #define IVTV_CMD_SPU_STOP 0x00000001 |
41 | #define IVTV_CMD_SDRAM_PRECHARGE_INIT 0x0000001A | 41 | #define IVTV_CMD_SDRAM_PRECHARGE_INIT 0x0000001A |
42 | #define IVTV_CMD_SDRAM_REFRESH_INIT 0x80000640 | 42 | #define IVTV_CMD_SDRAM_REFRESH_INIT 0x80000640 |
43 | #define IVTV_SDRAM_SLEEPTIME 600 | 43 | #define IVTV_SDRAM_SLEEPTIME 600 |
44 | 44 | ||
45 | #define IVTV_DECODE_INIT_MPEG_FILENAME "v4l-cx2341x-init.mpg" | 45 | #define IVTV_DECODE_INIT_MPEG_FILENAME "v4l-cx2341x-init.mpg" |
46 | #define IVTV_DECODE_INIT_MPEG_SIZE (152*1024) | 46 | #define IVTV_DECODE_INIT_MPEG_SIZE (152*1024) |
47 | 47 | ||
48 | /* Encoder/decoder firmware sizes */ | 48 | /* Encoder/decoder firmware sizes */ |
49 | #define IVTV_FW_ENC_SIZE (376836) | 49 | #define IVTV_FW_ENC_SIZE (376836) |
50 | #define IVTV_FW_DEC_SIZE (256*1024) | 50 | #define IVTV_FW_DEC_SIZE (256*1024) |
51 | 51 | ||
52 | static int load_fw_direct(const char *fn, volatile u8 __iomem *mem, struct ivtv *itv, long size) | 52 | static int load_fw_direct(const char *fn, volatile u8 __iomem *mem, struct ivtv *itv, long size) |
53 | { | 53 | { |
diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c b/drivers/media/pci/ivtv/ivtv-i2c.c index 893962ac85de..522cd111e399 100644 --- a/drivers/media/pci/ivtv/ivtv-i2c.c +++ b/drivers/media/pci/ivtv/ivtv-i2c.c | |||
@@ -76,22 +76,22 @@ | |||
76 | 76 | ||
77 | #define IVTV_CS53L32A_I2C_ADDR 0x11 | 77 | #define IVTV_CS53L32A_I2C_ADDR 0x11 |
78 | #define IVTV_M52790_I2C_ADDR 0x48 | 78 | #define IVTV_M52790_I2C_ADDR 0x48 |
79 | #define IVTV_CX25840_I2C_ADDR 0x44 | 79 | #define IVTV_CX25840_I2C_ADDR 0x44 |
80 | #define IVTV_SAA7115_I2C_ADDR 0x21 | 80 | #define IVTV_SAA7115_I2C_ADDR 0x21 |
81 | #define IVTV_SAA7127_I2C_ADDR 0x44 | 81 | #define IVTV_SAA7127_I2C_ADDR 0x44 |
82 | #define IVTV_SAA717x_I2C_ADDR 0x21 | 82 | #define IVTV_SAA717x_I2C_ADDR 0x21 |
83 | #define IVTV_MSP3400_I2C_ADDR 0x40 | 83 | #define IVTV_MSP3400_I2C_ADDR 0x40 |
84 | #define IVTV_HAUPPAUGE_I2C_ADDR 0x50 | 84 | #define IVTV_HAUPPAUGE_I2C_ADDR 0x50 |
85 | #define IVTV_WM8739_I2C_ADDR 0x1a | 85 | #define IVTV_WM8739_I2C_ADDR 0x1a |
86 | #define IVTV_WM8775_I2C_ADDR 0x1b | 86 | #define IVTV_WM8775_I2C_ADDR 0x1b |
87 | #define IVTV_TEA5767_I2C_ADDR 0x60 | 87 | #define IVTV_TEA5767_I2C_ADDR 0x60 |
88 | #define IVTV_UPD64031A_I2C_ADDR 0x12 | 88 | #define IVTV_UPD64031A_I2C_ADDR 0x12 |
89 | #define IVTV_UPD64083_I2C_ADDR 0x5c | 89 | #define IVTV_UPD64083_I2C_ADDR 0x5c |
90 | #define IVTV_VP27SMPX_I2C_ADDR 0x5b | 90 | #define IVTV_VP27SMPX_I2C_ADDR 0x5b |
91 | #define IVTV_M52790_I2C_ADDR 0x48 | 91 | #define IVTV_M52790_I2C_ADDR 0x48 |
92 | #define IVTV_AVERMEDIA_IR_RX_I2C_ADDR 0x40 | 92 | #define IVTV_AVERMEDIA_IR_RX_I2C_ADDR 0x40 |
93 | #define IVTV_HAUP_EXT_IR_RX_I2C_ADDR 0x1a | 93 | #define IVTV_HAUP_EXT_IR_RX_I2C_ADDR 0x1a |
94 | #define IVTV_HAUP_INT_IR_RX_I2C_ADDR 0x18 | 94 | #define IVTV_HAUP_INT_IR_RX_I2C_ADDR 0x18 |
95 | #define IVTV_Z8F0811_IR_TX_I2C_ADDR 0x70 | 95 | #define IVTV_Z8F0811_IR_TX_I2C_ADDR 0x70 |
96 | #define IVTV_Z8F0811_IR_RX_I2C_ADDR 0x71 | 96 | #define IVTV_Z8F0811_IR_RX_I2C_ADDR 0x71 |
97 | #define IVTV_ADAPTEC_IR_ADDR 0x6b | 97 | #define IVTV_ADAPTEC_IR_ADDR 0x6b |
@@ -117,8 +117,7 @@ static const u8 hw_addrs[] = { | |||
117 | IVTV_AVERMEDIA_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_AVER */ | 117 | IVTV_AVERMEDIA_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_AVER */ |
118 | IVTV_HAUP_EXT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */ | 118 | IVTV_HAUP_EXT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */ |
119 | IVTV_HAUP_INT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_INT */ | 119 | IVTV_HAUP_INT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_INT */ |
120 | IVTV_Z8F0811_IR_TX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_TX_HAUP */ | 120 | IVTV_Z8F0811_IR_RX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_HAUP */ |
121 | IVTV_Z8F0811_IR_RX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_RX_HAUP */ | ||
122 | IVTV_ADAPTEC_IR_ADDR, /* IVTV_HW_I2C_IR_RX_ADAPTEC */ | 121 | IVTV_ADAPTEC_IR_ADDR, /* IVTV_HW_I2C_IR_RX_ADAPTEC */ |
123 | }; | 122 | }; |
124 | 123 | ||
@@ -143,8 +142,7 @@ static const char * const hw_devicenames[] = { | |||
143 | "ir_video", /* IVTV_HW_I2C_IR_RX_AVER */ | 142 | "ir_video", /* IVTV_HW_I2C_IR_RX_AVER */ |
144 | "ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_EXT */ | 143 | "ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_EXT */ |
145 | "ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_INT */ | 144 | "ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_INT */ |
146 | "ir_tx_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_TX_HAUP */ | 145 | "ir_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_HAUP */ |
147 | "ir_rx_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_RX_HAUP */ | ||
148 | "ir_video", /* IVTV_HW_I2C_IR_RX_ADAPTEC */ | 146 | "ir_video", /* IVTV_HW_I2C_IR_RX_ADAPTEC */ |
149 | }; | 147 | }; |
150 | 148 | ||
@@ -181,18 +179,8 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) | |||
181 | struct IR_i2c_init_data *init_data = &itv->ir_i2c_init_data; | 179 | struct IR_i2c_init_data *init_data = &itv->ir_i2c_init_data; |
182 | unsigned short addr_list[2] = { addr, I2C_CLIENT_END }; | 180 | unsigned short addr_list[2] = { addr, I2C_CLIENT_END }; |
183 | 181 | ||
184 | /* Only allow one IR transmitter to be registered per board */ | ||
185 | if (hw & IVTV_HW_IR_TX_ANY) { | ||
186 | if (itv->hw_flags & IVTV_HW_IR_TX_ANY) | ||
187 | return -1; | ||
188 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
189 | strlcpy(info.type, type, I2C_NAME_SIZE); | ||
190 | return i2c_new_probed_device(adap, &info, addr_list, NULL) | ||
191 | == NULL ? -1 : 0; | ||
192 | } | ||
193 | |||
194 | /* Only allow one IR receiver to be registered per board */ | 182 | /* Only allow one IR receiver to be registered per board */ |
195 | if (itv->hw_flags & IVTV_HW_IR_RX_ANY) | 183 | if (itv->hw_flags & IVTV_HW_IR_ANY) |
196 | return -1; | 184 | return -1; |
197 | 185 | ||
198 | /* Our default information for ir-kbd-i2c.c to use */ | 186 | /* Our default information for ir-kbd-i2c.c to use */ |
@@ -211,7 +199,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) | |||
211 | init_data->type = RC_PROTO_BIT_RC5; | 199 | init_data->type = RC_PROTO_BIT_RC5; |
212 | init_data->name = itv->card_name; | 200 | init_data->name = itv->card_name; |
213 | break; | 201 | break; |
214 | case IVTV_HW_Z8F0811_IR_RX_HAUP: | 202 | case IVTV_HW_Z8F0811_IR_HAUP: |
215 | /* Default to grey remote */ | 203 | /* Default to grey remote */ |
216 | init_data->ir_codes = RC_MAP_HAUPPAUGE; | 204 | init_data->ir_codes = RC_MAP_HAUPPAUGE; |
217 | init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; | 205 | init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; |
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 670462d195b5..4cdc6d2be85d 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c | |||
@@ -1884,65 +1884,65 @@ static long ivtv_default(struct file *file, void *fh, bool valid_prio, | |||
1884 | } | 1884 | } |
1885 | 1885 | ||
1886 | static const struct v4l2_ioctl_ops ivtv_ioctl_ops = { | 1886 | static const struct v4l2_ioctl_ops ivtv_ioctl_ops = { |
1887 | .vidioc_querycap = ivtv_querycap, | 1887 | .vidioc_querycap = ivtv_querycap, |
1888 | .vidioc_s_audio = ivtv_s_audio, | 1888 | .vidioc_s_audio = ivtv_s_audio, |
1889 | .vidioc_g_audio = ivtv_g_audio, | 1889 | .vidioc_g_audio = ivtv_g_audio, |
1890 | .vidioc_enumaudio = ivtv_enumaudio, | 1890 | .vidioc_enumaudio = ivtv_enumaudio, |
1891 | .vidioc_s_audout = ivtv_s_audout, | 1891 | .vidioc_s_audout = ivtv_s_audout, |
1892 | .vidioc_g_audout = ivtv_g_audout, | 1892 | .vidioc_g_audout = ivtv_g_audout, |
1893 | .vidioc_enum_input = ivtv_enum_input, | 1893 | .vidioc_enum_input = ivtv_enum_input, |
1894 | .vidioc_enum_output = ivtv_enum_output, | 1894 | .vidioc_enum_output = ivtv_enum_output, |
1895 | .vidioc_enumaudout = ivtv_enumaudout, | 1895 | .vidioc_enumaudout = ivtv_enumaudout, |
1896 | .vidioc_cropcap = ivtv_cropcap, | 1896 | .vidioc_cropcap = ivtv_cropcap, |
1897 | .vidioc_s_selection = ivtv_s_selection, | 1897 | .vidioc_s_selection = ivtv_s_selection, |
1898 | .vidioc_g_selection = ivtv_g_selection, | 1898 | .vidioc_g_selection = ivtv_g_selection, |
1899 | .vidioc_g_input = ivtv_g_input, | 1899 | .vidioc_g_input = ivtv_g_input, |
1900 | .vidioc_s_input = ivtv_s_input, | 1900 | .vidioc_s_input = ivtv_s_input, |
1901 | .vidioc_g_output = ivtv_g_output, | 1901 | .vidioc_g_output = ivtv_g_output, |
1902 | .vidioc_s_output = ivtv_s_output, | 1902 | .vidioc_s_output = ivtv_s_output, |
1903 | .vidioc_g_frequency = ivtv_g_frequency, | 1903 | .vidioc_g_frequency = ivtv_g_frequency, |
1904 | .vidioc_s_frequency = ivtv_s_frequency, | 1904 | .vidioc_s_frequency = ivtv_s_frequency, |
1905 | .vidioc_s_tuner = ivtv_s_tuner, | 1905 | .vidioc_s_tuner = ivtv_s_tuner, |
1906 | .vidioc_g_tuner = ivtv_g_tuner, | 1906 | .vidioc_g_tuner = ivtv_g_tuner, |
1907 | .vidioc_g_enc_index = ivtv_g_enc_index, | 1907 | .vidioc_g_enc_index = ivtv_g_enc_index, |
1908 | .vidioc_g_fbuf = ivtv_g_fbuf, | 1908 | .vidioc_g_fbuf = ivtv_g_fbuf, |
1909 | .vidioc_s_fbuf = ivtv_s_fbuf, | 1909 | .vidioc_s_fbuf = ivtv_s_fbuf, |
1910 | .vidioc_g_std = ivtv_g_std, | 1910 | .vidioc_g_std = ivtv_g_std, |
1911 | .vidioc_s_std = ivtv_s_std, | 1911 | .vidioc_s_std = ivtv_s_std, |
1912 | .vidioc_overlay = ivtv_overlay, | 1912 | .vidioc_overlay = ivtv_overlay, |
1913 | .vidioc_log_status = ivtv_log_status, | 1913 | .vidioc_log_status = ivtv_log_status, |
1914 | .vidioc_enum_fmt_vid_cap = ivtv_enum_fmt_vid_cap, | 1914 | .vidioc_enum_fmt_vid_cap = ivtv_enum_fmt_vid_cap, |
1915 | .vidioc_encoder_cmd = ivtv_encoder_cmd, | 1915 | .vidioc_encoder_cmd = ivtv_encoder_cmd, |
1916 | .vidioc_try_encoder_cmd = ivtv_try_encoder_cmd, | 1916 | .vidioc_try_encoder_cmd = ivtv_try_encoder_cmd, |
1917 | .vidioc_decoder_cmd = ivtv_decoder_cmd, | 1917 | .vidioc_decoder_cmd = ivtv_decoder_cmd, |
1918 | .vidioc_try_decoder_cmd = ivtv_try_decoder_cmd, | 1918 | .vidioc_try_decoder_cmd = ivtv_try_decoder_cmd, |
1919 | .vidioc_enum_fmt_vid_out = ivtv_enum_fmt_vid_out, | 1919 | .vidioc_enum_fmt_vid_out = ivtv_enum_fmt_vid_out, |
1920 | .vidioc_g_fmt_vid_cap = ivtv_g_fmt_vid_cap, | 1920 | .vidioc_g_fmt_vid_cap = ivtv_g_fmt_vid_cap, |
1921 | .vidioc_g_fmt_vbi_cap = ivtv_g_fmt_vbi_cap, | 1921 | .vidioc_g_fmt_vbi_cap = ivtv_g_fmt_vbi_cap, |
1922 | .vidioc_g_fmt_sliced_vbi_cap = ivtv_g_fmt_sliced_vbi_cap, | 1922 | .vidioc_g_fmt_sliced_vbi_cap = ivtv_g_fmt_sliced_vbi_cap, |
1923 | .vidioc_g_fmt_vid_out = ivtv_g_fmt_vid_out, | 1923 | .vidioc_g_fmt_vid_out = ivtv_g_fmt_vid_out, |
1924 | .vidioc_g_fmt_vid_out_overlay = ivtv_g_fmt_vid_out_overlay, | 1924 | .vidioc_g_fmt_vid_out_overlay = ivtv_g_fmt_vid_out_overlay, |
1925 | .vidioc_g_fmt_sliced_vbi_out = ivtv_g_fmt_sliced_vbi_out, | 1925 | .vidioc_g_fmt_sliced_vbi_out = ivtv_g_fmt_sliced_vbi_out, |
1926 | .vidioc_s_fmt_vid_cap = ivtv_s_fmt_vid_cap, | 1926 | .vidioc_s_fmt_vid_cap = ivtv_s_fmt_vid_cap, |
1927 | .vidioc_s_fmt_vbi_cap = ivtv_s_fmt_vbi_cap, | 1927 | .vidioc_s_fmt_vbi_cap = ivtv_s_fmt_vbi_cap, |
1928 | .vidioc_s_fmt_sliced_vbi_cap = ivtv_s_fmt_sliced_vbi_cap, | 1928 | .vidioc_s_fmt_sliced_vbi_cap = ivtv_s_fmt_sliced_vbi_cap, |
1929 | .vidioc_s_fmt_vid_out = ivtv_s_fmt_vid_out, | 1929 | .vidioc_s_fmt_vid_out = ivtv_s_fmt_vid_out, |
1930 | .vidioc_s_fmt_vid_out_overlay = ivtv_s_fmt_vid_out_overlay, | 1930 | .vidioc_s_fmt_vid_out_overlay = ivtv_s_fmt_vid_out_overlay, |
1931 | .vidioc_s_fmt_sliced_vbi_out = ivtv_s_fmt_sliced_vbi_out, | 1931 | .vidioc_s_fmt_sliced_vbi_out = ivtv_s_fmt_sliced_vbi_out, |
1932 | .vidioc_try_fmt_vid_cap = ivtv_try_fmt_vid_cap, | 1932 | .vidioc_try_fmt_vid_cap = ivtv_try_fmt_vid_cap, |
1933 | .vidioc_try_fmt_vbi_cap = ivtv_try_fmt_vbi_cap, | 1933 | .vidioc_try_fmt_vbi_cap = ivtv_try_fmt_vbi_cap, |
1934 | .vidioc_try_fmt_sliced_vbi_cap = ivtv_try_fmt_sliced_vbi_cap, | 1934 | .vidioc_try_fmt_sliced_vbi_cap = ivtv_try_fmt_sliced_vbi_cap, |
1935 | .vidioc_try_fmt_vid_out = ivtv_try_fmt_vid_out, | 1935 | .vidioc_try_fmt_vid_out = ivtv_try_fmt_vid_out, |
1936 | .vidioc_try_fmt_vid_out_overlay = ivtv_try_fmt_vid_out_overlay, | 1936 | .vidioc_try_fmt_vid_out_overlay = ivtv_try_fmt_vid_out_overlay, |
1937 | .vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out, | 1937 | .vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out, |
1938 | .vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap, | 1938 | .vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap, |
1939 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1939 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1940 | .vidioc_g_register = ivtv_g_register, | 1940 | .vidioc_g_register = ivtv_g_register, |
1941 | .vidioc_s_register = ivtv_s_register, | 1941 | .vidioc_s_register = ivtv_s_register, |
1942 | #endif | 1942 | #endif |
1943 | .vidioc_default = ivtv_default, | 1943 | .vidioc_default = ivtv_default, |
1944 | .vidioc_subscribe_event = ivtv_subscribe_event, | 1944 | .vidioc_subscribe_event = ivtv_subscribe_event, |
1945 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | 1945 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, |
1946 | }; | 1946 | }; |
1947 | 1947 | ||
1948 | void ivtv_set_funcs(struct video_device *vdev) | 1948 | void ivtv_set_funcs(struct video_device *vdev) |
diff --git a/drivers/media/pci/ivtv/ivtv-mailbox.c b/drivers/media/pci/ivtv/ivtv-mailbox.c index 9a2506a5edbe..f317c8f0938d 100644 --- a/drivers/media/pci/ivtv/ivtv-mailbox.c +++ b/drivers/media/pci/ivtv/ivtv-mailbox.c | |||
@@ -28,118 +28,118 @@ | |||
28 | #define IVTV_MBOX_FIRMWARE_DONE 0x00000004 | 28 | #define IVTV_MBOX_FIRMWARE_DONE 0x00000004 |
29 | #define IVTV_MBOX_DRIVER_DONE 0x00000002 | 29 | #define IVTV_MBOX_DRIVER_DONE 0x00000002 |
30 | #define IVTV_MBOX_DRIVER_BUSY 0x00000001 | 30 | #define IVTV_MBOX_DRIVER_BUSY 0x00000001 |
31 | #define IVTV_MBOX_FREE 0x00000000 | 31 | #define IVTV_MBOX_FREE 0x00000000 |
32 | 32 | ||
33 | /* Firmware mailbox standard timeout */ | 33 | /* Firmware mailbox standard timeout */ |
34 | #define IVTV_API_STD_TIMEOUT 0x02000000 | 34 | #define IVTV_API_STD_TIMEOUT 0x02000000 |
35 | 35 | ||
36 | #define API_CACHE (1 << 0) /* Allow the command to be stored in the cache */ | 36 | #define API_CACHE (1 << 0) /* Allow the command to be stored in the cache */ |
37 | #define API_RESULT (1 << 1) /* Allow 1 second for this cmd to end */ | 37 | #define API_RESULT (1 << 1) /* Allow 1 second for this cmd to end */ |
38 | #define API_FAST_RESULT (3 << 1) /* Allow 0.1 second for this cmd to end */ | 38 | #define API_FAST_RESULT (3 << 1) /* Allow 0.1 second for this cmd to end */ |
39 | #define API_DMA (1 << 3) /* DMA mailbox, has special handling */ | 39 | #define API_DMA (1 << 3) /* DMA mailbox, has special handling */ |
40 | #define API_HIGH_VOL (1 << 5) /* High volume command (i.e. called during encoding or decoding) */ | 40 | #define API_HIGH_VOL (1 << 5) /* High volume command (i.e. called during encoding or decoding) */ |
41 | #define API_NO_WAIT_MB (1 << 4) /* Command may not wait for a free mailbox */ | 41 | #define API_NO_WAIT_MB (1 << 4) /* Command may not wait for a free mailbox */ |
42 | #define API_NO_WAIT_RES (1 << 5) /* Command may not wait for the result */ | 42 | #define API_NO_WAIT_RES (1 << 5) /* Command may not wait for the result */ |
43 | #define API_NO_POLL (1 << 6) /* Avoid pointless polling */ | 43 | #define API_NO_POLL (1 << 6) /* Avoid pointless polling */ |
44 | 44 | ||
45 | struct ivtv_api_info { | 45 | struct ivtv_api_info { |
46 | int flags; /* Flags, see above */ | 46 | int flags; /* Flags, see above */ |
47 | const char *name; /* The name of the command */ | 47 | const char *name; /* The name of the command */ |
48 | }; | 48 | }; |
49 | 49 | ||
50 | #define API_ENTRY(x, f) [x] = { (f), #x } | 50 | #define API_ENTRY(x, f) [x] = { (f), #x } |
51 | 51 | ||
52 | static const struct ivtv_api_info api_info[256] = { | 52 | static const struct ivtv_api_info api_info[256] = { |
53 | /* MPEG encoder API */ | 53 | /* MPEG encoder API */ |
54 | API_ENTRY(CX2341X_ENC_PING_FW, API_FAST_RESULT), | 54 | API_ENTRY(CX2341X_ENC_PING_FW, API_FAST_RESULT), |
55 | API_ENTRY(CX2341X_ENC_START_CAPTURE, API_RESULT | API_NO_POLL), | 55 | API_ENTRY(CX2341X_ENC_START_CAPTURE, API_RESULT | API_NO_POLL), |
56 | API_ENTRY(CX2341X_ENC_STOP_CAPTURE, API_RESULT), | 56 | API_ENTRY(CX2341X_ENC_STOP_CAPTURE, API_RESULT), |
57 | API_ENTRY(CX2341X_ENC_SET_AUDIO_ID, API_CACHE), | 57 | API_ENTRY(CX2341X_ENC_SET_AUDIO_ID, API_CACHE), |
58 | API_ENTRY(CX2341X_ENC_SET_VIDEO_ID, API_CACHE), | 58 | API_ENTRY(CX2341X_ENC_SET_VIDEO_ID, API_CACHE), |
59 | API_ENTRY(CX2341X_ENC_SET_PCR_ID, API_CACHE), | 59 | API_ENTRY(CX2341X_ENC_SET_PCR_ID, API_CACHE), |
60 | API_ENTRY(CX2341X_ENC_SET_FRAME_RATE, API_CACHE), | 60 | API_ENTRY(CX2341X_ENC_SET_FRAME_RATE, API_CACHE), |
61 | API_ENTRY(CX2341X_ENC_SET_FRAME_SIZE, API_CACHE), | 61 | API_ENTRY(CX2341X_ENC_SET_FRAME_SIZE, API_CACHE), |
62 | API_ENTRY(CX2341X_ENC_SET_BIT_RATE, API_CACHE), | 62 | API_ENTRY(CX2341X_ENC_SET_BIT_RATE, API_CACHE), |
63 | API_ENTRY(CX2341X_ENC_SET_GOP_PROPERTIES, API_CACHE), | 63 | API_ENTRY(CX2341X_ENC_SET_GOP_PROPERTIES, API_CACHE), |
64 | API_ENTRY(CX2341X_ENC_SET_ASPECT_RATIO, API_CACHE), | 64 | API_ENTRY(CX2341X_ENC_SET_ASPECT_RATIO, API_CACHE), |
65 | API_ENTRY(CX2341X_ENC_SET_DNR_FILTER_MODE, API_CACHE), | 65 | API_ENTRY(CX2341X_ENC_SET_DNR_FILTER_MODE, API_CACHE), |
66 | API_ENTRY(CX2341X_ENC_SET_DNR_FILTER_PROPS, API_CACHE), | 66 | API_ENTRY(CX2341X_ENC_SET_DNR_FILTER_PROPS, API_CACHE), |
67 | API_ENTRY(CX2341X_ENC_SET_CORING_LEVELS, API_CACHE), | 67 | API_ENTRY(CX2341X_ENC_SET_CORING_LEVELS, API_CACHE), |
68 | API_ENTRY(CX2341X_ENC_SET_SPATIAL_FILTER_TYPE, API_CACHE), | 68 | API_ENTRY(CX2341X_ENC_SET_SPATIAL_FILTER_TYPE, API_CACHE), |
69 | API_ENTRY(CX2341X_ENC_SET_VBI_LINE, API_RESULT), | 69 | API_ENTRY(CX2341X_ENC_SET_VBI_LINE, API_RESULT), |
70 | API_ENTRY(CX2341X_ENC_SET_STREAM_TYPE, API_CACHE), | 70 | API_ENTRY(CX2341X_ENC_SET_STREAM_TYPE, API_CACHE), |
71 | API_ENTRY(CX2341X_ENC_SET_OUTPUT_PORT, API_CACHE), | 71 | API_ENTRY(CX2341X_ENC_SET_OUTPUT_PORT, API_CACHE), |
72 | API_ENTRY(CX2341X_ENC_SET_AUDIO_PROPERTIES, API_CACHE), | 72 | API_ENTRY(CX2341X_ENC_SET_AUDIO_PROPERTIES, API_CACHE), |
73 | API_ENTRY(CX2341X_ENC_HALT_FW, API_FAST_RESULT), | 73 | API_ENTRY(CX2341X_ENC_HALT_FW, API_FAST_RESULT), |
74 | API_ENTRY(CX2341X_ENC_GET_VERSION, API_FAST_RESULT), | 74 | API_ENTRY(CX2341X_ENC_GET_VERSION, API_FAST_RESULT), |
75 | API_ENTRY(CX2341X_ENC_SET_GOP_CLOSURE, API_CACHE), | 75 | API_ENTRY(CX2341X_ENC_SET_GOP_CLOSURE, API_CACHE), |
76 | API_ENTRY(CX2341X_ENC_GET_SEQ_END, API_RESULT), | 76 | API_ENTRY(CX2341X_ENC_GET_SEQ_END, API_RESULT), |
77 | API_ENTRY(CX2341X_ENC_SET_PGM_INDEX_INFO, API_FAST_RESULT), | 77 | API_ENTRY(CX2341X_ENC_SET_PGM_INDEX_INFO, API_FAST_RESULT), |
78 | API_ENTRY(CX2341X_ENC_SET_VBI_CONFIG, API_RESULT), | 78 | API_ENTRY(CX2341X_ENC_SET_VBI_CONFIG, API_RESULT), |
79 | API_ENTRY(CX2341X_ENC_SET_DMA_BLOCK_SIZE, API_CACHE), | 79 | API_ENTRY(CX2341X_ENC_SET_DMA_BLOCK_SIZE, API_CACHE), |
80 | API_ENTRY(CX2341X_ENC_GET_PREV_DMA_INFO_MB_10, API_FAST_RESULT), | 80 | API_ENTRY(CX2341X_ENC_GET_PREV_DMA_INFO_MB_10, API_FAST_RESULT), |
81 | API_ENTRY(CX2341X_ENC_GET_PREV_DMA_INFO_MB_9, API_FAST_RESULT), | 81 | API_ENTRY(CX2341X_ENC_GET_PREV_DMA_INFO_MB_9, API_FAST_RESULT), |
82 | API_ENTRY(CX2341X_ENC_SCHED_DMA_TO_HOST, API_DMA | API_HIGH_VOL), | 82 | API_ENTRY(CX2341X_ENC_SCHED_DMA_TO_HOST, API_DMA | API_HIGH_VOL), |
83 | API_ENTRY(CX2341X_ENC_INITIALIZE_INPUT, API_RESULT), | 83 | API_ENTRY(CX2341X_ENC_INITIALIZE_INPUT, API_RESULT), |
84 | API_ENTRY(CX2341X_ENC_SET_FRAME_DROP_RATE, API_CACHE), | 84 | API_ENTRY(CX2341X_ENC_SET_FRAME_DROP_RATE, API_CACHE), |
85 | API_ENTRY(CX2341X_ENC_PAUSE_ENCODER, API_RESULT), | 85 | API_ENTRY(CX2341X_ENC_PAUSE_ENCODER, API_RESULT), |
86 | API_ENTRY(CX2341X_ENC_REFRESH_INPUT, API_NO_WAIT_MB | API_HIGH_VOL), | 86 | API_ENTRY(CX2341X_ENC_REFRESH_INPUT, API_NO_WAIT_MB | API_HIGH_VOL), |
87 | API_ENTRY(CX2341X_ENC_SET_COPYRIGHT, API_CACHE), | 87 | API_ENTRY(CX2341X_ENC_SET_COPYRIGHT, API_CACHE), |
88 | API_ENTRY(CX2341X_ENC_SET_EVENT_NOTIFICATION, API_RESULT), | 88 | API_ENTRY(CX2341X_ENC_SET_EVENT_NOTIFICATION, API_RESULT), |
89 | API_ENTRY(CX2341X_ENC_SET_NUM_VSYNC_LINES, API_CACHE), | 89 | API_ENTRY(CX2341X_ENC_SET_NUM_VSYNC_LINES, API_CACHE), |
90 | API_ENTRY(CX2341X_ENC_SET_PLACEHOLDER, API_CACHE), | 90 | API_ENTRY(CX2341X_ENC_SET_PLACEHOLDER, API_CACHE), |
91 | API_ENTRY(CX2341X_ENC_MUTE_VIDEO, API_RESULT), | 91 | API_ENTRY(CX2341X_ENC_MUTE_VIDEO, API_RESULT), |
92 | API_ENTRY(CX2341X_ENC_MUTE_AUDIO, API_RESULT), | 92 | API_ENTRY(CX2341X_ENC_MUTE_AUDIO, API_RESULT), |
93 | API_ENTRY(CX2341X_ENC_SET_VERT_CROP_LINE, API_FAST_RESULT), | 93 | API_ENTRY(CX2341X_ENC_SET_VERT_CROP_LINE, API_FAST_RESULT), |
94 | API_ENTRY(CX2341X_ENC_MISC, API_FAST_RESULT), | 94 | API_ENTRY(CX2341X_ENC_MISC, API_FAST_RESULT), |
95 | /* Obsolete PULLDOWN API command */ | 95 | /* Obsolete PULLDOWN API command */ |
96 | API_ENTRY(0xb1, API_CACHE), | 96 | API_ENTRY(0xb1, API_CACHE), |
97 | 97 | ||
98 | /* MPEG decoder API */ | 98 | /* MPEG decoder API */ |
99 | API_ENTRY(CX2341X_DEC_PING_FW, API_FAST_RESULT), | 99 | API_ENTRY(CX2341X_DEC_PING_FW, API_FAST_RESULT), |
100 | API_ENTRY(CX2341X_DEC_START_PLAYBACK, API_RESULT | API_NO_POLL), | 100 | API_ENTRY(CX2341X_DEC_START_PLAYBACK, API_RESULT | API_NO_POLL), |
101 | API_ENTRY(CX2341X_DEC_STOP_PLAYBACK, API_RESULT), | 101 | API_ENTRY(CX2341X_DEC_STOP_PLAYBACK, API_RESULT), |
102 | API_ENTRY(CX2341X_DEC_SET_PLAYBACK_SPEED, API_RESULT), | 102 | API_ENTRY(CX2341X_DEC_SET_PLAYBACK_SPEED, API_RESULT), |
103 | API_ENTRY(CX2341X_DEC_STEP_VIDEO, API_RESULT), | 103 | API_ENTRY(CX2341X_DEC_STEP_VIDEO, API_RESULT), |
104 | API_ENTRY(CX2341X_DEC_SET_DMA_BLOCK_SIZE, API_CACHE), | 104 | API_ENTRY(CX2341X_DEC_SET_DMA_BLOCK_SIZE, API_CACHE), |
105 | API_ENTRY(CX2341X_DEC_GET_XFER_INFO, API_FAST_RESULT), | 105 | API_ENTRY(CX2341X_DEC_GET_XFER_INFO, API_FAST_RESULT), |
106 | API_ENTRY(CX2341X_DEC_GET_DMA_STATUS, API_FAST_RESULT), | 106 | API_ENTRY(CX2341X_DEC_GET_DMA_STATUS, API_FAST_RESULT), |
107 | API_ENTRY(CX2341X_DEC_SCHED_DMA_FROM_HOST, API_DMA | API_HIGH_VOL), | 107 | API_ENTRY(CX2341X_DEC_SCHED_DMA_FROM_HOST, API_DMA | API_HIGH_VOL), |
108 | API_ENTRY(CX2341X_DEC_PAUSE_PLAYBACK, API_RESULT), | 108 | API_ENTRY(CX2341X_DEC_PAUSE_PLAYBACK, API_RESULT), |
109 | API_ENTRY(CX2341X_DEC_HALT_FW, API_FAST_RESULT), | 109 | API_ENTRY(CX2341X_DEC_HALT_FW, API_FAST_RESULT), |
110 | API_ENTRY(CX2341X_DEC_SET_STANDARD, API_CACHE), | 110 | API_ENTRY(CX2341X_DEC_SET_STANDARD, API_CACHE), |
111 | API_ENTRY(CX2341X_DEC_GET_VERSION, API_FAST_RESULT), | 111 | API_ENTRY(CX2341X_DEC_GET_VERSION, API_FAST_RESULT), |
112 | API_ENTRY(CX2341X_DEC_SET_STREAM_INPUT, API_CACHE), | 112 | API_ENTRY(CX2341X_DEC_SET_STREAM_INPUT, API_CACHE), |
113 | API_ENTRY(CX2341X_DEC_GET_TIMING_INFO, API_RESULT /*| API_NO_WAIT_RES*/), | 113 | API_ENTRY(CX2341X_DEC_GET_TIMING_INFO, API_RESULT /*| API_NO_WAIT_RES*/), |
114 | API_ENTRY(CX2341X_DEC_SET_AUDIO_MODE, API_CACHE), | 114 | API_ENTRY(CX2341X_DEC_SET_AUDIO_MODE, API_CACHE), |
115 | API_ENTRY(CX2341X_DEC_SET_EVENT_NOTIFICATION, API_RESULT), | 115 | API_ENTRY(CX2341X_DEC_SET_EVENT_NOTIFICATION, API_RESULT), |
116 | API_ENTRY(CX2341X_DEC_SET_DISPLAY_BUFFERS, API_CACHE), | 116 | API_ENTRY(CX2341X_DEC_SET_DISPLAY_BUFFERS, API_CACHE), |
117 | API_ENTRY(CX2341X_DEC_EXTRACT_VBI, API_RESULT), | 117 | API_ENTRY(CX2341X_DEC_EXTRACT_VBI, API_RESULT), |
118 | API_ENTRY(CX2341X_DEC_SET_DECODER_SOURCE, API_FAST_RESULT), | 118 | API_ENTRY(CX2341X_DEC_SET_DECODER_SOURCE, API_FAST_RESULT), |
119 | API_ENTRY(CX2341X_DEC_SET_PREBUFFERING, API_CACHE), | 119 | API_ENTRY(CX2341X_DEC_SET_PREBUFFERING, API_CACHE), |
120 | 120 | ||
121 | /* OSD API */ | 121 | /* OSD API */ |
122 | API_ENTRY(CX2341X_OSD_GET_FRAMEBUFFER, API_FAST_RESULT), | 122 | API_ENTRY(CX2341X_OSD_GET_FRAMEBUFFER, API_FAST_RESULT), |
123 | API_ENTRY(CX2341X_OSD_GET_PIXEL_FORMAT, API_FAST_RESULT), | 123 | API_ENTRY(CX2341X_OSD_GET_PIXEL_FORMAT, API_FAST_RESULT), |
124 | API_ENTRY(CX2341X_OSD_SET_PIXEL_FORMAT, API_CACHE), | 124 | API_ENTRY(CX2341X_OSD_SET_PIXEL_FORMAT, API_CACHE), |
125 | API_ENTRY(CX2341X_OSD_GET_STATE, API_FAST_RESULT), | 125 | API_ENTRY(CX2341X_OSD_GET_STATE, API_FAST_RESULT), |
126 | API_ENTRY(CX2341X_OSD_SET_STATE, API_CACHE), | 126 | API_ENTRY(CX2341X_OSD_SET_STATE, API_CACHE), |
127 | API_ENTRY(CX2341X_OSD_GET_OSD_COORDS, API_FAST_RESULT), | 127 | API_ENTRY(CX2341X_OSD_GET_OSD_COORDS, API_FAST_RESULT), |
128 | API_ENTRY(CX2341X_OSD_SET_OSD_COORDS, API_CACHE), | 128 | API_ENTRY(CX2341X_OSD_SET_OSD_COORDS, API_CACHE), |
129 | API_ENTRY(CX2341X_OSD_GET_SCREEN_COORDS, API_FAST_RESULT), | 129 | API_ENTRY(CX2341X_OSD_GET_SCREEN_COORDS, API_FAST_RESULT), |
130 | API_ENTRY(CX2341X_OSD_SET_SCREEN_COORDS, API_CACHE), | 130 | API_ENTRY(CX2341X_OSD_SET_SCREEN_COORDS, API_CACHE), |
131 | API_ENTRY(CX2341X_OSD_GET_GLOBAL_ALPHA, API_FAST_RESULT), | 131 | API_ENTRY(CX2341X_OSD_GET_GLOBAL_ALPHA, API_FAST_RESULT), |
132 | API_ENTRY(CX2341X_OSD_SET_GLOBAL_ALPHA, API_CACHE), | 132 | API_ENTRY(CX2341X_OSD_SET_GLOBAL_ALPHA, API_CACHE), |
133 | API_ENTRY(CX2341X_OSD_SET_BLEND_COORDS, API_CACHE), | 133 | API_ENTRY(CX2341X_OSD_SET_BLEND_COORDS, API_CACHE), |
134 | API_ENTRY(CX2341X_OSD_GET_FLICKER_STATE, API_FAST_RESULT), | 134 | API_ENTRY(CX2341X_OSD_GET_FLICKER_STATE, API_FAST_RESULT), |
135 | API_ENTRY(CX2341X_OSD_SET_FLICKER_STATE, API_CACHE), | 135 | API_ENTRY(CX2341X_OSD_SET_FLICKER_STATE, API_CACHE), |
136 | API_ENTRY(CX2341X_OSD_BLT_COPY, API_RESULT), | 136 | API_ENTRY(CX2341X_OSD_BLT_COPY, API_RESULT), |
137 | API_ENTRY(CX2341X_OSD_BLT_FILL, API_RESULT), | 137 | API_ENTRY(CX2341X_OSD_BLT_FILL, API_RESULT), |
138 | API_ENTRY(CX2341X_OSD_BLT_TEXT, API_RESULT), | 138 | API_ENTRY(CX2341X_OSD_BLT_TEXT, API_RESULT), |
139 | API_ENTRY(CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, API_CACHE), | 139 | API_ENTRY(CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, API_CACHE), |
140 | API_ENTRY(CX2341X_OSD_SET_CHROMA_KEY, API_CACHE), | 140 | API_ENTRY(CX2341X_OSD_SET_CHROMA_KEY, API_CACHE), |
141 | API_ENTRY(CX2341X_OSD_GET_ALPHA_CONTENT_INDEX, API_FAST_RESULT), | 141 | API_ENTRY(CX2341X_OSD_GET_ALPHA_CONTENT_INDEX, API_FAST_RESULT), |
142 | API_ENTRY(CX2341X_OSD_SET_ALPHA_CONTENT_INDEX, API_CACHE) | 142 | API_ENTRY(CX2341X_OSD_SET_ALPHA_CONTENT_INDEX, API_CACHE) |
143 | }; | 143 | }; |
144 | 144 | ||
145 | static int try_mailbox(struct ivtv *itv, struct ivtv_mailbox_data *mbdata, int mb) | 145 | static int try_mailbox(struct ivtv *itv, struct ivtv_mailbox_data *mbdata, int mb) |