aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-hdw.c52
1 files changed, 38 insertions, 14 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index 816c85786c2a..6fe8b9af858a 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -1,17 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
*
- *
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
*/
#include <linux/errno.h>
@@ -316,6 +306,8 @@ static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = {
{FX2CMD_ONAIR_DTV_STREAMING_OFF, "onair dtv stream off"},
{FX2CMD_ONAIR_DTV_POWER_ON, "onair dtv power on"},
{FX2CMD_ONAIR_DTV_POWER_OFF, "onair dtv power off"},
+ {FX2CMD_HCW_DEMOD_RESET_PIN, "hcw demod reset pin"},
+ {FX2CMD_HCW_MAKO_SLEEP_PIN, "hcw mako sleep pin"},
};
@@ -1680,7 +1672,7 @@ static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl)
}
if (!hdw->flag_decoder_missed) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
- "WARNING: No decoder present");
+ "***WARNING*** No decoder present");
hdw->flag_decoder_missed = !0;
trace_stbit("flag_decoder_missed",
hdw->flag_decoder_missed);
@@ -2139,10 +2131,28 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
((0) << 16));
}
- // This step MUST happen after the earlier powerup step.
+ /* This step MUST happen after the earlier powerup step */
pvr2_i2c_core_init(hdw);
if (!pvr2_hdw_dev_ok(hdw)) return;
+ /* Reset demod only on Hauppauge 160xxx platform */
+ if (le16_to_cpu(hdw->usb_dev->descriptor.idVendor) == 0x2040 &&
+ (le16_to_cpu(hdw->usb_dev->descriptor.idProduct) == 0x7502 ||
+ le16_to_cpu(hdw->usb_dev->descriptor.idProduct) == 0x7510)) {
+ pr_info("%s(): resetting 160xxx demod\n", __func__);
+ /* TODO: not sure this is proper place to reset once only */
+ pvr2_issue_simple_cmd(hdw,
+ FX2CMD_HCW_DEMOD_RESET_PIN |
+ (1 << 8) |
+ ((0) << 16));
+ usleep_range(10000, 10500);
+ pvr2_issue_simple_cmd(hdw,
+ FX2CMD_HCW_DEMOD_RESET_PIN |
+ (1 << 8) |
+ ((1) << 16));
+ usleep_range(10000, 10500);
+ }
+
pvr2_hdw_load_modules(hdw);
if (!pvr2_hdw_dev_ok(hdw)) return;
@@ -2366,7 +2376,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
if (hdw_desc->flag_is_experimental) {
pvr2_trace(PVR2_TRACE_INFO, "**********");
pvr2_trace(PVR2_TRACE_INFO,
- "WARNING: Support for this device (%s) is experimental.",
+ "***WARNING*** Support for this device (%s) is experimental.",
hdw_desc->description);
pvr2_trace(PVR2_TRACE_INFO,
"Important functionality might not be entirely working.");
@@ -4012,6 +4022,20 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
static int pvr2_hdw_cmd_hcw_demod_reset(struct pvr2_hdw *hdw, int onoff)
{
hdw->flag_ok = !0;
+
+ /* Use this for Hauppauge 160xxx only */
+ if (le16_to_cpu(hdw->usb_dev->descriptor.idVendor) == 0x2040 &&
+ (le16_to_cpu(hdw->usb_dev->descriptor.idProduct) == 0x7502 ||
+ le16_to_cpu(hdw->usb_dev->descriptor.idProduct) == 0x7510)) {
+ pr_debug("%s(): resetting demod on Hauppauge 160xxx platform skipped\n",
+ __func__);
+ /* Can't reset 160xxx or it will trash Demod tristate */
+ return pvr2_issue_simple_cmd(hdw,
+ FX2CMD_HCW_MAKO_SLEEP_PIN |
+ (1 << 8) |
+ ((onoff ? 1 : 0) << 16));
+ }
+
return pvr2_issue_simple_cmd(hdw,
FX2CMD_HCW_DEMOD_RESETIN |
(1 << 8) |