diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-01-23 14:11:09 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-23 14:11:09 -0500 |
commit | 8a4b275f9c192921797f45c2d4b5e4bc3875500a (patch) | |
tree | da12ba774968078df22718a58221e87b71387fca /drivers/media/video/cx25840 | |
parent | 9aeb4b051b65c0248ea6589096950413c4da9d63 (diff) |
V4L/DVB (3427): audmode and rxsubchans fixes (VIDIOC_G/S_TUNER)
- Audmode and rxsubchans fixes in msp3400, tuner, tvaudio and cx25840.
- msp3400 cleanups
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 46 | ||||
-rw-r--r-- | drivers/media/video/cx25840/cx25840.h | 1 |
2 files changed, 27 insertions, 20 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index c66c2c1f4809..3acd587b160c 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -753,6 +753,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, | |||
753 | 753 | ||
754 | memset(input, 0, sizeof(*input)); | 754 | memset(input, 0, sizeof(*input)); |
755 | input->index = state->aud_input; | 755 | input->index = state->aud_input; |
756 | input->capability = V4L2_AUDCAP_STEREO; | ||
756 | break; | 757 | break; |
757 | } | 758 | } |
758 | 759 | ||
@@ -763,7 +764,6 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, | |||
763 | case VIDIOC_G_TUNER: | 764 | case VIDIOC_G_TUNER: |
764 | { | 765 | { |
765 | u8 mode = cx25840_read(client, 0x804); | 766 | u8 mode = cx25840_read(client, 0x804); |
766 | u8 pref = cx25840_read(client, 0x809) & 0xf; | ||
767 | u8 vpres = cx25840_read(client, 0x80a) & 0x10; | 767 | u8 vpres = cx25840_read(client, 0x80a) & 0x10; |
768 | int val = 0; | 768 | int val = 0; |
769 | 769 | ||
@@ -783,44 +783,49 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, | |||
783 | val |= V4L2_TUNER_SUB_MONO; | 783 | val |= V4L2_TUNER_SUB_MONO; |
784 | 784 | ||
785 | if (mode == 2 || mode == 4) | 785 | if (mode == 2 || mode == 4) |
786 | val |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; | 786 | val = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; |
787 | 787 | ||
788 | if (mode & 0x10) | 788 | if (mode & 0x10) |
789 | val |= V4L2_TUNER_SUB_SAP; | 789 | val |= V4L2_TUNER_SUB_SAP; |
790 | 790 | ||
791 | vt->rxsubchans = val; | 791 | vt->rxsubchans = val; |
792 | 792 | vt->audmode = state->audmode; | |
793 | switch (pref) { | ||
794 | case 0: | ||
795 | vt->audmode = V4L2_TUNER_MODE_MONO; | ||
796 | break; | ||
797 | case 1: | ||
798 | case 2: | ||
799 | vt->audmode = V4L2_TUNER_MODE_LANG2; | ||
800 | break; | ||
801 | case 4: | ||
802 | default: | ||
803 | vt->audmode = V4L2_TUNER_MODE_STEREO; | ||
804 | } | ||
805 | break; | 793 | break; |
806 | } | 794 | } |
807 | 795 | ||
808 | case VIDIOC_S_TUNER: | 796 | case VIDIOC_S_TUNER: |
797 | if (state->radio) | ||
798 | break; | ||
799 | |||
809 | switch (vt->audmode) { | 800 | switch (vt->audmode) { |
810 | case V4L2_TUNER_MODE_MONO: | 801 | case V4L2_TUNER_MODE_MONO: |
811 | case V4L2_TUNER_MODE_LANG1: | 802 | /* mono -> mono |
812 | /* Force PREF_MODE to MONO */ | 803 | stereo -> mono |
804 | bilingual -> lang1 */ | ||
813 | cx25840_and_or(client, 0x809, ~0xf, 0x00); | 805 | cx25840_and_or(client, 0x809, ~0xf, 0x00); |
814 | break; | 806 | break; |
815 | case V4L2_TUNER_MODE_STEREO: | 807 | case V4L2_TUNER_MODE_LANG1: |
816 | /* Force PREF_MODE to STEREO */ | 808 | /* mono -> mono |
809 | stereo -> stereo | ||
810 | bilingual -> lang1 */ | ||
817 | cx25840_and_or(client, 0x809, ~0xf, 0x04); | 811 | cx25840_and_or(client, 0x809, ~0xf, 0x04); |
818 | break; | 812 | break; |
813 | case V4L2_TUNER_MODE_STEREO: | ||
814 | /* mono -> mono | ||
815 | stereo -> stereo | ||
816 | bilingual -> lang1/lang2 */ | ||
817 | cx25840_and_or(client, 0x809, ~0xf, 0x07); | ||
818 | break; | ||
819 | case V4L2_TUNER_MODE_LANG2: | 819 | case V4L2_TUNER_MODE_LANG2: |
820 | /* Force PREF_MODE to LANG2 */ | 820 | /* mono -> mono |
821 | stereo ->stereo | ||
822 | bilingual -> lang2 */ | ||
821 | cx25840_and_or(client, 0x809, ~0xf, 0x01); | 823 | cx25840_and_or(client, 0x809, ~0xf, 0x01); |
822 | break; | 824 | break; |
825 | default: | ||
826 | return -EINVAL; | ||
823 | } | 827 | } |
828 | state->audmode = vt->audmode; | ||
824 | break; | 829 | break; |
825 | 830 | ||
826 | case VIDIOC_G_FMT: | 831 | case VIDIOC_G_FMT: |
@@ -901,6 +906,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, | |||
901 | state->aud_input = CX25840_AUDIO8; | 906 | state->aud_input = CX25840_AUDIO8; |
902 | state->audclk_freq = 48000; | 907 | state->audclk_freq = 48000; |
903 | state->pvr150_workaround = 0; | 908 | state->pvr150_workaround = 0; |
909 | state->audmode = V4L2_TUNER_MODE_LANG1; | ||
904 | 910 | ||
905 | cx25840_initialize(client, 1); | 911 | cx25840_initialize(client, 1); |
906 | 912 | ||
diff --git a/drivers/media/video/cx25840/cx25840.h b/drivers/media/video/cx25840/cx25840.h index fd22f30dcc1b..dd70664d1dd9 100644 --- a/drivers/media/video/cx25840/cx25840.h +++ b/drivers/media/video/cx25840/cx25840.h | |||
@@ -78,6 +78,7 @@ struct cx25840_state { | |||
78 | enum cx25840_video_input vid_input; | 78 | enum cx25840_video_input vid_input; |
79 | enum cx25840_audio_input aud_input; | 79 | enum cx25840_audio_input aud_input; |
80 | u32 audclk_freq; | 80 | u32 audclk_freq; |
81 | int audmode; | ||
81 | }; | 82 | }; |
82 | 83 | ||
83 | /* ----------------------------------------------------------------------- */ | 84 | /* ----------------------------------------------------------------------- */ |