diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-03-25 13:50:20 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2006-03-25 13:50:20 +0100 |
commit | 1b05455603d8adbfd4e694422972e4c812981ff3 (patch) | |
tree | 739104f1651bdc16b6ae44ee095f625c0d0d0978 /linux/drivers | |
parent | 2871cb92086c1371c1325830290ee3de57c55c13 (diff) | |
download | mediapointer-dvb-s2-1b05455603d8adbfd4e694422972e4c812981ff3.tar.gz mediapointer-dvb-s2-1b05455603d8adbfd4e694422972e4c812981ff3.tar.bz2 |
Implement new routing commands in saa7127.c
From: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/saa7127.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/linux/drivers/media/video/saa7127.c b/linux/drivers/media/video/saa7127.c index e4420ec85..379de09ab 100644 --- a/linux/drivers/media/video/saa7127.c +++ b/linux/drivers/media/video/saa7127.c @@ -55,6 +55,7 @@ #include <linux/i2c.h> #include <linux/videodev2.h> #include <media/v4l2-common.h> +#include <media/saa7127.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" #endif @@ -234,22 +235,6 @@ static struct i2c_reg_value saa7127_init_config_50hz[] = { { 0, 0 } }; -/* Enumeration for the Supported input types */ -enum saa7127_input_type { - SAA7127_INPUT_TYPE_NORMAL, - SAA7127_INPUT_TYPE_TEST_IMAGE -}; - -/* Enumeration for the Supported Output signal types */ -enum saa7127_output_type { - SAA7127_OUTPUT_TYPE_BOTH, - SAA7127_OUTPUT_TYPE_COMPOSITE, - SAA7127_OUTPUT_TYPE_SVIDEO, - SAA7127_OUTPUT_TYPE_RGB, - SAA7127_OUTPUT_TYPE_YUV_C, - SAA7127_OUTPUT_TYPE_YUV_V -}; - /* ********************************************************************** * @@ -573,7 +558,7 @@ static int saa7127_command(struct i2c_client *client, { struct saa7127_state *state = i2c_get_clientdata(client); struct v4l2_format *fmt = arg; - int *iarg = arg; + struct v4l2_routing *route = arg; switch (cmd) { case VIDIOC_S_STD: @@ -585,15 +570,23 @@ static int saa7127_command(struct i2c_client *client, *(v4l2_std_id *)arg = state->std; break; - case VIDIOC_S_INPUT: - if (state->input_type == *iarg) - break; - return saa7127_set_input_type(client, *iarg); + case VIDIOC_INT_G_VIDEO_ROUTING: + route->input = state->input_type; + route->output = state->output_type; + break; - case VIDIOC_S_OUTPUT: - if (state->output_type == *iarg) - break; - return saa7127_set_output_type(client, *iarg); + case VIDIOC_INT_S_VIDEO_ROUTING: + { + int rc = 0; + + if (state->input_type != route->input) { + rc = saa7127_set_input_type(client, route->input); + } + if (rc == 0 && state->output_type != route->output) { + rc = saa7127_set_output_type(client, route->output); + } + return rc; + } case VIDIOC_STREAMON: case VIDIOC_STREAMOFF: |