[media] drxk: Move I2C address into a config structure
Currently, the only parameter to be configured is the I2C address. However, Terratec H5 logs shows that it needs a different setting for some things, and it has its own firmware. So, move the addr into a config structure, in order to allow adding the required configuration bits. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Родитель
5e66b87840
Коммит
0fc55e81d3
|
@ -574,10 +574,12 @@ static int demod_attach_drxk(struct ddb_input *input)
|
||||||
{
|
{
|
||||||
struct i2c_adapter *i2c = &input->port->i2c->adap;
|
struct i2c_adapter *i2c = &input->port->i2c->adap;
|
||||||
struct dvb_frontend *fe;
|
struct dvb_frontend *fe;
|
||||||
|
struct drxk_config config;
|
||||||
|
|
||||||
fe = input->fe = dvb_attach(drxk_attach,
|
memset(&config, 0, sizeof(config));
|
||||||
i2c, 0x29 + (input->nr&1),
|
config.adr = 0x29 + (input->nr & 1);
|
||||||
&input->fe2);
|
|
||||||
|
fe = input->fe = dvb_attach(drxk_attach, &config, i2c, &input->fe2);
|
||||||
if (!input->fe) {
|
if (!input->fe) {
|
||||||
printk(KERN_ERR "No DRXK found!\n");
|
printk(KERN_ERR "No DRXK found!\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
|
|
||||||
extern struct dvb_frontend *drxk_attach(struct i2c_adapter *i2c,
|
struct drxk_config {
|
||||||
u8 adr,
|
u8 adr;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct dvb_frontend *drxk_attach(const struct drxk_config *config,
|
||||||
|
struct i2c_adapter *i2c,
|
||||||
struct dvb_frontend **fe_t);
|
struct dvb_frontend **fe_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6341,10 +6341,12 @@ static struct dvb_frontend_ops drxk_t_ops = {
|
||||||
.read_ucblocks = drxk_read_ucblocks,
|
.read_ucblocks = drxk_read_ucblocks,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dvb_frontend *drxk_attach(struct i2c_adapter *i2c, u8 adr,
|
struct dvb_frontend *drxk_attach(const struct drxk_config *config,
|
||||||
|
struct i2c_adapter *i2c,
|
||||||
struct dvb_frontend **fe_t)
|
struct dvb_frontend **fe_t)
|
||||||
{
|
{
|
||||||
struct drxk_state *state = NULL;
|
struct drxk_state *state = NULL;
|
||||||
|
u8 adr = config->adr;
|
||||||
|
|
||||||
dprintk(1, "\n");
|
dprintk(1, "\n");
|
||||||
state = kzalloc(sizeof(struct drxk_state), GFP_KERNEL);
|
state = kzalloc(sizeof(struct drxk_state), GFP_KERNEL);
|
||||||
|
|
|
@ -213,9 +213,12 @@ static int port_has_drxk(struct i2c_adapter *i2c, int port)
|
||||||
static int demod_attach_drxk(struct ngene_channel *chan,
|
static int demod_attach_drxk(struct ngene_channel *chan,
|
||||||
struct i2c_adapter *i2c)
|
struct i2c_adapter *i2c)
|
||||||
{
|
{
|
||||||
chan->fe = dvb_attach(drxk_attach,
|
struct drxk_config config;
|
||||||
i2c, 0x29 + (chan->number^2),
|
|
||||||
&chan->fe2);
|
memset(&config, 0, sizeof(config));
|
||||||
|
config.adr = 0x29 + (chan->number ^ 2);
|
||||||
|
|
||||||
|
chan->fe = dvb_attach(drxk_attach, &config, i2c, &chan->fe2);
|
||||||
if (!chan->fe) {
|
if (!chan->fe) {
|
||||||
printk(KERN_ERR "No DRXK found!\n");
|
printk(KERN_ERR "No DRXK found!\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче