V4L/DVB (5323): Updated support for tuner callbacks
This change supplies a more generic version of the tuner callback.
The tuner struct now has a function pointer
int (*tuner_callback) (void *dev, int command, int arg)
additionally to a int config parameter.
both can be set through the TUNER_SET_TYPE_ADDR client call.
Note that the meaning of the parameters depend on the tuner type.
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index e6c3e61..44348f9 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -211,19 +211,19 @@
case 2:
/* turn Vsync on */
if (t->std & V4L2_STD_MN)
- arg = 5;
+ arg = 1;
else
- arg = 4;
- if (t->gpio_func)
- t->gpio_func(c->adapter->algo_data, 22, 5);
+ arg = 0;
+ if (t->tuner_callback)
+ t->tuner_callback(c->adapter->algo_data, 1, arg);
buf[1] = high ? 0 : 1;
if (t->config == 2)
buf[1] = high ? 1 : 0;
i2c_transfer(c->adapter, &msg, 1);
break;
case 3: /* switch with GPIO of saa713x */
- if (t->gpio_func)
- t->gpio_func(c->adapter->algo_data, 22, high);
+ if (t->tuner_callback)
+ t->tuner_callback(c->adapter->algo_data, 0, high);
break;
}
}