aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-04-02 10:26:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:27 -0400
commit5325b4272a53b43f55b82cc369c310c2fcacdca1 (patch)
treef2a1491de3d05901152e0e271c0cb5ce381884c2 /drivers/media/video/cx18
parentc0ff29150d37615ac703802ab3edc775fd402491 (diff)
V4L/DVB (11380): v4l2-subdev: change s_routing prototype
It is no longer needed to use a struct pointer as argument, since v4l2_subdev doesn't require that ioctl-like approach anymore. Instead just pass the input, output and config (new!) arguments directly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r--drivers/media/video/cx18/cx18-audio.c9
-rw-r--r--drivers/media/video/cx18/cx18-av-core.c8
-rw-r--r--drivers/media/video/cx18/cx18-gpio.c4
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c2
-rw-r--r--drivers/media/video/cx18/cx18-video.c16
5 files changed, 12 insertions, 27 deletions
diff --git a/drivers/media/video/cx18/cx18-audio.c b/drivers/media/video/cx18/cx18-audio.c
index bb5c5165dd5f..1519e91c677a 100644
--- a/drivers/media/video/cx18/cx18-audio.c
+++ b/drivers/media/video/cx18/cx18-audio.c
@@ -33,7 +33,6 @@
33int cx18_audio_set_io(struct cx18 *cx) 33int cx18_audio_set_io(struct cx18 *cx)
34{ 34{
35 const struct cx18_card_audio_input *in; 35 const struct cx18_card_audio_input *in;
36 struct v4l2_routing route;
37 u32 val; 36 u32 val;
38 int err; 37 int err;
39 38
@@ -44,13 +43,11 @@ int cx18_audio_set_io(struct cx18 *cx)
44 in = &cx->card->audio_inputs[cx->audio_input]; 43 in = &cx->card->audio_inputs[cx->audio_input];
45 44
46 /* handle muxer chips */ 45 /* handle muxer chips */
47 route.input = in->muxer_input; 46 v4l2_subdev_call(cx->sd_extmux, audio, s_routing,
48 route.output = 0; 47 in->audio_input, 0, 0);
49 v4l2_subdev_call(cx->sd_extmux, audio, s_routing, &route);
50 48
51 route.input = in->audio_input;
52 err = cx18_call_hw_err(cx, cx->card->hw_audio_ctrl, 49 err = cx18_call_hw_err(cx, cx->card->hw_audio_ctrl,
53 audio, s_routing, &route); 50 audio, s_routing, in->audio_input, 0, 0);
54 if (err) 51 if (err)
55 return err; 52 return err;
56 53
diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c
index 9b3e574dd829..cf2bd888a429 100644
--- a/drivers/media/video/cx18/cx18-av-core.c
+++ b/drivers/media/video/cx18/cx18-av-core.c
@@ -547,19 +547,19 @@ static int set_input(struct cx18 *cx, enum cx18_av_video_input vid_input,
547} 547}
548 548
549static int cx18_av_s_video_routing(struct v4l2_subdev *sd, 549static int cx18_av_s_video_routing(struct v4l2_subdev *sd,
550 const struct v4l2_routing *route) 550 u32 input, u32 output, u32 config)
551{ 551{
552 struct cx18_av_state *state = to_cx18_av_state(sd); 552 struct cx18_av_state *state = to_cx18_av_state(sd);
553 struct cx18 *cx = v4l2_get_subdevdata(sd); 553 struct cx18 *cx = v4l2_get_subdevdata(sd);
554 return set_input(cx, route->input, state->aud_input); 554 return set_input(cx, input, state->aud_input);
555} 555}
556 556
557static int cx18_av_s_audio_routing(struct v4l2_subdev *sd, 557static int cx18_av_s_audio_routing(struct v4l2_subdev *sd,
558 const struct v4l2_routing *route) 558 u32 input, u32 output, u32 config)
559{ 559{
560 struct cx18_av_state *state = to_cx18_av_state(sd); 560 struct cx18_av_state *state = to_cx18_av_state(sd);
561 struct cx18 *cx = v4l2_get_subdevdata(sd); 561 struct cx18 *cx = v4l2_get_subdevdata(sd);
562 return set_input(cx, state->vid_input, route->input); 562 return set_input(cx, state->vid_input, input);
563} 563}
564 564
565static int cx18_av_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) 565static int cx18_av_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
diff --git a/drivers/media/video/cx18/cx18-gpio.c b/drivers/media/video/cx18/cx18-gpio.c
index ae2460e6860a..86a204b5448e 100644
--- a/drivers/media/video/cx18/cx18-gpio.c
+++ b/drivers/media/video/cx18/cx18-gpio.c
@@ -156,12 +156,12 @@ static int gpiomux_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
156} 156}
157 157
158static int gpiomux_s_audio_routing(struct v4l2_subdev *sd, 158static int gpiomux_s_audio_routing(struct v4l2_subdev *sd,
159 const struct v4l2_routing *route) 159 u32 input, u32 output, u32 config)
160{ 160{
161 struct cx18 *cx = v4l2_get_subdevdata(sd); 161 struct cx18 *cx = v4l2_get_subdevdata(sd);
162 u32 data; 162 u32 data;
163 163
164 switch (route->input) { 164 switch (input) {
165 case 0: 165 case 0:
166 data = cx->card->gpio_audio_input.tuner; 166 data = cx->card->gpio_audio_input.tuner;
167 break; 167 break;
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index f572080590fb..cdefd90d5eca 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -932,7 +932,7 @@ static long cx18_default(struct file *file, void *fh, int cmd, void *arg)
932 CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n", 932 CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n",
933 route->input, route->output); 933 route->input, route->output);
934 cx18_call_hw(cx, cx->card->hw_audio_ctrl, audio, s_routing, 934 cx18_call_hw(cx, cx->card->hw_audio_ctrl, audio, s_routing,
935 route); 935 route->input, route->output, 0);
936 break; 936 break;
937 } 937 }
938 938
diff --git a/drivers/media/video/cx18/cx18-video.c b/drivers/media/video/cx18/cx18-video.c
index 6fdadedf17a8..6dc84aac8f44 100644
--- a/drivers/media/video/cx18/cx18-video.c
+++ b/drivers/media/video/cx18/cx18-video.c
@@ -25,20 +25,8 @@
25 25
26void cx18_video_set_io(struct cx18 *cx) 26void cx18_video_set_io(struct cx18 *cx)
27{ 27{
28 struct v4l2_routing route;
29 int inp = cx->active_input; 28 int inp = cx->active_input;
30 u32 type;
31 29
32 route.input = cx->card->video_inputs[inp].video_input; 30 v4l2_subdev_call(cx->sd_av, video, s_routing,
33 route.output = 0; 31 cx->card->video_inputs[inp].video_input, 0, 0);
34 v4l2_subdev_call(cx->sd_av, video, s_routing, &route);
35
36 type = cx->card->video_inputs[inp].video_type;
37
38 if (type == CX18_CARD_INPUT_VID_TUNER)
39 route.input = 0; /* Tuner */
40 else if (type < CX18_CARD_INPUT_COMPOSITE1)
41 route.input = 2; /* S-Video */
42 else
43 route.input = 1; /* Composite */
44} 32}