From 84147f3dd9187cd0c9810801be1282419a8ea00a Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Tue, 22 Apr 2008 14:45:40 -0300 Subject: [PATCH] V4L/DVB (7307): pvrusb2: New functions for additional FX2 digital-related commands This code is actually part of a larger set from Mike Krufky , to support ATSC streaming from within the pvrusb2 driver. More to come... Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h | 9 +++ drivers/media/video/pvrusb2/pvrusb2-hdw.c | 55 +++++++++++++++++++ drivers/media/video/pvrusb2/pvrusb2-hdw.h | 8 +++ 3 files changed, 72 insertions(+) diff --git a/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h b/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h index ffbc6d096108..a866c949243c 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h +++ b/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h @@ -49,6 +49,15 @@ #define FX2CMD_GET_EEPROM_ADDR 0xeb #define FX2CMD_GET_IR_CODE 0xec +#define FX2CMD_HCW_DEMOD_RESETIN 0xf0 +#define FX2CMD_HCW_DTV_STREAMING_ON 0xf1 +#define FX2CMD_HCW_DTV_STREAMING_OFF 0xf2 + +#define FX2CMD_ONAIR_DTV_STREAMING_ON 0xa0 +#define FX2CMD_ONAIR_DTV_STREAMING_OFF 0xa1 +#define FX2CMD_ONAIR_DTV_POWER_ON 0xa2 +#define FX2CMD_ONAIR_DTV_POWER_OFF 0xa3 + #endif /* _PVRUSB2_FX2_CMD_H_ */ /* diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 9408e8db98ef..8eabb67e5895 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -3241,6 +3241,61 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) } +int pvr2_hdw_cmd_hcw_demod_reset(struct pvr2_hdw *hdw, int onoff) +{ + int status; + + LOCK_TAKE(hdw->ctl_lock); do { + pvr2_trace(PVR2_TRACE_INIT, "Issuing fe demod wake command"); + hdw->flag_ok = !0; + hdw->cmd_buffer[0] = FX2CMD_HCW_DEMOD_RESETIN; + hdw->cmd_buffer[1] = onoff; + status = pvr2_send_request(hdw, hdw->cmd_buffer, 2, NULL, 0); + } while (0); LOCK_GIVE(hdw->ctl_lock); + + return status; +} + +int pvr2_hdw_cmd_hcw_usbstream_dvb(struct pvr2_hdw *hdw, int onoff) +{ + int status; + LOCK_TAKE(hdw->ctl_lock); do { + hdw->cmd_buffer[0] = + (onoff ? FX2CMD_HCW_DTV_STREAMING_ON : + FX2CMD_HCW_DTV_STREAMING_OFF); + status = pvr2_send_request(hdw, hdw->cmd_buffer, 1, NULL, 0); + } while (0); LOCK_GIVE(hdw->ctl_lock); + return status; +} + +int pvr2_hdw_cmd_onair_fe_power_ctrl(struct pvr2_hdw *hdw, int onoff) +{ + int status; + + LOCK_TAKE(hdw->ctl_lock); do { + pvr2_trace(PVR2_TRACE_INIT, "Issuing fe power command to CPLD"); + hdw->flag_ok = !0; + hdw->cmd_buffer[0] = + (onoff ? FX2CMD_ONAIR_DTV_POWER_ON : + FX2CMD_ONAIR_DTV_POWER_OFF); + status = pvr2_send_request(hdw, hdw->cmd_buffer, 1, NULL, 0); + } while (0); LOCK_GIVE(hdw->ctl_lock); + + return status; +} + +int pvr2_hdw_cmd_onair_digital_path_ctrl(struct pvr2_hdw *hdw, int onoff) +{ + int status; + LOCK_TAKE(hdw->ctl_lock); do { + hdw->cmd_buffer[0] = + (onoff ? FX2CMD_ONAIR_DTV_STREAMING_ON : + FX2CMD_ONAIR_DTV_STREAMING_OFF); + status = pvr2_send_request(hdw, hdw->cmd_buffer, 1, NULL, 0); + } while (0); LOCK_GIVE(hdw->ctl_lock); + return status; +} + /* Stop / start video stream transport */ static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) { diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 57e1ff491497..e9090c5064d8 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -258,6 +258,14 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); /* suspend */ int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *); +/* Hauppauge - specific */ +int pvr2_hdw_cmd_hcw_demod_reset(struct pvr2_hdw *hdw, int onoff); +int pvr2_hdw_cmd_hcw_usbstream_dvb(struct pvr2_hdw *hdw, int onoff); + +/* onair - specific */ +int pvr2_hdw_cmd_onair_fe_power_ctrl(struct pvr2_hdw *hdw, int onoff); +int pvr2_hdw_cmd_onair_digital_path_ctrl(struct pvr2_hdw *hdw, int onoff); + /* Order decoder to reset */ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); -- 2.34.1