diff options
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 31 | ||||
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/tvp5150.c | 122 |
4 files changed, 11 insertions, 146 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index dfba33d0fa61..daa2ac2e6b90 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1141,26 +1141,16 @@ static int em28xx_do_ioctl(struct inode *inode, struct file *filp, | |||
1141 | case VIDIOC_G_TUNER: | 1141 | case VIDIOC_G_TUNER: |
1142 | { | 1142 | { |
1143 | struct v4l2_tuner *t = arg; | 1143 | struct v4l2_tuner *t = arg; |
1144 | int status = 0; | ||
1145 | 1144 | ||
1146 | if (0 != t->index) | 1145 | if (0 != t->index) |
1147 | return -EINVAL; | 1146 | return -EINVAL; |
1148 | 1147 | ||
1149 | memset(t, 0, sizeof(*t)); | 1148 | memset(t, 0, sizeof(*t)); |
1150 | strcpy(t->name, "Tuner"); | 1149 | strcpy(t->name, "Tuner"); |
1151 | t->type = V4L2_TUNER_ANALOG_TV; | ||
1152 | t->capability = V4L2_TUNER_CAP_NORM; | ||
1153 | t->rangehigh = 0xffffffffUL; /* FIXME: set correct range */ | ||
1154 | /* t->signal = 0xffff;*/ | ||
1155 | /* em28xx_i2c_call_clients(dev,VIDIOC_G_TUNER,t);*/ | ||
1156 | /* No way to get signal strength? */ | ||
1157 | mutex_lock(&dev->lock); | 1150 | mutex_lock(&dev->lock); |
1158 | em28xx_i2c_call_clients(dev, DECODER_GET_STATUS, | 1151 | /* let clients fill in the remainder of this struct */ |
1159 | &status); | 1152 | em28xx_i2c_call_clients(dev, cmd, t); |
1160 | mutex_unlock(&dev->lock); | 1153 | mutex_unlock(&dev->lock); |
1161 | t->signal = | ||
1162 | (status & DECODER_STATUS_GOOD) != 0 ? 0xffff : 0; | ||
1163 | |||
1164 | em28xx_videodbg("VIDIO_G_TUNER: signal=%x, afc=%x\n", t->signal, | 1154 | em28xx_videodbg("VIDIO_G_TUNER: signal=%x, afc=%x\n", t->signal, |
1165 | t->afc); | 1155 | t->afc); |
1166 | return 0; | 1156 | return 0; |
@@ -1168,26 +1158,13 @@ static int em28xx_do_ioctl(struct inode *inode, struct file *filp, | |||
1168 | case VIDIOC_S_TUNER: | 1158 | case VIDIOC_S_TUNER: |
1169 | { | 1159 | { |
1170 | struct v4l2_tuner *t = arg; | 1160 | struct v4l2_tuner *t = arg; |
1171 | int status = 0; | ||
1172 | 1161 | ||
1173 | if (0 != t->index) | 1162 | if (0 != t->index) |
1174 | return -EINVAL; | 1163 | return -EINVAL; |
1175 | memset(t, 0, sizeof(*t)); | ||
1176 | strcpy(t->name, "Tuner"); | ||
1177 | t->type = V4L2_TUNER_ANALOG_TV; | ||
1178 | t->capability = V4L2_TUNER_CAP_NORM; | ||
1179 | t->rangehigh = 0xffffffffUL; /* FIXME: set correct range */ | ||
1180 | /* t->signal = 0xffff; */ | ||
1181 | /* No way to get signal strength? */ | ||
1182 | mutex_lock(&dev->lock); | 1164 | mutex_lock(&dev->lock); |
1183 | em28xx_i2c_call_clients(dev, DECODER_GET_STATUS, | 1165 | /* let clients handle this */ |
1184 | &status); | 1166 | em28xx_i2c_call_clients(dev, cmd, t); |
1185 | mutex_unlock(&dev->lock); | 1167 | mutex_unlock(&dev->lock); |
1186 | t->signal = | ||
1187 | (status & DECODER_STATUS_GOOD) != 0 ? 0xffff : 0; | ||
1188 | |||
1189 | em28xx_videodbg("VIDIO_S_TUNER: signal=%x, afc=%x\n", | ||
1190 | t->signal, t->afc); | ||
1191 | return 0; | 1168 | return 0; |
1192 | } | 1169 | } |
1193 | case VIDIOC_G_FREQUENCY: | 1170 | case VIDIOC_G_FREQUENCY: |
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index a82a26aa1e48..b806999d6e0f 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -703,7 +703,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
703 | msp_detect_stereo(client); | 703 | msp_detect_stereo(client); |
704 | vt->audmode = state->audmode; | 704 | vt->audmode = state->audmode; |
705 | vt->rxsubchans = state->rxsubchans; | 705 | vt->rxsubchans = state->rxsubchans; |
706 | vt->capability = V4L2_TUNER_CAP_STEREO | | 706 | vt->capability |= V4L2_TUNER_CAP_STEREO | |
707 | V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; | 707 | V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; |
708 | break; | 708 | break; |
709 | } | 709 | } |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index d68137f2eb8c..1013b4de89a2 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -744,6 +744,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
744 | switch_v4l2(); | 744 | switch_v4l2(); |
745 | 745 | ||
746 | tuner->type = t->mode; | 746 | tuner->type = t->mode; |
747 | if (t->mode == V4L2_TUNER_ANALOG_TV) | ||
748 | tuner->capability |= V4L2_TUNER_CAP_NORM; | ||
747 | if (t->mode != V4L2_TUNER_RADIO) { | 749 | if (t->mode != V4L2_TUNER_RADIO) { |
748 | tuner->rangelow = tv_range[0] * 16; | 750 | tuner->rangelow = tv_range[0] * 16; |
749 | tuner->rangehigh = tv_range[1] * 16; | 751 | tuner->rangehigh = tv_range[1] * 16; |
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 1055423aa2b9..dab4973bcf82 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c | |||
@@ -858,7 +858,6 @@ static int tvp5150_command(struct i2c_client *c, | |||
858 | 858 | ||
859 | case 0: | 859 | case 0: |
860 | case VIDIOC_INT_RESET: | 860 | case VIDIOC_INT_RESET: |
861 | case DECODER_INIT: | ||
862 | tvp5150_reset(c); | 861 | tvp5150_reset(c); |
863 | break; | 862 | break; |
864 | case VIDIOC_S_STD: | 863 | case VIDIOC_S_STD: |
@@ -957,99 +956,15 @@ static int tvp5150_command(struct i2c_client *c, | |||
957 | #endif | 956 | #endif |
958 | 957 | ||
959 | case VIDIOC_LOG_STATUS: | 958 | case VIDIOC_LOG_STATUS: |
960 | case DECODER_DUMP: | ||
961 | dump_reg(c); | 959 | dump_reg(c); |
962 | break; | 960 | break; |
963 | 961 | ||
964 | case DECODER_GET_CAPABILITIES: | 962 | case VIDIOC_G_TUNER: |
965 | { | 963 | { |
966 | struct video_decoder_capability *cap = arg; | 964 | struct v4l2_tuner *vt = arg; |
967 | 965 | int status = tvp5150_read(c, 0x88); | |
968 | cap->flags = VIDEO_DECODER_PAL | | ||
969 | VIDEO_DECODER_NTSC | | ||
970 | VIDEO_DECODER_SECAM | | ||
971 | VIDEO_DECODER_AUTO | VIDEO_DECODER_CCIR; | ||
972 | cap->inputs = 3; | ||
973 | cap->outputs = 1; | ||
974 | break; | ||
975 | } | ||
976 | case DECODER_GET_STATUS: | ||
977 | { | ||
978 | int *iarg = arg; | ||
979 | int status; | ||
980 | int res=0; | ||
981 | status = tvp5150_read(c, 0x88); | ||
982 | if(status&0x08){ | ||
983 | res |= DECODER_STATUS_COLOR; | ||
984 | } | ||
985 | if(status&0x04 && status&0x02){ | ||
986 | res |= DECODER_STATUS_GOOD; | ||
987 | } | ||
988 | *iarg=res; | ||
989 | break; | ||
990 | } | ||
991 | |||
992 | case DECODER_SET_GPIO: | ||
993 | break; | ||
994 | |||
995 | case DECODER_SET_VBI_BYPASS: | ||
996 | break; | ||
997 | |||
998 | case DECODER_SET_NORM: | ||
999 | { | ||
1000 | int *iarg = arg; | ||
1001 | |||
1002 | switch (*iarg) { | ||
1003 | |||
1004 | case VIDEO_MODE_NTSC: | ||
1005 | break; | ||
1006 | |||
1007 | case VIDEO_MODE_PAL: | ||
1008 | break; | ||
1009 | |||
1010 | case VIDEO_MODE_SECAM: | ||
1011 | break; | ||
1012 | |||
1013 | case VIDEO_MODE_AUTO: | ||
1014 | break; | ||
1015 | |||
1016 | default: | ||
1017 | return -EINVAL; | ||
1018 | |||
1019 | } | ||
1020 | decoder->norm = *iarg; | ||
1021 | break; | ||
1022 | } | ||
1023 | case DECODER_SET_INPUT: | ||
1024 | { | ||
1025 | int *iarg = arg; | ||
1026 | if (*iarg < 0 || *iarg > 3) { | ||
1027 | return -EINVAL; | ||
1028 | } | ||
1029 | |||
1030 | decoder->input = *iarg; | ||
1031 | tvp5150_selmux(c, decoder->input); | ||
1032 | |||
1033 | break; | ||
1034 | } | ||
1035 | case DECODER_SET_OUTPUT: | ||
1036 | { | ||
1037 | int *iarg = arg; | ||
1038 | |||
1039 | /* not much choice of outputs */ | ||
1040 | if (*iarg != 0) { | ||
1041 | return -EINVAL; | ||
1042 | } | ||
1043 | break; | ||
1044 | } | ||
1045 | case DECODER_ENABLE_OUTPUT: | ||
1046 | { | ||
1047 | int *iarg = arg; | ||
1048 | |||
1049 | decoder->enable = (*iarg != 0); | ||
1050 | |||
1051 | tvp5150_selmux(c, decoder->input); | ||
1052 | 966 | ||
967 | vt->signal = ((status & 0x04) && (status & 0x02)) ? 0xffff : 0x0; | ||
1053 | break; | 968 | break; |
1054 | } | 969 | } |
1055 | case VIDIOC_QUERYCTRL: | 970 | case VIDIOC_QUERYCTRL: |
@@ -1095,35 +1010,6 @@ static int tvp5150_command(struct i2c_client *c, | |||
1095 | return -EINVAL; | 1010 | return -EINVAL; |
1096 | } | 1011 | } |
1097 | 1012 | ||
1098 | case DECODER_SET_PICTURE: | ||
1099 | { | ||
1100 | struct video_picture *pic = arg; | ||
1101 | if (decoder->bright != pic->brightness) { | ||
1102 | /* We want 0 to 255 we get 0-65535 */ | ||
1103 | decoder->bright = pic->brightness; | ||
1104 | tvp5150_write(c, TVP5150_BRIGHT_CTL, | ||
1105 | decoder->bright >> 8); | ||
1106 | } | ||
1107 | if (decoder->contrast != pic->contrast) { | ||
1108 | /* We want 0 to 255 we get 0-65535 */ | ||
1109 | decoder->contrast = pic->contrast; | ||
1110 | tvp5150_write(c, TVP5150_CONTRAST_CTL, | ||
1111 | decoder->contrast >> 8); | ||
1112 | } | ||
1113 | if (decoder->sat != pic->colour) { | ||
1114 | /* We want 0 to 255 we get 0-65535 */ | ||
1115 | decoder->sat = pic->colour; | ||
1116 | tvp5150_write(c, TVP5150_SATURATION_CTL, | ||
1117 | decoder->contrast >> 8); | ||
1118 | } | ||
1119 | if (decoder->hue != pic->hue) { | ||
1120 | /* We want -128 to 127 we get 0-65535 */ | ||
1121 | decoder->hue = pic->hue; | ||
1122 | tvp5150_write(c, TVP5150_HUE_CTL, | ||
1123 | (decoder->hue - 32768) >> 8); | ||
1124 | } | ||
1125 | break; | ||
1126 | } | ||
1127 | default: | 1013 | default: |
1128 | return -EINVAL; | 1014 | return -EINVAL; |
1129 | } | 1015 | } |