aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c24
-rw-r--r--drivers/media/video/cx88/cx88.h1
2 files changed, 18 insertions, 7 deletions
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index ccd8797ffc83..cd5386ee210c 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -614,13 +614,17 @@ static int cx8802_request_acquire(struct cx8802_driver *drv)
614 core->active_type_id != drv->type_id) 614 core->active_type_id != drv->type_id)
615 return -EBUSY; 615 return -EBUSY;
616 616
617 core->input = 0; 617 if (drv->type_id == CX88_MPEG_DVB) {
618 for (i = 0; 618 /* When switching to DVB, always set the input to the tuner */
619 i < (sizeof(core->board.input) / sizeof(struct cx88_input)); 619 core->last_analog_input = core->input;
620 i++) { 620 core->input = 0;
621 if (core->board.input[i].type == CX88_VMUX_DVB) { 621 for (i = 0;
622 core->input = i; 622 i < (sizeof(core->board.input) / sizeof(struct cx88_input));
623 break; 623 i++) {
624 if (core->board.input[i].type == CX88_VMUX_DVB) {
625 core->input = i;
626 break;
627 }
624 } 628 }
625 } 629 }
626 630
@@ -645,6 +649,12 @@ static int cx8802_request_release(struct cx8802_driver *drv)
645 649
646 if (drv->advise_release && --core->active_ref == 0) 650 if (drv->advise_release && --core->active_ref == 0)
647 { 651 {
652 if (drv->type_id == CX88_MPEG_DVB) {
653 /* If the DVB driver is releasing, reset the input
654 state to the last configured analog input */
655 core->input = core->last_analog_input;
656 }
657
648 drv->advise_release(drv); 658 drv->advise_release(drv);
649 core->active_type_id = CX88_BOARD_NONE; 659 core->active_type_id = CX88_BOARD_NONE;
650 mpeg_dbg(1,"%s() Post release GPIO=%x\n", __func__, cx_read(MO_GP0_IO)); 660 mpeg_dbg(1,"%s() Post release GPIO=%x\n", __func__, cx_read(MO_GP0_IO));
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 425c9fbcc750..fa8d307e1a3d 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -377,6 +377,7 @@ struct cx88_core {
377 u32 audiomode_manual; 377 u32 audiomode_manual;
378 u32 audiomode_current; 378 u32 audiomode_current;
379 u32 input; 379 u32 input;
380 u32 last_analog_input;
380 u32 astat; 381 u32 astat;
381 u32 use_nicam; 382 u32 use_nicam;
382 unsigned long last_change; 383 unsigned long last_change;