aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-03-19 10:35:57 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-03-24 14:26:57 -0500
commit2474ed444b475614ef795523076be7cc8437ae00 (patch)
tree87808b3c7ff145b63a638e6e42ffce9db7db1b8c /drivers/media/video/bt8xx
parent49965a80a4c4f5cbe15fb3bb1f8f8b0ec4ef02bc (diff)
V4L/DVB (3582): Implement correct msp3400 input/output routing
- implement VIDIOC_INT_S_AUDIO_ROUTING for msp3400 and tvaudio - use the new command in bttv, pvrusb2 and em28xx. - remove the now obsolete MSP_SET_MATRIX from msp3400 (yeah!) - remove the obsolete VIDIOC_S_AUDIO from msp3400. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c52
1 files changed, 43 insertions, 9 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index be567ec9e145..80e4a7406ac2 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -37,6 +37,7 @@
37#include "bttvp.h" 37#include "bttvp.h"
38#include <media/v4l2-common.h> 38#include <media/v4l2-common.h>
39#include <media/tvaudio.h> 39#include <media/tvaudio.h>
40#include <media/msp3400.h>
40 41
41#include <linux/dma-mapping.h> 42#include <linux/dma-mapping.h>
42 43
@@ -934,11 +935,9 @@ static int
934audio_mux(struct bttv *btv, int input, int mute) 935audio_mux(struct bttv *btv, int input, int mute)
935{ 936{
936 int gpio_val, signal; 937 int gpio_val, signal;
937 struct v4l2_audio aud_input;
938 struct v4l2_control ctrl; 938 struct v4l2_control ctrl;
939 struct i2c_client *c; 939 struct i2c_client *c;
940 940
941 memset(&aud_input, 0, sizeof(aud_input));
942 gpio_inout(bttv_tvcards[btv->c.type].gpiomask, 941 gpio_inout(bttv_tvcards[btv->c.type].gpiomask,
943 bttv_tvcards[btv->c.type].gpiomask); 942 bttv_tvcards[btv->c.type].gpiomask);
944 signal = btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC; 943 signal = btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC;
@@ -953,7 +952,6 @@ audio_mux(struct bttv *btv, int input, int mute)
953 gpio_val = bttv_tvcards[btv->c.type].gpiomute; 952 gpio_val = bttv_tvcards[btv->c.type].gpiomute;
954 else 953 else
955 gpio_val = bttv_tvcards[btv->c.type].gpiomux[input]; 954 gpio_val = bttv_tvcards[btv->c.type].gpiomux[input];
956 aud_input.index = btv->audio;
957 955
958 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val); 956 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val);
959 if (bttv_gpio) 957 if (bttv_gpio)
@@ -962,15 +960,51 @@ audio_mux(struct bttv *btv, int input, int mute)
962 return 0; 960 return 0;
963 961
964 ctrl.id = V4L2_CID_AUDIO_MUTE; 962 ctrl.id = V4L2_CID_AUDIO_MUTE;
965 /* take automute into account, just btv->mute is not enough */ 963 ctrl.value = btv->mute;
966 ctrl.value = mute;
967 bttv_call_i2c_clients(btv, VIDIOC_S_CTRL, &ctrl); 964 bttv_call_i2c_clients(btv, VIDIOC_S_CTRL, &ctrl);
968 c = btv->i2c_msp34xx_client; 965 c = btv->i2c_msp34xx_client;
969 if (c) 966 if (c) {
970 c->driver->command(c, VIDIOC_S_AUDIO, &aud_input); 967 struct v4l2_routing route;
968
969 /* Note: the inputs tuner/radio/extern/intern are translated
970 to msp routings. This assumes common behavior for all msp3400
971 based TV cards. When this assumption fails, then the
972 specific MSP routing must be added to the card table.
973 For now this is sufficient. */
974 switch (input) {
975 case TVAUDIO_INPUT_RADIO:
976 route.input = MSP_INPUT(MSP_IN_SCART_2, MSP_IN_TUNER_1,
977 MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART);
978 break;
979 case TVAUDIO_INPUT_EXTERN:
980 route.input = MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1,
981 MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART);
982 break;
983 case TVAUDIO_INPUT_INTERN:
984 /* Yes, this is the same input as for RADIO. I doubt
985 if this is ever used. The only board with an INTERN
986 input is the BTTV_BOARD_AVERMEDIA98. I wonder how
987 that was tested. My guess is that the whole INTERN
988 input does not work. */
989 route.input = MSP_INPUT(MSP_IN_SCART_2, MSP_IN_TUNER_1,
990 MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART);
991 break;
992 case TVAUDIO_INPUT_TUNER:
993 default:
994 route.input = MSP_INPUT_DEFAULT;
995 break;
996 }
997 route.output = MSP_OUTPUT_DEFAULT;
998 c->driver->command(c, VIDIOC_INT_S_AUDIO_ROUTING, &route);
999 }
971 c = btv->i2c_tvaudio_client; 1000 c = btv->i2c_tvaudio_client;
972 if (c) 1001 if (c) {
973 c->driver->command(c, VIDIOC_S_AUDIO, &aud_input); 1002 struct v4l2_routing route;
1003
1004 route.input = input;
1005 route.output = 0;
1006 c->driver->command(c, VIDIOC_INT_S_AUDIO_ROUTING, &route);
1007 }
974 return 0; 1008 return 0;
975} 1009}
976 1010