aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-driver.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-23 06:46:02 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-23 06:46:02 -0500
commit53a7240416adabb84e32334a9f118b7f05392ba2 (patch)
tree3589d708545b4ba84fcdc39b696f4bd7269dcd5f /drivers/media/video/msp3400-driver.c
parentb639f9d286f2216795492eac2a39b8ed6b4d555c (diff)
V4L/DVB (3402): Fix handling of VIDIOC_G_TUNER audmode in msp3400
- Fix handling of VIDIOC_G_TUNER audmode in msp3400: audmode is only changed by the user with S_TUNER, never by the driver. 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.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 69ed369c2f48..994c340f9d02 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -653,7 +653,6 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
653 } 653 }
654 if (scart) { 654 if (scart) {
655 state->rxsubchans = V4L2_TUNER_SUB_STEREO; 655 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
656 state->audmode = V4L2_TUNER_MODE_STEREO;
657 msp_set_scart(client, scart, 0); 656 msp_set_scart(client, scart, 0);
658 msp_write_dsp(client, 0x000d, 0x1900); 657 msp_write_dsp(client, 0x000d, 0x1900);
659 if (state->opmode != OPMODE_AUTOSELECT) 658 if (state->opmode != OPMODE_AUTOSELECT)
@@ -831,11 +830,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
831 return -EINVAL; 830 return -EINVAL;
832 } 831 }
833 832
834 msp_any_detect_stereo(client); 833 a->capability = V4L2_AUDCAP_STEREO;
835 if (state->audmode == V4L2_TUNER_MODE_STEREO) { 834 a->mode = 0; /* TODO: add support for AVL */
836 a->capability = V4L2_AUDCAP_STEREO;
837 }
838
839 break; 835 break;
840 } 836 }
841 837
@@ -865,15 +861,9 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
865 } 861 }
866 if (scart) { 862 if (scart) {
867 state->rxsubchans = V4L2_TUNER_SUB_STEREO; 863 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
868 state->audmode = V4L2_TUNER_MODE_STEREO;
869 msp_set_scart(client, scart, 0); 864 msp_set_scart(client, scart, 0);
870 msp_write_dsp(client, 0x000d, 0x1900); 865 msp_write_dsp(client, 0x000d, 0x1900);
871 } 866 }
872 if (sarg->capability == V4L2_AUDCAP_STEREO) {
873 state->audmode = V4L2_TUNER_MODE_STEREO;
874 } else {
875 state->audmode &= ~V4L2_TUNER_MODE_STEREO;
876 }
877 msp_any_set_audmode(client, state->audmode); 867 msp_any_set_audmode(client, state->audmode);
878 msp_wake_thread(client); 868 msp_wake_thread(client);
879 break; 869 break;
@@ -898,11 +888,10 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
898 { 888 {
899 struct v4l2_tuner *vt = (struct v4l2_tuner *)arg; 889 struct v4l2_tuner *vt = (struct v4l2_tuner *)arg;
900 890
901 if (state->radio) 891 if (state->radio) /* TODO: add mono/stereo support for radio */
902 break; 892 break;
903 /* only set audmode */ 893 /* only set audmode */
904 if (vt->audmode != -1 && vt->audmode != 0) 894 msp_any_set_audmode(client, vt->audmode);
905 msp_any_set_audmode(client, vt->audmode);
906 break; 895 break;
907 } 896 }
908 897
@@ -927,7 +916,6 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
927 return -EINVAL; 916 return -EINVAL;
928 } 917 }
929 break; 918 break;
930
931 } 919 }
932 920
933 case VIDIOC_S_AUDOUT: 921 case VIDIOC_S_AUDOUT:
@@ -1094,6 +1082,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
1094 1082
1095 memset(state, 0, sizeof(*state)); 1083 memset(state, 0, sizeof(*state));
1096 state->v4l2_std = V4L2_STD_NTSC; 1084 state->v4l2_std = V4L2_STD_NTSC;
1085 state->audmode = V4L2_TUNER_MODE_STEREO;
1097 state->volume = 58880; /* 0db gain */ 1086 state->volume = 58880; /* 0db gain */
1098 state->balance = 32768; /* 0db gain */ 1087 state->balance = 32768; /* 0db gain */
1099 state->bass = 32768; 1088 state->bass = 32768;