Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5325b427 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c0ff2915
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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);

@@ -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");
@@ -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;
}

+10 −9
Original line number Diff line number Diff line
@@ -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 */
@@ -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;
}

+9 −8
Original line number Diff line number Diff line
@@ -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);

@@ -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;
}

+4 −6
Original line number Diff line number Diff line
@@ -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);
@@ -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;
@@ -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;
}

+6 −5
Original line number Diff line number Diff line
@@ -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);
Loading