提交 e1edb19a 编写于 作者: M Michael Krufky 提交者: Mauro Carvalho Chehab

V4L/DVB (7304): pvrusb2: add function pvr2_hdw_cmd_powerdown

Call pvr2_hdw_cmd_powerdown to power down the device
Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: NMike Isely <isely@pobox.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 dbc40a0e
......@@ -3193,17 +3193,32 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw)
}
int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw)
static int pvr2_hdw_cmd_power_ctrl(struct pvr2_hdw *hdw, int onoff)
{
int status;
LOCK_TAKE(hdw->ctl_lock); do {
pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup");
hdw->cmd_buffer[0] = FX2CMD_POWER_ON;
status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
if (onoff) {
pvr2_trace(PVR2_TRACE_INIT, "Requesting powerup");
hdw->cmd_buffer[0] = FX2CMD_POWER_ON;
} else {
pvr2_trace(PVR2_TRACE_INIT, "Requesting powerdown");
hdw->cmd_buffer[0] = FX2CMD_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_powerup(struct pvr2_hdw *hdw)
{
return pvr2_hdw_cmd_power_ctrl(hdw, 1);
}
int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *hdw)
{
return pvr2_hdw_cmd_power_ctrl(hdw, 0);
}
int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
{
......
......@@ -255,6 +255,9 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *);
/* Execute simple reset command */
int pvr2_hdw_cmd_powerup(struct pvr2_hdw *);
/* suspend */
int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *);
/* Order decoder to reset */
int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册