aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
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/pvrusb2
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/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-audio.c8
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c7
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c9
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-video-v4l.c8
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-wm8775.c12
5 files changed, 18 insertions, 26 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c
index ccf2a3c7ad0..10ef1a2c13e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-audio.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c
@@ -58,9 +58,9 @@ static const struct routing_scheme routing_schemes[] = {
58void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 58void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
59{ 59{
60 if (hdw->input_dirty || hdw->force_dirty) { 60 if (hdw->input_dirty || hdw->force_dirty) {
61 struct v4l2_routing route;
62 const struct routing_scheme *sp; 61 const struct routing_scheme *sp;
63 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 62 unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
63 u32 input;
64 64
65 pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo"); 65 pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo");
66 66
@@ -68,7 +68,7 @@ void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
68 ((sp = routing_schemes + sid) != NULL) && 68 ((sp = routing_schemes + sid) != NULL) &&
69 (hdw->input_val >= 0) && 69 (hdw->input_val >= 0) &&
70 (hdw->input_val < sp->cnt)) { 70 (hdw->input_val < sp->cnt)) {
71 route.input = sp->def[hdw->input_val]; 71 input = sp->def[hdw->input_val];
72 } else { 72 } else {
73 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 73 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
74 "*** WARNING *** subdev msp3400 set_input:" 74 "*** WARNING *** subdev msp3400 set_input:"
@@ -77,8 +77,8 @@ void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
77 sid, hdw->input_val); 77 sid, hdw->input_val);
78 return; 78 return;
79 } 79 }
80 route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 80 sd->ops->audio->s_routing(sd, input,
81 sd->ops->audio->s_routing(sd, &route); 81 MSP_OUTPUT(MSP_SC_IN_DSP_SCART1), 0);
82 } 82 }
83} 83}
84 84
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
index b5c3428ebb9..9023adf3fdc 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
@@ -60,16 +60,16 @@ static const struct routing_scheme routing_schemes[] = {
60void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 60void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
61{ 61{
62 if (hdw->input_dirty || hdw->force_dirty) { 62 if (hdw->input_dirty || hdw->force_dirty) {
63 struct v4l2_routing route;
64 const struct routing_scheme *sp; 63 const struct routing_scheme *sp;
65 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 64 unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
65 u32 input;
66 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", 66 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)",
67 hdw->input_val); 67 hdw->input_val);
68 if ((sid < ARRAY_SIZE(routing_schemes)) && 68 if ((sid < ARRAY_SIZE(routing_schemes)) &&
69 ((sp = routing_schemes + sid) != NULL) && 69 ((sp = routing_schemes + sid) != NULL) &&
70 (hdw->input_val >= 0) && 70 (hdw->input_val >= 0) &&
71 (hdw->input_val < sp->cnt)) { 71 (hdw->input_val < sp->cnt)) {
72 route.input = sp->def[hdw->input_val]; 72 input = sp->def[hdw->input_val];
73 } else { 73 } else {
74 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 74 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
75 "*** WARNING *** subdev v4l2 set_input:" 75 "*** WARNING *** subdev v4l2 set_input:"
@@ -78,8 +78,7 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
78 sid, hdw->input_val); 78 sid, hdw->input_val);
79 return; 79 return;
80 } 80 }
81 route.output = 0; 81 sd->ops->audio->s_routing(sd, input, 0, 0);
82 sd->ops->audio->s_routing(sd, &route);
83 } 82 }
84} 83}
85 84
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
index 4e017ff26c3..05e52358ae4 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
@@ -105,14 +105,11 @@ void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
105{ 105{
106 pvr2_trace(PVR2_TRACE_CHIPS, "subdev cx2584x update..."); 106 pvr2_trace(PVR2_TRACE_CHIPS, "subdev cx2584x update...");
107 if (hdw->input_dirty || hdw->force_dirty) { 107 if (hdw->input_dirty || hdw->force_dirty) {
108 struct v4l2_routing route;
109 enum cx25840_video_input vid_input; 108 enum cx25840_video_input vid_input;
110 enum cx25840_audio_input aud_input; 109 enum cx25840_audio_input aud_input;
111 const struct routing_scheme *sp; 110 const struct routing_scheme *sp;
112 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 111 unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
113 112
114 memset(&route, 0, sizeof(route));
115
116 if ((sid < ARRAY_SIZE(routing_schemes)) && 113 if ((sid < ARRAY_SIZE(routing_schemes)) &&
117 ((sp = routing_schemes + sid) != NULL) && 114 ((sp = routing_schemes + sid) != NULL) &&
118 (hdw->input_val >= 0) && 115 (hdw->input_val >= 0) &&
@@ -131,10 +128,8 @@ void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
131 pvr2_trace(PVR2_TRACE_CHIPS, 128 pvr2_trace(PVR2_TRACE_CHIPS,
132 "subdev cx2584x set_input vid=0x%x aud=0x%x", 129 "subdev cx2584x set_input vid=0x%x aud=0x%x",
133 vid_input, aud_input); 130 vid_input, aud_input);
134 route.input = (u32)vid_input; 131 sd->ops->video->s_routing(sd, (u32)vid_input, 0, 0);
135 sd->ops->video->s_routing(sd, &route); 132 sd->ops->audio->s_routing(sd, (u32)aud_input, 0, 0);
136 route.input = (u32)aud_input;
137 sd->ops->audio->s_routing(sd, &route);
138 } 133 }
139} 134}
140 135
diff --git a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
index b3862f5554b..d2fe7c8f2c3 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
@@ -75,16 +75,17 @@ static const struct routing_scheme routing_schemes[] = {
75void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 75void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
76{ 76{
77 if (hdw->input_dirty || hdw->force_dirty) { 77 if (hdw->input_dirty || hdw->force_dirty) {
78 struct v4l2_routing route;
79 const struct routing_scheme *sp; 78 const struct routing_scheme *sp;
80 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 79 unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
80 u32 input;
81
81 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", 82 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)",
82 hdw->input_val); 83 hdw->input_val);
83 if ((sid < ARRAY_SIZE(routing_schemes)) && 84 if ((sid < ARRAY_SIZE(routing_schemes)) &&
84 ((sp = routing_schemes + sid) != NULL) && 85 ((sp = routing_schemes + sid) != NULL) &&
85 (hdw->input_val >= 0) && 86 (hdw->input_val >= 0) &&
86 (hdw->input_val < sp->cnt)) { 87 (hdw->input_val < sp->cnt)) {
87 route.input = sp->def[hdw->input_val]; 88 input = sp->def[hdw->input_val];
88 } else { 89 } else {
89 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 90 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
90 "*** WARNING *** subdev v4l2 set_input:" 91 "*** WARNING *** subdev v4l2 set_input:"
@@ -93,8 +94,7 @@ void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
93 sid, hdw->input_val); 94 sid, hdw->input_val);
94 return; 95 return;
95 } 96 }
96 route.output = 0; 97 sd->ops->video->s_routing(sd, input, 0, 0);
97 sd->ops->video->s_routing(sd, &route);
98 } 98 }
99} 99}
100 100
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
index 1670aa4051c..8c1eae05aa0 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
@@ -39,24 +39,22 @@
39void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 39void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
40{ 40{
41 if (hdw->input_dirty || hdw->force_dirty) { 41 if (hdw->input_dirty || hdw->force_dirty) {
42 struct v4l2_routing route; 42 u32 input;
43
44 memset(&route, 0, sizeof(route));
45 43
46 switch (hdw->input_val) { 44 switch (hdw->input_val) {
47 case PVR2_CVAL_INPUT_RADIO: 45 case PVR2_CVAL_INPUT_RADIO:
48 route.input = 1; 46 input = 1;
49 break; 47 break;
50 default: 48 default:
51 /* All other cases just use the second input */ 49 /* All other cases just use the second input */
52 route.input = 2; 50 input = 2;
53 break; 51 break;
54 } 52 }
55 pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775" 53 pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775"
56 " set_input(val=%d route=0x%x)", 54 " set_input(val=%d route=0x%x)",
57 hdw->input_val, route.input); 55 hdw->input_val, input);
58 56
59 sd->ops->audio->s_routing(sd, &route); 57 sd->ops->audio->s_routing(sd, input, 0, 0);
60 } 58 }
61} 59}
62 60