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>
This commit is contained in:
Mike Isely 2008-07-25 19:35:31 -03:00 committed by Mauro Carvalho Chehab
parent 7e994302ed
commit 31335b13ca
5 changed files with 35 additions and 11 deletions

View file

@ -97,13 +97,13 @@ static const struct pvr2_device_desc pvr2_device_24xxx = {
.flag_has_cx25840 = !0,
.flag_has_wm8775 = !0,
.flag_has_hauppauge_rom = !0,
.flag_has_hauppauge_custom_ir = !0,
.flag_has_analogtuner = !0,
.flag_has_fmradio = !0,
.flag_has_composite = !0,
.flag_has_svideo = !0,
.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
.ir_scheme = PVR2_IR_SCHEME_24XXX,
};
@ -344,6 +344,7 @@ static const struct pvr2_device_desc pvr2_device_73xxx = {
.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
.ir_scheme = PVR2_IR_SCHEME_ZILOG,
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
.dvb_props = &pvr2_73xxx_dvb_props,
#endif
@ -453,6 +454,7 @@ static const struct pvr2_device_desc pvr2_device_750xx = {
.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
.default_std_mask = V4L2_STD_NTSC_M,
.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
.ir_scheme = PVR2_IR_SCHEME_ZILOG,
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
.dvb_props = &pvr2_750xx_dvb_props,
#endif
@ -474,6 +476,7 @@ static const struct pvr2_device_desc pvr2_device_751xx = {
.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
.default_std_mask = V4L2_STD_NTSC_M,
.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
.ir_scheme = PVR2_IR_SCHEME_ZILOG,
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
.dvb_props = &pvr2_751xx_dvb_props,
#endif

View file

@ -48,6 +48,10 @@ struct pvr2_string_table {
#define PVR2_LED_SCHEME_NONE 0
#define PVR2_LED_SCHEME_HAUPPAUGE 1
#define PVR2_IR_SCHEME_NONE 0
#define PVR2_IR_SCHEME_24XXX 1
#define PVR2_IR_SCHEME_ZILOG 2
/* This describes a particular hardware type (except for the USB device ID
which must live in a separate structure due to environmental
constraints). See the top of pvrusb2-hdw.c for where this is
@ -126,15 +130,19 @@ struct pvr2_device_desc {
ensure that it is found. */
unsigned int flag_has_wm8775:1;
/* Device has IR hardware that can be faked into looking like a
normal Hauppauge i2c IR receiver. This is currently very
specific to the 24xxx device, where Hauppauge had replaced their
'standard' I2C IR receiver with a bunch of FPGA logic controlled
directly via the FX2. Turning this on tells the pvrusb2 driver
to virtualize the presence of the non-existant IR receiver chip and
implement the virtual receiver in terms of appropriate FX2
commands. */
unsigned int flag_has_hauppauge_custom_ir:1;
/* Indicate any specialized IR scheme that might need to be
supported by this driver. If not set, then it is assumed that
IR can work without help from the driver (which is frequently
the case). This is otherwise set to one of
PVR2_IR_SCHEME_xxxx. For "xxxx", the value "24XXX" indicates a
Hauppauge 24xxx class device which has an FPGA-hosted IR
receiver that can only be reached via FX2 command codes. In
that case the pvrusb2 driver will emulate the behavior of the
older 29xxx device's IR receiver (a "virtual" I2C chip) in terms
of those command codes. For the value "ZILOG", we're dealing
with an IR chip that must be taken out of reset via another FX2
command code (which is the case for HVR-1950 devices). */
unsigned int ir_scheme:2;
/* These bits define which kinds of sources the device can handle.
Note: Digital tuner presence is inferred by the

View file

@ -24,6 +24,8 @@
#define FX2CMD_MEM_WRITE_DWORD 0x01u
#define FX2CMD_MEM_READ_DWORD 0x02u
#define FX2CMD_HCW_ZILOG_RESET 0x10u /* 1=reset 0=release */
#define FX2CMD_MEM_READ_64BYTES 0x28u
#define FX2CMD_REG_WRITE 0x04u

View file

@ -250,6 +250,7 @@ struct pvr2_fx2cmd_descdef {
static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = {
{FX2CMD_MEM_WRITE_DWORD, "write encoder dword"},
{FX2CMD_MEM_READ_DWORD, "read encoder dword"},
{FX2CMD_HCW_ZILOG_RESET, "zilog IR reset control"},
{FX2CMD_MEM_READ_64BYTES, "read encoder 64bytes"},
{FX2CMD_REG_WRITE, "write encoder register"},
{FX2CMD_REG_READ, "read encoder register"},
@ -1711,6 +1712,14 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
if (!pvr2_hdw_dev_ok(hdw)) return;
}
/* Take the IR chip out of reset, if appropriate */
if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_ZILOG) {
pvr2_issue_simple_cmd(hdw,
FX2CMD_HCW_ZILOG_RESET |
(1 << 8) |
((0) << 16));
}
// This step MUST happen after the earlier powerup step.
pvr2_i2c_core_init(hdw);
if (!pvr2_hdw_dev_ok(hdw)) return;

View file

@ -979,7 +979,9 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
printk(KERN_INFO "%s: IR disabled\n",hdw->name);
hdw->i2c_func[0x18] = i2c_black_hole;
} else if (ir_mode[hdw->unit_number] == 1) {
if (hdw->hdw_desc->flag_has_hauppauge_custom_ir) {
if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_24XXX) {
/* This comment is present PURELY to get
checkpatch.pl to STFU. Lovely, eh? */
hdw->i2c_func[0x18] = i2c_24xxx_ir;
}
}