aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/Kconfig2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-context.h4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c11
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.h26
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c9
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-core.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c6
8 files changed, 41 insertions, 23 deletions
diff --git a/drivers/media/video/pvrusb2/Kconfig b/drivers/media/video/pvrusb2/Kconfig
index 4482b2c72ced..19eb274c9cd0 100644
--- a/drivers/media/video/pvrusb2/Kconfig
+++ b/drivers/media/video/pvrusb2/Kconfig
@@ -2,8 +2,6 @@ config VIDEO_PVRUSB2
2 tristate "Hauppauge WinTV-PVR USB2 support" 2 tristate "Hauppauge WinTV-PVR USB2 support"
3 depends on VIDEO_V4L2 && I2C 3 depends on VIDEO_V4L2 && I2C
4 depends on VIDEO_MEDIA # Avoids pvrusb = Y / DVB = M 4 depends on VIDEO_MEDIA # Avoids pvrusb = Y / DVB = M
5 depends on HOTPLUG # due to FW_LOADER
6 select FW_LOADER
7 select VIDEO_TUNER 5 select VIDEO_TUNER
8 select VIDEO_TVEEPROM 6 select VIDEO_TVEEPROM
9 select VIDEO_CX2341X 7 select VIDEO_CX2341X
diff --git a/drivers/media/video/pvrusb2/pvrusb2-context.h b/drivers/media/video/pvrusb2/pvrusb2-context.h
index 61801291c2af..d657e53bbfa3 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-context.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-context.h
@@ -16,8 +16,8 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * 17 *
18 */ 18 */
19#ifndef __PVRUSB2_BASE_H 19#ifndef __PVRUSB2_CONTEXT_H
20#define __PVRUSB2_BASE_H 20#define __PVRUSB2_CONTEXT_H
21 21
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23#include <linux/usb.h> 23#include <linux/usb.h>
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index 5d036e7e3f07..88e175168438 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -97,13 +97,13 @@ static const struct pvr2_device_desc pvr2_device_24xxx = {
97 .flag_has_cx25840 = !0, 97 .flag_has_cx25840 = !0,
98 .flag_has_wm8775 = !0, 98 .flag_has_wm8775 = !0,
99 .flag_has_hauppauge_rom = !0, 99 .flag_has_hauppauge_rom = !0,
100 .flag_has_hauppauge_custom_ir = !0,
101 .flag_has_analogtuner = !0, 100 .flag_has_analogtuner = !0,
102 .flag_has_fmradio = !0, 101 .flag_has_fmradio = !0,
103 .flag_has_composite = !0, 102 .flag_has_composite = !0,
104 .flag_has_svideo = !0, 103 .flag_has_svideo = !0,
105 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 104 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
106 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, 105 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
106 .ir_scheme = PVR2_IR_SCHEME_24XXX,
107}; 107};
108 108
109 109
@@ -330,7 +330,7 @@ static const char *pvr2_fw1_names_73xxx[] = {
330}; 330};
331 331
332static const struct pvr2_device_desc pvr2_device_73xxx = { 332static const struct pvr2_device_desc pvr2_device_73xxx = {
333 .description = "WinTV PVR USB2 Model Category 73xxx", 333 .description = "WinTV HVR-1900 Model Category 73xxx",
334 .shortname = "73xxx", 334 .shortname = "73xxx",
335 .client_modules.lst = pvr2_client_73xxx, 335 .client_modules.lst = pvr2_client_73xxx,
336 .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx), 336 .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
@@ -344,6 +344,7 @@ static const struct pvr2_device_desc pvr2_device_73xxx = {
344 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 344 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
345 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, 345 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
346 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, 346 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
347 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
347#ifdef CONFIG_VIDEO_PVRUSB2_DVB 348#ifdef CONFIG_VIDEO_PVRUSB2_DVB
348 .dvb_props = &pvr2_73xxx_dvb_props, 349 .dvb_props = &pvr2_73xxx_dvb_props,
349#endif 350#endif
@@ -438,7 +439,7 @@ static const char *pvr2_fw1_names_75xxx[] = {
438}; 439};
439 440
440static const struct pvr2_device_desc pvr2_device_750xx = { 441static const struct pvr2_device_desc pvr2_device_750xx = {
441 .description = "WinTV PVR USB2 Model Category 750xx", 442 .description = "WinTV HVR-1950 Model Category 750xx",
442 .shortname = "750xx", 443 .shortname = "750xx",
443 .client_modules.lst = pvr2_client_75xxx, 444 .client_modules.lst = pvr2_client_75xxx,
444 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx), 445 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
@@ -453,13 +454,14 @@ static const struct pvr2_device_desc pvr2_device_750xx = {
453 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, 454 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
454 .default_std_mask = V4L2_STD_NTSC_M, 455 .default_std_mask = V4L2_STD_NTSC_M,
455 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, 456 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
457 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
456#ifdef CONFIG_VIDEO_PVRUSB2_DVB 458#ifdef CONFIG_VIDEO_PVRUSB2_DVB
457 .dvb_props = &pvr2_750xx_dvb_props, 459 .dvb_props = &pvr2_750xx_dvb_props,
458#endif 460#endif
459}; 461};
460 462
461static const struct pvr2_device_desc pvr2_device_751xx = { 463static const struct pvr2_device_desc pvr2_device_751xx = {
462 .description = "WinTV PVR USB2 Model Category 751xx", 464 .description = "WinTV HVR-1950 Model Category 751xx",
463 .shortname = "751xx", 465 .shortname = "751xx",
464 .client_modules.lst = pvr2_client_75xxx, 466 .client_modules.lst = pvr2_client_75xxx,
465 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx), 467 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
@@ -474,6 +476,7 @@ static const struct pvr2_device_desc pvr2_device_751xx = {
474 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, 476 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
475 .default_std_mask = V4L2_STD_NTSC_M, 477 .default_std_mask = V4L2_STD_NTSC_M,
476 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, 478 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
479 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
477#ifdef CONFIG_VIDEO_PVRUSB2_DVB 480#ifdef CONFIG_VIDEO_PVRUSB2_DVB
478 .dvb_props = &pvr2_751xx_dvb_props, 481 .dvb_props = &pvr2_751xx_dvb_props,
479#endif 482#endif
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
index e23ce1d2edd7..cb3a33eb0276 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
@@ -48,6 +48,10 @@ struct pvr2_string_table {
48#define PVR2_LED_SCHEME_NONE 0 48#define PVR2_LED_SCHEME_NONE 0
49#define PVR2_LED_SCHEME_HAUPPAUGE 1 49#define PVR2_LED_SCHEME_HAUPPAUGE 1
50 50
51#define PVR2_IR_SCHEME_NONE 0
52#define PVR2_IR_SCHEME_24XXX 1
53#define PVR2_IR_SCHEME_ZILOG 2
54
51/* This describes a particular hardware type (except for the USB device ID 55/* This describes a particular hardware type (except for the USB device ID
52 which must live in a separate structure due to environmental 56 which must live in a separate structure due to environmental
53 constraints). See the top of pvrusb2-hdw.c for where this is 57 constraints). See the top of pvrusb2-hdw.c for where this is
@@ -126,15 +130,19 @@ struct pvr2_device_desc {
126 ensure that it is found. */ 130 ensure that it is found. */
127 unsigned int flag_has_wm8775:1; 131 unsigned int flag_has_wm8775:1;
128 132
129 /* Device has IR hardware that can be faked into looking like a 133 /* Indicate any specialized IR scheme that might need to be
130 normal Hauppauge i2c IR receiver. This is currently very 134 supported by this driver. If not set, then it is assumed that
131 specific to the 24xxx device, where Hauppauge had replaced their 135 IR can work without help from the driver (which is frequently
132 'standard' I2C IR receiver with a bunch of FPGA logic controlled 136 the case). This is otherwise set to one of
133 directly via the FX2. Turning this on tells the pvrusb2 driver 137 PVR2_IR_SCHEME_xxxx. For "xxxx", the value "24XXX" indicates a
134 to virtualize the presence of the non-existant IR receiver chip and 138 Hauppauge 24xxx class device which has an FPGA-hosted IR
135 implement the virtual receiver in terms of appropriate FX2 139 receiver that can only be reached via FX2 command codes. In
136 commands. */ 140 that case the pvrusb2 driver will emulate the behavior of the
137 unsigned int flag_has_hauppauge_custom_ir:1; 141 older 29xxx device's IR receiver (a "virtual" I2C chip) in terms
142 of those command codes. For the value "ZILOG", we're dealing
143 with an IR chip that must be taken out of reset via another FX2
144 command code (which is the case for HVR-1950 devices). */
145 unsigned int ir_scheme:2;
138 146
139 /* These bits define which kinds of sources the device can handle. 147 /* These bits define which kinds of sources the device can handle.
140 Note: Digital tuner presence is inferred by the 148 Note: Digital tuner presence is inferred by the
diff --git a/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h b/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h
index b58369e7f30b..614755ea2ea3 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h
@@ -24,6 +24,8 @@
24#define FX2CMD_MEM_WRITE_DWORD 0x01u 24#define FX2CMD_MEM_WRITE_DWORD 0x01u
25#define FX2CMD_MEM_READ_DWORD 0x02u 25#define FX2CMD_MEM_READ_DWORD 0x02u
26 26
27#define FX2CMD_HCW_ZILOG_RESET 0x10u /* 1=reset 0=release */
28
27#define FX2CMD_MEM_READ_64BYTES 0x28u 29#define FX2CMD_MEM_READ_64BYTES 0x28u
28 30
29#define FX2CMD_REG_WRITE 0x04u 31#define FX2CMD_REG_WRITE 0x04u
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index a5217a2cf4c0..f051c6aa7f1f 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -250,6 +250,7 @@ struct pvr2_fx2cmd_descdef {
250static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = { 250static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = {
251 {FX2CMD_MEM_WRITE_DWORD, "write encoder dword"}, 251 {FX2CMD_MEM_WRITE_DWORD, "write encoder dword"},
252 {FX2CMD_MEM_READ_DWORD, "read encoder dword"}, 252 {FX2CMD_MEM_READ_DWORD, "read encoder dword"},
253 {FX2CMD_HCW_ZILOG_RESET, "zilog IR reset control"},
253 {FX2CMD_MEM_READ_64BYTES, "read encoder 64bytes"}, 254 {FX2CMD_MEM_READ_64BYTES, "read encoder 64bytes"},
254 {FX2CMD_REG_WRITE, "write encoder register"}, 255 {FX2CMD_REG_WRITE, "write encoder register"},
255 {FX2CMD_REG_READ, "read encoder register"}, 256 {FX2CMD_REG_READ, "read encoder register"},
@@ -1711,6 +1712,14 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
1711 if (!pvr2_hdw_dev_ok(hdw)) return; 1712 if (!pvr2_hdw_dev_ok(hdw)) return;
1712 } 1713 }
1713 1714
1715 /* Take the IR chip out of reset, if appropriate */
1716 if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_ZILOG) {
1717 pvr2_issue_simple_cmd(hdw,
1718 FX2CMD_HCW_ZILOG_RESET |
1719 (1 << 8) |
1720 ((0) << 16));
1721 }
1722
1714 // This step MUST happen after the earlier powerup step. 1723 // This step MUST happen after the earlier powerup step.
1715 pvr2_i2c_core_init(hdw); 1724 pvr2_i2c_core_init(hdw);
1716 if (!pvr2_hdw_dev_ok(hdw)) return; 1725 if (!pvr2_hdw_dev_ok(hdw)) return;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index 9d3c18b24744..e600576a6c4b 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -979,7 +979,9 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
979 printk(KERN_INFO "%s: IR disabled\n",hdw->name); 979 printk(KERN_INFO "%s: IR disabled\n",hdw->name);
980 hdw->i2c_func[0x18] = i2c_black_hole; 980 hdw->i2c_func[0x18] = i2c_black_hole;
981 } else if (ir_mode[hdw->unit_number] == 1) { 981 } else if (ir_mode[hdw->unit_number] == 1) {
982 if (hdw->hdw_desc->flag_has_hauppauge_custom_ir) { 982 if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_24XXX) {
983 /* This comment is present PURELY to get
984 checkpatch.pl to STFU. Lovely, eh? */
983 hdw->i2c_func[0x18] = i2c_24xxx_ir; 985 hdw->i2c_func[0x18] = i2c_24xxx_ir;
984 } 986 }
985 } 987 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 0d72dc470fef..00306faeac01 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -30,6 +30,7 @@
30#include <linux/videodev2.h> 30#include <linux/videodev2.h>
31#include <media/v4l2-dev.h> 31#include <media/v4l2-dev.h>
32#include <media/v4l2-common.h> 32#include <media/v4l2-common.h>
33#include <media/v4l2-ioctl.h>
33 34
34struct pvr2_v4l2_dev; 35struct pvr2_v4l2_dev;
35struct pvr2_v4l2_fh; 36struct pvr2_v4l2_fh;
@@ -1160,11 +1161,6 @@ static const struct file_operations vdev_fops = {
1160 1161
1161 1162
1162static struct video_device vdev_template = { 1163static struct video_device vdev_template = {
1163 .owner = THIS_MODULE,
1164 .type = VID_TYPE_CAPTURE | VID_TYPE_TUNER,
1165 .type2 = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VBI_CAPTURE
1166 | V4L2_CAP_TUNER | V4L2_CAP_AUDIO
1167 | V4L2_CAP_READWRITE),
1168 .fops = &vdev_fops, 1164 .fops = &vdev_fops,
1169}; 1165};
1170 1166