summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorHartmut Hackmann <hartmut.hackmann@t-online.de>2007-01-23 00:14:25 +0100
committerHartmut Hackmann <hartmut.hackmann@t-online.de>2007-01-23 00:14:25 +0100
commit0124d3c9c8071f1994a85d9f9973129efd6e044d (patch)
tree30f40b67f0bb327b6ecbb23303232bac9f0d78b9 /linux/drivers/media/video/tuner-core.c
parenteb69d8221127090471e67cdb38e3d97f4ae5ca80 (diff)
downloadmediapointer-dvb-s2-0124d3c9c8071f1994a85d9f9973129efd6e044d.tar.gz
mediapointer-dvb-s2-0124d3c9c8071f1994a85d9f9973129efd6e044d.tar.bz2
Added a config entry and a gpio function pointer to the tuner struct
From: Hartmut Hackmann <hartmut.hackmann@t-online.de> These entries mainly are to support configurations of the tda827x silicon tuner with a preamplifier. The values can be set throgh the attach inform or through the extended TUNER_SET_TYPE_ADDR client call. The function pointer will only be updated if the parameter is not NULL. Since a typecast is necessary to set the pointer, i added a typedef for this pointer (tuner_gpio_func_t) in tuner.h Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index a42204b02..af694b572 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -170,7 +170,8 @@ static void set_freq(struct i2c_client *c, unsigned long freq)
}
static void set_type(struct i2c_client *c, unsigned int type,
- unsigned int new_mode_mask)
+ unsigned int new_mode_mask, unsigned int new_config,
+ tuner_gpio_func_t gpio_func)
{
struct tuner *t = i2c_get_clientdata(c);
unsigned char buffer[4];
@@ -201,6 +202,11 @@ static void set_type(struct i2c_client *c, unsigned int type,
microtune_init(c);
break;
case TUNER_PHILIPS_TDA8290:
+ t->config = new_config;
+ if (gpio_func != NULL) {
+ tuner_dbg("Defining GPIO function\n");
+ t->gpio_func = gpio_func;
+ }
tda8290_init(c);
break;
case TUNER_TEA5767:
@@ -273,10 +279,11 @@ static void set_addr(struct i2c_client *c, struct tuner_setup *tun_setup)
tuner_dbg("set addr for type %i\n", t->type);
- if ( t->type == UNSET && ((tun_setup->addr == ADDR_UNSET &&
- (t->mode_mask & tun_setup->mode_mask)) ||
- tun_setup->addr == c->addr)) {
- set_type(c, tun_setup->type, tun_setup->mode_mask);
+ if ( (t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) &&
+ (t->mode_mask & tun_setup->mode_mask))) ||
+ (tun_setup->addr == c->addr)) {
+ set_type(c, tun_setup->type, tun_setup->mode_mask,
+ tun_setup->config, tun_setup->gpio_func);
}
}
@@ -543,7 +550,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr,
register_client:
tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name);
i2c_attach_client (&t->i2c);
- set_type (&t->i2c,t->type, t->mode_mask);
+ set_type (&t->i2c,t->type, t->mode_mask, t->config, t->gpio_func);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_INC_USE_COUNT;
#endif
@@ -640,10 +647,11 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
switch (cmd) {
/* --- configuration --- */
case TUNER_SET_TYPE_ADDR:
- tuner_dbg ("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x\n",
+ tuner_dbg ("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=0x%02x\n",
((struct tuner_setup *)arg)->type,
((struct tuner_setup *)arg)->addr,
- ((struct tuner_setup *)arg)->mode_mask);
+ ((struct tuner_setup *)arg)->mode_mask,
+ ((struct tuner_setup *)arg)->config);
set_addr(client, (struct tuner_setup *)arg);
break;