Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
5325b427 c0ff2915

+370 -444
+6 -6
drivers/media/dvb/frontends/au8522_decoder.c
··· 652 652 } 653 653 654 654 static int au8522_s_video_routing(struct v4l2_subdev *sd, 655 - const struct v4l2_routing *route) 655 + u32 input, u32 output, u32 config) 656 656 { 657 657 struct au8522_state *state = to_state(sd); 658 658 ··· 663 663 closed), and then came back to analog mode */ 664 664 au8522_writereg(state, 0x106, 1); 665 665 666 - if (route->input == AU8522_COMPOSITE_CH1) { 666 + if (input == AU8522_COMPOSITE_CH1) { 667 667 au8522_setup_cvbs_mode(state); 668 - } else if (route->input == AU8522_SVIDEO_CH13) { 668 + } else if (input == AU8522_SVIDEO_CH13) { 669 669 au8522_setup_svideo_mode(state); 670 - } else if (route->input == AU8522_COMPOSITE_CH4_SIF) { 670 + } else if (input == AU8522_COMPOSITE_CH4_SIF) { 671 671 au8522_setup_cvbs_tuner_mode(state); 672 672 } else { 673 673 printk(KERN_ERR "au8522 mode not currently supported\n"); ··· 677 677 } 678 678 679 679 static int au8522_s_audio_routing(struct v4l2_subdev *sd, 680 - const struct v4l2_routing *route) 680 + u32 input, u32 output, u32 config) 681 681 { 682 682 struct au8522_state *state = to_state(sd); 683 - set_audio_input(state, route->input); 683 + set_audio_input(state, input); 684 684 return 0; 685 685 } 686 686
+10 -9
drivers/media/video/adv7170.c
··· 219 219 return 0; 220 220 } 221 221 222 - static int adv7170_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 222 + static int adv7170_s_routing(struct v4l2_subdev *sd, 223 + u32 input, u32 output, u32 config) 223 224 { 224 225 struct adv7170 *encoder = to_adv7170(sd); 225 226 226 - /* RJ: route->input = 0: input is from decoder 227 - route->input = 1: input is from ZR36060 228 - route->input = 2: color bar */ 227 + /* RJ: input = 0: input is from decoder 228 + input = 1: input is from ZR36060 229 + input = 2: color bar */ 229 230 230 231 v4l2_dbg(1, debug, sd, "set input from %s\n", 231 - route->input == 0 ? "decoder" : "ZR36060"); 232 + input == 0 ? "decoder" : "ZR36060"); 232 233 233 - switch (route->input) { 234 + switch (input) { 234 235 case 0: 235 236 adv7170_write(sd, 0x01, 0x20); 236 237 adv7170_write(sd, 0x08, TR1CAPT); /* TR1 */ ··· 251 250 break; 252 251 253 252 default: 254 - v4l2_dbg(1, debug, sd, "illegal input: %d\n", route->input); 253 + v4l2_dbg(1, debug, sd, "illegal input: %d\n", input); 255 254 return -EINVAL; 256 255 } 257 - v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[route->input]); 258 - encoder->input = route->input; 256 + v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[input]); 257 + encoder->input = input; 259 258 return 0; 260 259 } 261 260
+9 -8
drivers/media/video/adv7175.c
··· 237 237 return 0; 238 238 } 239 239 240 - static int adv7175_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 240 + static int adv7175_s_routing(struct v4l2_subdev *sd, 241 + u32 input, u32 output, u32 config) 241 242 { 242 243 struct adv7175 *encoder = to_adv7175(sd); 243 244 244 - /* RJ: route->input = 0: input is from decoder 245 - route->input = 1: input is from ZR36060 246 - route->input = 2: color bar */ 245 + /* RJ: input = 0: input is from decoder 246 + input = 1: input is from ZR36060 247 + input = 2: color bar */ 247 248 248 - switch (route->input) { 249 + switch (input) { 249 250 case 0: 250 251 adv7175_write(sd, 0x01, 0x00); 251 252 ··· 289 288 break; 290 289 291 290 default: 292 - v4l2_dbg(1, debug, sd, "illegal input: %d\n", route->input); 291 + v4l2_dbg(1, debug, sd, "illegal input: %d\n", input); 293 292 return -EINVAL; 294 293 } 295 - v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[route->input]); 296 - encoder->input = route->input; 294 + v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[input]); 295 + encoder->input = input; 297 296 return 0; 298 297 } 299 298
+4 -6
drivers/media/video/au0828/au0828-video.c
··· 1154 1154 struct au0828_fh *fh = priv; 1155 1155 struct au0828_dev *dev = fh->dev; 1156 1156 int i; 1157 - struct v4l2_routing route; 1158 1157 1159 1158 dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __func__, 1160 1159 index); ··· 1179 1180 break; 1180 1181 } 1181 1182 1182 - route.input = AUVI_INPUT(index).vmux; 1183 - route.output = 0; 1184 - v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, &route); 1183 + v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, 1184 + AUVI_INPUT(index).vmux, 0, 0); 1185 1185 1186 1186 for (i = 0; i < AU0828_MAX_INPUT; i++) { 1187 1187 int enable = 0; ··· 1203 1205 } 1204 1206 } 1205 1207 1206 - route.input = AUVI_INPUT(index).amux; 1207 - v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, &route); 1208 + v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, 1209 + AUVI_INPUT(index).amux, 0, 0); 1208 1210 return 0; 1209 1211 } 1210 1212
+6 -5
drivers/media/video/bt819.c
··· 292 292 return 0; 293 293 } 294 294 295 - static int bt819_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 295 + static int bt819_s_routing(struct v4l2_subdev *sd, 296 + u32 input, u32 output, u32 config) 296 297 { 297 298 struct bt819 *decoder = to_bt819(sd); 298 299 299 - v4l2_dbg(1, debug, sd, "set input %x\n", route->input); 300 + v4l2_dbg(1, debug, sd, "set input %x\n", input); 300 301 301 - if (route->input < 0 || route->input > 7) 302 + if (input < 0 || input > 7) 302 303 return -EINVAL; 303 304 304 305 if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) 305 306 v4l2_err(sd, "no notify found!\n"); 306 307 307 - if (decoder->input != route->input) { 308 + if (decoder->input != input) { 308 309 v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0); 309 - decoder->input = route->input; 310 + decoder->input = input; 310 311 /* select mode */ 311 312 if (decoder->input == 0) { 312 313 bt819_setbit(decoder, 0x0b, 6, 0);
+6 -5
drivers/media/video/bt856.c
··· 142 142 return 0; 143 143 } 144 144 145 - static int bt856_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 145 + static int bt856_s_routing(struct v4l2_subdev *sd, 146 + u32 input, u32 output, u32 config) 146 147 { 147 148 struct bt856 *encoder = to_bt856(sd); 148 149 149 - v4l2_dbg(1, debug, sd, "set input %d\n", route->input); 150 + v4l2_dbg(1, debug, sd, "set input %d\n", input); 150 151 151 152 /* We only have video bus. 152 - * route->input= 0: input is from bt819 153 - * route->input= 1: input is from ZR36060 */ 154 - switch (route->input) { 153 + * input= 0: input is from bt819 154 + * input= 1: input is from ZR36060 */ 155 + switch (input) { 155 156 case 0: 156 157 bt856_setbit(encoder, 0xde, 4, 0); 157 158 bt856_setbit(encoder, 0xde, 3, 1);
+6 -5
drivers/media/video/bt866.c
··· 99 99 return 0; 100 100 } 101 101 102 - static int bt866_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 102 + static int bt866_s_routing(struct v4l2_subdev *sd, 103 + u32 input, u32 output, u32 config) 103 104 { 104 105 static const __u8 init[] = { 105 106 0xc8, 0xcc, /* CRSCALE */ ··· 138 137 139 138 val = encoder->reg[0xdc]; 140 139 141 - if (route->input == 0) 140 + if (input == 0) 142 141 val |= 0x40; /* CBSWAP */ 143 142 else 144 143 val &= ~0x40; /* !CBSWAP */ ··· 146 145 bt866_write(encoder, 0xdc, val); 147 146 148 147 val = encoder->reg[0xcc]; 149 - if (route->input == 2) 148 + if (input == 2) 150 149 val |= 0x01; /* OSDBAR */ 151 150 else 152 151 val &= ~0x01; /* !OSDBAR */ 153 152 bt866_write(encoder, 0xcc, val); 154 153 155 - v4l2_dbg(1, debug, sd, "set input %d\n", route->input); 154 + v4l2_dbg(1, debug, sd, "set input %d\n", input); 156 155 157 - switch (route->input) { 156 + switch (input) { 158 157 case 0: 159 158 case 1: 160 159 case 2:
+10 -13
drivers/media/video/bt8xx/bttv-driver.c
··· 1198 1198 ctrl.value = btv->mute; 1199 1199 bttv_call_all(btv, core, s_ctrl, &ctrl); 1200 1200 if (btv->sd_msp34xx) { 1201 - struct v4l2_routing route; 1201 + u32 in; 1202 1202 1203 1203 /* Note: the inputs tuner/radio/extern/intern are translated 1204 1204 to msp routings. This assumes common behavior for all msp3400 ··· 1207 1207 For now this is sufficient. */ 1208 1208 switch (input) { 1209 1209 case TVAUDIO_INPUT_RADIO: 1210 - route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 1210 + in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 1211 1211 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 1212 1212 break; 1213 1213 case TVAUDIO_INPUT_EXTERN: 1214 - route.input = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, 1214 + in = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, 1215 1215 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 1216 1216 break; 1217 1217 case TVAUDIO_INPUT_INTERN: ··· 1220 1220 input is the BTTV_BOARD_AVERMEDIA98. I wonder how 1221 1221 that was tested. My guess is that the whole INTERN 1222 1222 input does not work. */ 1223 - route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 1223 + in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 1224 1224 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 1225 1225 break; 1226 1226 case TVAUDIO_INPUT_TUNER: ··· 1229 1229 is the only difference between the VOODOOTV_FM 1230 1230 and VOODOOTV_200 */ 1231 1231 if (btv->c.type == BTTV_BOARD_VOODOOTV_200) 1232 - route.input = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER2, \ 1232 + in = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER2, \ 1233 1233 MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER); 1234 1234 else 1235 - route.input = MSP_INPUT_DEFAULT; 1235 + in = MSP_INPUT_DEFAULT; 1236 1236 break; 1237 1237 } 1238 - route.output = MSP_OUTPUT_DEFAULT; 1239 - v4l2_subdev_call(btv->sd_msp34xx, audio, s_routing, &route); 1238 + v4l2_subdev_call(btv->sd_msp34xx, audio, s_routing, 1239 + in, MSP_OUTPUT_DEFAULT, 0); 1240 1240 } 1241 1241 if (btv->sd_tvaudio) { 1242 - struct v4l2_routing route; 1243 - 1244 - route.input = input; 1245 - route.output = 0; 1246 - v4l2_subdev_call(btv->sd_tvaudio, audio, s_routing, &route); 1242 + v4l2_subdev_call(btv->sd_tvaudio, audio, s_routing, 1243 + input, 0, 0); 1247 1244 } 1248 1245 return 0; 1249 1246 }
+6 -5
drivers/media/video/cs5345.c
··· 53 53 return i2c_smbus_read_byte_data(client, reg); 54 54 } 55 55 56 - static int cs5345_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 56 + static int cs5345_s_routing(struct v4l2_subdev *sd, 57 + u32 input, u32 output, u32 config) 57 58 { 58 - if ((route->input & 0xf) > 6) { 59 - v4l2_err(sd, "Invalid input %d.\n", route->input); 59 + if ((input & 0xf) > 6) { 60 + v4l2_err(sd, "Invalid input %d.\n", input); 60 61 return -EINVAL; 61 62 } 62 - cs5345_write(sd, 0x09, route->input & 0xf); 63 - cs5345_write(sd, 0x05, route->input & 0xf0); 63 + cs5345_write(sd, 0x09, input & 0xf); 64 + cs5345_write(sd, 0x05, input & 0xf0); 64 65 return 0; 65 66 } 66 67
+5 -4
drivers/media/video/cs53l32a.c
··· 58 58 return i2c_smbus_read_byte_data(client, reg); 59 59 } 60 60 61 - static int cs53l32a_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 61 + static int cs53l32a_s_routing(struct v4l2_subdev *sd, 62 + u32 input, u32 output, u32 config) 62 63 { 63 64 /* There are 2 physical inputs, but the second input can be 64 65 placed in two modes, the first mode bypasses the PGA (gain), 65 66 the second goes through the PGA. Hence there are three 66 67 possible inputs to choose from. */ 67 - if (route->input > 2) { 68 - v4l2_err(sd, "Invalid input %d.\n", route->input); 68 + if (input > 2) { 69 + v4l2_err(sd, "Invalid input %d.\n", input); 69 70 return -EINVAL; 70 71 } 71 - cs53l32a_write(sd, 0x01, 0x01 + (route->input << 4)); 72 + cs53l32a_write(sd, 0x01, 0x01 + (input << 4)); 72 73 return 0; 73 74 } 74 75
+3 -6
drivers/media/video/cx18/cx18-audio.c
··· 33 33 int cx18_audio_set_io(struct cx18 *cx) 34 34 { 35 35 const struct cx18_card_audio_input *in; 36 - struct v4l2_routing route; 37 36 u32 val; 38 37 int err; 39 38 ··· 43 44 in = &cx->card->audio_inputs[cx->audio_input]; 44 45 45 46 /* handle muxer chips */ 46 - route.input = in->muxer_input; 47 - route.output = 0; 48 - v4l2_subdev_call(cx->sd_extmux, audio, s_routing, &route); 47 + v4l2_subdev_call(cx->sd_extmux, audio, s_routing, 48 + in->audio_input, 0, 0); 49 49 50 - route.input = in->audio_input; 51 50 err = cx18_call_hw_err(cx, cx->card->hw_audio_ctrl, 52 - audio, s_routing, &route); 51 + audio, s_routing, in->audio_input, 0, 0); 53 52 if (err) 54 53 return err; 55 54
+4 -4
drivers/media/video/cx18/cx18-av-core.c
··· 547 547 } 548 548 549 549 static 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 552 struct cx18_av_state *state = to_cx18_av_state(sd); 553 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 557 557 static 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 560 struct cx18_av_state *state = to_cx18_av_state(sd); 561 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 565 565 static int cx18_av_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+2 -2
drivers/media/video/cx18/cx18-gpio.c
··· 156 156 } 157 157 158 158 static 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 161 struct cx18 *cx = v4l2_get_subdevdata(sd); 162 162 u32 data; 163 163 164 - switch (route->input) { 164 + switch (input) { 165 165 case 0: 166 166 data = cx->card->gpio_audio_input.tuner; 167 167 break;
+1 -1
drivers/media/video/cx18/cx18-ioctl.c
··· 932 932 CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n", 933 933 route->input, route->output); 934 934 cx18_call_hw(cx, cx->card->hw_audio_ctrl, audio, s_routing, 935 - route); 935 + route->input, route->output, 0); 936 936 break; 937 937 } 938 938
+2 -14
drivers/media/video/cx18/cx18-video.c
··· 25 25 26 26 void cx18_video_set_io(struct cx18 *cx) 27 27 { 28 - struct v4l2_routing route; 29 28 int inp = cx->active_input; 30 - u32 type; 31 29 32 - route.input = cx->card->video_inputs[inp].video_input; 33 - route.output = 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 */ 30 + v4l2_subdev_call(cx->sd_av, video, s_routing, 31 + cx->card->video_inputs[inp].video_input, 0, 0); 44 32 }
+1 -4
drivers/media/video/cx231xx/cx231xx-cards.c
··· 357 357 */ 358 358 void cx231xx_config_i2c(struct cx231xx *dev) 359 359 { 360 - struct v4l2_routing route; 361 - 362 - route.input = INPUT(dev->video_input)->vmux; 363 - route.output = 0; 360 + /* u32 input = INPUT(dev->video_input)->vmux; */ 364 361 365 362 call_all(dev, video, s_stream, 1); 366 363 }
+1 -6
drivers/media/video/cx231xx/cx231xx-video.c
··· 820 820 821 821 void video_mux(struct cx231xx *dev, int index) 822 822 { 823 - 824 - struct v4l2_routing route; 825 - 826 - route.input = INPUT(index)->vmux; 827 - route.output = 0; 828 823 dev->video_input = index; 829 824 dev->ctl_ainput = INPUT(index)->amux; 830 825 831 826 cx231xx_set_video_input_mux(dev, index); 832 827 833 - cx25840_call(dev, video, s_routing, &route); 828 + cx25840_call(dev, video, s_routing, INPUT(index)->vmux, 0, 0); 834 829 835 830 cx231xx_set_audio_input(dev, dev->ctl_ainput); 836 831
+2 -6
drivers/media/video/cx23885/cx23885-video.c
··· 393 393 394 394 static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) 395 395 { 396 - struct v4l2_routing route; 397 - memset(&route, 0, sizeof(route)); 398 - 399 396 dprintk(1, "%s() video_mux: %d [vmux=%d, gpio=0x%x,0x%x,0x%x,0x%x]\n", 400 397 __func__, 401 398 input, INPUT(input)->vmux, ··· 400 403 INPUT(input)->gpio2, INPUT(input)->gpio3); 401 404 dev->input = input; 402 405 403 - route.input = INPUT(input)->vmux; 404 - 405 406 /* Tell the internal A/V decoder */ 406 - v4l2_subdev_call(dev->sd_cx25840, video, s_routing, &route); 407 + v4l2_subdev_call(dev->sd_cx25840, video, s_routing, 408 + INPUT(input)->vmux, 0, 0); 407 409 408 410 return 0; 409 411 }
+6 -4
drivers/media/video/cx25840/cx25840-core.c
··· 1322 1322 return 0; 1323 1323 } 1324 1324 1325 - static int cx25840_s_video_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 1325 + static int cx25840_s_video_routing(struct v4l2_subdev *sd, 1326 + u32 input, u32 output, u32 config) 1326 1327 { 1327 1328 struct cx25840_state *state = to_state(sd); 1328 1329 struct i2c_client *client = v4l2_get_subdevdata(sd); 1329 1330 1330 - return set_input(client, route->input, state->aud_input); 1331 + return set_input(client, input, state->aud_input); 1331 1332 } 1332 1333 1333 - static int cx25840_s_audio_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 1334 + static int cx25840_s_audio_routing(struct v4l2_subdev *sd, 1335 + u32 input, u32 output, u32 config) 1334 1336 { 1335 1337 struct cx25840_state *state = to_state(sd); 1336 1338 struct i2c_client *client = v4l2_get_subdevdata(sd); 1337 1339 1338 1340 if (state->is_cx25836) 1339 1341 return -EINVAL; 1340 - return set_input(client, state->vid_input, route->input); 1342 + return set_input(client, state->vid_input, input); 1341 1343 } 1342 1344 1343 1345 static int cx25840_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)
+4 -8
drivers/media/video/cx88/cx88-video.c
··· 428 428 routes for different inputs. HVR-1300 surely does */ 429 429 if (core->board.audio_chip && 430 430 core->board.audio_chip == V4L2_IDENT_WM8775) { 431 - struct v4l2_routing route; 432 - 433 - route.input = INPUT(input).audioroute; 434 - call_all(core, audio, s_routing, &route); 431 + call_all(core, audio, s_routing, 432 + INPUT(input).audioroute, 0, 0); 435 433 } 436 434 /* cx2388's C-ADC is connected to the tuner only. 437 435 When used with S-Video, that ADC is busy dealing with ··· 821 823 if (core->board.radio.audioroute) { 822 824 if(core->board.audio_chip && 823 825 core->board.audio_chip == V4L2_IDENT_WM8775) { 824 - struct v4l2_routing route; 825 - 826 - route.input = core->board.radio.audioroute; 827 - call_all(core, audio, s_routing, &route); 826 + call_all(core, audio, s_routing, 827 + core->board.radio.audioroute, 0, 0); 828 828 } 829 829 /* "I2S ADC mode" */ 830 830 core->tvaudio = WW_I2SADC;
+3 -8
drivers/media/video/em28xx/em28xx-core.c
··· 1018 1018 */ 1019 1019 void em28xx_wake_i2c(struct em28xx *dev) 1020 1020 { 1021 - struct v4l2_routing route; 1022 - int zero = 0; 1023 - 1024 - route.input = INPUT(dev->ctl_input)->vmux; 1025 - route.output = 0; 1026 - 1027 - v4l2_device_call_all(&dev->v4l2_dev, 0, core, reset, zero); 1028 - v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, &route); 1021 + v4l2_device_call_all(&dev->v4l2_dev, 0, core, reset, 0); 1022 + v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, 1023 + INPUT(dev->ctl_input)->vmux, 0, 0); 1029 1024 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0); 1030 1025 } 1031 1026
+6 -13
drivers/media/video/em28xx/em28xx-video.c
··· 515 515 516 516 static void video_mux(struct em28xx *dev, int index) 517 517 { 518 - struct v4l2_routing route; 519 - 520 - route.input = INPUT(index)->vmux; 521 - route.output = 0; 522 518 dev->ctl_input = index; 523 519 dev->ctl_ainput = INPUT(index)->amux; 524 520 dev->ctl_aoutput = INPUT(index)->aout; ··· 522 526 if (!dev->ctl_aoutput) 523 527 dev->ctl_aoutput = EM28XX_AOUT_MASTER; 524 528 525 - v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, &route); 529 + v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, 530 + INPUT(index)->vmux, 0, 0); 526 531 527 532 if (dev->board.has_msp34xx) { 528 533 if (dev->i2s_speed) { 529 534 v4l2_device_call_all(&dev->v4l2_dev, 0, audio, 530 535 s_i2s_clock_freq, dev->i2s_speed); 531 536 } 532 - route.input = dev->ctl_ainput; 533 - route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 534 - 535 537 /* Note: this is msp3400 specific */ 536 - v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, &route); 538 + v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, 539 + dev->ctl_ainput, MSP_OUTPUT(MSP_SC_IN_DSP_SCART1), 0); 537 540 } 538 541 539 542 if (dev->board.adecoder != EM28XX_NOADECODER) { 540 - route.input = dev->ctl_ainput; 541 - route.output = dev->ctl_aoutput; 542 - 543 - v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, &route); 543 + v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, 544 + dev->ctl_ainput, dev->ctl_aoutput, 0); 544 545 } 545 546 546 547 em28xx_audio_analog_set(dev);
+9 -7
drivers/media/video/ivtv/ivtv-gpio.c
··· 248 248 return 0; 249 249 } 250 250 251 - static int subdev_s_audio_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 251 + static int subdev_s_audio_routing(struct v4l2_subdev *sd, 252 + u32 input, u32 output, u32 config) 252 253 { 253 254 struct ivtv *itv = sd_to_ivtv(sd); 254 255 u16 mask, data; 255 256 256 - if (route->input > 2) 257 + if (input > 2) 257 258 return -EINVAL; 258 259 mask = itv->card->gpio_audio_input.mask; 259 - switch (route->input) { 260 + switch (input) { 260 261 case 0: 261 262 data = itv->card->gpio_audio_input.tuner; 262 263 break; ··· 319 318 return 0; 320 319 } 321 320 322 - static int subdev_s_video_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 321 + static int subdev_s_video_routing(struct v4l2_subdev *sd, 322 + u32 input, u32 output, u32 config) 323 323 { 324 324 struct ivtv *itv = sd_to_ivtv(sd); 325 325 u16 mask, data; 326 326 327 - if (route->input > 2) /* 0:Tuner 1:Composite 2:S-Video */ 327 + if (input > 2) /* 0:Tuner 1:Composite 2:S-Video */ 328 328 return -EINVAL; 329 329 mask = itv->card->gpio_video_input.mask; 330 - if (route->input == 0) 330 + if (input == 0) 331 331 data = itv->card->gpio_video_input.tuner; 332 - else if (route->input == 1) 332 + else if (input == 1) 333 333 data = itv->card->gpio_video_input.composite; 334 334 else 335 335 data = itv->card->gpio_video_input.svideo;
+5 -5
drivers/media/video/ivtv/ivtv-ioctl.c
··· 1033 1033 static int ivtv_s_output(struct file *file, void *fh, unsigned int outp) 1034 1034 { 1035 1035 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 1036 - struct v4l2_routing route; 1037 1036 1038 1037 if (outp >= itv->card->nof_outputs) 1039 1038 return -EINVAL; ··· 1045 1046 itv->active_output, outp); 1046 1047 1047 1048 itv->active_output = outp; 1048 - route.input = SAA7127_INPUT_TYPE_NORMAL; 1049 - route.output = itv->card->video_outputs[outp].video_output; 1050 - ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_routing, &route); 1049 + ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_routing, 1050 + SAA7127_INPUT_TYPE_NORMAL, 1051 + itv->card->video_outputs[outp].video_output, 0); 1051 1052 1052 1053 return 0; 1053 1054 } ··· 1737 1738 case VIDIOC_INT_S_AUDIO_ROUTING: { 1738 1739 struct v4l2_routing *route = arg; 1739 1740 1740 - ivtv_call_hw(itv, itv->card->hw_audio, audio, s_routing, route); 1741 + ivtv_call_hw(itv, itv->card->hw_audio, audio, s_routing, 1742 + route->input, route->output, 0); 1741 1743 break; 1742 1744 } 1743 1745
+35 -31
drivers/media/video/ivtv/ivtv-routing.c
··· 34 34 void ivtv_audio_set_io(struct ivtv *itv) 35 35 { 36 36 const struct ivtv_card_audio_input *in; 37 - struct v4l2_routing route; 37 + u32 input, output = 0; 38 38 39 39 /* Determine which input to use */ 40 40 if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) ··· 43 43 in = &itv->card->audio_inputs[itv->audio_input]; 44 44 45 45 /* handle muxer chips */ 46 - route.input = in->muxer_input; 47 - route.output = 0; 46 + input = in->muxer_input; 48 47 if (itv->card->hw_muxer & IVTV_HW_M52790) 49 - route.output = M52790_OUT_STEREO; 50 - v4l2_subdev_call(itv->sd_muxer, audio, s_routing, &route); 48 + output = M52790_OUT_STEREO; 49 + v4l2_subdev_call(itv->sd_muxer, audio, s_routing, 50 + input, output, 0); 51 51 52 - route.input = in->audio_input; 53 - route.output = 0; 52 + input = in->audio_input; 53 + output = 0; 54 54 if (itv->card->hw_audio & IVTV_HW_MSP34XX) 55 - route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 56 - ivtv_call_hw(itv, itv->card->hw_audio, audio, s_routing, &route); 55 + output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 56 + ivtv_call_hw(itv, itv->card->hw_audio, audio, s_routing, 57 + input, output, 0); 57 58 } 58 59 59 60 /* Selects the video input and output according to the current 60 61 settings. */ 61 62 void ivtv_video_set_io(struct ivtv *itv) 62 63 { 63 - struct v4l2_routing route; 64 64 int inp = itv->active_input; 65 + u32 input; 65 66 u32 type; 66 67 67 - route.input = itv->card->video_inputs[inp].video_input; 68 - route.output = 0; 69 - v4l2_subdev_call(itv->sd_video, video, s_routing, &route); 68 + v4l2_subdev_call(itv->sd_video, video, s_routing, 69 + itv->card->video_inputs[inp].video_input, 0, 0); 70 70 71 71 type = itv->card->video_inputs[inp].video_type; 72 72 73 73 if (type == IVTV_CARD_INPUT_VID_TUNER) { 74 - route.input = 0; /* Tuner */ 74 + input = 0; /* Tuner */ 75 75 } else if (type < IVTV_CARD_INPUT_COMPOSITE1) { 76 - route.input = 2; /* S-Video */ 76 + input = 2; /* S-Video */ 77 77 } else { 78 - route.input = 1; /* Composite */ 78 + input = 1; /* Composite */ 79 79 } 80 80 81 81 if (itv->card->hw_video & IVTV_HW_GPIO) 82 - ivtv_call_hw(itv, IVTV_HW_GPIO, video, s_routing, &route); 82 + ivtv_call_hw(itv, IVTV_HW_GPIO, video, s_routing, 83 + input, 0, 0); 83 84 84 85 if (itv->card->hw_video & IVTV_HW_UPD64031A) { 85 86 if (type == IVTV_CARD_INPUT_VID_TUNER || 86 87 type >= IVTV_CARD_INPUT_COMPOSITE1) { 87 88 /* Composite: GR on, connect to 3DYCS */ 88 - route.input = UPD64031A_GR_ON | UPD64031A_3DYCS_COMPOSITE; 89 + input = UPD64031A_GR_ON | UPD64031A_3DYCS_COMPOSITE; 89 90 } else { 90 91 /* S-Video: GR bypassed, turn it off */ 91 - route.input = UPD64031A_GR_OFF | UPD64031A_3DYCS_DISABLE; 92 + input = UPD64031A_GR_OFF | UPD64031A_3DYCS_DISABLE; 92 93 } 93 - route.input |= itv->card->gr_config; 94 + input |= itv->card->gr_config; 94 95 95 - ivtv_call_hw(itv, IVTV_HW_UPD64031A, video, s_routing, &route); 96 + ivtv_call_hw(itv, IVTV_HW_UPD64031A, video, s_routing, 97 + input, 0, 0); 96 98 } 97 99 98 100 if (itv->card->hw_video & IVTV_HW_UPD6408X) { 99 - route.input = UPD64083_YCS_MODE; 101 + input = UPD64083_YCS_MODE; 100 102 if (type > IVTV_CARD_INPUT_VID_TUNER && 101 103 type < IVTV_CARD_INPUT_COMPOSITE1) { 102 - /* S-Video uses YCNR mode and internal Y-ADC, the upd64031a 103 - is not used. */ 104 - route.input |= UPD64083_YCNR_MODE; 104 + /* S-Video uses YCNR mode and internal Y-ADC, the 105 + upd64031a is not used. */ 106 + input |= UPD64083_YCNR_MODE; 105 107 } 106 108 else if (itv->card->hw_video & IVTV_HW_UPD64031A) { 107 - /* Use upd64031a output for tuner and composite(CX23416GYC only) inputs */ 108 - if ((type == IVTV_CARD_INPUT_VID_TUNER)|| 109 - (itv->card->type == IVTV_CARD_CX23416GYC)) { 110 - route.input |= UPD64083_EXT_Y_ADC; 111 - } 109 + /* Use upd64031a output for tuner and 110 + composite(CX23416GYC only) inputs */ 111 + if (type == IVTV_CARD_INPUT_VID_TUNER || 112 + itv->card->type == IVTV_CARD_CX23416GYC) { 113 + input |= UPD64083_EXT_Y_ADC; 114 + } 112 115 } 113 - ivtv_call_hw(itv, IVTV_HW_UPD6408X, video, s_routing, &route); 116 + ivtv_call_hw(itv, IVTV_HW_UPD6408X, video, s_routing, 117 + input, 0, 0); 114 118 } 115 119 }
+9 -8
drivers/media/video/ks0127.c
··· 409 409 } 410 410 } 411 411 412 - static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 412 + static int ks0127_s_routing(struct v4l2_subdev *sd, 413 + u32 input, u32 output, u32 config) 413 414 { 414 415 struct ks0127 *ks = to_ks0127(sd); 415 416 416 - switch (route->input) { 417 + switch (input) { 417 418 case KS_INPUT_COMPOSITE_1: 418 419 case KS_INPUT_COMPOSITE_2: 419 420 case KS_INPUT_COMPOSITE_3: ··· 422 421 case KS_INPUT_COMPOSITE_5: 423 422 case KS_INPUT_COMPOSITE_6: 424 423 v4l2_dbg(1, debug, sd, 425 - "s_routing %d: Composite\n", route->input); 424 + "s_routing %d: Composite\n", input); 426 425 /* autodetect 50/60 Hz */ 427 426 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00); 428 427 /* VSE=0 */ 429 428 ks0127_and_or(sd, KS_CMDA, ~0x40, 0x00); 430 429 /* set input line */ 431 - ks0127_and_or(sd, KS_CMDB, 0xb0, route->input); 430 + ks0127_and_or(sd, KS_CMDB, 0xb0, input); 432 431 /* non-freerunning mode */ 433 432 ks0127_and_or(sd, KS_CMDC, 0x70, 0x0a); 434 433 /* analog input */ ··· 456 455 case KS_INPUT_SVIDEO_2: 457 456 case KS_INPUT_SVIDEO_3: 458 457 v4l2_dbg(1, debug, sd, 459 - "s_routing %d: S-Video\n", route->input); 458 + "s_routing %d: S-Video\n", input); 460 459 /* autodetect 50/60 Hz */ 461 460 ks0127_and_or(sd, KS_CMDA, 0xfc, 0x00); 462 461 /* VSE=0 */ 463 462 ks0127_and_or(sd, KS_CMDA, ~0x40, 0x00); 464 463 /* set input line */ 465 - ks0127_and_or(sd, KS_CMDB, 0xb0, route->input); 464 + ks0127_and_or(sd, KS_CMDB, 0xb0, input); 466 465 /* non-freerunning mode */ 467 466 ks0127_and_or(sd, KS_CMDC, 0x70, 0x0a); 468 467 /* analog input */ ··· 497 496 498 497 ks0127_and_or(sd, KS_CMDA, 0xff, 0x40); /* VSE=1 */ 499 498 /* set input line and VALIGN */ 500 - ks0127_and_or(sd, KS_CMDB, 0xb0, (route->input | 0x40)); 499 + ks0127_and_or(sd, KS_CMDB, 0xb0, (input | 0x40)); 501 500 /* freerunning mode, */ 502 501 /* TSTGEN = 1 TSTGFR=11 TSTGPH=0 TSTGPK=0 VMEM=1*/ 503 502 ks0127_and_or(sd, KS_CMDC, 0x70, 0x87); ··· 532 531 533 532 default: 534 533 v4l2_dbg(1, debug, sd, 535 - "s_routing: Unknown input %d\n", route->input); 534 + "s_routing: Unknown input %d\n", input); 536 535 break; 537 536 } 538 537
+4 -3
drivers/media/video/m52790.c
··· 69 69 part of the audio output routing. The normal case is that another 70 70 chip takes care of the actual muting so making it part of the 71 71 output routing seems to be the right thing to do for now. */ 72 - static int m52790_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 72 + static int m52790_s_routing(struct v4l2_subdev *sd, 73 + u32 input, u32 output, u32 config) 73 74 { 74 75 struct m52790_state *state = to_state(sd); 75 76 76 - state->input = route->input; 77 - state->output = route->output; 77 + state->input = input; 78 + state->output = output; 78 79 m52790_write(sd); 79 80 return 0; 80 81 }
+13 -12
drivers/media/video/msp3400-driver.c
··· 505 505 return 0; 506 506 } 507 507 508 - static int msp_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *rt) 508 + static int msp_s_routing(struct v4l2_subdev *sd, 509 + u32 input, u32 output, u32 config) 509 510 { 510 511 struct msp_state *state = to_state(sd); 511 512 struct i2c_client *client = v4l2_get_subdevdata(sd); 512 - int tuner = (rt->input >> 3) & 1; 513 - int sc_in = rt->input & 0x7; 514 - int sc1_out = rt->output & 0xf; 515 - int sc2_out = (rt->output >> 4) & 0xf; 513 + int tuner = (input >> 3) & 1; 514 + int sc_in = input & 0x7; 515 + int sc1_out = output & 0xf; 516 + int sc2_out = (output >> 4) & 0xf; 516 517 u16 val, reg; 517 518 int i; 518 519 int extern_input = 1; 519 520 520 - if (state->routing.input == rt->input && 521 - state->routing.output == rt->output) 521 + if (state->route_in == input && state->route_out == output) 522 522 return 0; 523 - state->routing = *rt; 523 + state->route_in = input; 524 + state->route_out = output; 524 525 /* check if the tuner input is used */ 525 526 for (i = 0; i < 5; i++) { 526 - if (((rt->input >> (4 + i * 4)) & 0xf) == 0) 527 + if (((input >> (4 + i * 4)) & 0xf) == 0) 527 528 extern_input = 0; 528 529 } 529 530 state->mode = extern_input ? MSP_MODE_EXTERN : MSP_MODE_AM_DETECT; ··· 674 673 } 675 674 v4l_info(client, "Audmode: 0x%04x\n", state->audmode); 676 675 v4l_info(client, "Routing: 0x%08x (input) 0x%08x (output)\n", 677 - state->routing.input, state->routing.output); 676 + state->route_in, state->route_out); 678 677 v4l_info(client, "ACB: 0x%04x\n", state->acb); 679 678 return 0; 680 679 } ··· 762 761 state->i2s_mode = 0; 763 762 init_waitqueue_head(&state->wq); 764 763 /* These are the reset input/output positions */ 765 - state->routing.input = MSP_INPUT_DEFAULT; 766 - state->routing.output = MSP_OUTPUT_DEFAULT; 764 + state->route_in = MSP_INPUT_DEFAULT; 765 + state->route_out = MSP_OUTPUT_DEFAULT; 767 766 768 767 state->rev1 = msp_read_dsp(client, 0x1e); 769 768 if (state->rev1 != -1)
+2 -1
drivers/media/video/msp3400-driver.h
··· 80 80 int i2s_mode; 81 81 int main, second; /* sound carrier */ 82 82 int input; 83 - struct v4l2_routing routing; 83 + u32 route_in; 84 + u32 route_out; 84 85 85 86 /* v4l2 */ 86 87 int audmode;
+3 -3
drivers/media/video/msp3400-kthreads.c
··· 188 188 { 189 189 struct msp_state *state = to_state(i2c_get_clientdata(client)); 190 190 struct msp3400c_init_data_dem *data = &msp3400c_init_data[mode]; 191 - int tuner = (state->routing.input >> 3) & 1; 191 + int tuner = (state->route_in >> 3) & 1; 192 192 int i; 193 193 194 194 v4l_dbg(1, msp_debug, client, "set_mode: %d\n", mode); ··· 896 896 static void msp34xxg_set_sources(struct i2c_client *client) 897 897 { 898 898 struct msp_state *state = to_state(i2c_get_clientdata(client)); 899 - u32 in = state->routing.input; 899 + u32 in = state->route_in; 900 900 901 901 msp34xxg_set_source(client, 0x0008, (in >> 4) & 0xf); 902 902 /* quasi-peak detector is set to same input as the loudspeaker (MAIN) */ ··· 912 912 static void msp34xxg_reset(struct i2c_client *client) 913 913 { 914 914 struct msp_state *state = to_state(i2c_get_clientdata(client)); 915 - int tuner = (state->routing.input >> 3) & 1; 915 + int tuner = (state->route_in >> 3) & 1; 916 916 int modus; 917 917 918 918 /* initialize std to 1 (autodetect) to signal that no standard is
+45 -70
drivers/media/video/mxb.c
··· 83 83 static int video_audio_connect[MXB_INPUTS] = 84 84 { 0, 1, 3, 3 }; 85 85 86 + struct mxb_routing { 87 + u32 input; 88 + u32 output; 89 + }; 90 + 86 91 /* These are the necessary input-output-pins for bringing one audio source 87 92 (see above) to the CD-output. Note that gain is set to 0 in this table. */ 88 - static struct v4l2_routing TEA6420_cd[MXB_AUDIOS + 1][2] = { 93 + static struct mxb_routing TEA6420_cd[MXB_AUDIOS + 1][2] = { 89 94 { { 1, 1 }, { 1, 1 } }, /* Tuner */ 90 95 { { 5, 1 }, { 6, 1 } }, /* AUX 1 */ 91 96 { { 4, 1 }, { 6, 1 } }, /* AUX 2 */ ··· 102 97 103 98 /* These are the necessary input-output-pins for bringing one audio source 104 99 (see above) to the line-output. Note that gain is set to 0 in this table. */ 105 - static struct v4l2_routing TEA6420_line[MXB_AUDIOS + 1][2] = { 100 + static struct mxb_routing TEA6420_line[MXB_AUDIOS + 1][2] = { 106 101 { { 2, 3 }, { 1, 2 } }, 107 102 { { 5, 3 }, { 6, 2 } }, 108 103 { { 4, 3 }, { 6, 2 } }, ··· 139 134 140 135 #define saa7111a_call(mxb, o, f, args...) \ 141 136 v4l2_subdev_call(mxb->saa7111a, o, f, ##args) 142 - #define tea6420_1_call(mxb, o, f, args...) \ 143 - v4l2_subdev_call(mxb->tea6420_1, o, f, ##args) 144 - #define tea6420_2_call(mxb, o, f, args...) \ 145 - v4l2_subdev_call(mxb->tea6420_2, o, f, ##args) 146 137 #define tda9840_call(mxb, o, f, args...) \ 147 138 v4l2_subdev_call(mxb->tda9840, o, f, ##args) 148 139 #define tea6415c_call(mxb, o, f, args...) \ ··· 147 146 v4l2_subdev_call(mxb->tuner, o, f, ##args) 148 147 #define call_all(dev, o, f, args...) \ 149 148 v4l2_device_call_until_err(&dev->v4l2_dev, 0, o, f, ##args) 149 + 150 + static inline void tea6420_route_cd(struct mxb *mxb, int idx) 151 + { 152 + v4l2_subdev_call(mxb->tea6420_1, audio, s_routing, 153 + TEA6420_cd[idx][0].input, TEA6420_cd[idx][0].output, 0); 154 + v4l2_subdev_call(mxb->tea6420_2, audio, s_routing, 155 + TEA6420_cd[idx][1].input, TEA6420_cd[idx][1].output, 0); 156 + } 157 + 158 + static inline void tea6420_route_line(struct mxb *mxb, int idx) 159 + { 160 + v4l2_subdev_call(mxb->tea6420_1, audio, s_routing, 161 + TEA6420_line[idx][0].input, TEA6420_line[idx][0].output, 0); 162 + v4l2_subdev_call(mxb->tea6420_2, audio, s_routing, 163 + TEA6420_line[idx][1].input, TEA6420_line[idx][1].output, 0); 164 + } 150 165 151 166 static struct saa7146_extension extension; 152 167 ··· 285 268 struct i2c_msg msg; 286 269 struct tuner_setup tun_setup; 287 270 v4l2_std_id std = V4L2_STD_PAL_BG; 288 - struct v4l2_routing route; 289 271 290 272 int i = 0, err = 0; 291 273 ··· 293 277 294 278 /* select tuner-output on saa7111a */ 295 279 i = 0; 296 - route.input = SAA7115_COMPOSITE0; 297 - route.output = SAA7111_FMT_CCIR | SAA7111_VBI_BYPASS; 298 - saa7111a_call(mxb, video, s_routing, &route); 280 + saa7111a_call(mxb, video, s_routing, SAA7115_COMPOSITE0, 281 + SAA7111_FMT_CCIR | SAA7111_VBI_BYPASS, 0); 299 282 300 283 /* select a tuner type */ 301 284 tun_setup.mode_mask = T_ANALOG_TV; ··· 311 296 tuner_call(mxb, core, s_std, std); 312 297 313 298 /* mute audio on tea6420s */ 314 - tea6420_1_call(mxb, audio, s_routing, &TEA6420_line[6][0]); 315 - tea6420_2_call(mxb, audio, s_routing, &TEA6420_line[6][1]); 316 - tea6420_1_call(mxb, audio, s_routing, &TEA6420_cd[6][0]); 317 - tea6420_2_call(mxb, audio, s_routing, &TEA6420_cd[6][1]); 299 + tea6420_route_line(mxb, 6); 300 + tea6420_route_cd(mxb, 6); 318 301 319 302 /* switch to tuner-channel on tea6415c */ 320 - route.input = 3; 321 - route.output = 17; 322 - tea6415c_call(mxb, video, s_routing, &route); 303 + tea6415c_call(mxb, video, s_routing, 3, 17, 0); 323 304 324 305 /* select tuner-output on multicable on tea6415c */ 325 - route.input = 3; 326 - route.output = 13; 327 - tea6415c_call(mxb, video, s_routing, &route); 306 + tea6415c_call(mxb, video, s_routing, 3, 13, 0); 328 307 329 308 /* the rest for mxb */ 330 309 mxb->cur_input = 0; ··· 442 433 443 434 if (vc->id == V4L2_CID_AUDIO_MUTE) { 444 435 mxb->cur_mute = vc->value; 445 - if (!vc->value) { 446 - /* switch the audio-source */ 447 - tea6420_1_call(mxb, audio, s_routing, 448 - &TEA6420_line[video_audio_connect[mxb->cur_input]][0]); 449 - tea6420_2_call(mxb, audio, s_routing, 450 - &TEA6420_line[video_audio_connect[mxb->cur_input]][1]); 451 - } else { 452 - tea6420_1_call(mxb, audio, s_routing, 453 - &TEA6420_line[6][0]); 454 - tea6420_2_call(mxb, audio, s_routing, 455 - &TEA6420_line[6][1]); 456 - } 436 + /* switch the audio-source */ 437 + tea6420_route_line(mxb, vc->value ? 6 : 438 + video_audio_connect[mxb->cur_input]); 457 439 DEB_EE(("VIDIOC_S_CTRL, V4L2_CID_AUDIO_MUTE: %d.\n", vc->value)); 458 440 } 459 441 return 0; ··· 473 473 { 474 474 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 475 475 struct mxb *mxb = (struct mxb *)dev->ext_priv; 476 - struct v4l2_routing route; 476 + int err = 0; 477 477 int i = 0; 478 478 479 479 DEB_EE(("VIDIOC_S_INPUT %d.\n", input)); ··· 491 491 switch (input) { 492 492 case TUNER: 493 493 i = SAA7115_COMPOSITE0; 494 - route.input = 3; 495 - route.output = 17; 496 494 497 - if (tea6415c_call(mxb, video, s_routing, &route)) { 498 - printk(KERN_ERR "VIDIOC_S_INPUT: could not address tea6415c #1\n"); 499 - return -EFAULT; 500 - } 495 + err = tea6415c_call(mxb, video, s_routing, 3, 17, 0); 496 + 501 497 /* connect tuner-output always to multicable */ 502 - route.input = 3; 503 - route.output = 13; 498 + if (!err) 499 + err = tea6415c_call(mxb, video, s_routing, 3, 13, 0); 504 500 break; 505 501 case AUX3_YC: 506 502 /* nothing to be done here. aux3_yc is ··· 510 514 break; 511 515 case AUX1: 512 516 i = SAA7115_COMPOSITE0; 513 - route.input = 1; 514 - route.output = 17; 517 + err = tea6415c_call(mxb, video, s_routing, 1, 17, 0); 515 518 break; 516 519 } 517 520 518 - /* switch video in tea6415c only if necessary */ 519 - switch (input) { 520 - case TUNER: 521 - case AUX1: 522 - if (tea6415c_call(mxb, video, s_routing, &route)) { 523 - printk(KERN_ERR "VIDIOC_S_INPUT: could not address tea6415c #3\n"); 524 - return -EFAULT; 525 - } 526 - break; 527 - default: 528 - break; 529 - } 521 + if (err) 522 + return err; 530 523 531 524 /* switch video in saa7111a */ 532 - route.input = i; 533 - route.output = 0; 534 - if (saa7111a_call(mxb, video, s_routing, &route)) 525 + if (saa7111a_call(mxb, video, s_routing, i, 0, 0)) 535 526 printk(KERN_ERR "VIDIOC_S_INPUT: could not address saa7111a #1.\n"); 536 527 537 528 /* switch the audio-source only if necessary */ 538 - if (0 == mxb->cur_mute) { 539 - tea6420_1_call(mxb, audio, s_routing, 540 - &TEA6420_line[video_audio_connect[input]][0]); 541 - tea6420_2_call(mxb, audio, s_routing, 542 - &TEA6420_line[video_audio_connect[input]][1]); 543 - } 529 + if (0 == mxb->cur_mute) 530 + tea6420_route_line(mxb, video_audio_connect[input]); 544 531 545 532 return 0; 546 533 } ··· 665 686 666 687 DEB_EE(("MXB_S_AUDIO_CD: i:%d.\n", i)); 667 688 668 - tea6420_1_call(mxb, audio, s_routing, &TEA6420_cd[i][0]); 669 - tea6420_2_call(mxb, audio, s_routing, &TEA6420_cd[i][1]); 670 - 689 + tea6420_route_cd(mxb, i); 671 690 return 0; 672 691 } 673 692 case MXB_S_AUDIO_LINE: ··· 678 701 } 679 702 680 703 DEB_EE(("MXB_S_AUDIO_LINE: i:%d.\n", i)); 681 - tea6420_1_call(mxb, audio, s_routing, &TEA6420_line[i][0]); 682 - tea6420_2_call(mxb, audio, s_routing, &TEA6420_line[i][1]); 683 - 704 + tea6420_route_line(mxb, i); 684 705 return 0; 685 706 } 686 707 default:
+4 -4
drivers/media/video/pvrusb2/pvrusb2-audio.c
··· 58 58 void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 59 59 { 60 60 if (hdw->input_dirty || hdw->force_dirty) { 61 - struct v4l2_routing route; 62 61 const struct routing_scheme *sp; 63 62 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 63 + u32 input; 64 64 65 65 pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo"); 66 66 ··· 68 68 ((sp = routing_schemes + sid) != NULL) && 69 69 (hdw->input_val >= 0) && 70 70 (hdw->input_val < sp->cnt)) { 71 - route.input = sp->def[hdw->input_val]; 71 + input = sp->def[hdw->input_val]; 72 72 } else { 73 73 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 74 74 "*** WARNING *** subdev msp3400 set_input:" ··· 77 77 sid, hdw->input_val); 78 78 return; 79 79 } 80 - route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 81 - sd->ops->audio->s_routing(sd, &route); 80 + sd->ops->audio->s_routing(sd, input, 81 + MSP_OUTPUT(MSP_SC_IN_DSP_SCART1), 0); 82 82 } 83 83 } 84 84
+3 -4
drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
··· 60 60 void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 61 61 { 62 62 if (hdw->input_dirty || hdw->force_dirty) { 63 - struct v4l2_routing route; 64 63 const struct routing_scheme *sp; 65 64 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 65 + u32 input; 66 66 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", 67 67 hdw->input_val); 68 68 if ((sid < ARRAY_SIZE(routing_schemes)) && 69 69 ((sp = routing_schemes + sid) != NULL) && 70 70 (hdw->input_val >= 0) && 71 71 (hdw->input_val < sp->cnt)) { 72 - route.input = sp->def[hdw->input_val]; 72 + input = sp->def[hdw->input_val]; 73 73 } else { 74 74 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 75 75 "*** WARNING *** subdev v4l2 set_input:" ··· 78 78 sid, hdw->input_val); 79 79 return; 80 80 } 81 - route.output = 0; 82 - sd->ops->audio->s_routing(sd, &route); 81 + sd->ops->audio->s_routing(sd, input, 0, 0); 83 82 } 84 83 } 85 84
+2 -7
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
··· 105 105 { 106 106 pvr2_trace(PVR2_TRACE_CHIPS, "subdev cx2584x update..."); 107 107 if (hdw->input_dirty || hdw->force_dirty) { 108 - struct v4l2_routing route; 109 108 enum cx25840_video_input vid_input; 110 109 enum cx25840_audio_input aud_input; 111 110 const struct routing_scheme *sp; 112 111 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 113 - 114 - memset(&route, 0, sizeof(route)); 115 112 116 113 if ((sid < ARRAY_SIZE(routing_schemes)) && 117 114 ((sp = routing_schemes + sid) != NULL) && ··· 128 131 pvr2_trace(PVR2_TRACE_CHIPS, 129 132 "subdev cx2584x set_input vid=0x%x aud=0x%x", 130 133 vid_input, aud_input); 131 - route.input = (u32)vid_input; 132 - sd->ops->video->s_routing(sd, &route); 133 - route.input = (u32)aud_input; 134 - sd->ops->audio->s_routing(sd, &route); 134 + sd->ops->video->s_routing(sd, (u32)vid_input, 0, 0); 135 + sd->ops->audio->s_routing(sd, (u32)aud_input, 0, 0); 135 136 } 136 137 } 137 138
+4 -4
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
··· 75 75 void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 76 76 { 77 77 if (hdw->input_dirty || hdw->force_dirty) { 78 - struct v4l2_routing route; 79 78 const struct routing_scheme *sp; 80 79 unsigned int sid = hdw->hdw_desc->signal_routing_scheme; 80 + u32 input; 81 + 81 82 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", 82 83 hdw->input_val); 83 84 if ((sid < ARRAY_SIZE(routing_schemes)) && 84 85 ((sp = routing_schemes + sid) != NULL) && 85 86 (hdw->input_val >= 0) && 86 87 (hdw->input_val < sp->cnt)) { 87 - route.input = sp->def[hdw->input_val]; 88 + input = sp->def[hdw->input_val]; 88 89 } else { 89 90 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 90 91 "*** WARNING *** subdev v4l2 set_input:" ··· 94 93 sid, hdw->input_val); 95 94 return; 96 95 } 97 - route.output = 0; 98 - sd->ops->video->s_routing(sd, &route); 96 + sd->ops->video->s_routing(sd, input, 0, 0); 99 97 } 100 98 } 101 99
+5 -7
drivers/media/video/pvrusb2/pvrusb2-wm8775.c
··· 39 39 void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) 40 40 { 41 41 if (hdw->input_dirty || hdw->force_dirty) { 42 - struct v4l2_routing route; 43 - 44 - memset(&route, 0, sizeof(route)); 42 + u32 input; 45 43 46 44 switch (hdw->input_val) { 47 45 case PVR2_CVAL_INPUT_RADIO: 48 - route.input = 1; 46 + input = 1; 49 47 break; 50 48 default: 51 49 /* All other cases just use the second input */ 52 - route.input = 2; 50 + input = 2; 53 51 break; 54 52 } 55 53 pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775" 56 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
+7 -6
drivers/media/video/saa7110.c
··· 299 299 return 0; 300 300 } 301 301 302 - static int saa7110_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 302 + static int saa7110_s_routing(struct v4l2_subdev *sd, 303 + u32 input, u32 output, u32 config) 303 304 { 304 305 struct saa7110 *decoder = to_saa7110(sd); 305 306 306 - if (route->input < 0 || route->input >= SAA7110_MAX_INPUT) { 307 - v4l2_dbg(1, debug, sd, "input=%d not available\n", route->input); 307 + if (input < 0 || input >= SAA7110_MAX_INPUT) { 308 + v4l2_dbg(1, debug, sd, "input=%d not available\n", input); 308 309 return -EINVAL; 309 310 } 310 - if (decoder->input != route->input) { 311 - saa7110_selmux(sd, route->input); 312 - v4l2_dbg(1, debug, sd, "switched to input=%d\n", route->input); 311 + if (decoder->input != input) { 312 + saa7110_selmux(sd, input); 313 + v4l2_dbg(1, debug, sd, "switched to input=%d\n", input); 313 314 } 314 315 return 0; 315 316 }
+16 -14
drivers/media/video/saa7115.c
··· 1228 1228 return 0; 1229 1229 } 1230 1230 1231 - static int saa711x_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 1231 + static int saa711x_s_routing(struct v4l2_subdev *sd, 1232 + u32 input, u32 output, u32 config) 1232 1233 { 1233 1234 struct saa711x_state *state = to_state(sd); 1234 - u32 input = route->input; 1235 1235 u8 mask = (state->ident == V4L2_IDENT_SAA7111) ? 0xf8 : 0xf0; 1236 1236 1237 - v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", route->input, route->output); 1237 + v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", 1238 + input, output); 1239 + 1238 1240 /* saa7111/3 does not have these inputs */ 1239 1241 if ((state->ident == V4L2_IDENT_SAA7113 || 1240 1242 state->ident == V4L2_IDENT_SAA7111) && 1241 - (route->input == SAA7115_COMPOSITE4 || 1242 - route->input == SAA7115_COMPOSITE5)) { 1243 + (input == SAA7115_COMPOSITE4 || 1244 + input == SAA7115_COMPOSITE5)) { 1243 1245 return -EINVAL; 1244 1246 } 1245 - if (route->input > SAA7115_SVIDEO3) 1247 + if (input > SAA7115_SVIDEO3) 1246 1248 return -EINVAL; 1247 - if (route->output > SAA7115_IPORT_ON) 1249 + if (output > SAA7115_IPORT_ON) 1248 1250 return -EINVAL; 1249 - if (state->input == route->input && state->output == route->output) 1251 + if (state->input == input && state->output == output) 1250 1252 return 0; 1251 1253 v4l2_dbg(1, debug, sd, "now setting %s input %s output\n", 1252 - (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", 1253 - (route->output == SAA7115_IPORT_ON) ? "iport on" : "iport off"); 1254 - state->input = route->input; 1254 + (input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", 1255 + (output == SAA7115_IPORT_ON) ? "iport on" : "iport off"); 1256 + state->input = input; 1255 1257 1256 1258 /* saa7111 has slightly different input numbering */ 1257 1259 if (state->ident == V4L2_IDENT_SAA7111) { ··· 1262 1260 /* saa7111 specific */ 1263 1261 saa711x_write(sd, R_10_CHROMA_CNTL_2, 1264 1262 (saa711x_read(sd, R_10_CHROMA_CNTL_2) & 0x3f) | 1265 - ((route->output & 0xc0) ^ 0x40)); 1263 + ((output & 0xc0) ^ 0x40)); 1266 1264 saa711x_write(sd, R_13_RT_X_PORT_OUT_CNTL, 1267 1265 (saa711x_read(sd, R_13_RT_X_PORT_OUT_CNTL) & 0xf0) | 1268 - ((route->output & 2) ? 0x0a : 0)); 1266 + ((output & 2) ? 0x0a : 0)); 1269 1267 } 1270 1268 1271 1269 /* select mode */ ··· 1278 1276 (saa711x_read(sd, R_09_LUMA_CNTL) & 0x7f) | 1279 1277 (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); 1280 1278 1281 - state->output = route->output; 1279 + state->output = output; 1282 1280 if (state->ident == V4L2_IDENT_SAA7114 || 1283 1281 state->ident == V4L2_IDENT_SAA7115) { 1284 1282 saa711x_write(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK,
+6 -5
drivers/media/video/saa7127.c
··· 570 570 return saa7127_set_std(sd, std); 571 571 } 572 572 573 - static int saa7127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 573 + static int saa7127_s_routing(struct v4l2_subdev *sd, 574 + u32 input, u32 output, u32 config) 574 575 { 575 576 struct saa7127_state *state = to_state(sd); 576 577 int rc = 0; 577 578 578 - if (state->input_type != route->input) 579 - rc = saa7127_set_input_type(sd, route->input); 580 - if (rc == 0 && state->output_type != route->output) 581 - rc = saa7127_set_output_type(sd, route->output); 579 + if (state->input_type != input) 580 + rc = saa7127_set_input_type(sd, input); 581 + if (rc == 0 && state->output_type != output) 582 + rc = saa7127_set_output_type(sd, output); 582 583 return rc; 583 584 } 584 585
+12 -11
drivers/media/video/saa717x.c
··· 1104 1104 }, 1105 1105 }; 1106 1106 1107 - static int saa717x_s_video_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 1107 + static int saa717x_s_video_routing(struct v4l2_subdev *sd, 1108 + u32 input, u32 output, u32 config) 1108 1109 { 1109 1110 struct saa717x_state *decoder = to_state(sd); 1110 - int inp = route->input; 1111 - int is_tuner = inp & 0x80; /* tuner input flag */ 1111 + int is_tuner = input & 0x80; /* tuner input flag */ 1112 1112 1113 - inp &= 0x7f; 1113 + input &= 0x7f; 1114 1114 1115 - v4l2_dbg(1, debug, sd, "decoder set input (%d)\n", inp); 1115 + v4l2_dbg(1, debug, sd, "decoder set input (%d)\n", input); 1116 1116 /* inputs from 0-9 are available*/ 1117 1117 /* saa717x have mode0-mode9 but mode5 is reserved. */ 1118 - if (inp < 0 || inp > 9 || inp == 5) 1118 + if (input < 0 || input > 9 || input == 5) 1119 1119 return -EINVAL; 1120 1120 1121 - if (decoder->input != inp) { 1122 - int input_line = inp; 1121 + if (decoder->input != input) { 1122 + int input_line = input; 1123 1123 1124 1124 decoder->input = input_line; 1125 1125 v4l2_dbg(1, debug, sd, "now setting %s input %d\n", ··· 1276 1276 return 0; 1277 1277 } 1278 1278 1279 - static int saa717x_s_audio_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 1279 + static int saa717x_s_audio_routing(struct v4l2_subdev *sd, 1280 + u32 input, u32 output, u32 config) 1280 1281 { 1281 1282 struct saa717x_state *decoder = to_state(sd); 1282 1283 1283 - if (route->input < 3) { /* FIXME! --tadachi */ 1284 - decoder->audio_input = route->input; 1284 + if (input < 3) { /* FIXME! --tadachi */ 1285 + decoder->audio_input = input; 1285 1286 v4l2_dbg(1, debug, sd, 1286 1287 "set decoder audio input to %d\n", 1287 1288 decoder->audio_input);
+5 -4
drivers/media/video/saa7185.c
··· 245 245 return 0; 246 246 } 247 247 248 - static int saa7185_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 248 + static int saa7185_s_routing(struct v4l2_subdev *sd, 249 + u32 input, u32 output, u32 config) 249 250 { 250 251 struct saa7185 *encoder = to_saa7185(sd); 251 252 252 - /* RJ: route->input = 0: input is from SA7111 253 - route->input = 1: input is from ZR36060 */ 253 + /* RJ: input = 0: input is from SA7111 254 + input = 1: input is from ZR36060 */ 254 255 255 - switch (route->input) { 256 + switch (input) { 256 257 case 0: 257 258 /* turn off colorbar */ 258 259 saa7185_write(sd, 0x3a, 0x0f);
+3 -3
drivers/media/video/saa7191.c
··· 160 160 /* Helper functions */ 161 161 162 162 static int saa7191_s_routing(struct v4l2_subdev *sd, 163 - const struct v4l2_routing *route) 163 + u32 input, u32 output, u32 config) 164 164 { 165 165 struct saa7191 *decoder = to_saa7191(sd); 166 166 u8 luma = saa7191_read_reg(sd, SAA7191_REG_LUMA); 167 167 u8 iock = saa7191_read_reg(sd, SAA7191_REG_IOCK); 168 168 int err; 169 169 170 - switch (route->input) { 170 + switch (input) { 171 171 case SAA7191_INPUT_COMPOSITE: /* Set Composite input */ 172 172 iock &= ~(SAA7191_IOCK_CHRS | SAA7191_IOCK_GPSW1 173 173 | SAA7191_IOCK_GPSW2); ··· 190 190 if (err) 191 191 return -EIO; 192 192 193 - decoder->input = route->input; 193 + decoder->input = input; 194 194 195 195 return 0; 196 196 }
+2 -3
drivers/media/video/tea6415c.c
··· 47 47 48 48 49 49 /* makes a connection between the input-pin 'i' and the output-pin 'o' */ 50 - static int tea6415c_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 50 + static int tea6415c_s_routing(struct v4l2_subdev *sd, 51 + u32 i, u32 o, u32 config) 51 52 { 52 53 struct i2c_client *client = v4l2_get_subdevdata(sd); 53 54 u8 byte = 0; 54 - u32 i = route->input; 55 - u32 o = route->output; 56 55 int ret; 57 56 58 57 v4l2_dbg(1, debug, sd, "i=%d, o=%d\n", i, o);
+6 -11
drivers/media/video/tea6420.c
··· 48 48 49 49 /* make a connection between the input 'i' and the output 'o' 50 50 with gain 'g' (note: i = 6 means 'mute') */ 51 - static int tea6420_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 51 + static int tea6420_s_routing(struct v4l2_subdev *sd, 52 + u32 i, u32 o, u32 config) 52 53 { 53 54 struct i2c_client *client = v4l2_get_subdevdata(sd); 54 - int i = route->input; 55 - int o = route->output & 0xf; 56 - int g = (route->output >> 4) & 0xf; 55 + int g = (o >> 4) & 0xf; 57 56 u8 byte; 58 57 int ret; 59 58 59 + o &= 0xf; 60 60 v4l2_dbg(1, debug, sd, "i=%d, o=%d, g=%d\n", i, o, g); 61 61 62 62 /* check if the parameters are valid */ ··· 133 133 134 134 /* set initial values: set "mute"-input to all outputs at gain 0 */ 135 135 err = 0; 136 - for (i = 1; i < 5; i++) { 137 - struct v4l2_routing route; 138 - 139 - route.input = 6; 140 - route.output = i; 141 - err += tea6420_s_routing(sd, &route); 142 - } 136 + for (i = 1; i < 5; i++) 137 + err += tea6420_s_routing(sd, 6, i, 0); 143 138 if (err) { 144 139 v4l_dbg(1, debug, client, "could not initialize tea6420\n"); 145 140 return -ENODEV;
+4 -3
drivers/media/video/tvaudio.c
··· 1781 1781 return -EINVAL; 1782 1782 } 1783 1783 1784 - static int tvaudio_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *rt) 1784 + static int tvaudio_s_routing(struct v4l2_subdev *sd, 1785 + u32 input, u32 output, u32 config) 1785 1786 { 1786 1787 struct CHIPSTATE *chip = to_state(sd); 1787 1788 struct CHIPDESC *desc = chip->desc; 1788 1789 1789 1790 if (!(desc->flags & CHIP_HAS_INPUTSEL)) 1790 1791 return 0; 1791 - if (rt->input >= 4) 1792 + if (input >= 4) 1792 1793 return -EINVAL; 1793 1794 /* There are four inputs: tuner, radio, extern and intern. */ 1794 - chip->input = rt->input; 1795 + chip->input = input; 1795 1796 if (chip->muted) 1796 1797 return 0; 1797 1798 chip_write_masked(chip, desc->inputreg,
+12 -9
drivers/media/video/tvp5150.c
··· 69 69 struct v4l2_subdev sd; 70 70 71 71 v4l2_std_id norm; /* Current set standard */ 72 - struct v4l2_routing route; 72 + u32 input; 73 + u32 output; 73 74 int enable; 74 75 int bright; 75 76 int contrast; ··· 281 280 int input = 0; 282 281 unsigned char val; 283 282 284 - if ((decoder->route.output & TVP5150_BLACK_SCREEN) || !decoder->enable) 283 + if ((decoder->output & TVP5150_BLACK_SCREEN) || !decoder->enable) 285 284 input = 8; 286 285 287 - switch (decoder->route.input) { 286 + switch (decoder->input) { 288 287 case TVP5150_COMPOSITE1: 289 288 input |= 2; 290 289 /* fall through */ ··· 300 299 301 300 v4l2_dbg(1, debug, sd, "Selecting video route: route input=%i, output=%i " 302 301 "=> tvp5150 input=%i, opmode=%i\n", 303 - decoder->route.input,decoder->route.output, 304 - input, opmode ); 302 + decoder->input, decoder->output, 303 + input, opmode); 305 304 306 305 tvp5150_write(sd, TVP5150_OP_MODE_CTL, opmode); 307 306 tvp5150_write(sd, TVP5150_VD_IN_SRC_SEL_1, input); ··· 310 309 * For Composite and TV, it should be the reverse 311 310 */ 312 311 val = tvp5150_read(sd, TVP5150_MISC_CTL); 313 - if (decoder->route.input == TVP5150_SVIDEO) 312 + if (decoder->input == TVP5150_SVIDEO) 314 313 val = (val & ~0x40) | 0x10; 315 314 else 316 315 val = (val & ~0x10) | 0x40; ··· 879 878 I2C Command 880 879 ****************************************************************************/ 881 880 882 - static int tvp5150_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 881 + static int tvp5150_s_routing(struct v4l2_subdev *sd, 882 + u32 input, u32 output, u32 config) 883 883 { 884 884 struct tvp5150 *decoder = to_tvp5150(sd); 885 885 886 - decoder->route = *route; 886 + decoder->input = input; 887 + decoder->output = output; 887 888 tvp5150_selmux(sd); 888 889 return 0; 889 890 } ··· 1080 1077 c->addr << 1, c->adapter->name); 1081 1078 1082 1079 core->norm = V4L2_STD_ALL; /* Default is autodetect */ 1083 - core->route.input = TVP5150_COMPOSITE1; 1080 + core->input = TVP5150_COMPOSITE1; 1084 1081 core->enable = 1; 1085 1082 core->bright = 128; 1086 1083 core->contrast = 128;
+6 -5
drivers/media/video/upd64031a.c
··· 124 124 125 125 /* ------------------------------------------------------------------------ */ 126 126 127 - static int upd64031a_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 127 + static int upd64031a_s_routing(struct v4l2_subdev *sd, 128 + u32 input, u32 output, u32 config) 128 129 { 129 130 struct upd64031a_state *state = to_state(sd); 130 131 u8 r00, r05, r08; 131 132 132 - state->gr_mode = (route->input & 3) << 6; 133 - state->direct_3dycs_connect = (route->input & 0xc) << 4; 133 + state->gr_mode = (input & 3) << 6; 134 + state->direct_3dycs_connect = (input & 0xc) << 4; 134 135 state->ext_comp_sync = 135 - (route->input & UPD64031A_COMPOSITE_EXTERNAL) << 1; 136 + (input & UPD64031A_COMPOSITE_EXTERNAL) << 1; 136 137 state->ext_vert_sync = 137 - (route->input & UPD64031A_VERTICAL_EXTERNAL) << 2; 138 + (input & UPD64031A_VERTICAL_EXTERNAL) << 2; 138 139 r00 = (state->regs[R00] & ~GR_MODE_MASK) | state->gr_mode; 139 140 r05 = (state->regs[R00] & ~SYNC_CIRCUIT_MASK) | 140 141 state->ext_comp_sync | state->ext_vert_sync;
+5 -4
drivers/media/video/upd64083.c
··· 102 102 103 103 /* ------------------------------------------------------------------------ */ 104 104 105 - static int upd64083_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 105 + static int upd64083_s_routing(struct v4l2_subdev *sd, 106 + u32 input, u32 output, u32 config) 106 107 { 107 108 struct upd64083_state *state = to_state(sd); 108 109 u8 r00, r02; 109 110 110 - if (route->input > 7 || (route->input & 6) == 6) 111 + if (input > 7 || (input & 6) == 6) 111 112 return -EINVAL; 112 - state->mode = (route->input & 3) << 6; 113 - state->ext_y_adc = (route->input & UPD64083_EXT_Y_ADC) << 3; 113 + state->mode = (input & 3) << 6; 114 + state->ext_y_adc = (input & UPD64083_EXT_Y_ADC) << 3; 114 115 r00 = (state->regs[R00] & ~(3 << 6)) | state->mode; 115 116 r02 = (state->regs[R02] & ~(1 << 5)) | state->ext_y_adc; 116 117 upd64083_write(sd, R00, r00);
+1 -4
drivers/media/video/usbvision/usbvision-core.c
··· 2597 2597 /* inputs #1 and #2 are variable for SAA7111 and SAA7113 */ 2598 2598 int mode[4]= {SAA7115_COMPOSITE0, 0, 0, SAA7115_COMPOSITE3}; 2599 2599 int audio[]= {1, 0, 0, 0}; 2600 - struct v4l2_routing route; 2601 2600 //channel 0 is TV with audiochannel 1 (tuner mono) 2602 2601 //channel 1 is Composite with audio channel 0 (line in) 2603 2602 //channel 2 is S-Video with audio channel 0 (line in) ··· 2629 2630 mode[2] = SAA7115_SVIDEO1; 2630 2631 break; 2631 2632 } 2632 - route.input = mode[channel]; 2633 - route.output = 0; 2634 - call_all(usbvision, video, s_routing, &route); 2633 + call_all(usbvision, video, s_routing, mode[channel], 0, 0); 2635 2634 usbvision_set_audio(usbvision, audio[channel]); 2636 2635 return 0; 2637 2636 }
+4 -6
drivers/media/video/vino.c
··· 2565 2565 int input; 2566 2566 int data_norm; 2567 2567 v4l2_std_id norm; 2568 - struct v4l2_routing route = { 0, 0 }; 2569 2568 2570 2569 input = VINO_INPUT_COMPOSITE; 2571 2570 2572 - route.input = vino_get_saa7191_input(input); 2573 - ret = decoder_call(video, s_routing, &route); 2571 + ret = decoder_call(video, s_routing, 2572 + vino_get_saa7191_input(input), 0, 0); 2574 2573 if (ret) { 2575 2574 ret = -EINVAL; 2576 2575 goto out; ··· 2655 2656 if (vino_drvdata->decoder_owner == vcs->channel) { 2656 2657 int data_norm; 2657 2658 v4l2_std_id norm; 2658 - struct v4l2_routing route = { 0, 0 }; 2659 2659 2660 - route.input = vino_get_saa7191_input(input); 2661 - ret = decoder_call(video, s_routing, &route); 2660 + ret = decoder_call(video, s_routing, 2661 + vino_get_saa7191_input(input), 0, 0); 2662 2662 if (ret) { 2663 2663 vino_drvdata->decoder_owner = VINO_NO_CHANNEL; 2664 2664 ret = -EINVAL;
+10 -9
drivers/media/video/vpx3220.c
··· 376 376 return 0; 377 377 } 378 378 379 - static int vpx3220_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 379 + static int vpx3220_s_routing(struct v4l2_subdev *sd, 380 + u32 input, u32 output, u32 config) 380 381 { 381 382 int data; 382 383 383 - /* RJ: route->input = 0: ST8 (PCTV) input 384 - route->input = 1: COMPOSITE input 385 - route->input = 2: SVHS input */ 384 + /* RJ: input = 0: ST8 (PCTV) input 385 + input = 1: COMPOSITE input 386 + input = 2: SVHS input */ 386 387 387 - const int input[3][2] = { 388 + const int input_vals[3][2] = { 388 389 {0x0c, 0}, 389 390 {0x0d, 0}, 390 391 {0x0e, 1} 391 392 }; 392 393 393 - if (route->input < 0 || route->input > 2) 394 + if (input < 0 || input > 2) 394 395 return -EINVAL; 395 396 396 - v4l2_dbg(1, debug, sd, "input switched to %s\n", inputs[route->input]); 397 + v4l2_dbg(1, debug, sd, "input switched to %s\n", inputs[input]); 397 398 398 - vpx3220_write(sd, 0x33, input[route->input][0]); 399 + vpx3220_write(sd, 0x33, input_vals[input][0]); 399 400 400 401 data = vpx3220_fp_read(sd, 0xf2) & ~(0x0020); 401 402 if (data < 0) 402 403 return data; 403 404 /* 0x0010 is required to latch the setting */ 404 405 vpx3220_fp_write(sd, 0xf2, 405 - data | (input[route->input][1] << 5) | 0x0010); 406 + data | (input_vals[input][1] << 5) | 0x0010); 406 407 407 408 udelay(10); 408 409 return 0;
+5 -4
drivers/media/video/wm8775.c
··· 79 79 return -1; 80 80 } 81 81 82 - static int wm8775_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 82 + static int wm8775_s_routing(struct v4l2_subdev *sd, 83 + u32 input, u32 output, u32 config) 83 84 { 84 85 struct wm8775_state *state = to_state(sd); 85 86 ··· 89 88 16 combinations. 90 89 If only one input is active (the normal case) then the 91 90 input values 1, 2, 4 or 8 should be used. */ 92 - if (route->input > 15) { 93 - v4l2_err(sd, "Invalid input %d.\n", route->input); 91 + if (input > 15) { 92 + v4l2_err(sd, "Invalid input %d.\n", input); 94 93 return -EINVAL; 95 94 } 96 - state->input = route->input; 95 + state->input = input; 97 96 if (state->muted) 98 97 return 0; 99 98 wm8775_write(sd, R21, 0x0c0);
+1 -3
drivers/media/video/zoran/zoran_card.c
··· 1087 1087 detect_guest_activity(zr); 1088 1088 test_interrupts(zr); 1089 1089 if (!pass_through) { 1090 - struct v4l2_routing route = { 2, 0 }; 1091 - 1092 1090 decoder_call(zr, video, s_stream, 0); 1093 - encoder_call(zr, video, s_routing, &route); 1091 + encoder_call(zr, video, s_routing, 2, 0, 0); 1094 1092 } 1095 1093 1096 1094 zr->zoran_proc = NULL;
+6 -14
drivers/media/video/zoran/zoran_device.c
··· 971 971 struct vfe_settings cap; 972 972 int field_size = 973 973 zr->jpg_buffers.buffer_size / zr->jpg_settings.field_per_buff; 974 - struct v4l2_routing route = { 0, 0 }; 975 974 976 975 zr->codec_mode = mode; 977 976 ··· 993 994 */ 994 995 set_videobus_dir(zr, 0); 995 996 decoder_call(zr, video, s_stream, 1); 996 - route.input = 0; 997 - encoder_call(zr, video, s_routing, &route); 997 + encoder_call(zr, video, s_routing, 0, 0, 0); 998 998 999 999 /* Take the JPEG codec and the VFE out of sleep */ 1000 1000 jpeg_codec_sleep(zr, 0); ··· 1041 1043 */ 1042 1044 decoder_call(zr, video, s_stream, 0); 1043 1045 set_videobus_dir(zr, 1); 1044 - route.input = 1; 1045 - encoder_call(zr, video, s_routing, &route); 1046 + encoder_call(zr, video, s_routing, 1, 0, 0); 1046 1047 1047 1048 /* Take the JPEG codec and the VFE out of sleep */ 1048 1049 jpeg_codec_sleep(zr, 0); ··· 1086 1089 zr36057_adjust_vfe(zr, mode); 1087 1090 1088 1091 decoder_call(zr, video, s_stream, 1); 1089 - route.input = 0; 1090 - encoder_call(zr, video, s_routing, &route); 1092 + encoder_call(zr, video, s_routing, 0, 0, 0); 1091 1093 1092 1094 dprintk(2, KERN_INFO "%s: enable_jpg(IDLE)\n", ZR_DEVNAME(zr)); 1093 1095 break; ··· 1567 1571 void 1568 1572 zoran_init_hardware (struct zoran *zr) 1569 1573 { 1570 - struct v4l2_routing route = { 0, 0 }; 1571 - 1572 1574 /* Enable bus-mastering */ 1573 1575 zoran_set_pci_master(zr, 1); 1574 1576 ··· 1575 1581 zr->card.init(zr); 1576 1582 } 1577 1583 1578 - route.input = zr->card.input[zr->input].muxsel; 1579 - 1580 1584 decoder_call(zr, core, init, 0); 1581 1585 decoder_call(zr, core, s_std, zr->norm); 1582 - decoder_call(zr, video, s_routing, &route); 1586 + decoder_call(zr, video, s_routing, 1587 + zr->card.input[zr->input].muxsel, 0, 0); 1583 1588 1584 1589 encoder_call(zr, core, init, 0); 1585 1590 encoder_call(zr, video, s_std_output, zr->norm); 1586 - route.input = 0; 1587 - encoder_call(zr, video, s_routing, &route); 1591 + encoder_call(zr, video, s_routing, 0, 0, 0); 1588 1592 1589 1593 /* toggle JPEG codec sleep to sync PLL */ 1590 1594 jpeg_codec_sleep(zr, 1);
+7 -13
drivers/media/video/zoran/zoran_driver.c
··· 1018 1018 zoran_set_pci_master(zr, 0); 1019 1019 1020 1020 if (!pass_through) { /* Switch to color bar */ 1021 - struct v4l2_routing route = { 2, 0 }; 1022 - 1023 1021 decoder_call(zr, video, s_stream, 0); 1024 - encoder_call(zr, video, s_routing, &route); 1022 + encoder_call(zr, video, s_routing, 2, 0, 0); 1025 1023 } 1026 1024 } 1027 1025 ··· 1494 1496 zoran_set_input (struct zoran *zr, 1495 1497 int input) 1496 1498 { 1497 - struct v4l2_routing route = { 0, 0 }; 1498 - 1499 1499 if (input == zr->input) { 1500 1500 return 0; 1501 1501 } ··· 1515 1519 return -EINVAL; 1516 1520 } 1517 1521 1518 - route.input = zr->card.input[input].muxsel; 1519 1522 zr->input = input; 1520 1523 1521 - decoder_call(zr, video, s_routing, &route); 1524 + decoder_call(zr, video, s_routing, 1525 + zr->card.input[input].muxsel, 0, 0); 1522 1526 1523 1527 return 0; 1524 1528 } ··· 1744 1748 case BUZIOC_G_STATUS: 1745 1749 { 1746 1750 struct zoran_status *bstat = arg; 1747 - struct v4l2_routing route = { 0, 0 }; 1748 1751 int status = 0, res = 0; 1749 1752 v4l2_std_id norm; 1750 1753 ··· 1757 1762 return -EINVAL; 1758 1763 } 1759 1764 1760 - route.input = zr->card.input[bstat->input].muxsel; 1761 - 1762 1765 mutex_lock(&zr->resource_lock); 1763 1766 1764 1767 if (zr->codec_mode != BUZ_MODE_IDLE) { ··· 1768 1775 goto gstat_unlock_and_return; 1769 1776 } 1770 1777 1771 - decoder_call(zr, video, s_routing, &route); 1778 + decoder_call(zr, video, s_routing, 1779 + zr->card.input[bstat->input].muxsel, 0, 0); 1772 1780 1773 1781 /* sleep 1 second */ 1774 1782 ssleep(1); ··· 1779 1785 decoder_call(zr, video, g_input_status, &status); 1780 1786 1781 1787 /* restore previous input and norm */ 1782 - route.input = zr->card.input[zr->input].muxsel; 1783 - decoder_call(zr, video, s_routing, &route); 1788 + decoder_call(zr, video, s_routing, 1789 + zr->card.input[zr->input].muxsel, 0, 0); 1784 1790 gstat_unlock_and_return: 1785 1791 mutex_unlock(&zr->resource_lock); 1786 1792
+2 -2
include/media/msp3400.h
··· 54 54 ======= 55 55 56 56 So to specify a complete routing scheme for the msp3400 you will have to 57 - specify in the 'input' field of the v4l2_routing struct: 57 + specify in the 'input' arg of the s_routing function: 58 58 59 59 1) which tuner input to use 60 60 2) which SCART input to use 61 61 3) which DSP input to use for each DSP output 62 62 63 - And in the 'output' field of the v4l2_routing struct you specify: 63 + And in the 'output' arg of the s_routing function you specify: 64 64 65 65 1) which SCART input to use for each SCART output 66 66
+4 -3
include/media/v4l2-subdev.h
··· 148 148 board designs. Usual values for the frequency are 1024000 and 2048000. 149 149 If the frequency is not supported, then -EINVAL is returned. 150 150 151 - s_routing: used to define the input and/or output pins of an audio chip. 151 + s_routing: used to define the input and/or output pins of an audio chip, 152 + and any additional configuration data. 152 153 Never attempt to use user-level input IDs (e.g. Composite, S-Video, 153 154 Tuner) at this level. An i2c device shouldn't know about whether an 154 155 input pin is connected to a Composite connector, become on another ··· 160 159 struct v4l2_subdev_audio_ops { 161 160 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq); 162 161 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq); 163 - int (*s_routing)(struct v4l2_subdev *sd, const struct v4l2_routing *route); 162 + int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 164 163 }; 165 164 166 165 /* ··· 201 200 devices. 202 201 */ 203 202 struct v4l2_subdev_video_ops { 204 - int (*s_routing)(struct v4l2_subdev *sd, const struct v4l2_routing *route); 203 + int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 205 204 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); 206 205 int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line); 207 206 int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data);