diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-04-02 07:21:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 00:57:34 -0400 |
commit | 2eb606db1134ce860cc0cbf8b533b6315d182e21 (patch) | |
tree | 1b0d026b77bc7d1cb9f3d9f60dd4fb7ac655333f /drivers/media/video/msp3400-driver.c | |
parent | 0ead09180a0620eaef761da84259262bfcf21090 (diff) |
V4L/DVB (3709): Improve line-in handling
- improve handling of the EXTERN input: don't start an unnecessary carrier scan
- improve the LOG_STATUS output
- ensure that a carrier scan is started again when switching back to the tuner.
- set correct prescale for L-NICAM
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index b806999d6e0f..5e55f71572f3 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -674,22 +674,31 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
674 | int sc1_out = rt->output & 0xf; | 674 | int sc1_out = rt->output & 0xf; |
675 | int sc2_out = (rt->output >> 4) & 0xf; | 675 | int sc2_out = (rt->output >> 4) & 0xf; |
676 | u16 val, reg; | 676 | u16 val, reg; |
677 | int i; | ||
678 | int extern_input = 1; | ||
677 | 679 | ||
678 | if (state->routing.input == rt->input && | 680 | if (state->routing.input == rt->input && |
679 | state->routing.output == rt->output) | 681 | state->routing.output == rt->output) |
680 | break; | 682 | break; |
681 | state->routing = *rt; | 683 | state->routing = *rt; |
684 | /* check if the tuner input is used */ | ||
685 | for (i = 0; i < 5; i++) { | ||
686 | if (((rt->input >> (4 + i * 4)) & 0xf) == 0) | ||
687 | extern_input = 0; | ||
688 | } | ||
689 | if (extern_input) | ||
690 | state->mode = MSP_MODE_EXTERN; | ||
691 | else | ||
692 | state->mode = MSP_MODE_AM_DETECT; | ||
682 | msp_set_scart(client, sc_in, 0); | 693 | msp_set_scart(client, sc_in, 0); |
683 | msp_set_scart(client, sc1_out, 1); | 694 | msp_set_scart(client, sc1_out, 1); |
684 | msp_set_scart(client, sc2_out, 2); | 695 | msp_set_scart(client, sc2_out, 2); |
685 | msp_set_audmode(client); | 696 | msp_set_audmode(client); |
686 | reg = (state->opmode == OPMODE_AUTOSELECT) ? 0x30 : 0xbb; | 697 | reg = (state->opmode == OPMODE_AUTOSELECT) ? 0x30 : 0xbb; |
687 | val = msp_read_dem(client, reg); | 698 | val = msp_read_dem(client, reg); |
688 | if (tuner != ((val >> 8) & 1)) { | 699 | msp_write_dem(client, reg, (val & ~0x100) | (tuner << 8)); |
689 | msp_write_dem(client, reg, (val & ~0x100) | (tuner << 8)); | 700 | /* wake thread when a new input is chosen */ |
690 | /* wake thread when a new tuner input is chosen */ | 701 | msp_wake_thread(client); |
691 | msp_wake_thread(client); | ||
692 | } | ||
693 | break; | 702 | break; |
694 | } | 703 | } |
695 | 704 | ||
@@ -794,7 +803,9 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
794 | case MSP_MODE_EXTERN: p = "External input"; break; | 803 | case MSP_MODE_EXTERN: p = "External input"; break; |
795 | default: p = "unknown"; break; | 804 | default: p = "unknown"; break; |
796 | } | 805 | } |
797 | if (state->opmode == OPMODE_MANUAL) { | 806 | if (state->mode == MSP_MODE_EXTERN) { |
807 | v4l_info(client, "Mode: %s\n", p); | ||
808 | } else if (state->opmode == OPMODE_MANUAL) { | ||
798 | v4l_info(client, "Mode: %s (%s%s)\n", p, | 809 | v4l_info(client, "Mode: %s (%s%s)\n", p, |
799 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", | 810 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", |
800 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); | 811 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); |