Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142457
b: refs/heads/master
c: 5325b42
h: refs/heads/master
i:
  142455: de3a646
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 7, 2009
1 parent 8ee0d73 commit 9b6ade9
Show file tree
Hide file tree
Showing 58 changed files with 371 additions and 445 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0ff29150d37615ac703802ab3edc775fd402491
refs/heads/master: 5325b4272a53b43f55b82cc369c310c2fcacdca1
12 changes: 6 additions & 6 deletions trunk/drivers/media/dvb/frontends/au8522_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ static int au8522_reset(struct v4l2_subdev *sd, u32 val)
}

static int au8522_s_video_routing(struct v4l2_subdev *sd,
const struct v4l2_routing *route)
u32 input, u32 output, u32 config)
{
struct au8522_state *state = to_state(sd);

Expand All @@ -663,11 +663,11 @@ static int au8522_s_video_routing(struct v4l2_subdev *sd,
closed), and then came back to analog mode */
au8522_writereg(state, 0x106, 1);

if (route->input == AU8522_COMPOSITE_CH1) {
if (input == AU8522_COMPOSITE_CH1) {
au8522_setup_cvbs_mode(state);
} else if (route->input == AU8522_SVIDEO_CH13) {
} else if (input == AU8522_SVIDEO_CH13) {
au8522_setup_svideo_mode(state);
} else if (route->input == AU8522_COMPOSITE_CH4_SIF) {
} else if (input == AU8522_COMPOSITE_CH4_SIF) {
au8522_setup_cvbs_tuner_mode(state);
} else {
printk(KERN_ERR "au8522 mode not currently supported\n");
Expand All @@ -677,10 +677,10 @@ static int au8522_s_video_routing(struct v4l2_subdev *sd,
}

static int au8522_s_audio_routing(struct v4l2_subdev *sd,
const struct v4l2_routing *route)
u32 input, u32 output, u32 config)
{
struct au8522_state *state = to_state(sd);
set_audio_input(state, route->input);
set_audio_input(state, input);
return 0;
}

Expand Down
19 changes: 10 additions & 9 deletions trunk/drivers/media/video/adv7170.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,19 @@ static int adv7170_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}

static int adv7170_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int adv7170_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
struct adv7170 *encoder = to_adv7170(sd);

/* RJ: route->input = 0: input is from decoder
route->input = 1: input is from ZR36060
route->input = 2: color bar */
/* RJ: input = 0: input is from decoder
input = 1: input is from ZR36060
input = 2: color bar */

v4l2_dbg(1, debug, sd, "set input from %s\n",
route->input == 0 ? "decoder" : "ZR36060");
input == 0 ? "decoder" : "ZR36060");

switch (route->input) {
switch (input) {
case 0:
adv7170_write(sd, 0x01, 0x20);
adv7170_write(sd, 0x08, TR1CAPT); /* TR1 */
Expand All @@ -250,11 +251,11 @@ static int adv7170_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *
break;

default:
v4l2_dbg(1, debug, sd, "illegal input: %d\n", route->input);
v4l2_dbg(1, debug, sd, "illegal input: %d\n", input);
return -EINVAL;
}
v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[route->input]);
encoder->input = route->input;
v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[input]);
encoder->input = input;
return 0;
}

Expand Down
17 changes: 9 additions & 8 deletions trunk/drivers/media/video/adv7175.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,16 @@ static int adv7175_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}

static int adv7175_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int adv7175_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
struct adv7175 *encoder = to_adv7175(sd);

/* RJ: route->input = 0: input is from decoder
route->input = 1: input is from ZR36060
route->input = 2: color bar */
/* RJ: input = 0: input is from decoder
input = 1: input is from ZR36060
input = 2: color bar */

switch (route->input) {
switch (input) {
case 0:
adv7175_write(sd, 0x01, 0x00);

Expand Down Expand Up @@ -288,11 +289,11 @@ static int adv7175_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *
break;

default:
v4l2_dbg(1, debug, sd, "illegal input: %d\n", route->input);
v4l2_dbg(1, debug, sd, "illegal input: %d\n", input);
return -EINVAL;
}
v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[route->input]);
encoder->input = route->input;
v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[input]);
encoder->input = input;
return 0;
}

Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,6 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
int i;
struct v4l2_routing route;

dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __func__,
index);
Expand All @@ -1180,9 +1179,8 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
break;
}

