diff options
author | Mike Isely <isely@pobox.com> | 2008-04-22 13:45:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:47 -0400 |
commit | c55a97d7538d5f3abbee5486e37e56e896478fbd (patch) | |
tree | f5eb276e4488cc0104646bf02f279140dad06b9f /drivers/media/video/pvrusb2 | |
parent | 1b9c18c54d68cc22f090948fc47890c56d22153d (diff) |
V4L/DVB (7312): pvrusb2: Indicate streaming status via LED
Most of this originates from Michael Krufky <mkrufky@linuxtv.org>;
these changes move LED control into separate functions. This is the
first step in new work to make LED control a device-specific attribute.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-encoder.c | 10 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 21 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.h | 3 |
3 files changed, 26 insertions, 8 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 64062879981e..ccb5d14ddf85 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c | |||
@@ -480,9 +480,7 @@ int pvr2_encoder_start(struct pvr2_hdw *hdw) | |||
480 | /* unmask some interrupts */ | 480 | /* unmask some interrupts */ |
481 | pvr2_write_register(hdw, 0x0048, 0xbfffffff); | 481 | pvr2_write_register(hdw, 0x0048, 0xbfffffff); |
482 | 482 | ||
483 | /* change some GPIO data */ | 483 | pvr2_led_ctrl(hdw, 1); |
484 | pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000481); | ||
485 | pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000000); | ||
486 | 484 | ||
487 | pvr2_encoder_vcmd(hdw,CX2341X_ENC_MUTE_VIDEO,1, | 485 | pvr2_encoder_vcmd(hdw,CX2341X_ENC_MUTE_VIDEO,1, |
488 | hdw->input_val == PVR2_CVAL_INPUT_RADIO ? 1 : 0); | 486 | hdw->input_val == PVR2_CVAL_INPUT_RADIO ? 1 : 0); |
@@ -526,11 +524,7 @@ int pvr2_encoder_stop(struct pvr2_hdw *hdw) | |||
526 | break; | 524 | break; |
527 | } | 525 | } |
528 | 526 | ||
529 | /* change some GPIO data */ | 527 | pvr2_led_ctrl(hdw, 0); |
530 | /* Note: Bit d7 of dir appears to control the LED. So we shut it | ||
531 | off here. */ | ||
532 | pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000401); | ||
533 | pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000000); | ||
534 | 528 | ||
535 | return status; | 529 | return status; |
536 | } | 530 | } |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index a85ffdaadccb..9b1e22f2e555 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -3357,6 +3357,27 @@ static void pvr2_hdw_cmd_modeswitch(struct pvr2_hdw *hdw,int digitalFl) | |||
3357 | } | 3357 | } |
3358 | 3358 | ||
3359 | 3359 | ||
3360 | /* Toggle LED */ | ||
3361 | int pvr2_led_ctrl(struct pvr2_hdw *hdw, int onoff) | ||
3362 | { | ||
3363 | /* change some GPIO data | ||
3364 | * | ||
3365 | * note: bit d7 of dir appears to control the LED, | ||
3366 | * so we shut it off here. | ||
3367 | * | ||
3368 | * FIXME: is this device-specific? | ||
3369 | */ | ||
3370 | if (onoff) | ||
3371 | pvr2_hdw_gpio_chg_dir(hdw, 0xffffffff, 0x00000481); | ||
3372 | else | ||
3373 | pvr2_hdw_gpio_chg_dir(hdw, 0xffffffff, 0x00000401); | ||
3374 | |||
3375 | pvr2_hdw_gpio_chg_out(hdw, 0xffffffff, 0x00000000); | ||
3376 | |||
3377 | return 0; | ||
3378 | } | ||
3379 | |||
3380 | |||
3360 | /* Stop / start video stream transport */ | 3381 | /* Stop / start video stream transport */ |
3361 | static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) | 3382 | static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) |
3362 | { | 3383 | { |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 57e1ff491497..4fc9db3efff2 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h | |||
@@ -258,6 +258,9 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); | |||
258 | /* suspend */ | 258 | /* suspend */ |
259 | int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *); | 259 | int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *); |
260 | 260 | ||
261 | /* toggle LED */ | ||
262 | int pvr2_led_ctrl(struct pvr2_hdw *hdw, int onoff); | ||
263 | |||
261 | /* Order decoder to reset */ | 264 | /* Order decoder to reset */ |
262 | int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); | 265 | int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); |
263 | 266 | ||