summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 007e5380b..142367f4e 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -18,6 +18,7 @@
#include "compat.h"
#include <linux/videodev.h>
#include <media/tuner.h>
+#include <media/tuner-types.h>
#include <media/v4l2-common.h>
#include "tuner-driver.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
@@ -27,6 +28,7 @@
#include "tda8290.h"
#include "tea5761.h"
#include "tea5767.h"
+#include "tuner-simple.h"
#define UNSET (-1U)
@@ -238,6 +240,15 @@ static void attach_tda8290(struct tuner *t)
tda8290_attach(&t->fe, t->i2c.adapter, t->i2c.addr, &cfg);
}
+static void attach_simple_tuner(struct tuner *t)
+{
+ struct simple_tuner_config cfg = {
+ .type = t->type,
+ .tun = &tuners[t->type]
+ };
+ simple_tuner_attach(&t->fe, t->i2c.adapter, t->i2c.addr, &cfg);
+}
+
static void set_type(struct i2c_client *c, unsigned int type,
unsigned int new_mode_mask, unsigned int new_config,
int (*tuner_callback) (void *dev, int command,int arg))
@@ -317,7 +328,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
buffer[2] = 0x86;
buffer[3] = 0x54;
i2c_master_send(c, buffer, 4);
- default_tuner_init(t);
+ attach_simple_tuner(t);
break;
case TUNER_PHILIPS_TD1316:
buffer[0] = 0x0b;
@@ -325,7 +336,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
buffer[2] = 0x86;
buffer[3] = 0xa4;
i2c_master_send(c,buffer,4);
- default_tuner_init(t);
+ attach_simple_tuner(t);
break;
case TUNER_TDA9887:
tda9887_tuner_init(t);
@@ -336,7 +347,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
break;
#endif
default:
- default_tuner_init(t);
+ attach_simple_tuner(t);
break;
}