route.input = AUVI_INPUT(index).vmux;
route.output = 0;
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, &route);
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing,
AUVI_INPUT(index).vmux, 0, 0);

for (i = 0; i < AU0828_MAX_INPUT; i++) {
int enable = 0;
Expand All @@ -1205,8 +1203,8 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
}
}

route.input = AUVI_INPUT(index).amux;
v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, &route);
v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing,
AUVI_INPUT(index).amux, 0, 0);
return 0;
}

Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/media/video/bt819.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,21 +292,22 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}

static int bt819_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int bt819_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
struct bt819 *decoder = to_bt819(sd);

v4l2_dbg(1, debug, sd, "set input %x\n", route->input);
v4l2_dbg(1, debug, sd, "set input %x\n", input);

if (route->input < 0 || route->input > 7)
if (input < 0 || input > 7)
return -EINVAL;

if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL)
v4l2_err(sd, "no notify found!\n");

if (decoder->input != route->input) {
if (decoder->input != input) {
v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0);
decoder->input = route->input;
decoder->input = input;
/* select mode */
if (decoder->input == 0) {
bt819_setbit(decoder, 0x0b, 6, 0);
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/media/video/bt856.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,17 @@ static int bt856_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}

static int bt856_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int bt856_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
struct bt856 *encoder = to_bt856(sd);

v4l2_dbg(1, debug, sd, "set input %d\n", route->input);
v4l2_dbg(1, debug, sd, "set input %d\n", input);

/* We only have video bus.
* route->input= 0: input is from bt819
* route->input= 1: input is from ZR36060 */
switch (route->input) {
* input= 0: input is from bt819
* input= 1: input is from ZR36060 */
switch (input) {
case 0:
bt856_setbit(encoder, 0xde, 4, 0);
bt856_setbit(encoder, 0xde, 3, 1);
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/media/video/bt866.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ static int bt866_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}

static int bt866_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int bt866_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
static const __u8 init[] = {
0xc8, 0xcc, /* CRSCALE */
Expand Down Expand Up @@ -137,23 +138,23 @@ static int bt866_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *ro

val = encoder->reg[0xdc];

if (route->input == 0)
if (input == 0)
val |= 0x40; /* CBSWAP */
else
val &= ~0x40; /* !CBSWAP */

bt866_write(encoder, 0xdc, val);

val = encoder->reg[0xcc];
if (route->input == 2)
if (input == 2)
val |= 0x01; /* OSDBAR */
else
val &= ~0x01; /* !OSDBAR */
bt866_write(encoder, 0xcc, val);

v4l2_dbg(1, debug, sd, "set input %d\n", route->input);
v4l2_dbg(1, debug, sd, "set input %d\n", input);

switch (route->input) {
switch (input) {
case 0:
case 1:
case 2:
Expand Down
23 changes: 10 additions & 13 deletions trunk/drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ audio_mux(struct bttv *btv, int input, int mute)
ctrl.value = btv->mute;
bttv_call_all(btv, core, s_ctrl, &ctrl);
if (btv->sd_msp34xx) {
struct v4l2_routing route;
u32 in;

/* Note: the inputs tuner/radio/extern/intern are translated
to msp routings. This assumes common behavior for all msp3400
Expand All @@ -1207,11 +1207,11 @@ audio_mux(struct bttv *btv, int input, int mute)
For now this is sufficient. */
switch (input) {
case TVAUDIO_INPUT_RADIO:
route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1,
in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1,
MSP_DSP_IN_SCART, MSP_DSP_IN_SCART);
break;
case TVAUDIO_INPUT_EXTERN:
route.input = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
in = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
MSP_DSP_IN_SCART, MSP_DSP_IN_SCART);
break;
case TVAUDIO_INPUT_INTERN:
Expand All @@ -1220,7 +1220,7 @@ audio_mux(struct bttv *btv, int input, int mute)
input is the BTTV_BOARD_AVERMEDIA98. I wonder how
that was tested. My guess is that the whole INTERN
input does not work. */
route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1,
in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1,
MSP_DSP_IN_SCART, MSP_DSP_IN_SCART);
break;
case TVAUDIO_INPUT_TUNER:
Expand All @@ -1229,21 +1229,18 @@ audio_mux(struct bttv *btv, int input, int mute)
is the only difference between the VOODOOTV_FM
and VOODOOTV_200 */
if (btv->c.type == BTTV_BOARD_VOODOOTV_200)
route.input = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER2, \
in = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER2, \
MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER);
else
route.input = MSP_INPUT_DEFAULT;
in = MSP_INPUT_DEFAULT;
break;
}
route.output = MSP_OUTPUT_DEFAULT;
v4l2_subdev_call(btv->sd_msp34xx, audio, s_routing, &route);
v4l2_subdev_call(btv->sd_msp34xx, audio, s_routing,
in, MSP_OUTPUT_DEFAULT, 0);
}
if (btv->sd_tvaudio) {
struct v4l2_routing route;

route.input = input;
route.output = 0;
v4l2_subdev_call(btv->sd_tvaudio, audio, s_routing, &route);
v4l2_subdev_call(btv->sd_tvaudio, audio, s_routing,
input, 0, 0);
}
return 0;
}
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/media/video/cs5345.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ static inline int cs5345_read(struct v4l2_subdev *sd, u8 reg)
return i2c_smbus_read_byte_data(client, reg);
}

static int cs5345_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int cs5345_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
if ((route->input & 0xf) > 6) {
v4l2_err(sd, "Invalid input %d.\n", route->input);
if ((input & 0xf) > 6) {
v4l2_err(sd, "Invalid input %d.\n", input);
return -EINVAL;
}
cs5345_write(sd, 0x09, route->input & 0xf);
cs5345_write(sd, 0x05, route->input & 0xf0);
cs5345_write(sd, 0x09, input & 0xf);
cs5345_write(sd, 0x05, input & 0xf0);
return 0;
}

Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/media/video/cs53l32a.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,18 @@ static int cs53l32a_read(struct v4l2_subdev *sd, u8 reg)
return i2c_smbus_read_byte_data(client, reg);
}

static int cs53l32a_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
static int cs53l32a_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
/* There are 2 physical inputs, but the second input can be
placed in two modes, the first mode bypasses the PGA (gain),
the second goes through the PGA. Hence there are three
possible inputs to choose from. */
if (route->input > 2) {
v4l2_err(sd, "Invalid input %d.\n", route->input);
if (input > 2) {
v4l2_err(sd, "Invalid input %d.\n", input);
return -EINVAL;
}
cs53l32a_write(sd, 0x01, 0x01 + (route->input << 4));
cs53l32a_write(sd, 0x01, 0x01 + (input << 4));
return 0;
}

Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/media/video/cx18/cx18-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
int cx18_audio_set_io(struct cx18 *cx)
{
const struct cx18_card_audio_input *in;
struct v4l2_routing route;
u32 val;
int err;

Expand All @@ -44,13 +43,11 @@ int cx18_audio_set_io(struct cx18 *cx)
in = &cx->card->audio_inputs[cx->audio_input];

/* handle muxer chips */
route.input = in->muxer_input;
route.output = 0;
v4l2_subdev_call(cx->sd_extmux, audio, s_routing, &route);
v4l2_subdev_call(cx->sd_extmux, audio, s_routing,
in->audio_input, 0, 0);

route.input = in->audio_input;
err = cx18_call_hw_err(cx, cx->card->hw_audio_ctrl,
audio, s_routing, &route);
audio, s_routing, in->audio_input, 0, 0);
if (err)
return err;

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/media/video/cx18/cx18-av-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,19 +547,19 @@ static int set_input(struct cx18 *cx, enum cx18_av_video_input vid_input,
}

static int cx18_av_s_video_routing(struct v4l2_subdev *sd,
const struct v4l2_routing *route)
u32 input, u32 output, u32 config)
{
struct cx18_av_state *state = to_cx18_av_state(sd);
struct cx18 *cx = v4l2_get_subdevdata(sd);
return set_input(cx, route->input, state->aud_input);
return set_input(cx, input, state->aud_input);
}

static int cx18_av_s_audio_routing(struct v4l2_subdev *sd,
const struct v4l2_routing *route)
u32 input, u32 output, u32 config)
{
struct cx18_av_state *state = to_cx18_av_state(sd);
struct cx18 *cx = v4l2_get_subdevdata(sd);
return set_input(cx, state->vid_input, route->input);
return set_input(cx, state->vid_input, input);
}

static int cx18_av_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
Expand Down
Loading

0 comments on commit 9b6ade9

Please sign in to comment.