summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tea6420.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/tea6420.c')
-rw-r--r--linux/drivers/media/video/tea6420.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/linux/drivers/media/video/tea6420.c b/linux/drivers/media/video/tea6420.c
index 8bddef6d9..0e7bb8d6a 100644
--- a/linux/drivers/media/video/tea6420.c
+++ b/linux/drivers/media/video/tea6420.c
@@ -46,7 +46,7 @@ module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Debug level (0-1)");
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static unsigned short normal_i2c[] = { 0x4c, 0x4d, I2C_CLIENT_END };
I2C_CLIENT_INSMOD;
@@ -54,15 +54,15 @@ I2C_CLIENT_INSMOD;
/* make a connection between the input 'i' and the output 'o'
with gain 'g' (note: i = 6 means 'mute') */
-static int tea6420_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
+static int tea6420_s_routing(struct v4l2_subdev *sd,
+ u32 i, u32 o, u32 config)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
- int i = route->input;
- int o = route->output & 0xf;
- int g = (route->output >> 4) & 0xf;
+ int g = (o >> 4) & 0xf;
u8 byte;
int ret;
+ o &= 0xf;
v4l2_dbg(1, debug, sd, "i=%d, o=%d, g=%d\n", i, o, g);
/* check if the parameters are valid */
@@ -118,7 +118,6 @@ static const struct v4l2_subdev_ops tea6420_ops = {
.audio = &tea6420_audio_ops,
};
-/* this function is called by i2c_probe */
static int tea6420_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -139,13 +138,8 @@ static int tea6420_probe(struct i2c_client *client,
/* set initial values: set "mute"-input to all outputs at gain 0 */
err = 0;
- for (i = 1; i < 5; i++) {
- struct v4l2_routing route;
-
- route.input = 6;
- route.output = i;
- err += tea6420_s_routing(sd, &route);
- }
+ for (i = 1; i < 5; i++)
+ err += tea6420_s_routing(sd, 6, i, 0);
if (err) {
v4l_dbg(1, debug, client, "could not initialize tea6420\n");
return -ENODEV;
@@ -162,16 +156,14 @@ static int tea6420_remove(struct i2c_client *client)
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static int tea6420_legacy_probe(struct i2c_adapter *adapter)
{
/* Let's see whether this is a known adapter we can attach to.
Prevents conflicts with tvaudio.c. */
return adapter->id == I2C_HW_SAA7146;
}
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+#else
static const struct i2c_device_id tea6420_id[] = {
{ "tea6420", 0 },
{ }
@@ -183,10 +175,9 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.name = "tea6420",
.probe = tea6420_probe,
.remove = tea6420_remove,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
.legacy_probe = tea6420_legacy_probe,
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+#else
.id_table = tea6420_id,
#endif
};