aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/vpx3220.c
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/vpx3220.c
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/vpx3220.c')
-rw-r--r--drivers/media/video/vpx3220.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c
index 59a8bb046c35..97e0ce28ff18 100644
--- a/drivers/media/video/vpx3220.c
+++ b/drivers/media/video/vpx3220.c
@@ -376,33 +376,34 @@ static int vpx3220_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
376 return 0; 376 return 0;
377} 377}
378 378
379static int vpx3220_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) 379static int vpx3220_s_routing(struct v4l2_subdev *sd,
380 u32 input, u32 output, u32 config)
380{ 381{
381 int data; 382 int data;
382 383
383 /* RJ: route->input = 0: ST8 (PCTV) input 384 /* RJ: input = 0: ST8 (PCTV) input
384 route->input = 1: COMPOSITE input 385 input = 1: COMPOSITE input
385 route->input = 2: SVHS input */ 386 input = 2: SVHS input */
386 387
387 const int input[3][2] = { 388 const int input_vals[3][2] = {
388 {0x0c, 0}, 389 {0x0c, 0},
389 {0x0d, 0}, 390 {0x0d, 0},
390 {0x0e, 1} 391 {0x0e, 1}
391 }; 392 };
392 393
393 if (route->input < 0 || route->input > 2) 394 if (input < 0 || input > 2)
394 return -EINVAL; 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 data = vpx3220_fp_read(sd, 0xf2) & ~(0x0020); 401 data = vpx3220_fp_read(sd, 0xf2) & ~(0x0020);
401 if (data < 0) 402 if (data < 0)
402 return data; 403 return data;
403 /* 0x0010 is required to latch the setting */ 404 /* 0x0010 is required to latch the setting */
404 vpx3220_fp_write(sd, 0xf2, 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 udelay(10); 408 udelay(10);
408 return 0; 409 return 0;