Commit 4adad287 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (6133): tuner-simple: convert from tuner sub-driver into dvb_frontend module

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Acked-by: default avatarMike Isely <isely@pobox.com>
Acked-by: default avatarSteven Toth <stoth@hauppauge.com>
Acked-by: default avatarPatrick Boettcher <pb@linuxtv.org>
Acked-by: default avatarJarod Wilson <jwilson@redhat.com>
Acked-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 8d0936ed
...@@ -17,12 +17,14 @@ ...@@ -17,12 +17,14 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/videodev.h> #include <linux/videodev.h>
#include <media/tuner.h> #include <media/tuner.h>
#include <media/tuner-types.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include "tuner-driver.h" #include "tuner-driver.h"
#include "mt20xx.h" #include "mt20xx.h"
#include "tda8290.h" #include "tda8290.h"
#include "tea5761.h" #include "tea5761.h"
#include "tea5767.h" #include "tea5767.h"
#include "tuner-simple.h"
#define UNSET (-1U) #define UNSET (-1U)
...@@ -213,6 +215,15 @@ static void attach_tda8290(struct tuner *t) ...@@ -213,6 +215,15 @@ static void attach_tda8290(struct tuner *t)
tda8290_attach(&t->fe, t->i2c.adapter, t->i2c.addr, &cfg); 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, static void set_type(struct i2c_client *c, unsigned int type,
unsigned int new_mode_mask, unsigned int new_config, unsigned int new_mode_mask, unsigned int new_config,
int (*tuner_callback) (void *dev, int command,int arg)) int (*tuner_callback) (void *dev, int command,int arg))
...@@ -290,7 +301,7 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -290,7 +301,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
buffer[2] = 0x86; buffer[2] = 0x86;
buffer[3] = 0x54; buffer[3] = 0x54;
i2c_master_send(c, buffer, 4); i2c_master_send(c, buffer, 4);
default_tuner_init(t); attach_simple_tuner(t);
break; break;
case TUNER_PHILIPS_TD1316: case TUNER_PHILIPS_TD1316:
buffer[0] = 0x0b; buffer[0] = 0x0b;
...@@ -298,13 +309,13 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -298,13 +309,13 @@ static void set_type(struct i2c_client *c, unsigned int type,
buffer[2] = 0x86; buffer[2] = 0x86;
buffer[3] = 0xa4; buffer[3] = 0xa4;
i2c_master_send(c,buffer,4); i2c_master_send(c,buffer,4);
default_tuner_init(t); attach_simple_tuner(t);
break; break;
case TUNER_TDA9887: case TUNER_TDA9887:
tda9887_tuner_init(t); tda9887_tuner_init(t);
break; break;
default: default:
default_tuner_init(t); attach_simple_tuner(t);
break; break;
} }
......
...@@ -72,8 +72,6 @@ struct tuner { ...@@ -72,8 +72,6 @@ struct tuner {
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
extern int default_tuner_init(struct tuner *t);
extern int tda9887_tuner_init(struct tuner *t); extern int tda9887_tuner_init(struct tuner *t);
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
......
This diff is collapsed.
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __TUNER_SIMPLE_H__
#define __TUNER_SIMPLE_H__
#include <linux/i2c.h>
#include "dvb_frontend.h"
struct simple_tuner_config
{
/* chip type */
unsigned int type;
struct tunertype *tun;
};
extern struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c_adap,
u8 i2c_addr,
struct simple_tuner_config *cfg);
#endif /* __TUNER_SIMPLE_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment