From 19e35224611a4b1aaf8f5d121233d3c81d920d44 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 30 Mar 2009 08:18:10 -0300 Subject: msp3400: use the V4L2 header since no V4L1 code is there From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/msp3400-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/msp3400-driver.c') diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index fdcc1c1c5..fbe69a62d 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -57,7 +57,7 @@ #else #include #endif -#include +#include #include #include #include -- cgit v1.2.3 From 6126d94ddc3aa2d314338c11109c97a1be4b22f0 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 29 Mar 2009 22:30:34 +0200 Subject: msp3400: remove i2c legacy code From: Hans Verkuil All drivers that use msp3400 now use v4l2_subdev, so we can remove the legacy code from msp3400. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/msp3400-driver.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'linux/drivers/media/video/msp3400-driver.c') diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index fbe69a62d..d89531433 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include #include #include "compat.h" @@ -113,10 +113,12 @@ MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); /* DSP unit subaddress */ #define I2C_MSP_DSP 0x12 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) /* Addresses to scan */ static unsigned short normal_i2c[] = { 0x80 >> 1, 0x88 >> 1, I2C_CLIENT_END }; I2C_CLIENT_INSMOD; +#endif /* ----------------------------------------------------------------------- */ /* functions for talking to the MSP3400C Sound processor */ @@ -701,11 +703,6 @@ static int msp_resume(struct i2c_client *client) return 0; } -static int msp_command(struct i2c_client *client, unsigned cmd, void *arg) -{ - return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg); -} - /* ----------------------------------------------------------------------- */ static const struct v4l2_subdev_core_ops msp_core_ops = { @@ -945,8 +942,6 @@ MODULE_DEVICE_TABLE(i2c, msp_id); #endif static struct v4l2_i2c_driver_data v4l2_i2c_data = { .name = "msp3400", - .driverid = I2C_DRIVERID_MSP3400, - .command = msp_command, .probe = msp_probe, .remove = msp_remove, .suspend = msp_suspend, -- cgit v1.2.3 From 0811e7462ce5c70637faa77e010016680c1e971a Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 1 Apr 2009 08:52:39 +0200 Subject: v4l2-subdev: move s_std from tuner to core. From: Hans Verkuil s_std didn't belong in the tuner ops. Stricly speaking it should be part of the video ops, but it is used by audio and tuner devices as well, so it is more efficient to make it part of the core ops. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/msp3400-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/msp3400-driver.c') diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index d89531433..5b63af6f8 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -711,6 +711,7 @@ static const struct v4l2_subdev_core_ops msp_core_ops = { .g_ctrl = msp_g_ctrl, .s_ctrl = msp_s_ctrl, .queryctrl = msp_queryctrl, + .s_std = msp_s_std, }; static const struct v4l2_subdev_tuner_ops msp_tuner_ops = { @@ -718,7 +719,6 @@ static const struct v4l2_subdev_tuner_ops msp_tuner_ops = { .g_tuner = msp_g_tuner, .s_tuner = msp_s_tuner, .s_radio = msp_s_radio, - .s_std = msp_s_std, }; static const struct v4l2_subdev_audio_ops msp_audio_ops = { -- cgit v1.2.3 From 1784ea5527ed756f946958f45f74d1f15797c366 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 30 Mar 2009 01:04:44 +0200 Subject: v4l2: use old-style i2c API for kernels < 2.6.26 instead of < 2.6.22 From: Hans Verkuil Originally the intention was to switch to the new style i2c API starting with the introduction of the API in 2.6.22. However, the i2c_new_probed_device() function has a lethal bug that wasn't fixed until 2.6.25. Or more accurately, it was only fixed in the stable series of 2.6.25 and 2.6.26. Given the fact that the new i2c API also changed starting with 2.6.26 (the addition of i2c_device_id), it is easiest to switch APIs starting with 2.6.26. This patch updates all the legacy code accordingly. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/msp3400-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/msp3400-driver.c') diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 5b63af6f8..7a2b87621 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -113,7 +113,7 @@ MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); /* DSP unit subaddress */ #define I2C_MSP_DSP 0x12 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) /* Addresses to scan */ static unsigned short normal_i2c[] = { 0x80 >> 1, 0x88 >> 1, I2C_CLIENT_END }; -- cgit v1.2.3 From b4d23428b3c4456414ad8bf5e974757fd354a66f Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 2 Apr 2009 16:26:22 +0200 Subject: v4l2-subdev: change s_routing prototype From: Hans Verkuil 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. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/msp3400-driver.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'linux/drivers/media/video/msp3400-driver.c') diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 7a2b87621..bbcc43a49 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -516,25 +516,26 @@ static int msp_s_std(struct v4l2_subdev *sd, v4l2_std_id id) return 0; } -static int msp_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *rt) +static int msp_s_routing(struct v4l2_subdev *sd, + u32 input, u32 output, u32 config) { struct msp_state *state = to_state(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - int tuner = (rt->input >> 3) & 1; - int sc_in = rt->input & 0x7; - int sc1_out = rt->output & 0xf; - int sc2_out = (rt->output >> 4) & 0xf; + int tuner = (input >> 3) & 1; + int sc_in = input & 0x7; + int sc1_out = output & 0xf; + int sc2_out = (output >> 4) & 0xf; u16 val, reg; int i; int extern_input = 1; - if (state->routing.input == rt->input && - state->routing.output == rt->output) + if (state->route_in == input && state->route_out == output) return 0; - state->routing = *rt; + state->route_in = input; + state->route_out = output; /* check if the tuner input is used */ for (i = 0; i < 5; i++) { - if (((rt->input >> (4 + i * 4)) & 0xf) == 0) + if (((input >> (4 + i * 4)) & 0xf) == 0) extern_input = 0; } state->mode = extern_input ? MSP_MODE_EXTERN : MSP_MODE_AM_DETECT; @@ -684,7 +685,7 @@ static int msp_log_status(struct v4l2_subdev *sd) } v4l_info(client, "Audmode: 0x%04x\n", state->audmode); v4l_info(client, "Routing: 0x%08x (input) 0x%08x (output)\n", - state->routing.input, state->routing.output); + state->route_in, state->route_out); v4l_info(client, "ACB: 0x%04x\n", state->acb); return 0; } @@ -776,8 +777,8 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) state->i2s_mode = 0; init_waitqueue_head(&state->wq); /* These are the reset input/output positions */ - state->routing.input = MSP_INPUT_DEFAULT; - state->routing.output = MSP_OUTPUT_DEFAULT; + state->route_in = MSP_INPUT_DEFAULT; + state->route_out = MSP_OUTPUT_DEFAULT; state->rev1 = msp_read_dsp(client, 0x1e); if (state->rev1 != -1) -- cgit v1.2.3