diff options
author | Mike Isely <isely@pobox.com> | 2008-07-25 18:35:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-26 11:54:35 -0400 |
commit | 31335b13ca3925f361702ca4fc895ab165beddb9 (patch) | |
tree | aadfdf374ceb7a69c043da27b0583c3b53d4468e /drivers/media | |
parent | 7e994302ed3fc6d209ce247ad5b6d9c2499bf7c2 (diff) |
V4L/DVB (8474): pvrusb2: Enable IR chip on HVR-1900 class devices
The Zilog IR chip on HVR-1900 devices is held in reset when the device
initializes. We have to bring this chip out of reset before LIRC has
any chance of operating the chip. So do it.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-devattr.c | 5 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-devattr.h | 26 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h | 2 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 9 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 4 |
5 files changed, 35 insertions, 11 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c index 5d036e7e3f07..e3b051197087 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 | ||
@@ -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 |
@@ -453,6 +454,7 @@ 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 |
@@ -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 { | |||
250 | static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = { | 250 | static 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 | } |