diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:45:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:47 -0400 |
commit | e1edb19a001b25c0ce2e52a669cba6b6eb31883c (patch) | |
tree | 3614bae5afd1ebd0014f18f494333200cdd754f4 /drivers | |
parent | dbc40a0e582a88d2561d13d1fea4f3496bff9650 (diff) |
V4L/DVB (7304): pvrusb2: add function pvr2_hdw_cmd_powerdown
Call pvr2_hdw_cmd_powerdown to power down the device
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 23 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.h | 3 |
2 files changed, 22 insertions, 4 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index ae36948c6c1d..9408e8db98ef 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -3193,17 +3193,32 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw) | |||
3193 | } | 3193 | } |
3194 | 3194 | ||
3195 | 3195 | ||
3196 | int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) | 3196 | static int pvr2_hdw_cmd_power_ctrl(struct pvr2_hdw *hdw, int onoff) |
3197 | { | 3197 | { |
3198 | int status; | 3198 | int status; |
3199 | LOCK_TAKE(hdw->ctl_lock); do { | 3199 | LOCK_TAKE(hdw->ctl_lock); do { |
3200 | pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); | 3200 | if (onoff) { |
3201 | hdw->cmd_buffer[0] = FX2CMD_POWER_ON; | 3201 | pvr2_trace(PVR2_TRACE_INIT, "Requesting powerup"); |
3202 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); | 3202 | hdw->cmd_buffer[0] = FX2CMD_POWER_ON; |
3203 | } else { | ||
3204 | pvr2_trace(PVR2_TRACE_INIT, "Requesting powerdown"); | ||
3205 | hdw->cmd_buffer[0] = FX2CMD_POWER_OFF; | ||
3206 | } | ||
3207 | status = pvr2_send_request(hdw, hdw->cmd_buffer, 1, NULL, 0); | ||
3203 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 3208 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
3204 | return status; | 3209 | return status; |
3205 | } | 3210 | } |
3206 | 3211 | ||
3212 | int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) | ||
3213 | { | ||
3214 | return pvr2_hdw_cmd_power_ctrl(hdw, 1); | ||
3215 | } | ||
3216 | |||
3217 | int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *hdw) | ||
3218 | { | ||
3219 | return pvr2_hdw_cmd_power_ctrl(hdw, 0); | ||
3220 | } | ||
3221 | |||
3207 | 3222 | ||
3208 | int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) | 3223 | int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) |
3209 | { | 3224 | { |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 2919a1d9ed0f..57e1ff491497 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h | |||
@@ -255,6 +255,9 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *); | |||
255 | /* Execute simple reset command */ | 255 | /* Execute simple reset command */ |
256 | int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); | 256 | int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); |
257 | 257 | ||
258 | /* suspend */ | ||
259 | int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *); | ||
260 | |||
258 | /* Order decoder to reset */ | 261 | /* Order decoder to reset */ |
259 | int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); | 262 | int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); |
260 | 263 | ||