summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-08-27 21:59:08 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 22:07:41 -0300
commit4adad287de82703fd504fdab7aebe760196bb786 (patch)
treeabdb6772db2f03e6d914c6a5c9b060fbd33fff84 /drivers/media/video/tuner-core.c
parent8d0936ed15f509c32e8f81849be3a1cee80e2225 (diff)
downloadop-kernel-dev-4adad287de82703fd504fdab7aebe760196bb786.zip
op-kernel-dev-4adad287de82703fd504fdab7aebe760196bb786.tar.gz
V4L/DVB (6133): tuner-simple: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Acked-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r--drivers/media/video/tuner-core.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 9598a3d..8ee0be2 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -17,12 +17,14 @@
#include <linux/init.h>
#include <linux/videodev.h>
#include <media/tuner.h>
+#include <media/tuner-types.h>
#include <media/v4l2-common.h>
#include "tuner-driver.h"
#include "mt20xx.h"
#include "tda8290.h"
#include "tea5761.h"
#include "tea5767.h"
+#include "tuner-simple.h"
#define UNSET (-1U)
@@ -213,6 +215,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))
@@ -290,7 +301,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;
@@ -298,13 +309,13 @@ 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);
break;
default:
- default_tuner_init(t);
+ attach_simple_tuner(t);
break;
}
OpenPOWER on IntegriCloud